-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjquery.white-space.js
More file actions
22 lines (21 loc) · 832 Bytes
/
Copy pathjquery.white-space.js
File metadata and controls
22 lines (21 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(function($, win, doc) {
"use strict";
var cssTokenizer = /([^;{}\/]+)\s*\{\s*([^\/}]+)\s*}/g;
var isWhiteSpaceCssBlock = /white-space\s*:\s*none\s*;?/;
var cssSelector = /(.+)\s*{/;
var empty = /\s+/;
var stylesheets = doc.styleSheets; // is a StyleSheetList which can not be converted to an array (in FF)
var compose = function() { // continuation passing style - runs all supplied functions unless there is an rejection, then it stops.
function next(){
var args = getArguments.call(arguments);
var currentFn = this.shift();
if(!currentFn) return; // done
currentFn(continuation, args[0]);
}
var continuation = bind(next, getArguments.call(arguments));
return continuation;
}
$(stylesheets).each(function(i, el) {
console.log(i);
});
}(jQuery, window, document));