Set PageMaxWidth to 100% before printing

Former-commit-id: 2fd8e321450770d891a7283d49d8a9da796458c7 [formerly 8f65085fc2189b858d669617b26221cf75b6513c]
Former-commit-id: b15ee641b14703e31eed30ae247e131ccaed61dc
This commit is contained in:
Jaifroid 2018-03-29 10:45:40 +01:00
parent 78250558a8
commit d3e4a6a300
2 changed files with 15 additions and 2 deletions

View File

@ -1,7 +1,8 @@
## Release 0.9.9.4 (beta)
* ENHANCEMENT: Experimental support for printing articles
* ENHANCEMENT: Print zoom capability
* ENHANCEMENT: Prevent prevent printing of location pins
* ENHANCEMENT: Prevent printing of location pins
* ENHANCEMENT: Set maximum page width to 100% before printing
* ENHANCEMENT: Better presentation of About and Changelog information
* WORKAROUND: MW-Offliner bug which places extraneous tags in some HTML id attributes

View File

@ -170,6 +170,13 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
document.getElementById("printImageCheck").checked = false;
document.getElementById("printImageCheck").disabled = true;
}
//Remove max page-width restriction
if (params.removePageMaxWidth !== true) {
var tempPageMaxWidth = params.removePageMaxWidth;
params.removePageMaxWidth = true;
removePageMaxWidth();
params.removePageMaxWidth = tempPageMaxWidth;
}
var modalContent = document.getElementById("modal-content");
modalContent.classList.remove('dark');
if (params.cssUITheme != "light") modalContent.classList.add('dark');
@ -179,7 +186,12 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
});
$("#printModal").off('hide.bs.modal');
$("#printModal").on('hide.bs.modal', function() {
if (document.activeElement.id != "confirm-print-continue") { setTab(); return; }
if (document.activeElement.id != "confirm-print-continue") { //User cancelled
//Restore PageMaxWidth
removePageMaxWidth();
setTab();
return;
}
uiUtil.printCustomElements();
//innerDocument.execCommand("print", false, null);
window.frames[0].frameElement.contentWindow.print();