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

Delta Between Two Patch Sets: 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
Left Patch Set: Fix sourcemaps for CSS files, Change tabs to spaces Created Nov. 30, 2017, 10:03 a.m.
Right Patch Set: Consolidated gulp tasks Created Dec. 7, 2017, 2:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 */
9 /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
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
LEFTRIGHT

Powered by Google App Engine
This is Rietveld