1/* 2 /$$ 3 /$$ /$$$$ 4 | $$ |_ $$ /$$$$$$$ 5 /$$$$$$$$ | $$ /$$_____/ 6|__ $$__/ | $$ | $$$$$$ 7 | $$ | $$ \____ $$ 8 |__/ /$$$$$$ /$$$$$$$/ 9 |______/|_______/ 10================================ 11 Keep calm and get rich. 12 Is the best. 13*/ 14/* ---------------------------------------------- /* 15 * POPUP 16/* ---------------------------------------------- */ 17if (typeof jQuery != "undefined") { 18 var $ = jQuery.noConflict(); 19} 20 21function ncPopupTips(type, msg) { 22 var c = type ? "success" : "error"; 23 var icon = type ? "<i class='icon me-2'></i>" : "<i class='icon me-2'></i>"; 24 var html = 25 '<div class="nice-popup nice-popup-error ' + 26 c + 27 '">' + 28 '<div class="nice-popup-body">' + 29 '<div class="nice-popup-content">' + 30 icon + 31 msg + 32 "</div>" + 33 "</div>" + 34 "</div>"; 35 var tips = $(html); 36 $("body").append(tips); 37 setTimeout(function () { 38 tips.addClass("nice-popup-open"); 39 }, 300); 40 if (typeof lazyLoadInstance !== "undefined") { 41 lazyLoadInstance.update(); 42 } 43 44 setTimeout(function () { 45 tips.removeClass("nice-popup-open"); 46 setTimeout(function () { 47 setTimeout(function () { 48 tips.remove(); 49 }, 600); 50 }, 1000); 51 }, 2000); 52} 53 54function ncPopup(type, html, maskStyle, btnCallBack) { 55 var maskStyle = maskStyle ? 'style="' + maskStyle + '"' : ""; 56 57 var size = ""; 58 59 if (type == "big") { 60 size = "nice-popup-lg"; 61 } else if (type == "no-padding") { 62 size = "nice-popup-nopd"; 63 } else if (type == "cover") { 64 size = "nice-popup-cover nice-popup-nopd"; 65 } else if (type == "full") { 66 size = "nice-popup-xl"; 67 } else if (type == "scroll") { 68 size = "nice-popup-scroll"; 69 } else if (type == "middle") { 70 size = "nice-popup-md"; 71 } else if (type == "small") { 72 size = "nice-popup-sm"; 73 } 74 75 var template = 76 '\ 77 <div class="nice-popup nice-popup-center ' + 78 size + 79 '">\ 80 <div class="nice-popup-overlay" ' + 81 maskStyle + 82 '></div>\ 83 <div class="nice-popup-body">\ 84 <div class="nice-popup-close">\ 85 <span class="svg-white"></span>\ 86 <span class="svg-dark"></span>\ 87 </div>\ 88 <div class="nice-popup-content">\ 89 ' + 90 html + 91 "\ 92 </div>\ 93 </div>\ 94 </div>\ 95 "; 96 97 var popup = $(template); 98 $("body").append(popup); 99 $("body").addClass("nice-popup-hidden"); 100 setTimeout(function () { 101 popup.addClass("nice-popup-open"); 102 }, 300); 103 if (typeof lazyLoadInstance !== "undefined") { 104 lazyLoadInstance.update(); 105 } 106 107 var close = function () { 108 $("body").removeClass("nice-popup-hidden"); 109 $(popup).removeClass("nice-popup-open"); 110 setTimeout(function () { 111 setTimeout(function () { 112 popup.remove(); 113 }, 300); 114 }, 600); 115 }; 116 117 $(popup).on( 118 "click touchstart", 119 ".nice-popup-close, .nice-popup-overlay", 120 function (event) { 121 event.preventDefault(); 122 close(); 123 } 124 ); 125 126 if (typeof btnCallBack == "object") { 127 Object.keys(btnCallBack).forEach(function (key) { 128 $(popup).on("click touchstart", key, function (event) { 129 var ret = btnCallBack[key](event, close); 130 }); 131 }); 132 } 133 return popup; 134} 135 136/* ---------------------------------------------- /* 137 * OTHERS 138/* ---------------------------------------------- */ 139 140$(document).ready(function () { 141 $(".post-video .wp-video").attr("style", ""); 142 $(".post-video video").attr("width", "100%"); 143 $(".post-video video").attr("height", null); 144 145 if (typeof globals !== "undefined" && globals.comment_ip === "1") { 146 $(".author-ip").each(function () { 147 var ip = $(this).data("ip") + ""; 148 var that = this; 149 if (ip.split(".").length !== 4) return; 150 151 $.ajax({ 152 url: "https://ip-delta.vercel.app/" + ip, 153 }).done(function (location) { 154 if (location && location.length && location.length > 2) { 155 $(that).text(location[1] + " " + location[2]); 156 } 157 }); 158 }); 159 } 160}); 161 162/* ---------------------------------------------- /* 163 * OTHERS 164/* ---------------------------------------------- */ 165function nicethemeResponsiveEmbeds() { 166 var proportion, parentWidth; 167 168 // Loop iframe elements. 169 document.querySelectorAll('iframe').forEach(function (iframe) { 170 // Only continue if the iframe has a width & height defined. 171 if (iframe.width && iframe.height) { 172 // Calculate the proportion/ratio based on the width & height. 173 proportion = parseFloat(iframe.width) / parseFloat(iframe.height); 174 // Get the parent element's width. 175 parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement, null).width.replace('px', '')); 176 // Set the max-width & height. 177 iframe.style.maxWidth = '100%'; 178 iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + 'px'; 179 } 180 }); 181} 182 183// Run on initial load. 184nicethemeResponsiveEmbeds(); 185 186// Run on resize. 187window.onresize = nicethemeResponsiveEmbeds;
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.