-
Notifications
You must be signed in to change notification settings - Fork 2
/
white-space-fast.min.js
2 lines (2 loc) · 1.92 KB
/
white-space-fast.min.js
1
2
/*! css-white-space-none version 1.2.3-alfa.1 24-02-2014 */
!function(a,b){"use strict";function c(a){var b;return function(c,d){b||(b=!0,a(c,d))}}function d(a,b,c){return a.addEventListener(b,c,!1),{el:a,t:b,l:c}}function e(a){a.el.removeEventListener(a.type,l,!1)}function f(a,b){return a.bind?a.bind(b):function(){return a.apply(b,arguments)}}function g(){return Array.prototype.splice.call(this,0,this.length)}function h(a){for(var b=0,c=this.length;c>b;++b)if(a.call(this,this[b],b)===t)return}function i(a,c){var d=new b.XMLHttpRequest;d.onreadystatechange=function(){4!==this.readyState||200!==this.status&&304!==this.status||this.responseText&&a(this.responseText)};try{d.open("GET",c),d.send()}catch(e){}}function j(a,b){var c=b.match(o)||[],d=[];h.call(c,function(a){p.test(a)&&d.push(a.match(q)[1])}),d.length&&a(d)}function k(b,c){var f=[],g=!(~navigator.appName.indexOf("Internet Explorer")&&~navigator.appVersion.indexOf("MSIE 9"));"complete"==a.readyState||g&&"interactive"==a.readyState||"loaded"==a.readyState?(h.call(f,function(a){e(a)}),b(c)):(f.push(d(a,"DOMContentLoaded",function(){b(c)})),f.push(d(a,"readystatechange",function(){k(b,c)})))}function m(b,c){var d;h.call(c,function(b){d=a.querySelectorAll(b),d.length>0&&h.call(d,function(a){var b=(a.outerHTML,a.nextSibling);b&&3===b.nodeType&&r.test(b.nodeValue)&&b.parentNode.removeChild(b)})}),b(d)}function n(b,c){var d;document.implementation.hasFeature("Events","4.0")?d=new Event("WhiteSpaceDone"):a.createEvent&&(d=a.createEvent("CustomEvent"),d.initCustomEvent("WhiteSpaceDone",!0,!0,void 0)),c&&c.length?c[0].parentNode.dispatchEvent(d):a.documentElement.dispatchEvent(d),b()}var o=/([^;{}\/]+)\s*\{\s*([^\/}]+)\s*}/g,p=/white-space\s*:\s*none\s*;?/,q=/(.+)\s*{/,r=/\s+/,s=a.styleSheets,t=null,u=function(){function a(){var a=g.call(arguments),c=this.shift();c&&c(b,a[0])}var b=f(a,g.call(arguments));return b};h.call(s,function(a){a.href&&u(i,j,c(k),m,n)(a.href)})}(document,window);