bins |
var parseScopedCSS = function (op, final) {
for ( var root = op.id && doc.getElementById(op.id) || op.root || doc.body, caches = root.getElementsByTagName(op.bins || 'script'), scopes_ = [], _each, i = 0; _each = caches[i++]; '' == _each.src && (op.type && op.type.toLowerCase() || 'text/css') == _each.type.toLowerCase() && scopes_.push(_each) );
for ( var head = doc.head || doc.getElementsByTagName('head')[0], style = doc.createElement('style'), styleStr = '', scope, scopeID, n = 0, Done; _each = scopes_[n++] || (style.styleSheet? style.styleSheet.cssText += styleStr :style.appendChild(doc.createTextNode(styleStr)), head.appendChild(style) && Done); styleStr += _each.firstChild.nodeValue.replace(/((?:^|\})\s*)([^\d\s\{\};@]+[^\{\};@]*\{)(\s*(?:(?:\S[^\}])|;|\}))/g, '$1 ' + scopeID + ' $2$3') .replace(/(\s*@\w{2,}\s*\([^\}\)]*\)\s*\{\s)\s*([^\d\s\{\};@]+[^\{\};@]*\{)(\s*[^\}]\})*/g, '$1 ' + scopeID + ' $2$3') .replace(/(?:(?:#\w+)|(?:\.\w{6,}))\s+(body?)|(html?)/gi, '$1'), scope.className += ' '+(op.litmus || 'scoped')+' ' + scopeID.substring(1) ) scope = _each.parentNode, scopeID = scope.id != ''? '#'+scope.id :'.scope'+-745832*~i;
var scripts_ = 'script' != op.bins && op.bins || root != doc.body && doc.documentElement != root? doc.body.getElementsByTagName('script') :caches, goto = scripts_[scripts_.length-1]; !!goto.src && Function('_scopes', '_options', goto.firstChild.nodeValue).call(this, scopes_, op.devObj != win? JSON.stringify(op) :op);
final && final();
};
|
pending… |
no bins |
var parseScopedCSS = function (op, final) {
for ( var root = op.id && doc.getElementById(op.id) || op.root || doc.body, caches = root.getElementsByTagName('script'), scopes_ = [], _each, i = 0; _each = caches[i++]; '' == _each.src && (op.type && op.type.toLowerCase() || 'text/css') == _each.type.toLowerCase() && scopes_.push(_each) );
for ( var head = doc.head || doc.getElementsByTagName('head')[0], style = doc.createElement('style'), styleStr = '', scope, scopeID, n = 0, Done; _each = scopes_[n++] || (style.styleSheet? style.styleSheet.cssText += styleStr :style.appendChild(doc.createTextNode(styleStr)), head.appendChild(style) && Done); styleStr += _each.firstChild.nodeValue.replace(/((?:^|\})\s*)([^\d\s\{\};@]+[^\{\};@]*\{)(\s*(?:(?:\S[^\}])|;|\}))/g, '$1 ' + scopeID + ' $2$3') .replace(/(\s*@\w{2,}\s*\([^\}\)]*\)\s*\{\s)\s*([^\d\s\{\};@]+[^\{\};@]*\{)(\s*[^\}]\})*/g, '$1 ' + scopeID + ' $2$3') .replace(/(?:(?:#\w+)|(?:\.\w{6,}))\s+(body?)|(html?)/gi, '$1'), scope.className += ' '+(op.litmus || 'scoped')+' ' + scopeID.substring(1) ) scope = _each.parentNode, scopeID = scope.id != ''? '#'+scope.id :'.scope'+-745832*~i;
var scripts_ = root != doc.body && doc.documentElement != root? doc.body.getElementsByTagName('script') :caches, goto = scripts_[scripts_.length-1]; !!goto.src && Function('_scopes', '_options', goto.firstChild.nodeValue).call(this, scopes_, op.devObj != win? JSON.stringify(op) :op);
final && final();
};
|
pending… |
0 comments