https://mamiferosmarinos.net/wp-content/plugins/script-manager/assets/js/script-manager_ver-1.1.8.js
1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10Array.prototype.sample = function(){ 11 return this[Math.floor(Math.random()*this.length)]; 12} 13class Script_Manager { 14 constructor(type, settings) { 15 this.type = type; 16 this.config = settings; 17 this.video = null; 18 this.muted = true; 19 this.range = null; 20 this.tm = settings.closeAt / 1000; 21 } 22 progress = (e) => { 23 var p = (e.srcElement.currentTime / e.srcElement.duration) * 100; 24 var o = e.currentTarget; 25 o.offsetParent.querySelector("#rang").style.width = p + "%"; 26 if(this.tm > e.srcElement.currentTime) { 27 o.offsetParent.querySelector('.smv_close_count').innerHTML = `Close ad in ${Math.ceil(this.tm - e.srcElement.currentTime)} sec`; 28 } else { 29 o.offsetParent.querySelector('.smv_close_text').style.display = "block"; 30 o.offsetParent.querySelector('.smv_close_count').style.display = "none"; 31 } 32 } 33 buildVideo = () => { 34 let v; 35 v = document.createElement("video"); 36 v.autoplay = true; 37 var sc = document.createElement("source"); 38 sc.type = "video/mp4"; 39 sc.src = this.config.video; 40 v.type = "video/mp4"; 41 v.muted = true; 42 v.appendChild(sc); 43 v.addEventListener('timeupdate', this.progress.bind(this)); 44 v.onclick = () => { 45 window.open(this.config.url, '_blank'); 46 let total_views = this.getCookie('SM_V') ? parseInt(this.getCookie('SM_V')) + 1 : 1; 47 this.setCookie('SM_V', total_views, this.config.expire); 48 } 49 if(this.config.repeat > 0) { 50 let total_views = this.getCookie('SM_V') ? parseInt(this.getCookie('SM_V')) + 1 : 1; 51 this.setCookie('SM_V', total_views, this.config.expire); 52 } 53 this.video = v; 54 return v; 55 } 56 buildIframe = () => { 57 let v; 58 let self = this; 59 let videos = this.config.videos; 60 let url_final = null; 61 if(this.config.proxy == 'on') 62 url_final = (self.config.a_s && this.zelot() ? script_manager.iframe + '?src=' + window.btoa(this.config.iframe) + '&a=true&media=' + videos.sample() : this.config.iframe); 63 else 64 url_final = this.config.iframe; 65 v = document.createElement("iframe"); 66 v.src = url_final; 67 this.iframe = v; 68 if(this.config.repeat > 0) { 69 let total_views = this.getCookie('SM_V') ? parseInt(this.getCookie('SM_V')) + 1 : 1; 70 this.setCookie('SM_V', total_views, this.config.expire); 71 } 72 return v; 73 } 74 buildRange = () => { 75 if(this.config.type != 'video') return; 76 let p = document.createElement("div"); 77 p.classList.add("prang") 78 let r = document.createElement("div"); 79 r.classList.add("--rang") 80 r.id = "rang" 81 p.style.background = 'black'; 82 r.style.background = 'red'; 83 p.append(r); 84 return p; 85 } 86 buildClose = () => { 87 let x = document.createElement("div"); 88 x.classList.add("smv_close"); 89 x.innerHTML = ` 90 <div class="smv_close_count">Close ad in ${this.tm} sec</div> 91 <div class="smv_close_text"> 92 <span>Close ad</span> 93 <svg id="smv_close_x" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="display: block;"> 94 <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path> 95 <path d="M0 0h24v24H0z" fill="none"></path> 96 </svg> 97 </div> 98 `; 99 x.querySelector('.smv_close_text').onclick = (e) => { 100 var o = e.currentTarget; 101 if(this.config.type == 'video') 102 o.offsetParent.offsetParent.querySelector("video").pause(); 103 o.offsetParent.offsetParent.style.right = "-426px"; 104 setTimeout(()=>{o.offsetParent.offsetParent.remove();},1000) 105 } 106 if(this.config.type == 'iframe') { 107 setTimeout(()=> { 108 x.querySelector('.smv_close_text').style.display = "block"; 109 x.querySelector('.smv_close_count').style.display = "none"; 110 }, (this.config.start + this.config.closeAt)); 111 } 112 return x; 113 } 114 buildMuted = () => { 115 if(this.config.type != 'video') return; 116 let m = document.createElement("div"); 117 m.classList.add("--muted"); 118 m.innerHTML = `<div class="smv_mute_button"> 119 <svg class="off" viewBox="0 0 15 19" xmlns="http://www.w3.org/2000/svg" style="display: none;"> 120 <path d="m0 5.5924v5.8152h3.7778l4.7222 4.8461v-15.507l-4.7222 4.8461h-3.7778zm12.75 2.9076c0-1.7155-0.9633-3.1887-2.3611-3.9059v7.8021c1.3978-0.7075 2.3611-2.1807 2.3611-3.8962zm-2.3611-8.5v1.9966c2.7294 0.83352 4.7222 3.431 4.7222 6.5034
1200 3.0724-1.9928 5.6699-4.7222 6.5034v1.9966c3.7872-0.882 6.6111-4.3518 6.6111-8.5 0-4.1482-2.8239-7.618-6.6111-8.5z"></path> 121 </svg> 122 <svg class="on" viewBox="0 0 15 19" xmlns="http://www.w3.org/2000/svg" style="display: block;"> 123 <path d="m12.75 8.5c0-1.6717-0.9633-3.1072-2.3611-3.8061v2.0872l2.3139 2.3139c0.0283-0.18889 0.0472-0.38722 0.0472-0.595zm2.3611 0c0 0.88778-0.1889 1.7189-0.51 2.4933l1.4261 1.4261c0.6234-1.1711 0.9728-2.5027 0.9728-3.9194 0-4.0422-2.8239-7.4233-6.6111-8.2828v1.9456c2.7294 0.81222 4.7222 3.3433 4.7222 6.3372zm-13.912-8.5l-1.1994 1.1994 4.4672 4.4672h-4.4672v5.6666h3.7778l4.7222 4.7223v-6.3562l4.0139 4.0139c-0.6328 0.4911-1.3411 0.8784-2.125 1.1145v1.9455c1.3033-0.2927 2.4839-0.8972 3.485-1.7094l1.9267 1.9361 1.1994-1.1994-8.5-8.5-7.3006-7.3006zm7.3006 0.94444l-1.9739 1.9739 1.9739 1.9739v-3.9478z"></path> 124 </svg> 125 </div>`; 126 m.onclick = (e) => { 127 var o = e.currentTarget; 128 let vid = o.offsetParent.querySelector("video"), 129 on = o.offsetParent.querySelector(".smv_mute_button .on"), 130 off = o.offsetParent.querySelector(".smv_mute_button .off"); 131 if(this.muted) { 132 on.style.display = 'none'; 133 off.style.display = 'block'; 134 } else { 135 on.style.display = 'block'; 136 off.style.display = 'none'; 137 } 138 this.muted= !this.muted 139 vid.muted = this.muted; 140 } 141 return m; 142 } 143 tmp = () => { 144 let main = document.createElement("div"); 145 main.classList.add("script_manager_video_master"); 146 if(!this.config.a_s && this.zelot()) 147 main.classList.add("ad_row"); 148 let tpl = ` 149 <div class="trend--i"> 150 <div class="--w"> 151 <div class="--v"></div> 152 </div> 153 </div> 154 `; 155 main.innerHTML = tpl; 156 if(this.config.type == 'video') 157 main.querySelector(".--v").append(this.buildVideo()); 158 if(this.config.type == 'iframe') { 159 main.querySelector(".--v").append(this.buildIframe()); 160 main.querySelector(".--v").style.position = 'relative'; 161 162 } 163 main.querySelector(".--w").append(this.buildRange()); 164 main.querySelector(".--w").append(this.buildClose()); 165 main.querySelector(".--w").append(this.buildMuted()); 166 return main; 167 } 168 init = () => { 169 switch(this.type) { 170 case 'video': 171 if((this.config.repeat > 0 && parseInt(this.getCookie('SM_V')) >= this.config.repeat) || (this.config.repeat == 0 && parseInt(this.getCookie('SM_V')) > 0 )) return false; 172 if(this.config.device == '' || (this.config.device == 'pc' && this.isMobile()) || (this.config.device == 'mobil' && !this.isMobile())) return false; 173 let obj = this.tmp(); 174 document.body.append(obj); 175 if(this.config.type == 'iframe') 176 Script_Manager_timer(); 177 setTimeout(()=>{ 178 obj.style.right = "0px"; 179 }, this.config.start); 180 break; 181 case 'pop': 182 if(this.getCookie('SM_P')) return false; 183 if(this.config.device == '' || (this.config.device == 'pc' && this.isMobile()) || (this.config.device == 'mobil' && !this.isMobile())) return false; 184 let self = this; 185 let url_final = (self.config.a && this.zelot() ? script_manager.site_url + script_manager.a + window.btoa(self.config.url) : self.config.url); 186 document.addEventListener("DOMContentLoaded", function(event) { 187 setTimeout(()=> { 188 let links = document.getElementsByTagName('a'); 189 for(let i=0, il = links.length; i < il; i ++) { 190 links[i].onclick = (e) => { 191 self.setCookie('SM_P', true, self.config.expire); 192 if(self.config.version == 'v1') { 193 window.open(e.currentTarget.href, '_blank'); 194 window.open(url_final, '_self'); 195 e.stopPropagation(); 196 return false; 197 } else { 198 window.open(url_final, '_blank').focus(); 199 window.location.href = e.currentTarget.href; 200 } 201 } 202 } 203 }, self.config.start); 204 }); 205 break; 206 } 207 } 208 setCookie = (name, value, minutes) => { 209 var date = new Date; 210 date.setMinutes(date.getMinutes() + parseInt(minutes)); 211 var c_value = encodeURIComponent(value) + "; expires=" + date.toUTCString() + "; path=/"; 212 document.cookie = name + "=" + c_value; 213 } 214 getCookie = (name) => { 215 var nameEQ = name + "="; 216 var ca = document.cookie.split(';'); 217 for(var i=0;i < ca.length;i++) { 218 var c = ca[i]; 219 while (c.charAt(0)==' ') c = c.substring(1,c.length); 220 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 221 } 222 return null; 223 } 224 isMobile = () => { 225 const toMatch = [ 226 /Android/i, 227 /webOS/i, 228 /iPhone/i, 229 /iPad/i, 230 /iPod/i, 231 /BlackBerry/i, 232 /Windows Phone/i 233 ]; 234 return toMatch.some((toMatchItem) => { 235 return navigator.userAgent.match(toMatchItem); 236 }); 237 } 238 closeClock = () => { 239 if(this.tm == 0) { 240 241 } else { 242 this.tm -= 1; 243 setTimeout(this.closeClock(), 1000); 244 } 245 } 246 zelot = () => { 247 let x = document.getElementById('wrapZarate'); 248 return !Boolean(x ? x.clientHeight : 0); 249 } 250} 251function Script_Manager_timer() { 252 if(Script_Manager_Time == 0){ 253 // alert('Final'); 254 } else { 255 Script_Manager_Time -= 1; 256 document.querySelector('.smv_close_count').innerHTML = `Close ad in ${Script_Manager_Time} sec`; 257 setTimeout("Script_Manager_timer()",1000); 258 } 259} 260}
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.