1// PDF é¢è§ 2$(function () { 3 function isIEBrowser() { 4 if (!!window.ActiveXObject || "ActiveXObject" in window) { 5 return true; 6 } else { 7 var isIEBrowser = navigator.userAgent.toLowerCase().indexOf("msie") > -1; 8 if (isIEBrowser) { 9 return true; 10 } 11 } 12 return false; 13 } 14 15 var siteId = window.top.siteId || '1'; 16 var disallowSavePdf = window.sessionStorage['disallowSavePdf_' + siteId] === 'true'; 17 18 function canUseObjectTag() { 19 // ç¦ç¨PDFä¿ååè½çæ¶åï¼å§ç»è¿åfalse 20 if (disallowSavePdf || isIEBrowser()) { 21 return false; 22 } 23 24 var ua = navigator.userAgent; 25 // æé¤å¾®ä¿¡æµè§å¨ 26 if (/WindowsWechat/i.test(ua) || /MicroMessenger/i.test(ua)) { 27 return false; 28 } 29 return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua); 30 } 31 //éåææpdfç±»åæ ç¾ 32 // HTML5 æ¹å¼ 33 if (canUseObjectTag()) { 34 $("[data-uitype ='pdf']") 35 .each(function () { 36 var url = $(this).attr("data-powerurl").toLowerCase(); //è·åå½åpdfæä»¶è·¯å¾ 37 var pdfElement = document.createElement('object'); 38 pdfElement.setAttribute('type', 'application/pdf'); 39 var height = window.innerHeight > 750 ? '750px' : '100%'; 40 pdfElement.setAttribute('style', 'width:100%;height:' + height + ';min-height:600px;margin-top:15px;margin-left:0px;'); 41 pdfElement.setAttribute('internalinstanceid', '11'); 42 pdfElement.setAttribute('data', url); 43 var p = $(this).parent(); 44 p.append(pdfElement); 45 $(this).remove(); 46 }); 47 return; 48 } 49 50 // IEãç§»å¨ç«¯ï¼pdfjs 51 $("[data-uitype ='pdf']") 52 .each(function () { 53 var url = $(this).attr("data-powerurl"); //è·åå½åpdfæä»¶è·¯å¾ 54 var ran = Math.floor(Math.random() * 100); //çæéæºæ° 55 $(this).removeAttr("src"); 56 var height = window.innerHeight > 750 ? '750' : '100%'; 57 var frame = '<iframe src="/content/_common/base/pdfjs/web/viewer.html?file=' + url + '" frameborder="0" width="100%" height="' + height + '" style="min-height:600px;margin-top:15px;margin-left:0px;"></iframe>'; 58 $(this)[0].insertAdjacentHTML("afterEnd", frame); 59 $(this).remove(); 60 }); 61});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.