Sync with kiwix-js

Former-commit-id: ee67f2fe047fa2450212c970e5991738eebe5773 [formerly d84ad68682a6de99bae10a293a603fd4e1076f2b]
Former-commit-id: a8c807904da68a84d1c5d01c69c52278681cd851
This commit is contained in:
Jaifroid 2017-07-17 21:21:58 +01:00
parent 031f60a7ea
commit 88edcd7ccf
2 changed files with 3 additions and 2 deletions

View File

@ -817,6 +817,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
function getBLOB(arr) {
zimType = arr.join().match(/-\/s\/style\.css/i) ? "desktop" : zimType;
zimType = arr.join().match(/minerva|mobile/i) ? "mobile" : zimType;
for (var i = 0; i < arr.length; i++) {
var linkArray = regexpSheetHref.exec(arr[i]);
regexpSheetHref.lastIndex = 0; //Reset start position for next loop

View File

@ -73,7 +73,7 @@ define([], function () {
}
function toMobileCSS(html, zim, cc, cs, css) {
//DEV: the css.match statements below won't match BLOB URLs! Careful not to add styles twice... //EDIT: NOW THEY DO!!!!
//DEV: Careful not to add styles twice...
//NB Can't relocate to filterCSS function above because it filters styles serially and code would be called for every style...
if (zim != cs) { //If ZIM doesn't match user-requested style, add in stylesheets if they're missing
css += /-\/s\/css_modules\/content\.parsoid\.css/i.test(css) ? "" : '<link href="../-/s/css_modules/content.parsoid.css" rel="stylesheet" type="text/css">\r\n';
@ -94,7 +94,7 @@ define([], function () {
//Wrap <h2> tags in <div> to control bottom border width if there's an infobox
html = html.match(/table\s+(?=[^>]*class\s*=\s*["'][^"']*infobox)/i) ? html.replace(/(<h2\s+[^<]*<\/h2>)/ig, '<div style="width: 60%;">$1</div>') : html;
}
return { html: html, css: css };
return { html : html, css : css };
}
function toDesktopCSS(html, zim, cc, cs, css) {