D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
sadaunjx
/
forsa2you.com
/
wp-content
/
plugins
/
ad-inserter
/
includes
/
js
/
Filename :
ai-rotation.min.js
back
Copy
jQuery(function(b){function u(){b("div.ai-rotate.ai-rotation-groups").each(function(e,m){b(this).addClass("ai-timer");ai_process_rotation(this)})}var p=[];ai_process_rotation=function(e){if(b(e).hasClass("ai-unprocessed")||b(e).hasClass("ai-timer")){b(e).removeClass("ai-unprocessed").removeClass("ai-timer");var m=!1;if("undefined"!=typeof b(e).data("info")){var a="div.ai-rotate.ai-"+JSON.parse(atob(b(e).data("info")))[0];p.includes(a)&&(p.splice(p.indexOf(a),1),m=!0)}if("number"==typeof e.length)for(m= 0;m<e.length;m++)0==m?ai_process_single_rotation(e[m],!0):ai_process_single_rotation(e[m],!1);else ai_process_single_rotation(e,!m)}};ai_process_single_rotation=function(e,m){var a,k=b(e).children(".ai-rotate-option");if(0!=k.length){k.hide();if("undefined"==typeof b(e).data("next"))if("undefined"!=typeof b(k[0]).data("group")){var h=-1,t=[];b("span[data-ai-groups]").each(function(q){(b(this)[0].offsetWidth||b(this)[0].offsetHeight||b(this)[0].getClientRects().length)&&t.push(this)});1<=t.length&& JSON.parse(b64d(b(t).first().data("ai-groups"))).forEach(function(q,w){-1==h&&k.each(function(v){if(b64d(b(this).data("group"))==q)return h=v,!1})})}else{var g=b(e).data("shares");if("string"===typeof g){g=JSON.parse(atob(g));var f=Math.round(100*Math.random());for(a=0;a<g.length&&(h=a,0>g[a]||!(f<=g[a]));a++);}else g=b(e).hasClass("ai-unique"),f=new Date,g?("number"!=typeof ai_rotation_seed&&(ai_rotation_seed=(Math.floor(1E3*Math.random())+f.getMilliseconds())%k.length),g=b(e).data("counter"),h= ai_rotation_seed+g,h>=k.length&&(h-=k.length)):(h=Math.floor(Math.random()*k.length),f.getMilliseconds()%2&&(h=k.length-h-1))}else h=parseInt(b(e).attr("data-next")),a=b(k[h]),"undefined"!=typeof a.data("code")&&(a=b(b64d(a.data("code")))),0!=a.find("span[data-ai-groups]").addBack("span[data-ai-groups]").length&&0!=b(".ai-rotation-groups").length&&setTimeout(function(){u()},5);if(b(e).hasClass("ai-rotation-scheduling"))for(h=-1,g=0;g<k.length;g++)if(a=b(k[g]),f=a.data("scheduling"),"undefined"!=typeof f){a= b64d(f);f=!0;0==a.indexOf("^")&&(f=!1,a=a.substring(1));var d=a.split("="),c=-1!=a.indexOf("%")?d[0].split("%"):[d[0]];a=c[0].trim().toLowerCase();c="undefined"!=typeof c[1]?c[1].trim():0;d=d[1].replace(" ","");var n=(new Date).getTime();n=new Date(n);var l=0;switch(a){case "s":l=n.getSeconds();break;case "i":l=n.getMinutes();break;case "h":l=n.getHours();break;case "d":l=n.getDate();break;case "m":l=n.getMonth();break;case "y":l=n.getFullYear();break;case "w":l=n.getDay(),l=0==l?6:l-1}a=0!=c?l%c: l;c=d.split(",");d=!f;for(n=0;n<c.length;n++)if(l=c[n],-1!=l.indexOf("-")){if(l=l.split("-"),a>=l[0]&&a<=l[1]){d=f;break}}else if(a==l){d=f;break}if(d){h=g;break}}if(!(0>h||h>=k.length)){a=b(k[h]);f="";if("undefined"!=typeof a.data("time")){g=atob(a.data("time"));if(0==g&&1<k.length){c=h;do{c++;c>=k.length&&(c=0);d=b(k[c]);if("undefined"==typeof d.data("time")){h=c;a=b(k[h]);g=0;break}d=atob(d.data("time"))}while(0==d&&c!=h);0!=g&&(h=c,a=b(k[h]),g=atob(a.data("time")))}if(0<g&&(c=h+1,c>=k.length&& (c=0),"undefined"!=typeof b(e).data("info"))){f=JSON.parse(atob(b(e).data("info")))[0];b(e).attr("data-next",c);var r="div.ai-rotate.ai-"+f;p.includes(r)&&(m=!1);m&&(p.push(r),setTimeout(function(){b(r).addClass("ai-timer");ai_process_rotation(b(r))},1E3*g));f=" ("+g+" s)"}}else"undefined"==typeof a.data("group")&&k.each(function(q){q!=h&&b(this).remove()});a.css({display:"",visibility:"",position:"",width:"",height:"",top:"",left:""}).removeClass("ai-rotate-hidden").removeClass("ai-rotate-hidden-2"); b(e).css({position:""});"undefined"!=typeof a.data("code")&&(k.empty(),g=b64d(a.data("code")),a.append(g),ai_process_elements());g=a.data("index");a=b64d(a.data("name"));d=b(e).closest(".ai-debug-block");0!=d.length&&(c=d.find("kbd.ai-option-name"),d=d.find(".ai-debug-block"),"undefined"!=typeof d&&(d=d.find("kbd.ai-option-name"),c=c.slice(0,c.length-d.length)),"undefined"!=typeof c&&(d=c.first().data("separator"),"undefined"==typeof d&&(d=""),c.html(d+a+f)));c=!1;d=b(e).closest(".ai-adb-show");0!= d.length&&d.attr("data-ai-tracking")&&(f=JSON.parse(b64d(d.attr("data-ai-tracking"))),"undefined"!==typeof f&&f.constructor===Array&&(f[1]=g,f[3]=a,d.attr("data-ai-tracking",b64e(JSON.stringify(f))),d.addClass("ai-track"),c=!0));c||(c=b(e).closest("div[data-ai]"),"undefined"!=typeof c.attr("data-ai")&&(f=JSON.parse(b64d(c.attr("data-ai"))),"undefined"!==typeof f&&f.constructor===Array&&(f[1]=g,f[3]=a,c.attr("data-ai",b64e(JSON.stringify(f))),c.addClass("ai-track"))))}}};ai_process_rotations=function(){b("div.ai-rotate").each(function(e, m){ai_process_rotation(this)})};ai_process_rotations_in_element=function(e){b("div.ai-rotate",e).each(function(m,a){ai_process_rotation(this)})};b(document).ready(function(e){setTimeout(function(){ai_process_rotations()},10)})});ai_process_elements_active=!1; function ai_process_elements(){ai_process_elements_active||setTimeout(function(){ai_process_elements_active=!1;"function"==typeof ai_process_rotations&&ai_process_rotations();"function"==typeof ai_process_lists&&ai_process_lists(jQuery(".ai-list-data"));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery(".ai-ip-data"));"function"==typeof ai_process_filter_hooks&&ai_process_filter_hooks(jQuery(".ai-filter-check"));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(); "function"==typeof ai_process_impressions&&1==ai_tracking_finished&&ai_process_impressions();"function"==typeof ai_install_click_trackers&&1==ai_tracking_finished&&ai_install_click_trackers();"function"==typeof ai_install_close_buttons&&ai_install_close_buttons(document)},5);ai_process_elements_active=!0};