mz700-js
Version:
MZ-700 Full JavaScript Emulator
34 lines (33 loc) • 918 B
HTML
<html>
<script>
function clientPull(table) {
let pathname = window.location.pathname;
let redirect_table = {};
Object.keys(table).forEach( urlTo => {
table[urlTo].forEach( urlFrom => {
redirect_table[urlFrom] = urlTo;
});
});
if(pathname in redirect_table) {
let host = window.location.host;
let protocol = window.location.protocol;
let urlhead = protocol + "//" + host;
let redirectTo = urlhead + redirect_table[pathname];
console.log("clientPull redirectTo:", redirectTo);
window.location.href = redirectTo;
}
}
clientPull({
// Redirection on github.io (pulished gh-pages)
"/mz700-js/emu": [
"/mz700-js/MZ-700/client",
"/mz700-js/MZ-700/client.html",
],
// Redirection on local web server
"/emu.html": [
"/MZ-700/client.html",
],
});
</script>
</html>