• 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
layout: welcome
redirect_from:
- /index2.html
- /welcome.html
---

View File

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

View File

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