Prevent map pins from printing

Former-commit-id: e779a4add023280d30cfde63a52157c5ab2e509d [formerly 5bbb6d044faa8da0e8856efb5e8bf38189acbfd7]
Former-commit-id: 625358fe44e5d9344e5b900fb8e92a54b53e3bdf
This commit is contained in:
Jaifroid 2018-03-17 12:55:11 +00:00
parent 03b7f5d98d
commit 96c3375409

View File

@ -152,6 +152,7 @@ define([], function() {
function printCustomElements() {
var innerDocument = window.frames[0].frameElement.contentDocument;
//Add any missing classes
innerDocument.body.innerHTML = innerDocument.body.innerHTML.replace(/(class\s*=\s*["'][^"']*vcard\b[^>]+>\s*<span)>/ig, '$1 class="map-pin">');
innerDocument.body.innerHTML = innerDocument.body.innerHTML.replace(/(<h2\b[^<]+external_links(?:[^<]|<\/)+<ul\s+(?!class="externalLinks"))/i, '$1class="externalLinks" ');
innerDocument.body.innerHTML = innerDocument.body.innerHTML.replace(/(<h2\b[^<]+see_also(?:[^<]|<\/)+<ul\s+(?!class="seeAlso"))/i, '$1class="seeAlso" ');
innerDocument.body.innerHTML = innerDocument.body.innerHTML.replace(/(<div\s+)([^>]+>\s+This article is issued from)/i, '$1class="copyLeft" $2');
@ -171,6 +172,8 @@ define([], function() {
printStyleInnerHTML += document.getElementById("printInfoboxCheck").checked ? "" : ".mw-stack, .infobox, .infobox_v2, .infobox_v3, .qbRight, .qbRightDiv, .wv-quickbar, .wikitable { display: none; } ";
printStyleInnerHTML += document.getElementById("printImageCheck").checked ? "" : "img { display: none; } ";
printStyleInnerHTML += ".copyLeft { display: none } ";
printStyleInnerHTML += ".map-pin { display: none } ";
printStyleInnerHTML += ".external { padding-right: 0 !important } ";
var sliderVal = document.getElementById("documentZoomSlider").value;
sliderVal = ~~sliderVal;
sliderVal = Math.floor(sliderVal * (Math.max(window.screen.width, window.screen.height) / 1440));