-
Notifications
You must be signed in to change notification settings - Fork 0
/
1doc2rule.min.js
executable file
·6 lines (6 loc) · 2.52 KB
/
1doc2rule.min.js
1
2
3
4
5
6
function subst(b){1===b&&(document.getElementById("debug_info").innerHTML="wkhtmltopdf: called subst()");b={};var a=document.location.search.substring(1).split("&");for(c in a)if(a.hasOwnProperty(c)){var d=a[c].split("=",2);b[d[0]]=decodeURI(d[1])}var c="page frompage topage webpage section subsection date isodate time title doctitle sitepage sitepages".split(" ");for(var e in c)if(c.hasOwnProperty(e))for(d=document.getElementsByClassName(c[e]),a=0;a<d.length;++a)d[a].textContent=b[c[e]]}
function numberWithCommas(b){return b.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function goBack(){window.history.back()}function targetBlank(){var b=document.querySelectorAll(".blank_target_link,.https_blank_target_link,.button_blank_target_link");[].forEach.call(b,function(a){a.target="_blank"})}function AddAttribute(b,a,d){document.getElementById(b).setAttribute(a,d)}
function setAgent(){var b=navigator.userAgent;var a=document.querySelectorAll(".js_only");[].forEach.call(a,function(a){a.style.display="block"});-1<b.indexOf("wkhtmltopdf")||-1<b.indexOf("HeadlessChrome")?(a=document.querySelectorAll(".show_only_pdfs"),[].forEach.call(a,function(a){a.style.display="block"}),a=document.querySelectorAll(".no_show_book"),[].forEach.call(a,function(a){a.style.display="none"}),a=document.querySelectorAll(".no_show_pdf"),[].forEach.call(a,function(a){a.style.display="none"}),
a=document.querySelectorAll(".show_web_page_only"),[].forEach.call(a,function(a){a.style.display="none"}),a=document.querySelectorAll(".noprint"),[].forEach.call(a,function(a){a.style.display="none"}),a=document.querySelectorAll(".show_if_js_only_no_show_pdf_book"),[].forEach.call(a,function(a){a.style.display="none"})):(a=document.querySelectorAll(".a_line_show_break_html"),[].forEach.call(a,function(a){a.style.display="block"}),a=document.querySelectorAll(".noprint"),[].forEach.call(a,function(a){a.style.display=
"block";a.className="align_center"}),a=document.querySelectorAll(".no_show_book"),[].forEach.call(a,function(a){a.style.display="block";a.className="the_chapter"}),a=document.querySelectorAll(".show_if_js_only_no_show_pdf_book"),[].forEach.call(a,function(a){a.style.display="block"}),a=document.querySelectorAll(".show_web_page_only"),[].forEach.call(a,function(a){a.style.display="block"}),a=document.querySelectorAll(".goog-te-gadget-simple"),[].forEach.call(a,function(a){a.style.marginTop="0";a.style.paddingTop=
"0";a.style.fontSize="large"}),a=document.querySelectorAll(".no_show_pdf"),[].forEach.call(a,function(a){a.style.display="inline"}))}document.onload=setAgent();