Skip to content

Commit 9bdbbbd

Browse files
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
11
"use strict";
22

3-
if ( typeof module === 'object' ) {
3+
if (typeof module === 'object') {
44
module.exports = {
5-
parsoidServer: "http://localhost:8000",
65
stylesYamlFile: "<full-path-to-visual-diff-repo>/styles.yaml",
76
viewportWidth: 1920,
87
viewportHeight: 1080,
9-
dumpParsoidHTML: false,
8+
109
wiki: "enwiki",
1110
title: "Main_Page",
1211
filePrefix: null,
1312
quiet: true,
1413
outdir: "pngs",
14+
15+
// HTML1 generator options
16+
html1: {
17+
name: 'php',
18+
dumpHTML: false,
19+
postprocessorScript: "../lib/php_parser.postprocess.js",
20+
injectJQuery: false,
21+
},
22+
// HTML2 generator options
23+
html2: {
24+
name: 'parsoid',
25+
server: 'http://localhost:8000',
26+
dumpHTML: false,
27+
postprocessorScript: "../lib/parsoid.postprocess.js",
28+
injectJQuery: true,
29+
},
1530
// resemblejs options
16-
errorType: "movement", // Better error display for making sense of diffs
17-
largeImageThreshold: 0 // Cleaner diff without the skipped pixels grid
31+
outputSettings: {
32+
errorType: "movement", // Better error display for making sense of diffs
33+
largeImageThreshold: 0 // Cleaner diff without the skipped pixels grid
34+
},
1835
};
1936
}

lib/differ.utils.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ Util.computeOpts = function(argv) {
227227
// These computed properties are hardcoded for PHP parser API urls and output
228228
// These are updated only if not already set.
229229
if (!opts.html1.screenShot) {
230-
opts.html1.screenShot = filePath + '.' + opts.name1 + '.png';
230+
opts.html1.screenShot = filePath + '.' + opts.html1.name + '.png';
231231
}
232232
if (!opts.html1.server) {
233233
opts.html1.server = opts.html1Server || wikiBaseUrl[opts.wiki]; // Default to wikipedia server
234-
opts.html1.server = opts.html1.server.replace(/\/$/, '') + '/';
235234
}
235+
opts.html1.server = opts.html1.server.replace(/\/$/, '') + '/';
236236
if (!opts.html1.url) {
237237
opts.html1.url = opts.html1.server + encodeURIComponent(opts.title);
238238
}
@@ -246,11 +246,12 @@ Util.computeOpts = function(argv) {
246246
// These computed properties are hardcoded for Parsoid API urls and output
247247
// These are updated only if not already set.
248248
if (!opts.html2.screenShot) {
249-
opts.html2.screenShot = filePath + '.' + opts.name2 + '.png';
249+
opts.html2.screenShot = filePath + '.' + opts.html2.name + '.png';
250250
}
251-
if (!opts.html2.server) {
252-
opts.html2.server = opts.html2Server.replace(/\/$/, '') + "/";
251+
if (!opts.html1.server) {
252+
opts.html2.server = opts.html2Server;
253253
}
254+
opts.html2.server = opts.html2.server.replace(/\/$/, '') + '/';
254255
if (!opts.html2.url) {
255256
opts.html2.url = opts.html2.server + opts.wiki + '/' + encodeURIComponent(opts.title);
256257
}

lib/parsoid.postprocess.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ window.postprocessDOM = function(customCSS) {
88
$('table.collapsible tr').show();
99
$('*.NavContent').show();
1010

11-
// Fix problem with HTML2 (default: Parsoid) CSS to reduce rendering diffs
11+
// Fix problem with Parsoid CSS to reduce rendering diffs
1212
$('<style type="text/css">' + customCSS + '</style>').appendTo('head');
1313

1414
// Work-around for body.mediawiki matches in

lib/php_parser.postprocess.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ window.postprocessDOM = function() {
1818
$('span.collapseButton').hide();
1919
$('a.NavToggle').hide();
2020

21-
// Finally remove all chrome, only keep the actual
22-
// content.
21+
// Finally remove all chrome, only keep the actual content.
2322
document.body.innerHTML = $('div#mw-content-text').html();
2423
document.body.classList.add('mw-body');
2524
document.body.classList.add('mw-body-content');

0 commit comments

Comments
 (0)