• Fix a redirection bug in handler.js.
 • Make the card generator process images nicely.
This commit is contained in:
luk3yx 2018-12-07 18:16:33 +13:00
parent 828c95d82a
commit aa73598619
3 changed files with 10 additions and 4 deletions

View File

@ -2,6 +2,7 @@
title: Main Page title: Main Page
layout: welcome layout: welcome
redirect_from: redirect_from:
- /index2.html
- /welcome.html - /welcome.html
--- ---

View File

@ -65,6 +65,7 @@ colour = helpers.escapeHTML(colour);
// Get the image URL // Get the image URL
if (img) { if (img) {
// More code to support legacy options // More code to support legacy options
var url = helpers.url + '/images/';
switch (img) { switch (img) {
case "1": // The older format had '1-6', case "1": // The older format had '1-6',
case "2": // not xmas[n] and birthday[n]. case "2": // not xmas[n] and birthday[n].
@ -72,11 +73,11 @@ if (img) {
case "4": // used to be a Christmas case "4": // used to be a Christmas
case "5": // card generator. case "5": // card generator.
case "6": case "6":
imgurl = helpers.url + "/images/xmas" + img + ".jpg"; imgurl = url + 'xmas' + img + '.jpg';
break; break;
default: default:
if (img) { if (img) {
imgurl = helpers.url + "/images/" + img + ".jpg"; imgurl = url + img + ".jpg";
} }
break; break;
} }

View File

@ -26,14 +26,18 @@ var redirects = {
if (redirects[script]) { if (redirects[script]) {
if (redirects[script].indexOf('/') > -1) { if (redirects[script].indexOf('/') > -1) {
window.stop(); window.stop();
window.location.href = helpers.baseurl + redirects[script]; var url = redirects[script];
if (url.indexOf('://') < 0) {
url = helpers.baseurl + url;
}
window.location.href = url;
} else { } else {
helpers.loadScript(redirects[script]); helpers.loadScript(redirects[script]);
} }
} else if (script) { } else if (script) {
if (! helpers.loadScript(script)) { if (! helpers.loadScript(script)) {
window.stop(); window.stop();
window.location.href = helpers.baseurl + '404.html'; window.location.href = helpers.baseurl + '/404.html';
}; };
} else { } else {
helpers.loadScript('jsinfo'); helpers.loadScript('jsinfo');