Commit 0da69a34 authored by Jim Tittsler's avatar Jim Tittsler
Browse files

handle missing images and /Special: page links

issues #11 and #12
parent 1e9aabac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/* jshint node: true, multistr: true, trailing: true, esnext: true */
"use strict";

var VERSION = '0.11.0',
var VERSION = '0.11.1',
    JQUERY = 'http://code.jquery.com/jquery-2.1.1.min.js',
    FILEPATH = '/home/www/www';

+7 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ function quotedWPstring(s) {
}

module.exports = {
  version: '0.1.0',
  version: '0.1.1',

  // emit headers
  header: function ($, opt) {
@@ -317,6 +317,8 @@ ${idbody}
    $('table.oeru1, table.prettytable').addClass('table').addClass('table-striped');
    // images
    if (opt['--wpurl']) {
      // broken image links
      $('a[href^="/Special:Upload"]').replaceWith('<img src="MissingImage.png" title="Missing image">');
      // rewrite links to image pages for attribution/licensing
      $('a.image').each(function() {
        var dst = $(this).attr('href');
@@ -349,6 +351,10 @@ ${idbody}
    $('section#main').find('img').not('.pedagogicalicon')
                     .addClass('img-responsive');
    $('.WEflag img').attr('style', 'vertical-align: baseline; display: inline;');
    // Special: pages link directly to the wiki
    $('a[href^="/Special"]').each(function() {
      $(this).attr('href', 'http://WikiEducator.org' + $(this).attr('href'));
    });
    // use WEnotes plugin
    $('.WEnotes').each(function() {
      var tag = $(this).data('tag'),