-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwhite-space.min.js
2 lines (2 loc) · 2.16 KB
/
white-space.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?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c),{el:a,t:b,l:c}}function e(a){a.el.removeEventListener?a.el.removeEventListener(a.type,l,!1):a.el.detachEvent&&a.el.detachEvent("on"+a.type,l)}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=[];"complete"==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,e=/^\s+|\s+$/g;h.call(c,function(b){d=a.querySelectorAll(b),d.length>0&&h.call(d,function(a){var b=a.outerHTML,c=a.nextSibling;e.test(b)&&(a.outerHTML=b.replace(e,"")),c&&3===c.nodeType&&r.test(c.nodeValue)&&c.parentNode.removeChild(c)})}),b(d)}function n(b,c){var d;if(a.implementation.hasFeature("Events","4.0"))d=new Event("WhiteSpaceDone");else if(a.implementation.hasFeature("Events","3.0"))d=a.createEvent("CustomEvent"),d.initCustomEvent("WhiteSpaceDone",!0,!0,void 0);else if(a.createEventObject){console.log("IE8::WhiteSpaceDone::fired");var e=c[0],f=a.activeElement;return e.setActive(),e.WhiteSpaceDone=!0,f.setActive(),e=f=null,b()}c&&c.length?c[0].parentNode.dispatchEvent(d):a.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);