Commit 4c76b67e authored by Jim Tittsler's avatar Jim Tittsler

Handle WikiEducator pages not in outline

Fixes #29
parent b036d976
......@@ -280,6 +280,11 @@ function processPage(pi) {
var orig = $(this).attr("href");
if (urls.hasOwnProperty(orig)) {
$(this).attr("href", urls[orig]);
} else {
// other WikiEducator relative pages that are not in the outline
if (orig && orig.indexOf('//') === -1) {
$(this).attr("href", '//wikieducator.org' + orig);
}
}
});
......
......@@ -312,6 +312,11 @@ function processPage(pi) {
var orig = $(this).attr("href");
if (urls.hasOwnProperty(orig)) {
$(this).attr("href", urls[orig]);
} else {
// other WikiEducator relative pages that are not in the outline
if (orig && orig.indexOf('//') === -1) {
$(this).attr("href", '//wikieducator.org' + orig);
}
}
});
......
......@@ -475,13 +475,6 @@ module.exports = {
.addClass("img-responsive");
// Template:Pdf has some special cases
$(".pdfdown").each(function() {
// site relative URLs
$(this).find("a").each(function() {
let url = $(this).attr("href");
if (url && url.indexOf("//") === -1) {
$(this).attr("href", "//wikieducator.org" + url);
}
});
// override Bootstrap's img block
$(this)
.find('img[alt="PDF down.png"]')
......
......@@ -435,13 +435,6 @@ ${idbody}
});
// Template:Pdf has some special cases
$(".pdfdown").each(function() {
// site relative URLs
$(this).find("a").each(function() {
let url = $(this).attr("href");
if (url && url.indexOf("//") === -1) {
$(this).attr("href", "//wikieducator.org" + url);
}
});
// override Bootstrap's img block
$(this)
.find('img[alt="PDF down.png"]')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment