function getURLParameter(a){return decodeURIComponent((new RegExp("[?|&]"+a+"="+"([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}function filterListener(a){switch(console.log(a),a){case"subscription.lastDownload":$(".progress-bar").css("width",50/(alldown-fdownnum)+"%");break;case"subscription.downloadStatus":$(".progress-bar").css("width",60/(alldown-fdownnum)+"%");break;case"subscription.homepage":$(".progress-bar").css("width",70/(alldown-fdownnum)+"%");break;case"subscription.updated":$(".progress-bar").css("width",100/(alldown-fdownnum)+"%"),fdownnum+=1,alldown==fdownnum&&setTimeout(function(){$(".popbox .main").animate({"margin-left":"-500px"},300)},500)}}function addsubscription(){var a=[{homepage:"http://www.adtchrome.com/extension/adt-chinalist-easylist.html",title:"\u5e7f\u544a\u7ec8\u7ed3\u8005\u9ed8\u8ba4\u8fc7\u6ee4\u89c4\u5219",url:"http://sub.adtchrome.com/adt-chinalist-easylist.txt",disabled:!1},{homepage:"http://www.adtchrome.com/extension/adt-videolist.html",title:"Videolist(\u4e0d\u7a33\u5b9a)",url:"http://sub.adtchrome.com/adt-videolist.txt",disabled:!0}];a.forEach(function(a){var b=Subscription.fromURL(a.url);FilterStorage.addSubscription(b),b.disabled=a.disabled,b.title=a.title,b.homepage=a.homepage,b instanceof DownloadableSubscription&&!b.lastDownload&&Synchronizer.execute(b)})}function getBroswerType(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("lbbrowser")>0)return"lbbrowser";var b="track"in document.createElement("track"),c="scoped"in document.createElement("style"),d="v8Locale"in window;return b&&c&&d?"360se":b&&c&&!d?"360ee":"chrome"}var backgroundPage=chrome.extension.getBackgroundPage(),require=backgroundPage.require,subscriptionClasses=require("subscriptionClasses"),Subscription=subscriptionClasses.Subscription,FilterNotifier=require("filterNotifier").FilterNotifier,FilterStorage=require("filterStorage").FilterStorage,DownloadableSubscription=subscriptionClasses.DownloadableSubscription,Synchronizer=require("synchronizer").Synchronizer,fdownnum=0,alldown=2,canLeave=!1;!function(a){a.fn.extend({center:function(b){var b=a.extend({inside:window,transition:0,minX:0,minY:0,withScrolling:!0,vertical:!0,horizontal:!0},b);return this.each(function(){var c={position:"absolute"};if(b.vertical){var d=(a(b.inside).height()-a(this).outerHeight())/2;b.withScrolling&&(d+=a(b.inside).scrollTop()||0),d=d>b.minY?d:b.minY,a.extend(c,{top:d+"px"})}if(b.horizontal){var e=(a(b.inside).width()-a(this).outerWidth())/2;b.withScrolling&&(e+=a(b.inside).scrollLeft()||0),e=e>b.minX?e:b.minX,a.extend(c,{left:e+"px"})}return b.transition>0?a(this).animate(c,b.transition):a(this).css(c),a(this)})}})}(jQuery),$(function(){$("body").addClass("stop-scrolling"),$(".popbox").center(),$(window).bind("resize",function(){$(".popbox").center({transition:300})}),window.onbeforeunload=function(){return canLeave?void 0:"\u5e7f\u544a\u7ec8\u7ed3\u8005\u8fd8\u5728\u914d\u7f6e\u4e2d\uff0c\u5efa\u8bae\u4f60\u4e0d\u8981\u5173\u95ed\u8fd9\u4e2a\u9875\u9762\u3002"},FilterNotifier.addListener(filterListener),window.addEventListener("unload",function(){FilterNotifier.removeListener(filterListener)},!1),addsubscription(),$(".sure-btn").click(function(){$("body").removeClass("stop-scrolling"),$(".popboxbg").remove(),$(".popbox").remove(),canLeave=!0}),$(window).scroll(function(){$(window).scrollTop()>69?$("#sideToolbar-up").fadeIn(100):$("#sideToolbar-up").fadeOut(100)}),$("#sideToolbar-up").click(function(){$("body,html").animate({scrollTop:0},500)}),$("#"+getBroswerType()+"-warn").show(),null!=getURLParameter("test")&&($("body").removeClass("stop-scrolling"),$(".popboxbg").remove(),$(".popbox").remove())});var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-48334954-1"]),_gaq.push(["_trackPageview"]),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://ssl.google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}();