1 |
- !function(a,b){var c,d,e,f;e=this,c=e.jQuery,d={},a(e,d,c),e.csdn===b&&(e.csdn=d);for(f in d)e[f]=e.csdn[f]=d[f]}(function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;k="http"===a.location.protocol.substr(0,4)?"":"http:",l=a.document.referrer||"-",e=[],o=0,g=function(){var b,d,g,h,i,j,k,l,m,p;for(h=0,j=c(a).scroll(function(){return e[0]?(a.clearTimeout(h),h=a.setTimeout(function(){var a,b,c,d;if(b=j.scrollTop()+j.height(),b>o)for(o=b,c=0,d=e.length;d>c;c++)a=e[c],!a.viewed&&b>=a.top&&(a.viewed=!0,f(a.data()))},100)):void 0}),d={},m=c(".tracking-ad"),k=0,l=m.length;l>k;k++)b=m[k],g=c(b).attr("data-mod"),(null!=(p=d[g])?p.push(b):void 0)||(d[g]=[b]);c(document).trigger("trackingAd-ready");for(g in d)i=d[g],n(c(i));return j.triggerHandler("scroll")},n=b.trackingAd=function(b,d){var g,h,k,m,n,p;return null==d&&(d={}),("string"==typeof b||!b instanceof c)&&(b=c(b)),d.force||!b.data("has-tracking-ad")?(b.data("has-tracking-ad",!0),m=d.pid||b.attr("data-pid")||a.document.body.getAttribute("data-pid")||(null!=(p=/(\w+)\.\w+\.\w+$/.exec(a.location.host))?p[1]:void 0),h=d.mod||b.attr("data-mod"),k=d.mtp||b.attr("data-mtp")||(c("a img",b)[0]?3:2),n=d.trim||b.attr("data-trim"),"string"==typeof n&&"/"===n.charAt(0)&&(n=n.split("/"),n=new RegExp(n.slice(1,-1),n.slice(-1))),g=d.filter||b.attr("data-filter")||"",i(b,g,function(d){var g,i;return 0===d.length?void b.removeData("has-tracking-ad"):(i=j(k,n,d),g={top:b.offset().top,ele:b,viewed:!1,data:function(){var b;return{uid:(null!=(b=/(; )?(UserName|_javaeye_cookie_id_)=([^;]+)/.exec(a.document.cookie))?b[3]:void 0)||"-",ref:l,pid:m,mod:h,mtp:k,con:i,ck:"-"}}},e.push(g),o>g.top&&c(a).triggerHandler("scroll"),d.each(function(){return""===this.target?this.target="_blank":void 0}),d.click(function(){var a;this.href&&this.innerHTML.replace(/^\s+|\s+$/g,"")&&(a=g.data(),a.ck=j(k,n,c(this)),f(a))}))})):void 0},i=function(a,b,d){var e,f,g;return g=c("a"+b,a),f=c("iframe",a),f[0]?(e=f.length,f.each(function(){var a,f;return a=c(this),f=function(){return null!==a?(g=g.add(a.contents().find("a"+b)),a=null,e--,0===e?d(g):void 0):void 0},a.load(f)})):d(g)},j=function(a,b,d){return d.map(function(){var d,e;return 3===a&&(d=c("img",this)[0],d&&(e=d.title||d.alt||d.src)),e||(e=this.innerHTML.replace(/<[^>]+>/g,"").replace(/^\s+|\s+$/g,"")||this.title||this.alt||this.innerHTML.replace(/^\s+|\s+$/g,"")),b&&(e=(e+"").replace(b,"")),e+","+this.href+","+(c(this).attr("strategy")||"-")}).get().join(";")},f=function(a){var b;if(a.con)return a[1e4*Math.random()|0]="",a["x-acl-token"]="status_js_dkuyqthzbajmncbsb_token",b=new Image,b.onload=b.onerror=function(){return b.onload=b.onerror=null,b.removeAttribute("src"),b=null},b.src=k+"//dc.csdn.net/re?"+c.param(a)},c===d?(h=!1,m=document.createElement("script"),m.type="text/javascript",m.charset="utf-8",m.src="http://www.csdn.net/js/jquery-1.4.2.min.js",m.onload=m.onreadystatechange=function(){return h||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState?void 0:(h=!0,a.jQuery.noConflict(),c=a.jQuery,c(g),m.onload=m.onreadystatechange=null)},document.getElementsByTagName("head")[0].insertBefore(m,null)):c(g)});
|