luk3yx.github.io/js/handler.js
luk3yx 828c95d82a Okay, it's 2018.
• Rework the JavaScript handler.
 • Fix the card generator.
 • Nuke all known XSS attacks.
 • Change the background to white.
 • Change some fonts on index.html to make it look more modern.
 • Remove a few ".old" pages.
 • Improve the mobile-friendliness of index.html.
 • Remove all styling on <select> tags.
 • Other varied bugfixes
2018-12-08 10:51:13 +13:00

42 lines
972 B
JavaScript

---
# JavaScript script dispatcher
layout: compress
---
helpers.showLoadScreen();
(function() {
var script = helpers.params.get('type');
/* Trivial to implement redirects */
var redirects = {
'approve': '/403.html',
'archive': '/410.html',
'birthdaycard': 'card',
'fish': '/418.html',
'iso': 'http://cdimage.ubuntu.com',
'login': '/403.html',
'redirect': '/418.html',
'teapot': '/418.html',
'xmascard': 'card',
};
if (redirects[script]) {
if (redirects[script].indexOf('/') > -1) {
window.stop();
window.location.href = helpers.baseurl + redirects[script];
} else {
helpers.loadScript(redirects[script]);
}
} else if (script) {
if (! helpers.loadScript(script)) {
window.stop();
window.location.href = helpers.baseurl + '404.html';
};
} else {
helpers.loadScript('jsinfo');
}
})();