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

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

Issue 29624561: Issue 6104 - Minified code in help center repository (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Fix sourcemaps for CSS files, Change tabs to spaces Created Nov. 30, 2017, 10:03 a.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/js/vendor/bowser.js ('k') | static/js/vendor/element-closest.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*!
2 * classList.js: Cross-browser full element.classList implementation.
3 * 1.2.201711092
4 *
5 * By Eli Grey, http://eligrey.com
6 * License: Dedicated to the public domain.
7 * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
8 */
1 /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */ 9 /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
2 "document"in self&&("classList"in document.createElement("_")&&(!document.create ElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg"," g"))||!function(t){"use strict";if("Element"in t){var e="classList",n="prototype ",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+ |\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)i f(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.cod e=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a(" INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e )},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/ ):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.s etAttribute("class",""+this)}},u=l[n]=[],h=function(){return new l(this)};if(a[n ]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){retur n t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;d o t=e[n]+"",-1===c(this,t)&&(this.push(t),s=!0);while(++n<i);s&&this._updateClas sName()},u.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do for(t=n[ i]+"",e=c(this,t);-1!==e;)this.splice(e,1),r=!0,e=c(this,t);while(++i<s);r&&this ._updateClassName()},u.toggle=function(t,e){t+="";var n=this.contains(t),i=n?e!= =!0&&"remove":e!==!1&&"add";return i&&this[i](t),e===!0||e===!1?e:!n},u.toString =function(){return this.join(" ")},s.defineProperty){var f={get:h,enumerable:!0, configurable:!0};try{s.defineProperty(i,e,f)}catch(g){(void 0===g.number||-21468 23252===g.number)&&(f.enumerable=!1,s.defineProperty(i,e,f))}}else s[n].__define Getter__&&i.__defineGetter__(e,h)}}(self),function(){"use strict";var t=document .createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){v ar e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=funct ion(t){var n,i=arguments.length;for(n=0;i>n;n++)t=arguments[n],e.call(this,t)}}; e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){ var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){ return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}()); 10 "document"in self&&("classList"in document.createElement("_")&&(!document.create ElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg"," g"))||function(t){"use strict";if("Element"in t){var e=t.Element.prototype,n=Obj ect,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},s= Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in t his&&this[e]===t)return e;return-1},r=function(t,e){this.name=t,this.code=DOMExc eption[t],this.message=e},o=function(t,e){if(""===e)throw new r("SYNTAX_ERR","Th e token must not be empty.");if(/\s/.test(e))throw new r("INVALID_CHARACTER_ERR" ,"The token must not contain space characters.");return s.call(t,e)},c=function( t){for(var e=i.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],s=0,r=n.l ength;s<r;s++)this.push(n[s]);this._updateClassName=function(){t.setAttribute("c lass",this.toString())}},a=c.prototype=[],l=function(){return new c(this)};if(r. prototype=Error.prototype,a.item=function(t){return this[t]||null},a.contains=fu nction(t){return!~o(this,t+"")},a.add=function(){var t,e=arguments,n=0,i=e.lengt h,s=!1;do{t=e[n]+"",~o(this,t)&&(this.push(t),s=!0)}while(++n<i);s&&this._update ClassName()},a.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do{for( t=n[i]+"",e=o(this,t);~e;)this.splice(e,1),r=!0,e=o(this,t)}while(++i<s);r&&this ._updateClassName()},a.toggle=function(t,e){var n=this.contains(t),i=n?!0!==e&&" remove":!1!==e&&"add";return i&&this[i](t),!0===e||!1===e?e:!n},a.replace=functi on(t,e){var n=o(t+"");~n&&(this.splice(n,1,e),this._updateClassName())},a.toStri ng=function(){return this.join(" ")},n.defineProperty){var u={get:l,enumerable:! 0,configurable:!0};try{n.defineProperty(e,"classList",u)}catch(t){void 0!==t.num ber&&-2146823252!==t.number||(u.enumerable=!1,n.defineProperty(e,"classList",u)) }}else n.prototype.__defineGetter__&&e.__defineGetter__("classList",l)}}(self),f unction(){"use strict";var t=document.createElement("_");if(t.classList.add("c1" ,"c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototy pe[t];DOMTokenList.prototype[t]=function(t){var n,i=arguments.length;for(n=0;n<i ;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle( "c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMToke nList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==! e?e:n.call(this,t)}}"replace"in document.createElement("_").classList||(DOMToken List.prototype.replace=function(t,e){var n=this.toString().split(" "),i=n.indexO f(t+"");~i&&(n=n.slice(i),this.remove.apply(this,n),this.add(e),this.add.apply(t his,n.slice(1)))}),t=null}());
11 //# sourceMappingURL=classList.min.js.map
OLDNEW
« no previous file with comments | « static/js/vendor/bowser.js ('k') | static/js/vendor/element-closest.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld