Website updates - added the 'href' navigation system.

This commit is contained in:
Ivan Davidov 2018-01-04 22:51:53 +02:00
parent f8ab400021
commit b02cb7c54b
3 changed files with 773 additions and 727 deletions

147
docs/www/assets/js/main.js Normal file
View File

@ -0,0 +1,147 @@
function menuSwap(itemIndex) {
for(var i = 1; i <= 6; i++) {
var strItem = "item" + i;
var objItem = document.getElementById(strItem);
objItem.style.display = (i == itemIndex) ? "block" : "none";
}
}
function logSwap(itemIndex, show) {
for(var i = 1; i <= 7; i++) {
var showObj = document.getElementById("show" + i);
var hideObj = document.getElementById("hide" + i);
var textObj = document.getElementById("text" + i);
if(i == itemIndex) {
if(show == true) {
showObj.style.display = "none";
hideObj.style.display = "block";
textObj.style.display = "block";
} else {
showObj.style.display = "block";
hideObj.style.display = "none";
textObj.style.display = "none";
}
} else if(show == true) {
showObj.style.display = "block";
hideObj.style.display = "none";
textObj.style.display = "none";
}
}
}
function defaultTab(item) {
var hrefPart = document.location.href.split('#')[1];
if(hrefPart == undefined) {
hrefPart = item;
}
loadTab('#' + hrefPart);
}
function loadTab(hrefPart) {
document.location.href=hrefPart;
loadUrl();
}
function loadUrl() {
var hrefPart = document.location.href.split('#')[1];
switch(hrefPart) {
case 'home' : {
menuSwap(1);
break;
}
case 'changes' : {
menuSwap(2);
break;
}
case 'about' : {
menuSwap(3);
break;
}
case 'tutorial' : {
menuSwap(4);
break;
}
case 'emulator' : {
menuSwap(5);
break;
}
case 'download' : {
menuSwap(6);
break;
}
default: {
document.location.href='#home';
menuSwap(1);
}
}
}
function pageLoaded() {
defaultTab('home');
thankYou();
}
function thankYou() {
var footer = document.getElementById("footer");
var footerDiv = footer.getElementsByTagName("div")[0];
var html = footerDiv.innerHTML;
var sepa = ' <span class="separator">|</span> ';
var afterSepa = '<a target="_blank" href="http://{1}">{2}</a>'
var hostname = window.location.hostname;
switch(hostname) {
case 'minimal.idzona.com' : {
html += sepa;
html += afterSepa.replace("{1}", 'microweber.com').replace("{2}", 'Microweber CMS');
footerDiv.innerHTML = html;
break;
}
case 'skamilinux.hu' : {
html += sepa;
html += 'Hosted by <a target="_blank" href="http://skamilinux.hu">skamilinux.hu</a> - thank you!';
footerDiv.innerHTML = html;
break;
}
case 'minimal.linux-bg.org' : {
html += sepa;
html += 'Hosted by <a target="_blank" href="http://linux-bg.org">linux-bg.org</a> - thank you!';
footerDiv.innerHTML = html;
break;
}
case 'ivandavidov.github.io' : {
document.getElementById('hm5').style.display="none";
document.getElementById('dl2').style.display="none";
document.getElementById('dl5').style.display="none";
document.getElementById('dl6').style.display="none";
document.getElementById('gh1').style.display="none";
html += sepa;
html += 'Development website - may not be fully functional.';
footerDiv.innerHTML = html;
break;
}
default: {
if(hostname != "") {
html += sepa;
html += afterSepa.replace("{1}", hostname).replace("{2}", hostname);
footerDiv.innerHTML = html;
}
}
}
}

View File

@ -1,54 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Minimal Linux Live">
<meta name="keywords" content="minimal minimalistic tiny linux live tutorial howto kernel busybox cd usb iso image"/>
<meta name="author" content="Ivan Davidov - davidov (dot) i [at] gmail {dot} com">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minimal Linux Live - PC emulator</title>
<link rel="icon" type="image/x-icon" href="../assets/img/favicon.ico" />
<meta charset="utf-8">
<meta name="description" content="Minimal Linux Live" />
<meta name="keywords" content="minimal minimalistic tiny linux live tutorial howto kernel busybox cd usb iso image bios uefi" />
<meta name="author" content="Ivan Davidov - davidov (dot) i [at] gmail {dot} com" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Minimal Linux Live - PC emulator</title>
<link rel="icon" type="image/x-icon" href="../assets/img/favicon.ico" />
</head>
<body>
<div id="title" style="white-space: pre; font: 20px monospace;">
Minimal Linux Live (version 20-Jan-2017)
Minimal Linux Live (version 20-Jan-2017)
</div>
<br/>
<div id="screen_container">
<div style="white-space: pre; font: 20px monospace; line-height: 22px"></div>
<canvas style="display: none"></canvas>
<div style="white-space: pre; font: 20px monospace; line-height: 22px"></div>
<canvas style="display: none"></canvas>
</div>
<div style="white-space: pre; font: 12px monospace;">
This is JavaScript based PC emulator which works entirely in your browser and some OS features may not behave properly in it. All CPU instructions are emulated via JavaScript and the boot process may take 10-20 minutes.
This is JavaScript based PC emulator which works entirely in your browser and some OS features may not behave properly in it. All CPU instructions are emulated via JavaScript and the boot process may take 10-20 minutes.
</div>
<script src="libv86.min.js"></script>
<script>
"use strict";
window.onload = function () {
var image_name = 'minimal_linux_live_20-Jan-2017_32-bit.iso';
var cdrom_full = '../download/' + image_name;
var emulator = window.emulator = new V86Starter({
memory_size: 256 * 1024 * 1024,
vga_memory_size: 16 * 1024 * 1024,
screen_container: document.getElementById('screen_container'),
bios: {
url: 'seabios.bin'
},
vga_bios: {
url: 'vgabios.bin'
},
cdrom: {
url: cdrom_full
},
autostart: true
});
}
"use strict";
window.onload = function () {
var image_name = 'minimal_linux_live_20-Jan-2017_32-bit.iso';
var cdrom_full = '../download/' + image_name;
var emulator = window.emulator = new V86Starter({
memory_size: 256 * 1024 * 1024,
vga_memory_size: 16 * 1024 * 1024,
screen_container: document.getElementById('screen_container'),
bios: {
url: 'seabios.bin'
},
vga_bios: {
url: 'vgabios.bin'
},
cdrom: {
url: cdrom_full
},
autostart: true
});
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff