guff-compass 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +21 -0
- data/.gitignore +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +21 -0
- data/demo/bower_components/jquery/.bower.json +21 -0
- data/demo/bower_components/jquery/.editorconfig +43 -0
- data/demo/bower_components/jquery/.gitattributes +2 -0
- data/demo/bower_components/jquery/.gitignore +14 -0
- data/demo/bower_components/jquery/.gitmodules +6 -0
- data/demo/bower_components/jquery/.jshintrc +17 -0
- data/demo/bower_components/jquery/.mailmap +94 -0
- data/demo/bower_components/jquery/AUTHORS.txt +170 -0
- data/demo/bower_components/jquery/CONTRIBUTING.md +216 -0
- data/demo/bower_components/jquery/Gruntfile.js +594 -0
- data/demo/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/demo/bower_components/jquery/README.md +398 -0
- data/demo/bower_components/jquery/bower.json +11 -0
- data/demo/bower_components/jquery/build/release-notes.js +59 -0
- data/demo/bower_components/jquery/build/release.js +316 -0
- data/demo/bower_components/jquery/component.json +15 -0
- data/demo/bower_components/jquery/composer.json +35 -0
- data/demo/bower_components/jquery/jquery-migrate.js +511 -0
- data/demo/bower_components/jquery/jquery-migrate.min.js +3 -0
- data/demo/bower_components/jquery/jquery.js +9789 -0
- data/demo/bower_components/jquery/jquery.min.js +6 -0
- data/demo/bower_components/jquery/jquery.min.map +1 -0
- data/demo/bower_components/jquery/package.json +38 -0
- data/demo/bower_components/jquery/speed/benchmark.js +15 -0
- data/demo/bower_components/jquery/speed/benchmarker.css +65 -0
- data/demo/bower_components/jquery/speed/benchmarker.js +181 -0
- data/demo/bower_components/jquery/speed/closest.html +39 -0
- data/demo/bower_components/jquery/speed/css.html +82 -0
- data/demo/bower_components/jquery/speed/event.html +58 -0
- data/demo/bower_components/jquery/speed/filter.html +183 -0
- data/demo/bower_components/jquery/speed/find.html +179 -0
- data/demo/bower_components/jquery/speed/index.html +72 -0
- data/demo/bower_components/jquery/speed/jquery-basis.js +6238 -0
- data/demo/bower_components/jquery/speed/slice.vs.concat.html +47 -0
- data/demo/bower_components/jquery/src/.jshintrc +27 -0
- data/demo/bower_components/jquery/src/ajax.js +855 -0
- data/demo/bower_components/jquery/src/ajax/jsonp.js +80 -0
- data/demo/bower_components/jquery/src/ajax/script.js +86 -0
- data/demo/bower_components/jquery/src/ajax/xhr.js +207 -0
- data/demo/bower_components/jquery/src/attributes.js +659 -0
- data/demo/bower_components/jquery/src/callbacks.js +197 -0
- data/demo/bower_components/jquery/src/core.js +981 -0
- data/demo/bower_components/jquery/src/css.js +661 -0
- data/demo/bower_components/jquery/src/data.js +336 -0
- data/demo/bower_components/jquery/src/deferred.js +141 -0
- data/demo/bower_components/jquery/src/deprecated.js +11 -0
- data/demo/bower_components/jquery/src/dimensions.js +41 -0
- data/demo/bower_components/jquery/src/effects.js +732 -0
- data/demo/bower_components/jquery/src/event-alias.js +32 -0
- data/demo/bower_components/jquery/src/event.js +995 -0
- data/demo/bower_components/jquery/src/exports.js +21 -0
- data/demo/bower_components/jquery/src/intro.js +20 -0
- data/demo/bower_components/jquery/src/manipulation.js +744 -0
- data/demo/bower_components/jquery/src/offset.js +169 -0
- data/demo/bower_components/jquery/src/outro.js +2 -0
- data/demo/bower_components/jquery/src/queue.js +146 -0
- data/demo/bower_components/jquery/src/serialize.js +99 -0
- data/demo/bower_components/jquery/src/sizzle-jquery.js +7 -0
- data/demo/bower_components/jquery/src/support.js +246 -0
- data/demo/bower_components/jquery/src/traversing.js +283 -0
- data/demo/bower_components/jquery/src/wrap.js +66 -0
- data/demo/bower_components/jquery/test/.jshintignore +3 -0
- data/demo/bower_components/jquery/test/.jshintrc +60 -0
- data/demo/bower_components/jquery/test/data/1x1.jpg +0 -0
- data/demo/bower_components/jquery/test/data/ajax/unreleasedXHR.html +25 -0
- data/demo/bower_components/jquery/test/data/atom+xml.php +4 -0
- data/demo/bower_components/jquery/test/data/badcall.js +1 -0
- data/demo/bower_components/jquery/test/data/badjson.js +1 -0
- data/demo/bower_components/jquery/test/data/cleanScript.html +10 -0
- data/demo/bower_components/jquery/test/data/core/cc_on.html +22 -0
- data/demo/bower_components/jquery/test/data/dashboard.xml +11 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentLarge.html +17 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentSmall.html +21 -0
- data/demo/bower_components/jquery/test/data/echoData.php +1 -0
- data/demo/bower_components/jquery/test/data/echoQuery.php +1 -0
- data/demo/bower_components/jquery/test/data/errorWithJSON.php +6 -0
- data/demo/bower_components/jquery/test/data/errorWithText.php +5 -0
- data/demo/bower_components/jquery/test/data/etag.php +21 -0
- data/demo/bower_components/jquery/test/data/evalScript.php +1 -0
- data/demo/bower_components/jquery/test/data/event/focusElem.html +16 -0
- data/demo/bower_components/jquery/test/data/event/longLoadScript.php +4 -0
- data/demo/bower_components/jquery/test/data/event/promiseReady.html +17 -0
- data/demo/bower_components/jquery/test/data/event/syncReady.html +23 -0
- data/demo/bower_components/jquery/test/data/headers.php +18 -0
- data/demo/bower_components/jquery/test/data/if_modified_since.php +20 -0
- data/demo/bower_components/jquery/test/data/iframe.html +8 -0
- data/demo/bower_components/jquery/test/data/jquery-1.9.1.ajax_xhr.min.js +5 -0
- data/demo/bower_components/jquery/test/data/json.php +13 -0
- data/demo/bower_components/jquery/test/data/json_obj.js +1 -0
- data/demo/bower_components/jquery/test/data/jsonp.php +14 -0
- data/demo/bower_components/jquery/test/data/manipulation/iframe-denied.html +36 -0
- data/demo/bower_components/jquery/test/data/name.html +1 -0
- data/demo/bower_components/jquery/test/data/name.php +24 -0
- data/demo/bower_components/jquery/test/data/nocontent.php +5 -0
- data/demo/bower_components/jquery/test/data/offset/absolute.html +41 -0
- data/demo/bower_components/jquery/test/data/offset/body.html +26 -0
- data/demo/bower_components/jquery/test/data/offset/fixed.html +34 -0
- data/demo/bower_components/jquery/test/data/offset/relative.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/scroll.html +39 -0
- data/demo/bower_components/jquery/test/data/offset/static.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/table.html +43 -0
- data/demo/bower_components/jquery/test/data/params_html.php +12 -0
- data/demo/bower_components/jquery/test/data/readywaitasset.js +1 -0
- data/demo/bower_components/jquery/test/data/readywaitloader.js +25 -0
- data/demo/bower_components/jquery/test/data/script.php +11 -0
- data/demo/bower_components/jquery/test/data/selector/html5_selector.html +114 -0
- data/demo/bower_components/jquery/test/data/selector/sizzle_cache.html +21 -0
- data/demo/bower_components/jquery/test/data/statusText.php +5 -0
- data/demo/bower_components/jquery/test/data/support/bodyBackground.html +28 -0
- data/demo/bower_components/jquery/test/data/support/boxSizing.html +19 -0
- data/demo/bower_components/jquery/test/data/support/csp.js +3 -0
- data/demo/bower_components/jquery/test/data/support/csp.php +22 -0
- data/demo/bower_components/jquery/test/data/support/shrinkWrapBlocks.html +23 -0
- data/demo/bower_components/jquery/test/data/support/testElementCrash.html +17 -0
- data/demo/bower_components/jquery/test/data/test.html +7 -0
- data/demo/bower_components/jquery/test/data/test.js +3 -0
- data/demo/bower_components/jquery/test/data/test.php +7 -0
- data/demo/bower_components/jquery/test/data/test2.html +5 -0
- data/demo/bower_components/jquery/test/data/test3.html +3 -0
- data/demo/bower_components/jquery/test/data/testinit.js +264 -0
- data/demo/bower_components/jquery/test/data/testrunner.js +371 -0
- data/demo/bower_components/jquery/test/data/testsuite.css +155 -0
- data/demo/bower_components/jquery/test/data/text.php +12 -0
- data/demo/bower_components/jquery/test/data/ua.txt +272 -0
- data/demo/bower_components/jquery/test/data/with_fries.xml +25 -0
- data/demo/bower_components/jquery/test/data/with_fries_over_jsonp.php +7 -0
- data/demo/bower_components/jquery/test/delegatetest.html +228 -0
- data/demo/bower_components/jquery/test/hovertest.html +158 -0
- data/demo/bower_components/jquery/test/index.html +337 -0
- data/demo/bower_components/jquery/test/jquery.js +5 -0
- data/demo/bower_components/jquery/test/localfile.html +75 -0
- data/demo/bower_components/jquery/test/networkerror.html +84 -0
- data/demo/bower_components/jquery/test/readywait.html +70 -0
- data/demo/bower_components/jquery/test/unit/ajax.js +2016 -0
- data/demo/bower_components/jquery/test/unit/attributes.js +1388 -0
- data/demo/bower_components/jquery/test/unit/callbacks.js +342 -0
- data/demo/bower_components/jquery/test/unit/core.js +1360 -0
- data/demo/bower_components/jquery/test/unit/css.js +1056 -0
- data/demo/bower_components/jquery/test/unit/data.js +645 -0
- data/demo/bower_components/jquery/test/unit/deferred.js +436 -0
- data/demo/bower_components/jquery/test/unit/deprecated.js +8 -0
- data/demo/bower_components/jquery/test/unit/dimensions.js +472 -0
- data/demo/bower_components/jquery/test/unit/effects.js +2242 -0
- data/demo/bower_components/jquery/test/unit/event.js +2755 -0
- data/demo/bower_components/jquery/test/unit/exports.js +7 -0
- data/demo/bower_components/jquery/test/unit/manipulation.js +2120 -0
- data/demo/bower_components/jquery/test/unit/offset.js +559 -0
- data/demo/bower_components/jquery/test/unit/queue.js +314 -0
- data/demo/bower_components/jquery/test/unit/selector.js +172 -0
- data/demo/bower_components/jquery/test/unit/serialize.js +148 -0
- data/demo/bower_components/jquery/test/unit/support.js +370 -0
- data/demo/bower_components/jquery/test/unit/traversing.js +797 -0
- data/demo/bower_components/jquery/test/unit/wrap.js +265 -0
- data/demo/bower_components/jquery/test/xhtml.php +5 -0
- data/demo/index.html +347 -0
- data/demo/styles/main.css +208 -0
- data/demo/styles/main.scss +138 -0
- data/docs/docco.css +506 -0
- data/docs/guff.html +1127 -0
- data/docs/public/fonts/aller-bold.eot +0 -0
- data/docs/public/fonts/aller-bold.ttf +0 -0
- data/docs/public/fonts/aller-bold.woff +0 -0
- data/docs/public/fonts/aller-light.eot +0 -0
- data/docs/public/fonts/aller-light.ttf +0 -0
- data/docs/public/fonts/aller-light.woff +0 -0
- data/docs/public/fonts/novecento-bold.eot +0 -0
- data/docs/public/fonts/novecento-bold.ttf +0 -0
- data/docs/public/fonts/novecento-bold.woff +0 -0
- data/docs/public/stylesheets/normalize.css +375 -0
- data/guff.gemspec +16 -0
- data/guff.scss +514 -0
- data/gulpfile.js +67 -0
- data/lib/guff.rb +4 -0
- data/lib/stylesheets/_guff.scss +514 -0
- data/package.json +19 -0
- data/src/_functions.scss +57 -0
- data/src/_mixins.scss +301 -0
- data/src/_reset.scss +67 -0
- data/src/_settings.scss +22 -0
- data/src/_typography.scss +67 -0
- metadata +259 -0
@@ -0,0 +1,169 @@
|
|
1
|
+
jQuery.fn.offset = function( options ) {
|
2
|
+
if ( arguments.length ) {
|
3
|
+
return options === undefined ?
|
4
|
+
this :
|
5
|
+
this.each(function( i ) {
|
6
|
+
jQuery.offset.setOffset( this, options, i );
|
7
|
+
});
|
8
|
+
}
|
9
|
+
|
10
|
+
var docElem, win,
|
11
|
+
box = { top: 0, left: 0 },
|
12
|
+
elem = this[ 0 ],
|
13
|
+
doc = elem && elem.ownerDocument;
|
14
|
+
|
15
|
+
if ( !doc ) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
19
|
+
docElem = doc.documentElement;
|
20
|
+
|
21
|
+
// Make sure it's not a disconnected DOM node
|
22
|
+
if ( !jQuery.contains( docElem, elem ) ) {
|
23
|
+
return box;
|
24
|
+
}
|
25
|
+
|
26
|
+
// If we don't have gBCR, just use 0,0 rather than error
|
27
|
+
// BlackBerry 5, iOS 3 (original iPhone)
|
28
|
+
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
|
29
|
+
box = elem.getBoundingClientRect();
|
30
|
+
}
|
31
|
+
win = getWindow( doc );
|
32
|
+
return {
|
33
|
+
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
|
34
|
+
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
|
35
|
+
};
|
36
|
+
};
|
37
|
+
|
38
|
+
jQuery.offset = {
|
39
|
+
|
40
|
+
setOffset: function( elem, options, i ) {
|
41
|
+
var position = jQuery.css( elem, "position" );
|
42
|
+
|
43
|
+
// set position first, in-case top/left are set even on static elem
|
44
|
+
if ( position === "static" ) {
|
45
|
+
elem.style.position = "relative";
|
46
|
+
}
|
47
|
+
|
48
|
+
var curElem = jQuery( elem ),
|
49
|
+
curOffset = curElem.offset(),
|
50
|
+
curCSSTop = jQuery.css( elem, "top" ),
|
51
|
+
curCSSLeft = jQuery.css( elem, "left" ),
|
52
|
+
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
53
|
+
props = {}, curPosition = {}, curTop, curLeft;
|
54
|
+
|
55
|
+
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
56
|
+
if ( calculatePosition ) {
|
57
|
+
curPosition = curElem.position();
|
58
|
+
curTop = curPosition.top;
|
59
|
+
curLeft = curPosition.left;
|
60
|
+
} else {
|
61
|
+
curTop = parseFloat( curCSSTop ) || 0;
|
62
|
+
curLeft = parseFloat( curCSSLeft ) || 0;
|
63
|
+
}
|
64
|
+
|
65
|
+
if ( jQuery.isFunction( options ) ) {
|
66
|
+
options = options.call( elem, i, curOffset );
|
67
|
+
}
|
68
|
+
|
69
|
+
if ( options.top != null ) {
|
70
|
+
props.top = ( options.top - curOffset.top ) + curTop;
|
71
|
+
}
|
72
|
+
if ( options.left != null ) {
|
73
|
+
props.left = ( options.left - curOffset.left ) + curLeft;
|
74
|
+
}
|
75
|
+
|
76
|
+
if ( "using" in options ) {
|
77
|
+
options.using.call( elem, props );
|
78
|
+
} else {
|
79
|
+
curElem.css( props );
|
80
|
+
}
|
81
|
+
}
|
82
|
+
};
|
83
|
+
|
84
|
+
|
85
|
+
jQuery.fn.extend({
|
86
|
+
|
87
|
+
position: function() {
|
88
|
+
if ( !this[ 0 ] ) {
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
|
92
|
+
var offsetParent, offset,
|
93
|
+
parentOffset = { top: 0, left: 0 },
|
94
|
+
elem = this[ 0 ];
|
95
|
+
|
96
|
+
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
|
97
|
+
if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
98
|
+
// we assume that getBoundingClientRect is available when computed position is fixed
|
99
|
+
offset = elem.getBoundingClientRect();
|
100
|
+
} else {
|
101
|
+
// Get *real* offsetParent
|
102
|
+
offsetParent = this.offsetParent();
|
103
|
+
|
104
|
+
// Get correct offsets
|
105
|
+
offset = this.offset();
|
106
|
+
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
|
107
|
+
parentOffset = offsetParent.offset();
|
108
|
+
}
|
109
|
+
|
110
|
+
// Add offsetParent borders
|
111
|
+
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
|
112
|
+
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
|
113
|
+
}
|
114
|
+
|
115
|
+
// Subtract parent offsets and element margins
|
116
|
+
// note: when an element has margin: auto the offsetLeft and marginLeft
|
117
|
+
// are the same in Safari causing offset.left to incorrectly be 0
|
118
|
+
return {
|
119
|
+
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
|
120
|
+
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
|
121
|
+
};
|
122
|
+
},
|
123
|
+
|
124
|
+
offsetParent: function() {
|
125
|
+
return this.map(function() {
|
126
|
+
var offsetParent = this.offsetParent || docElem;
|
127
|
+
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
|
128
|
+
offsetParent = offsetParent.offsetParent;
|
129
|
+
}
|
130
|
+
return offsetParent || docElem;
|
131
|
+
});
|
132
|
+
}
|
133
|
+
});
|
134
|
+
|
135
|
+
|
136
|
+
// Create scrollLeft and scrollTop methods
|
137
|
+
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
|
138
|
+
var top = /Y/.test( prop );
|
139
|
+
|
140
|
+
jQuery.fn[ method ] = function( val ) {
|
141
|
+
return jQuery.access( this, function( elem, method, val ) {
|
142
|
+
var win = getWindow( elem );
|
143
|
+
|
144
|
+
if ( val === undefined ) {
|
145
|
+
return win ? (prop in win) ? win[ prop ] :
|
146
|
+
win.document.documentElement[ method ] :
|
147
|
+
elem[ method ];
|
148
|
+
}
|
149
|
+
|
150
|
+
if ( win ) {
|
151
|
+
win.scrollTo(
|
152
|
+
!top ? val : jQuery( win ).scrollLeft(),
|
153
|
+
top ? val : jQuery( win ).scrollTop()
|
154
|
+
);
|
155
|
+
|
156
|
+
} else {
|
157
|
+
elem[ method ] = val;
|
158
|
+
}
|
159
|
+
}, method, val, arguments.length, null );
|
160
|
+
};
|
161
|
+
});
|
162
|
+
|
163
|
+
function getWindow( elem ) {
|
164
|
+
return jQuery.isWindow( elem ) ?
|
165
|
+
elem :
|
166
|
+
elem.nodeType === 9 ?
|
167
|
+
elem.defaultView || elem.parentWindow :
|
168
|
+
false;
|
169
|
+
}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
jQuery.extend({
|
2
|
+
queue: function( elem, type, data ) {
|
3
|
+
var queue;
|
4
|
+
|
5
|
+
if ( elem ) {
|
6
|
+
type = ( type || "fx" ) + "queue";
|
7
|
+
queue = jQuery._data( elem, type );
|
8
|
+
|
9
|
+
// Speed up dequeue by getting out quickly if this is just a lookup
|
10
|
+
if ( data ) {
|
11
|
+
if ( !queue || jQuery.isArray(data) ) {
|
12
|
+
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
|
13
|
+
} else {
|
14
|
+
queue.push( data );
|
15
|
+
}
|
16
|
+
}
|
17
|
+
return queue || [];
|
18
|
+
}
|
19
|
+
},
|
20
|
+
|
21
|
+
dequeue: function( elem, type ) {
|
22
|
+
type = type || "fx";
|
23
|
+
|
24
|
+
var queue = jQuery.queue( elem, type ),
|
25
|
+
startLength = queue.length,
|
26
|
+
fn = queue.shift(),
|
27
|
+
hooks = jQuery._queueHooks( elem, type ),
|
28
|
+
next = function() {
|
29
|
+
jQuery.dequeue( elem, type );
|
30
|
+
};
|
31
|
+
|
32
|
+
// If the fx queue is dequeued, always remove the progress sentinel
|
33
|
+
if ( fn === "inprogress" ) {
|
34
|
+
fn = queue.shift();
|
35
|
+
startLength--;
|
36
|
+
}
|
37
|
+
|
38
|
+
if ( fn ) {
|
39
|
+
|
40
|
+
// Add a progress sentinel to prevent the fx queue from being
|
41
|
+
// automatically dequeued
|
42
|
+
if ( type === "fx" ) {
|
43
|
+
queue.unshift( "inprogress" );
|
44
|
+
}
|
45
|
+
|
46
|
+
// clear up the last queue stop function
|
47
|
+
delete hooks.stop;
|
48
|
+
fn.call( elem, next, hooks );
|
49
|
+
}
|
50
|
+
|
51
|
+
if ( !startLength && hooks ) {
|
52
|
+
hooks.empty.fire();
|
53
|
+
}
|
54
|
+
},
|
55
|
+
|
56
|
+
// not intended for public consumption - generates a queueHooks object, or returns the current one
|
57
|
+
_queueHooks: function( elem, type ) {
|
58
|
+
var key = type + "queueHooks";
|
59
|
+
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
|
60
|
+
empty: jQuery.Callbacks("once memory").add(function() {
|
61
|
+
jQuery._removeData( elem, type + "queue" );
|
62
|
+
jQuery._removeData( elem, key );
|
63
|
+
})
|
64
|
+
});
|
65
|
+
}
|
66
|
+
});
|
67
|
+
|
68
|
+
jQuery.fn.extend({
|
69
|
+
queue: function( type, data ) {
|
70
|
+
var setter = 2;
|
71
|
+
|
72
|
+
if ( typeof type !== "string" ) {
|
73
|
+
data = type;
|
74
|
+
type = "fx";
|
75
|
+
setter--;
|
76
|
+
}
|
77
|
+
|
78
|
+
if ( arguments.length < setter ) {
|
79
|
+
return jQuery.queue( this[0], type );
|
80
|
+
}
|
81
|
+
|
82
|
+
return data === undefined ?
|
83
|
+
this :
|
84
|
+
this.each(function() {
|
85
|
+
var queue = jQuery.queue( this, type, data );
|
86
|
+
|
87
|
+
// ensure a hooks for this queue
|
88
|
+
jQuery._queueHooks( this, type );
|
89
|
+
|
90
|
+
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
91
|
+
jQuery.dequeue( this, type );
|
92
|
+
}
|
93
|
+
});
|
94
|
+
},
|
95
|
+
dequeue: function( type ) {
|
96
|
+
return this.each(function() {
|
97
|
+
jQuery.dequeue( this, type );
|
98
|
+
});
|
99
|
+
},
|
100
|
+
// Based off of the plugin by Clint Helfers, with permission.
|
101
|
+
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
102
|
+
delay: function( time, type ) {
|
103
|
+
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
104
|
+
type = type || "fx";
|
105
|
+
|
106
|
+
return this.queue( type, function( next, hooks ) {
|
107
|
+
var timeout = setTimeout( next, time );
|
108
|
+
hooks.stop = function() {
|
109
|
+
clearTimeout( timeout );
|
110
|
+
};
|
111
|
+
});
|
112
|
+
},
|
113
|
+
clearQueue: function( type ) {
|
114
|
+
return this.queue( type || "fx", [] );
|
115
|
+
},
|
116
|
+
// Get a promise resolved when queues of a certain type
|
117
|
+
// are emptied (fx is the type by default)
|
118
|
+
promise: function( type, obj ) {
|
119
|
+
var tmp,
|
120
|
+
count = 1,
|
121
|
+
defer = jQuery.Deferred(),
|
122
|
+
elements = this,
|
123
|
+
i = this.length,
|
124
|
+
resolve = function() {
|
125
|
+
if ( !( --count ) ) {
|
126
|
+
defer.resolveWith( elements, [ elements ] );
|
127
|
+
}
|
128
|
+
};
|
129
|
+
|
130
|
+
if ( typeof type !== "string" ) {
|
131
|
+
obj = type;
|
132
|
+
type = undefined;
|
133
|
+
}
|
134
|
+
type = type || "fx";
|
135
|
+
|
136
|
+
while( i-- ) {
|
137
|
+
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
|
138
|
+
if ( tmp && tmp.empty ) {
|
139
|
+
count++;
|
140
|
+
tmp.empty.add( resolve );
|
141
|
+
}
|
142
|
+
}
|
143
|
+
resolve();
|
144
|
+
return defer.promise( obj );
|
145
|
+
}
|
146
|
+
});
|
@@ -0,0 +1,99 @@
|
|
1
|
+
var r20 = /%20/g,
|
2
|
+
rbracket = /\[\]$/,
|
3
|
+
rCRLF = /\r?\n/g,
|
4
|
+
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
|
5
|
+
rsubmittable = /^(?:input|select|textarea|keygen)/i;
|
6
|
+
|
7
|
+
jQuery.fn.extend({
|
8
|
+
serialize: function() {
|
9
|
+
return jQuery.param( this.serializeArray() );
|
10
|
+
},
|
11
|
+
serializeArray: function() {
|
12
|
+
return this.map(function(){
|
13
|
+
// Can add propHook for "elements" to filter or add form elements
|
14
|
+
var elements = jQuery.prop( this, "elements" );
|
15
|
+
return elements ? jQuery.makeArray( elements ) : this;
|
16
|
+
})
|
17
|
+
.filter(function(){
|
18
|
+
var type = this.type;
|
19
|
+
// Use .is(":disabled") so that fieldset[disabled] works
|
20
|
+
return this.name && !jQuery( this ).is( ":disabled" ) &&
|
21
|
+
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
|
22
|
+
( this.checked || !manipulation_rcheckableType.test( type ) );
|
23
|
+
})
|
24
|
+
.map(function( i, elem ){
|
25
|
+
var val = jQuery( this ).val();
|
26
|
+
|
27
|
+
return val == null ?
|
28
|
+
null :
|
29
|
+
jQuery.isArray( val ) ?
|
30
|
+
jQuery.map( val, function( val ){
|
31
|
+
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
32
|
+
}) :
|
33
|
+
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
34
|
+
}).get();
|
35
|
+
}
|
36
|
+
});
|
37
|
+
|
38
|
+
//Serialize an array of form elements or a set of
|
39
|
+
//key/values into a query string
|
40
|
+
jQuery.param = function( a, traditional ) {
|
41
|
+
var prefix,
|
42
|
+
s = [],
|
43
|
+
add = function( key, value ) {
|
44
|
+
// If value is a function, invoke it and return its value
|
45
|
+
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
|
46
|
+
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
47
|
+
};
|
48
|
+
|
49
|
+
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
50
|
+
if ( traditional === undefined ) {
|
51
|
+
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
52
|
+
}
|
53
|
+
|
54
|
+
// If an array was passed in, assume that it is an array of form elements.
|
55
|
+
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
56
|
+
// Serialize the form elements
|
57
|
+
jQuery.each( a, function() {
|
58
|
+
add( this.name, this.value );
|
59
|
+
});
|
60
|
+
|
61
|
+
} else {
|
62
|
+
// If traditional, encode the "old" way (the way 1.3.2 or older
|
63
|
+
// did it), otherwise encode params recursively.
|
64
|
+
for ( prefix in a ) {
|
65
|
+
buildParams( prefix, a[ prefix ], traditional, add );
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
// Return the resulting serialization
|
70
|
+
return s.join( "&" ).replace( r20, "+" );
|
71
|
+
};
|
72
|
+
|
73
|
+
function buildParams( prefix, obj, traditional, add ) {
|
74
|
+
var name;
|
75
|
+
|
76
|
+
if ( jQuery.isArray( obj ) ) {
|
77
|
+
// Serialize array item.
|
78
|
+
jQuery.each( obj, function( i, v ) {
|
79
|
+
if ( traditional || rbracket.test( prefix ) ) {
|
80
|
+
// Treat each array item as a scalar.
|
81
|
+
add( prefix, v );
|
82
|
+
|
83
|
+
} else {
|
84
|
+
// Item is non-scalar (array or object), encode its numeric index.
|
85
|
+
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
|
90
|
+
// Serialize object item.
|
91
|
+
for ( name in obj ) {
|
92
|
+
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
93
|
+
}
|
94
|
+
|
95
|
+
} else {
|
96
|
+
// Serialize scalar item.
|
97
|
+
add( prefix, obj );
|
98
|
+
}
|
99
|
+
}
|
@@ -0,0 +1,246 @@
|
|
1
|
+
jQuery.support = (function( support ) {
|
2
|
+
|
3
|
+
var all, a, input, select, fragment, opt, eventName, isSupported, i,
|
4
|
+
div = document.createElement("div");
|
5
|
+
|
6
|
+
// Setup
|
7
|
+
div.setAttribute( "className", "t" );
|
8
|
+
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
9
|
+
|
10
|
+
// Finish early in limited (non-browser) environments
|
11
|
+
all = div.getElementsByTagName("*") || [];
|
12
|
+
a = div.getElementsByTagName("a")[ 0 ];
|
13
|
+
if ( !a || !a.style || !all.length ) {
|
14
|
+
return support;
|
15
|
+
}
|
16
|
+
|
17
|
+
// First batch of tests
|
18
|
+
select = document.createElement("select");
|
19
|
+
opt = select.appendChild( document.createElement("option") );
|
20
|
+
input = div.getElementsByTagName("input")[ 0 ];
|
21
|
+
|
22
|
+
a.style.cssText = "top:1px;float:left;opacity:.5";
|
23
|
+
|
24
|
+
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
25
|
+
support.getSetAttribute = div.className !== "t";
|
26
|
+
|
27
|
+
// IE strips leading whitespace when .innerHTML is used
|
28
|
+
support.leadingWhitespace = div.firstChild.nodeType === 3;
|
29
|
+
|
30
|
+
// Make sure that tbody elements aren't automatically inserted
|
31
|
+
// IE will insert them into empty tables
|
32
|
+
support.tbody = !div.getElementsByTagName("tbody").length;
|
33
|
+
|
34
|
+
// Make sure that link elements get serialized correctly by innerHTML
|
35
|
+
// This requires a wrapper element in IE
|
36
|
+
support.htmlSerialize = !!div.getElementsByTagName("link").length;
|
37
|
+
|
38
|
+
// Get the style information from getAttribute
|
39
|
+
// (IE uses .cssText instead)
|
40
|
+
support.style = /top/.test( a.getAttribute("style") );
|
41
|
+
|
42
|
+
// Make sure that URLs aren't manipulated
|
43
|
+
// (IE normalizes it by default)
|
44
|
+
support.hrefNormalized = a.getAttribute("href") === "/a";
|
45
|
+
|
46
|
+
// Make sure that element opacity exists
|
47
|
+
// (IE uses filter instead)
|
48
|
+
// Use a regex to work around a WebKit issue. See #5145
|
49
|
+
support.opacity = /^0.5/.test( a.style.opacity );
|
50
|
+
|
51
|
+
// Verify style float existence
|
52
|
+
// (IE uses styleFloat instead of cssFloat)
|
53
|
+
support.cssFloat = !!a.style.cssFloat;
|
54
|
+
|
55
|
+
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
56
|
+
support.checkOn = !!input.value;
|
57
|
+
|
58
|
+
// Make sure that a selected-by-default option has a working selected property.
|
59
|
+
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
60
|
+
support.optSelected = opt.selected;
|
61
|
+
|
62
|
+
// Tests for enctype support on a form (#6743)
|
63
|
+
support.enctype = !!document.createElement("form").enctype;
|
64
|
+
|
65
|
+
// Makes sure cloning an html5 element does not cause problems
|
66
|
+
// Where outerHTML is undefined, this still works
|
67
|
+
support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
|
68
|
+
|
69
|
+
// Will be defined later
|
70
|
+
support.inlineBlockNeedsLayout = false;
|
71
|
+
support.shrinkWrapBlocks = false;
|
72
|
+
support.pixelPosition = false;
|
73
|
+
support.deleteExpando = true;
|
74
|
+
support.noCloneEvent = true;
|
75
|
+
support.reliableMarginRight = true;
|
76
|
+
support.boxSizingReliable = true;
|
77
|
+
|
78
|
+
// Make sure checked status is properly cloned
|
79
|
+
input.checked = true;
|
80
|
+
support.noCloneChecked = input.cloneNode( true ).checked;
|
81
|
+
|
82
|
+
// Make sure that the options inside disabled selects aren't marked as disabled
|
83
|
+
// (WebKit marks them as disabled)
|
84
|
+
select.disabled = true;
|
85
|
+
support.optDisabled = !opt.disabled;
|
86
|
+
|
87
|
+
// Support: IE<9
|
88
|
+
try {
|
89
|
+
delete div.test;
|
90
|
+
} catch( e ) {
|
91
|
+
support.deleteExpando = false;
|
92
|
+
}
|
93
|
+
|
94
|
+
// Check if we can trust getAttribute("value")
|
95
|
+
input = document.createElement("input");
|
96
|
+
input.setAttribute( "value", "" );
|
97
|
+
support.input = input.getAttribute( "value" ) === "";
|
98
|
+
|
99
|
+
// Check if an input maintains its value after becoming a radio
|
100
|
+
input.value = "t";
|
101
|
+
input.setAttribute( "type", "radio" );
|
102
|
+
support.radioValue = input.value === "t";
|
103
|
+
|
104
|
+
// #11217 - WebKit loses check when the name is after the checked attribute
|
105
|
+
input.setAttribute( "checked", "t" );
|
106
|
+
input.setAttribute( "name", "t" );
|
107
|
+
|
108
|
+
fragment = document.createDocumentFragment();
|
109
|
+
fragment.appendChild( input );
|
110
|
+
|
111
|
+
// Check if a disconnected checkbox will retain its checked
|
112
|
+
// value of true after appended to the DOM (IE6/7)
|
113
|
+
support.appendChecked = input.checked;
|
114
|
+
|
115
|
+
// WebKit doesn't clone checked state correctly in fragments
|
116
|
+
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
117
|
+
|
118
|
+
// Support: IE<9
|
119
|
+
// Opera does not clone events (and typeof div.attachEvent === undefined).
|
120
|
+
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
|
121
|
+
if ( div.attachEvent ) {
|
122
|
+
div.attachEvent( "onclick", function() {
|
123
|
+
support.noCloneEvent = false;
|
124
|
+
});
|
125
|
+
|
126
|
+
div.cloneNode( true ).click();
|
127
|
+
}
|
128
|
+
|
129
|
+
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
|
130
|
+
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
|
131
|
+
for ( i in { submit: true, change: true, focusin: true }) {
|
132
|
+
div.setAttribute( eventName = "on" + i, "t" );
|
133
|
+
|
134
|
+
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
|
135
|
+
}
|
136
|
+
|
137
|
+
div.style.backgroundClip = "content-box";
|
138
|
+
div.cloneNode( true ).style.backgroundClip = "";
|
139
|
+
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
140
|
+
|
141
|
+
// Support: IE<9
|
142
|
+
// Iteration over object's inherited properties before its own.
|
143
|
+
for ( i in jQuery( support ) ) {
|
144
|
+
break;
|
145
|
+
}
|
146
|
+
support.ownLast = i !== "0";
|
147
|
+
|
148
|
+
// Run tests that need a body at doc ready
|
149
|
+
jQuery(function() {
|
150
|
+
var container, marginDiv, tds,
|
151
|
+
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
|
152
|
+
body = document.getElementsByTagName("body")[0];
|
153
|
+
|
154
|
+
if ( !body ) {
|
155
|
+
// Return for frameset docs that don't have a body
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
|
159
|
+
container = document.createElement("div");
|
160
|
+
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
|
161
|
+
|
162
|
+
body.appendChild( container ).appendChild( div );
|
163
|
+
|
164
|
+
// Support: IE8
|
165
|
+
// Check if table cells still have offsetWidth/Height when they are set
|
166
|
+
// to display:none and there are still other visible table cells in a
|
167
|
+
// table row; if so, offsetWidth/Height are not reliable for use when
|
168
|
+
// determining if an element has been hidden directly using
|
169
|
+
// display:none (it is still safe to use offsets if a parent element is
|
170
|
+
// hidden; don safety goggles and see bug #4512 for more information).
|
171
|
+
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
|
172
|
+
tds = div.getElementsByTagName("td");
|
173
|
+
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
|
174
|
+
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
175
|
+
|
176
|
+
tds[ 0 ].style.display = "";
|
177
|
+
tds[ 1 ].style.display = "none";
|
178
|
+
|
179
|
+
// Support: IE8
|
180
|
+
// Check if empty table cells still have offsetWidth/Height
|
181
|
+
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
182
|
+
|
183
|
+
// Check box-sizing and margin behavior.
|
184
|
+
div.innerHTML = "";
|
185
|
+
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
|
186
|
+
|
187
|
+
// Workaround failing boxSizing test due to offsetWidth returning wrong value
|
188
|
+
// with some non-1 values of body zoom, ticket #13543
|
189
|
+
jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
|
190
|
+
support.boxSizing = div.offsetWidth === 4;
|
191
|
+
});
|
192
|
+
|
193
|
+
// Use window.getComputedStyle because jsdom on node.js will break without it.
|
194
|
+
if ( window.getComputedStyle ) {
|
195
|
+
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
|
196
|
+
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
|
197
|
+
|
198
|
+
// Check if div with explicit width and no margin-right incorrectly
|
199
|
+
// gets computed margin-right based on width of container. (#3333)
|
200
|
+
// Fails in WebKit before Feb 2011 nightlies
|
201
|
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
202
|
+
marginDiv = div.appendChild( document.createElement("div") );
|
203
|
+
marginDiv.style.cssText = div.style.cssText = divReset;
|
204
|
+
marginDiv.style.marginRight = marginDiv.style.width = "0";
|
205
|
+
div.style.width = "1px";
|
206
|
+
|
207
|
+
support.reliableMarginRight =
|
208
|
+
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
|
209
|
+
}
|
210
|
+
|
211
|
+
if ( typeof div.style.zoom !== core_strundefined ) {
|
212
|
+
// Support: IE<8
|
213
|
+
// Check if natively block-level elements act like inline-block
|
214
|
+
// elements when setting their display to 'inline' and giving
|
215
|
+
// them layout
|
216
|
+
div.innerHTML = "";
|
217
|
+
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
|
218
|
+
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
|
219
|
+
|
220
|
+
// Support: IE6
|
221
|
+
// Check if elements with layout shrink-wrap their children
|
222
|
+
div.style.display = "block";
|
223
|
+
div.innerHTML = "<div></div>";
|
224
|
+
div.firstChild.style.width = "5px";
|
225
|
+
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
|
226
|
+
|
227
|
+
if ( support.inlineBlockNeedsLayout ) {
|
228
|
+
// Prevent IE 6 from affecting layout for positioned elements #11048
|
229
|
+
// Prevent IE from shrinking the body in IE 7 mode #12869
|
230
|
+
// Support: IE<8
|
231
|
+
body.style.zoom = 1;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
body.removeChild( container );
|
236
|
+
|
237
|
+
// Null elements to avoid leaks in IE
|
238
|
+
container = div = tds = marginDiv = null;
|
239
|
+
});
|
240
|
+
|
241
|
+
// Null elements to avoid leaks in IE
|
242
|
+
all = select = fragment = opt = a = input = null;
|
243
|
+
|
244
|
+
return support;
|
245
|
+
})({});
|
246
|
+
|