1/** 2 * Custom JS 3 */ 4jQuery(function ($){ 5 (function (){ 6 if (!$("body").is(".single")){ 7 return; 8 } 9 10 if ($(".adpopup-wrapper").attr("data-has-content") == "0"){ 11 return; 12 } 13 14 // if ($(window).width() > 550){ 15 // //not mobile 16 // return; 17 // } 18 19 // var referrer = ""+document.referrer; 20 // if (referrer.indexOf("facebook") == -1){ 21 // return; 22 // } 23 24 var duration = $(".adpopup-wrapper").attr("data-popup-duration"); 25 26 try{ 27 duration = parseInt(duration); 28 }catch (e){ 29 duration = -1; 30 } 31 32 33 if (duration < 0){ 34 return; 35 } 36 37 38 setTimeout(function (){ 39 var showCBTimer = setInterval(function (){ 40 if ($(".adpopup-container .fb-page").attr("fb-xfbml-state") !== "rendered"){ 41 return; 42 } 43 44 $(".adpopup-bg,.adpopup-wrapper").removeClass("hide"); 45 46 $(".adpopup-wrapper .btn-close").click(function (){ 47 $("html,body").scrollTop(0); 48 $(".adpopup-bg,.adpopup-wrapper").addClass("hide"); 49 }); 50 51 clearInterval(showCBTimer); 52 }, 1000); 53 }, duration * 1000); 54 })(); 55 56 (function (){ 57 if (!$("body").is(".single")){ 58 return; 59 } 60 61 var adbox_shown = false; 62 63 var hiddenFB_enabled = $(".adbox-wrapper").attr("data-hidden-fb-enabled") == "1"; 64 65 var duration = $(".adpopup-wrapper").attr("data-fb-wait-duration"); 66 67 var isPopupBackToTop = false; //-2: disable; -1: enable 68 69 //Get init parameters from the meta tag 70 var metaIsPopupBackToTop = parseInt($('meta[name=fb_popup_back_to_top]').attr("content")); 71 //Data validation from the option value 72 if (metaIsPopupBackToTop == -1) { 73 isPopupBackToTop = true; 74 } 75 76 try{ 77 duration = parseInt(duration); 78 }catch (e){ 79 duration = -1; 80 } 81 if (duration == -2) { 82 return; 83 } 84 85 var showLikeFBDivByWaiting = (duration > -1); 86 87 if (hiddenFB_enabled || showLikeFBDivByWaiting){ 88 setTimeout(function (){ 89 if (adbox_shown){ 90 return; 91 } 92 93 adbox_shown = true; 94 $(".adbox-bg, .adbox-wrapper").removeClass("hide"); 95 }, duration* 1000); 96 }else { 97 $(window).scroll(function () { 98 if (adbox_shown) { 99 return; 100 } 101 if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { 102 adbox_shown = true; 103 $(".adbox-bg, .adbox-wrapper").removeClass("hide"); 104 } 105 }); 106 } 107 108 window.closeFacebookLikeWrapper = function(){ 109 $(".adbox-bg, .adbox-wrapper").addClass("hide"); 110 if (isPopupBackToTop) { 111 $("body").scrollTop(0); 112 } 113 }; 114 115 //$(".adbox-container .btn-close, .adbox-container .close").click(window.closeFacebookLikeWrapper); 116 117 })(); 118 119 /** 120 * Mobile Add Line 121 * 122 * @since 20170221 123 */ 124 (function (){ 125 if ($(window).width() > 550){ 126 //not mobile 127 return; 128 } 129 130 var showingLineBanner = false; 131 132 $(window).scroll(function (){ 133 var scrollTop = $(window).scrollTop(); 134 135 if (scrollTop > 10){ 136 if (! showingLineBanner){ 137 showingLineBanner = true; 138 $(".mobile-line-banner").addClass("active"); 139 } 140 }else{ 141 if (showingLineBanner){ 142 showingLineBanner = false; 143 $(".mobile-line-banner").removeClass("active"); 144 } 145 } 146 }); 147 })(); 148 149 /** 150 * Cookie View 1234 CloudFlare Bug Fix 151 * 152 * @since 20170221 153 */ 154 (function (){ 155 if (typeof(Storage) === "undefined") { 156 return; 157 } 158 159 var path = location.pathname; 160 161 var pattern = /^\/view([0-9]+)\//; 162 163 var matches = pattern.exec(path); 164 if (!matches || matches.length < 2){ 165 return; 166 } 167 168 var viewNum = matches[1]; 169 localStorage.setItem("view_path", viewNum); 170 })(); 171 (function (){ 172 if (typeof(Storage) === "undefined") { 173 return; 174 } 175 176 var viewNum = localStorage.getItem("view_path"); 177 if (viewNum == null){ 178 return; 179 } 180 181 viewNum = parseInt(viewNum); 182 183 var pattern = /^\/([0-9]+)/; 184 185 var host = location.host; 186 $("a").each(function (){ 187 if (host != this.host){ 188 return; 189 } 190 191 var path = this.pathname; 192 193 var matches = pattern.exec(path); 194 if (!matches || matches.length < 2){ 195 return; 196 } 197 198 this.pathname = "/view" + viewNum + "/" + matches[1]; 199 }); 200 })(); 201 202}); 203
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.