Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: static/js/vendor/cssfx.min.js

Issue 29670669: Issue 268 - Removed cssfxjs dependency (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Patch Set: Addressed #3 Created Jan. 17, 2018, 2:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « static/css/empty.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var cssFx=cssFx||{};(function(e){function a(e,t){var n=function(e){for(e=0;e<4;e ++)try{return e?new ActiveXObject([,"Msxml2","Msxml3","Microsoft"][e]+".XMLHTTP" ):new XMLHttpRequest}catch(t){}};(r=n())&&(r.onreadystatechange=function(){r.rea dyState==4&&t(r.responseText)},r.open("GET",e,!0),r.send(u))}function f(e){var t =window,n="complete",r="readystatechange",i=!1,s=i,o=!0,u=t.document,a=u.documen tElement,f=u.addEventListener?"addEventListener":"attachEvent",l=u.addEventListe ner?"removeEventListener":"detachEvent",c=u.addEventListener?"":"on",h=function( o){(o.type!=r||u.readyState==n)&&((o.type=="load"?t:u)[l](c+o.type,h,i),!s&&(s=! 0)&&e.call(t,o.type||o))},p=function(){try{a.doScroll("left")}catch(e){setTimeou t(p,50);return}h("poll")};if(u.readyState==n)e.call(t,"lazy");else{if(u.createEv entObject&&a.doScroll){try{o=!t.frameElement}catch(d){}o&&p()}u[f](c+"DOMContent Loaded",h,i),u[f](c+r,h,i),t[f](c+"load",h,i)}}function l(e,t){return e.replace( t!=u?/\/\*([\s\S]*?)\*\//gim:"","").replace(/\n/gm,"").replace(/^\s\s*/,"").repl ace(/\s\s*$/,"").replace(/\s{2,}|\t/gm," ")}function c(e,t,n){return((256+e<<8|t )<<8|n).toString(16).slice(1)}function h(e,t){for(var n=t.length,r=0;r<n;r++)if( t[r]==e)return!0;return!1}function p(e,t){for(var n=e.length,r=0;r<n;r++)t.call( this,e[r])}var t="text-overflow",n="-timing-function",i="-duration",s="-image",o ="transition",u=null,d="animation",v="border",m="background",g="box-",y="column" ,b=o,w=["-moz-","-webkit-","-o-","-ms-"],E=w[0],S=w[1],x=w[2],T=w[3],N=[m+"-orig in",m+"-size",v+s,v+"-image-outset",v+"-image-repeat",v+"-image-source",v+"-imag e-width",v+"-radius",g+"shadow",y+"-count",y+"-gap",y+"-rule",y+"-rule-color",y+ "-rule-style",y+"-rule-width",y+"-width"],C=[g+"flex",g+"orient",g+"align",g+"or dinal-group",g+"flex-group",g+"pack",g+"direction",g+"lines",g+"sizing",d+i,d+"- name",d+"-delay",d+"-direction",d+"-iteration-count",d+"-play-state",d+n,d+"-fil l-mode"],k=["transform","transform-origin",b,b+"-property",b+i,b+n,b+"-delay","u ser-select"],L=[m+"-clip",v+"-bottom-left-radius",v+"-bottom-right-radius",v+"-t op-left-radius",v+"-top-right-radius"],A=L.concat(k).concat(N).concat(C),O=["dis play","opacity",t,m+s,m].concat(A),M="filter:progid:DXImageTransform.Microsoft.g radient(startColorstr='{1}', endColorstr='{2}',GradientType=0)",_;e.processCSS=f unction(t,n){for(var r=[],i=/([\s\S]*?)\{([\s\S]*?)\}/gim,s=/\@import\s+(?:url\( [\'\"]?(.*)[\'\"]?\))\s*\;?/gim,o=/@keyframes\s*([^\{]*)\{([^@]*)\}/g,a,f,c,h,d, v,m,g,y,b,E,S,x,T,N,C,k,L,A=0;A<t.length;A++){var M=l(t[A],1),_=[],D=s.test(M)&& M.match(s),P=o.test(M)&&M.match(o);for(s.lastIndex=0,o.lastIndex=0,c=0;c<D.lengt h;c++)M=M.replace(D[c],""),a=s.exec(D[c])[1],f=a[0]=="/"?a:n.replace(/[^\/]*?$/, "")+a,e.fetchCSS(f,function(t){e.insertCSS(e.processCSS([t],n))}),s.lastIndex=0; for(c=0,h=P.length;c<h;c++){if(M=M.replace(P[c],""),d=o.exec(P[c]),d){for(v=d[2] .match(i),m=[],g=0;g<v.length;g++)y=i.exec(v[g]),y&&m.push(l(y[1])+"{"+e.process Dec(y[2],!0)+"}"),i.lastIndex=0;p([0,1,3],function(e){_.push("@"+w[e]+"keyframes "+l(d[1])+"{"+m.join("\n")+"}")})}o.lastIndex=0}for(b=i.test(M)&&M.match(i),i.l astIndex=0,E=0,S=b.length;E<S;E++){if(x=i.exec(b[E]),x!==u)for(T=l(x[1],1),N=l(x [2],1),C=0,k=O.length;C<k;C++)if(N.indexOf(O[C])>=0){L=e.processDec(N),L&&_.push (T+"{"+L+"}");break}i.lastIndex=0}_.length&&r.push(_.join("\n"))}return r},e.ins ertCSS=function(e){for(var t,n=0;n<e.length;n++)t=document.createElement("style" ),t.setAttribute("type","text/css"),t.styleSheet?t.styleSheet.cssText=e[n]:t.tex tContent=e[n],document.getElementsByTagName("head")[0].appendChild(t)},e.process Dec=function(e,n){var r="display:",i=":";for(var a=e.split(";"),f=[],d,v,g,y,b,O ,_,D,P,H=0;H<a.length;H++)if(a[H].indexOf(i)>=0){if(d=a[H].split(i),d.length!=2) return!1;var B=l(d[0]),j=l(d[1]),F=[B,j].join(i),I=[];if(h(B,N))I.push(E+F,S+F); else if(h(B,C))I.push(E+F,S+F,B=="box-align"?T+B+":middle":T+F);else if(h(B,k))p ([0,1,2,3],function(e){var t,n,r;B==o?(t=j.split(" ")[0],h(t,A)?I.push(w[e]+F.re place(t,w[e]+t)):I.push(w[e]+F)):B=="transition-property"?e==0&&(n=j.split(","), r=[],p(n,function(t){var n=l(t);h(n,A)&&r.push(w[e]+n)}),I.push(w[e]+B+i+r.join( ","))):I.push(w[e]+F)});else if(h(B,L))B==m+"-clip"?j==="padding-box"&&I.push(S+ F,E+B+":padding"):(v=B.split("-"),I.push(E+"border-radius-"+v[1]+v[2]+i+j,S+F)); else switch(B){case"display":j=="box"?p([0,1,3],function(e){I.push(r+w[e]+j)}):j =="inline-block"&&I.push(r+E+"inline-stack","zoom:1;*display:inline");break;case t:j=="ellipsis"&&I.push(x+F);break;case"opacity":g=Math.round(j*100),I.push(T+" filter:progid:DXImageTransform.Microsoft.Alpha(Opacity="+g+")","filter: alpha(op acity="+g+")",E+F,S+F);break;case m+s:case m+"-color":case m:y="linear-gradient" ,j.indexOf(y)>=0?(b=(new RegExp(y+"\\s?\\((.*)\\)","ig")).exec(j),b[1]!=u&&(b=b[ 1],O=y+"("+b+")",p([0,1,2,3],function(e){I.push(B+i+w[e]+O)}),_=b.match(/\#([a-z 0-9]{3,})/g),_&&_.length>1&&_[_.length-1]!=u&&I.push(M.replace("{1}",_[0]).repla ce("{2}",_[_.length-1])))):j.indexOf("rgba")>=0&&(D=j.match(/rgba\((.*?)\)/)[1]. split(","),P=Math.floor(+l(D[3])*255).toString(16)+c(+l(D[0]),+l(D[1]),+l(D[2])) ,I.push(M.replace("{1}","#"+P).replace("{2}","#"+P)+";zoom:1"));break;default:!n ||I.push(F)}I.length&&f.push(I.join(";"))}return f.length&&f.join(";")},e.fetchC SS=function(t,n){a(t,n==u?function(n){e.insertCSS(e.processCSS([n],t))}:n)},_=fu nction(){var t=document.getElementsByTagName("style"),n=document.getElementsByTa gName("link"),r,i;for(i in n)typeof n[i]=="object"&&n[i].className==="cssfx"&&e. fetchCSS(n[i].href);r=[];for(i in t)typeof t[i]=="object"&&r.push(t[i].innerHTML );r.length&&e.insertCSS(e.processCSS(r))},f(_)})(cssFx)
OLDNEW
« no previous file with comments | « static/css/empty.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld