Commit 97f49df7 authored by Jim Tittsler's avatar Jim Tittsler

course/courseWP: Special case handling for Template:PDF

Works around #25.
parent 91321ac4
{
"name": "wecourse",
"version": "0.9.7",
"version": "0.9.8",
"author": "Jim Tittsler <jim@oerfoundation.org>",
"description": "build a static course from WikiEducator open resources",
"keywords": [
......
......@@ -473,5 +473,19 @@ module.exports = {
.find("img")
.not(".pedagogicalicon")
.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"]')
.attr("style", "display: inline-block;");
});
}
};
......@@ -433,6 +433,20 @@ ${idbody}
$('a[href^="/Special"]').each(function() {
$(this).attr("href", "http://WikiEducator.org" + $(this).attr("href"));
});
// 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"]')
.attr("style", "display: inline-block;");
});
// use WEnotes plugin
$(".WEnotes").each(function() {
var tag = $(this).data("tag"),
......
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