MCPcopy Create free account
hub / github.com/HangfireIO/Hangfire.Samples / ripCSS

Function ripCSS

Hangfire.WebFormsApplication/Scripts/respond.js:75–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74 //loop stylesheets, send text content to translate
75 ripCSS = function(){
76 var sheets = links,
77 sl = sheets.length,
78 i = 0,
79 //vars for loop:
80 sheet, href, media, isCSS;
81
82 for( ; i < sl; i++ ){
83 sheet = sheets[ i ],
84 href = sheet.href,
85 media = sheet.media,
86 isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
87
88 //only links plz and prevent re-parsing
89 if( !!href && isCSS && !parsedSheets[ href ] ){
90 // selectivizr exposes css through the rawCssText expando
91 if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
92 translate( sheet.styleSheet.rawCssText, href, media );
93 parsedSheets[ href ] = true;
94 } else {
95 if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base)
96 || href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){
97 requestQueue.push( {
98 href: href,
99 media: media
100 } );
101 }
102 }
103 }
104 }
105 makeRequests();
106 },
107
108 //recurse through request queue, get css text
109 makeRequests = function(){

Callers 1

respond.jsFile · 0.85

Calls 2

translateFunction · 0.85
makeRequestsFunction · 0.85

Tested by

no test coverage detected