diff -r b5b13ce6935f -r b00fdbef41d4 integration/mediapart/article_files/chartbeat.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/integration/mediapart/article_files/chartbeat.js Tue Oct 09 16:31:25 2012 +0200 @@ -0,0 +1,12 @@ +(function(){var e=true,h,i=this;function k(){var a=l(),b;if(a)b=a._cb_cp,a._cb_cp="";else if(/_cb_cp[a-z0-9]{16}/.test(i.name))b=i.name.substr(6),i.name="";return b};function m(){this.a=i._sf_async_config||{};this.A=o(this,this.F);this.e=[];q(this);r(i,"unload",o(this,this.D));for(var a=0,b;b=(i._cbq||[])[a];++a)this.u(b);i._cbq={push:o(this,this.u)}}h=m.prototype;h.u=function(a){this.a[a[0]]=a[1];this.f=0};function o(a,b){return function(){b.apply(a,arguments)}}function u(){var a,b,c;a="";for(c=0;c<16;c++)b=Math.floor(Math.random()*36).toString(36),a+=b;return a} +function v(a){var b={};if(a){a.charAt(0)=="?"&&(a=a.substring(1));for(var a=a.replace("+"," "),a=a.split(/[&;]/g),c=0;c18E5?0:1;a.g?(b=D(),b[2]=C(),b[3]=c,a.g=b.join(".")):a.g=u()+"."+C()+"."+C()+"."+c;G("_chartbeat2",a.g,30);var p;b=D();if(c=b[3])F(b[1],b[2])<14&&(c=c.substr(c.indexOf("1"))),p=Math.round(c.length/c.replace(/0/g,"").length*10)/10;a.p=p;a.c?H(a.c):a.c=new I} +h.G=function(a,b){this.w=i.location.protocol+"//"+this.a.domain+this.a.path;this.a.path=a;b&&(this.a.title=b);i.clearInterval(this.j);q(this);A(this)};h.z=function(a){this.i=a};h.l=function(){var a=i._sf_startpt,b=i._sf_endpt;if(typeof a=="number")this.t=typeof b=="number"?b-a:C()-a;this.j=i.setInterval(o(this,this.s),15E3);this.s()};h.D=function(){var a=this.m,b=l();if(b)b._cb_cp+=(b._cb_cp?",":"")+a;else if(!i.name)i.name="_cb_cp"+a}; +function J(a,b){var c;c=new Image(1,1);c.onerror=a.A;c.src=b}h.F=function(){this.e.push(1);for(var a=0,b=0;b=this.r&&i.clearInterval(this.j))};function O(){var a=document.body,b=document.documentElement;if(typeof i.pageYOffset=="number")return i.pageYOffset;else if(a&&a.scrollTop)return a.scrollTop;else if(b&&b.scrollTop)return b.scrollTop;return 0} +function N(a){function b(a,b,d){return(b=c[b]||c[d])?"&g"+a+"="+encodeURIComponent(b):""}var c=a.a,d=O(),f=Math.round((C()-a.v)/600)/100,g=0,p=0,M=0;P(a.c,"onkeydown")?p=1:a.a.reading&&+a.a.reading||P(a.c,"onmousemove")||P(a.c,"onscroll")||f<0.1?g=1:M=1;var n="",j="",y=i.location;if(a.n)a.n=false,a.w?(n=a.w,j=e):(n=document.referrer||"",j=n.indexOf("://"+y.host+"/"),j=j!=-1&&j<9),n=(j?"&v=":"&r=")+encodeURIComponent(n),j="&i="+Q(c.title.slice(0,100));var X=a.t?"&b="+a.t:"",Y=a.i?"&A="+a.i:"",Z=a.p? +"&f="+a.p:"",s=k(),s=s?"&D="+s:"";a.e.push(0);a.e.length>18&&a.e.shift();var z=[],t;for(t in a.a)t.charAt(0)=="_"&&z.push(t+"="+a.a[t]);J(a,(y.protocol||"http:")+"//"+c.pingServer+"/ping?h="+encodeURIComponent(c.domain)+"&p="+encodeURIComponent(c.path)+"&u="+(D()[0]||a.m)+"&d="+Q(y.host.replace(/^www\./,""))+"&g="+c.uid+b(0,"sections","categories")+b(1,"authors","brands")+(c.noCookies?"":"&n="+a.C)+Z+"&c="+f+"&x="+d+"&y="+(document.body.scrollHeight||0)+"&w="+(i.innerHeight||document.body.offsetHeight|| +0)+"&j="+Math.round((a.f+2)*15E3/1E3)+"&R="+g+"&W="+p+"&I="+M+"&E="+a.o+n+X+Y+w(a,"C","utm_campaign","campaignTag")+w(a,"M","utm_medium","mediumTag")+"&t="+a.m+"&V=6"+s+j+(z.length?"&"+z.join("&"):"")+"&_")};function I(){this.h=[];R(this,i,"onscroll");R(this,document.body,"onkeydown");R(this,document.body,"onmousemove");H(this)}function H(a){a.b=[{},{},{},{}];a.d=0;L(a)}function R(a,b,c){var d=b[c]||function(){};a.h.push(c);b[c]=function(b){d.apply(this,arguments);if(b&&c=="onkeydown"){var g=b.keyCode?b.keyCode:b.which;if(g==32||g>36&&g<41){a.b[a.d].onscroll++;return}}a.b[a.d][c]++}}function P(a,b){for(var c=0,d=0;d