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

course/courseWP: Special case handling for Template:PDF

Works around #25.
parent 91321ac4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
{
  "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": [
+14 −0
Original line number Diff line number Diff line
@@ -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;");
    });
  }
};
+14 −0
Original line number Diff line number Diff line
@@ -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"),