guff-compass 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,197 @@
|
|
|
1
|
+
// String to Object options format cache
|
|
2
|
+
var optionsCache = {};
|
|
3
|
+
|
|
4
|
+
// Convert String-formatted options into Object-formatted ones and store in cache
|
|
5
|
+
function createOptions( options ) {
|
|
6
|
+
var object = optionsCache[ options ] = {};
|
|
7
|
+
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
|
|
8
|
+
object[ flag ] = true;
|
|
9
|
+
});
|
|
10
|
+
return object;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Create a callback list using the following parameters:
|
|
15
|
+
*
|
|
16
|
+
* options: an optional list of space-separated options that will change how
|
|
17
|
+
* the callback list behaves or a more traditional option object
|
|
18
|
+
*
|
|
19
|
+
* By default a callback list will act like an event callback list and can be
|
|
20
|
+
* "fired" multiple times.
|
|
21
|
+
*
|
|
22
|
+
* Possible options:
|
|
23
|
+
*
|
|
24
|
+
* once: will ensure the callback list can only be fired once (like a Deferred)
|
|
25
|
+
*
|
|
26
|
+
* memory: will keep track of previous values and will call any callback added
|
|
27
|
+
* after the list has been fired right away with the latest "memorized"
|
|
28
|
+
* values (like a Deferred)
|
|
29
|
+
*
|
|
30
|
+
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
|
31
|
+
*
|
|
32
|
+
* stopOnFalse: interrupt callings when a callback returns false
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
jQuery.Callbacks = function( options ) {
|
|
36
|
+
|
|
37
|
+
// Convert options from String-formatted to Object-formatted if needed
|
|
38
|
+
// (we check in cache first)
|
|
39
|
+
options = typeof options === "string" ?
|
|
40
|
+
( optionsCache[ options ] || createOptions( options ) ) :
|
|
41
|
+
jQuery.extend( {}, options );
|
|
42
|
+
|
|
43
|
+
var // Flag to know if list is currently firing
|
|
44
|
+
firing,
|
|
45
|
+
// Last fire value (for non-forgettable lists)
|
|
46
|
+
memory,
|
|
47
|
+
// Flag to know if list was already fired
|
|
48
|
+
fired,
|
|
49
|
+
// End of the loop when firing
|
|
50
|
+
firingLength,
|
|
51
|
+
// Index of currently firing callback (modified by remove if needed)
|
|
52
|
+
firingIndex,
|
|
53
|
+
// First callback to fire (used internally by add and fireWith)
|
|
54
|
+
firingStart,
|
|
55
|
+
// Actual callback list
|
|
56
|
+
list = [],
|
|
57
|
+
// Stack of fire calls for repeatable lists
|
|
58
|
+
stack = !options.once && [],
|
|
59
|
+
// Fire callbacks
|
|
60
|
+
fire = function( data ) {
|
|
61
|
+
memory = options.memory && data;
|
|
62
|
+
fired = true;
|
|
63
|
+
firingIndex = firingStart || 0;
|
|
64
|
+
firingStart = 0;
|
|
65
|
+
firingLength = list.length;
|
|
66
|
+
firing = true;
|
|
67
|
+
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
|
68
|
+
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
|
|
69
|
+
memory = false; // To prevent further calls using add
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
firing = false;
|
|
74
|
+
if ( list ) {
|
|
75
|
+
if ( stack ) {
|
|
76
|
+
if ( stack.length ) {
|
|
77
|
+
fire( stack.shift() );
|
|
78
|
+
}
|
|
79
|
+
} else if ( memory ) {
|
|
80
|
+
list = [];
|
|
81
|
+
} else {
|
|
82
|
+
self.disable();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
// Actual Callbacks object
|
|
87
|
+
self = {
|
|
88
|
+
// Add a callback or a collection of callbacks to the list
|
|
89
|
+
add: function() {
|
|
90
|
+
if ( list ) {
|
|
91
|
+
// First, we save the current length
|
|
92
|
+
var start = list.length;
|
|
93
|
+
(function add( args ) {
|
|
94
|
+
jQuery.each( args, function( _, arg ) {
|
|
95
|
+
var type = jQuery.type( arg );
|
|
96
|
+
if ( type === "function" ) {
|
|
97
|
+
if ( !options.unique || !self.has( arg ) ) {
|
|
98
|
+
list.push( arg );
|
|
99
|
+
}
|
|
100
|
+
} else if ( arg && arg.length && type !== "string" ) {
|
|
101
|
+
// Inspect recursively
|
|
102
|
+
add( arg );
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
})( arguments );
|
|
106
|
+
// Do we need to add the callbacks to the
|
|
107
|
+
// current firing batch?
|
|
108
|
+
if ( firing ) {
|
|
109
|
+
firingLength = list.length;
|
|
110
|
+
// With memory, if we're not firing then
|
|
111
|
+
// we should call right away
|
|
112
|
+
} else if ( memory ) {
|
|
113
|
+
firingStart = start;
|
|
114
|
+
fire( memory );
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return this;
|
|
118
|
+
},
|
|
119
|
+
// Remove a callback from the list
|
|
120
|
+
remove: function() {
|
|
121
|
+
if ( list ) {
|
|
122
|
+
jQuery.each( arguments, function( _, arg ) {
|
|
123
|
+
var index;
|
|
124
|
+
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
|
|
125
|
+
list.splice( index, 1 );
|
|
126
|
+
// Handle firing indexes
|
|
127
|
+
if ( firing ) {
|
|
128
|
+
if ( index <= firingLength ) {
|
|
129
|
+
firingLength--;
|
|
130
|
+
}
|
|
131
|
+
if ( index <= firingIndex ) {
|
|
132
|
+
firingIndex--;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return this;
|
|
139
|
+
},
|
|
140
|
+
// Check if a given callback is in the list.
|
|
141
|
+
// If no argument is given, return whether or not list has callbacks attached.
|
|
142
|
+
has: function( fn ) {
|
|
143
|
+
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
|
|
144
|
+
},
|
|
145
|
+
// Remove all callbacks from the list
|
|
146
|
+
empty: function() {
|
|
147
|
+
list = [];
|
|
148
|
+
firingLength = 0;
|
|
149
|
+
return this;
|
|
150
|
+
},
|
|
151
|
+
// Have the list do nothing anymore
|
|
152
|
+
disable: function() {
|
|
153
|
+
list = stack = memory = undefined;
|
|
154
|
+
return this;
|
|
155
|
+
},
|
|
156
|
+
// Is it disabled?
|
|
157
|
+
disabled: function() {
|
|
158
|
+
return !list;
|
|
159
|
+
},
|
|
160
|
+
// Lock the list in its current state
|
|
161
|
+
lock: function() {
|
|
162
|
+
stack = undefined;
|
|
163
|
+
if ( !memory ) {
|
|
164
|
+
self.disable();
|
|
165
|
+
}
|
|
166
|
+
return this;
|
|
167
|
+
},
|
|
168
|
+
// Is it locked?
|
|
169
|
+
locked: function() {
|
|
170
|
+
return !stack;
|
|
171
|
+
},
|
|
172
|
+
// Call all callbacks with the given context and arguments
|
|
173
|
+
fireWith: function( context, args ) {
|
|
174
|
+
if ( list && ( !fired || stack ) ) {
|
|
175
|
+
args = args || [];
|
|
176
|
+
args = [ context, args.slice ? args.slice() : args ];
|
|
177
|
+
if ( firing ) {
|
|
178
|
+
stack.push( args );
|
|
179
|
+
} else {
|
|
180
|
+
fire( args );
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return this;
|
|
184
|
+
},
|
|
185
|
+
// Call all the callbacks with the given arguments
|
|
186
|
+
fire: function() {
|
|
187
|
+
self.fireWith( this, arguments );
|
|
188
|
+
return this;
|
|
189
|
+
},
|
|
190
|
+
// To know if the callbacks have already been called at least once
|
|
191
|
+
fired: function() {
|
|
192
|
+
return !!fired;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return self;
|
|
197
|
+
};
|
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
var
|
|
2
|
+
// The deferred used on DOM ready
|
|
3
|
+
readyList,
|
|
4
|
+
|
|
5
|
+
// A central reference to the root jQuery(document)
|
|
6
|
+
rootjQuery,
|
|
7
|
+
|
|
8
|
+
// Support: IE<10
|
|
9
|
+
// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
|
|
10
|
+
core_strundefined = typeof undefined,
|
|
11
|
+
|
|
12
|
+
// Use the correct document accordingly with window argument (sandbox)
|
|
13
|
+
location = window.location,
|
|
14
|
+
document = window.document,
|
|
15
|
+
docElem = document.documentElement,
|
|
16
|
+
|
|
17
|
+
// Map over jQuery in case of overwrite
|
|
18
|
+
_jQuery = window.jQuery,
|
|
19
|
+
|
|
20
|
+
// Map over the $ in case of overwrite
|
|
21
|
+
_$ = window.$,
|
|
22
|
+
|
|
23
|
+
// [[Class]] -> type pairs
|
|
24
|
+
class2type = {},
|
|
25
|
+
|
|
26
|
+
// List of deleted data cache ids, so we can reuse them
|
|
27
|
+
core_deletedIds = [],
|
|
28
|
+
|
|
29
|
+
core_version = "@VERSION",
|
|
30
|
+
|
|
31
|
+
// Save a reference to some core methods
|
|
32
|
+
core_concat = core_deletedIds.concat,
|
|
33
|
+
core_push = core_deletedIds.push,
|
|
34
|
+
core_slice = core_deletedIds.slice,
|
|
35
|
+
core_indexOf = core_deletedIds.indexOf,
|
|
36
|
+
core_toString = class2type.toString,
|
|
37
|
+
core_hasOwn = class2type.hasOwnProperty,
|
|
38
|
+
core_trim = core_version.trim,
|
|
39
|
+
|
|
40
|
+
// Define a local copy of jQuery
|
|
41
|
+
jQuery = function( selector, context ) {
|
|
42
|
+
// The jQuery object is actually just the init constructor 'enhanced'
|
|
43
|
+
return new jQuery.fn.init( selector, context, rootjQuery );
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
// Used for matching numbers
|
|
47
|
+
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
|
|
48
|
+
|
|
49
|
+
// Used for splitting on whitespace
|
|
50
|
+
core_rnotwhite = /\S+/g,
|
|
51
|
+
|
|
52
|
+
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
|
|
53
|
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
54
|
+
|
|
55
|
+
// A simple way to check for HTML strings
|
|
56
|
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
|
57
|
+
// Strict HTML recognition (#11290: must start with <)
|
|
58
|
+
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
|
59
|
+
|
|
60
|
+
// Match a standalone tag
|
|
61
|
+
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
|
62
|
+
|
|
63
|
+
// JSON RegExp
|
|
64
|
+
rvalidchars = /^[\],:{}\s]*$/,
|
|
65
|
+
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
|
66
|
+
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
|
|
67
|
+
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
|
|
68
|
+
|
|
69
|
+
// Matches dashed string for camelizing
|
|
70
|
+
rmsPrefix = /^-ms-/,
|
|
71
|
+
rdashAlpha = /-([\da-z])/gi,
|
|
72
|
+
|
|
73
|
+
// Used by jQuery.camelCase as callback to replace()
|
|
74
|
+
fcamelCase = function( all, letter ) {
|
|
75
|
+
return letter.toUpperCase();
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// The ready event handler
|
|
79
|
+
completed = function( event ) {
|
|
80
|
+
|
|
81
|
+
// readyState === "complete" is good enough for us to call the dom ready in oldIE
|
|
82
|
+
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
|
|
83
|
+
detach();
|
|
84
|
+
jQuery.ready();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
// Clean-up method for dom ready events
|
|
88
|
+
detach = function() {
|
|
89
|
+
if ( document.addEventListener ) {
|
|
90
|
+
document.removeEventListener( "DOMContentLoaded", completed, false );
|
|
91
|
+
window.removeEventListener( "load", completed, false );
|
|
92
|
+
|
|
93
|
+
} else {
|
|
94
|
+
document.detachEvent( "onreadystatechange", completed );
|
|
95
|
+
window.detachEvent( "onload", completed );
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
jQuery.fn = jQuery.prototype = {
|
|
100
|
+
// The current version of jQuery being used
|
|
101
|
+
jquery: core_version,
|
|
102
|
+
|
|
103
|
+
constructor: jQuery,
|
|
104
|
+
init: function( selector, context, rootjQuery ) {
|
|
105
|
+
var match, elem;
|
|
106
|
+
|
|
107
|
+
// HANDLE: $(""), $(null), $(undefined), $(false)
|
|
108
|
+
if ( !selector ) {
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Handle HTML strings
|
|
113
|
+
if ( typeof selector === "string" ) {
|
|
114
|
+
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
|
115
|
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
|
116
|
+
match = [ null, selector, null ];
|
|
117
|
+
|
|
118
|
+
} else {
|
|
119
|
+
match = rquickExpr.exec( selector );
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Match html or make sure no context is specified for #id
|
|
123
|
+
if ( match && (match[1] || !context) ) {
|
|
124
|
+
|
|
125
|
+
// HANDLE: $(html) -> $(array)
|
|
126
|
+
if ( match[1] ) {
|
|
127
|
+
context = context instanceof jQuery ? context[0] : context;
|
|
128
|
+
|
|
129
|
+
// scripts is true for back-compat
|
|
130
|
+
jQuery.merge( this, jQuery.parseHTML(
|
|
131
|
+
match[1],
|
|
132
|
+
context && context.nodeType ? context.ownerDocument || context : document,
|
|
133
|
+
true
|
|
134
|
+
) );
|
|
135
|
+
|
|
136
|
+
// HANDLE: $(html, props)
|
|
137
|
+
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
|
|
138
|
+
for ( match in context ) {
|
|
139
|
+
// Properties of context are called as methods if possible
|
|
140
|
+
if ( jQuery.isFunction( this[ match ] ) ) {
|
|
141
|
+
this[ match ]( context[ match ] );
|
|
142
|
+
|
|
143
|
+
// ...and otherwise set as attributes
|
|
144
|
+
} else {
|
|
145
|
+
this.attr( match, context[ match ] );
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return this;
|
|
151
|
+
|
|
152
|
+
// HANDLE: $(#id)
|
|
153
|
+
} else {
|
|
154
|
+
elem = document.getElementById( match[2] );
|
|
155
|
+
|
|
156
|
+
// Check parentNode to catch when Blackberry 4.6 returns
|
|
157
|
+
// nodes that are no longer in the document #6963
|
|
158
|
+
if ( elem && elem.parentNode ) {
|
|
159
|
+
// Handle the case where IE and Opera return items
|
|
160
|
+
// by name instead of ID
|
|
161
|
+
if ( elem.id !== match[2] ) {
|
|
162
|
+
return rootjQuery.find( selector );
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Otherwise, we inject the element directly into the jQuery object
|
|
166
|
+
this.length = 1;
|
|
167
|
+
this[0] = elem;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
this.context = document;
|
|
171
|
+
this.selector = selector;
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// HANDLE: $(expr, $(...))
|
|
176
|
+
} else if ( !context || context.jquery ) {
|
|
177
|
+
return ( context || rootjQuery ).find( selector );
|
|
178
|
+
|
|
179
|
+
// HANDLE: $(expr, context)
|
|
180
|
+
// (which is just equivalent to: $(context).find(expr)
|
|
181
|
+
} else {
|
|
182
|
+
return this.constructor( context ).find( selector );
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// HANDLE: $(DOMElement)
|
|
186
|
+
} else if ( selector.nodeType ) {
|
|
187
|
+
this.context = this[0] = selector;
|
|
188
|
+
this.length = 1;
|
|
189
|
+
return this;
|
|
190
|
+
|
|
191
|
+
// HANDLE: $(function)
|
|
192
|
+
// Shortcut for document ready
|
|
193
|
+
} else if ( jQuery.isFunction( selector ) ) {
|
|
194
|
+
return rootjQuery.ready( selector );
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if ( selector.selector !== undefined ) {
|
|
198
|
+
this.selector = selector.selector;
|
|
199
|
+
this.context = selector.context;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return jQuery.makeArray( selector, this );
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
// Start with an empty selector
|
|
206
|
+
selector: "",
|
|
207
|
+
|
|
208
|
+
// The default length of a jQuery object is 0
|
|
209
|
+
length: 0,
|
|
210
|
+
|
|
211
|
+
toArray: function() {
|
|
212
|
+
return core_slice.call( this );
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
// Get the Nth element in the matched element set OR
|
|
216
|
+
// Get the whole matched element set as a clean array
|
|
217
|
+
get: function( num ) {
|
|
218
|
+
return num == null ?
|
|
219
|
+
|
|
220
|
+
// Return a 'clean' array
|
|
221
|
+
this.toArray() :
|
|
222
|
+
|
|
223
|
+
// Return just the object
|
|
224
|
+
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
// Take an array of elements and push it onto the stack
|
|
228
|
+
// (returning the new matched element set)
|
|
229
|
+
pushStack: function( elems ) {
|
|
230
|
+
|
|
231
|
+
// Build a new jQuery matched element set
|
|
232
|
+
var ret = jQuery.merge( this.constructor(), elems );
|
|
233
|
+
|
|
234
|
+
// Add the old object onto the stack (as a reference)
|
|
235
|
+
ret.prevObject = this;
|
|
236
|
+
ret.context = this.context;
|
|
237
|
+
|
|
238
|
+
// Return the newly-formed element set
|
|
239
|
+
return ret;
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
// Execute a callback for every element in the matched set.
|
|
243
|
+
// (You can seed the arguments with an array of args, but this is
|
|
244
|
+
// only used internally.)
|
|
245
|
+
each: function( callback, args ) {
|
|
246
|
+
return jQuery.each( this, callback, args );
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
ready: function( fn ) {
|
|
250
|
+
// Add the callback
|
|
251
|
+
jQuery.ready.promise().done( fn );
|
|
252
|
+
|
|
253
|
+
return this;
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
slice: function() {
|
|
257
|
+
return this.pushStack( core_slice.apply( this, arguments ) );
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
first: function() {
|
|
261
|
+
return this.eq( 0 );
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
last: function() {
|
|
265
|
+
return this.eq( -1 );
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
eq: function( i ) {
|
|
269
|
+
var len = this.length,
|
|
270
|
+
j = +i + ( i < 0 ? len : 0 );
|
|
271
|
+
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
map: function( callback ) {
|
|
275
|
+
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
|
276
|
+
return callback.call( elem, i, elem );
|
|
277
|
+
}));
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
end: function() {
|
|
281
|
+
return this.prevObject || this.constructor(null);
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
// For internal use only.
|
|
285
|
+
// Behaves like an Array's method, not like a jQuery method.
|
|
286
|
+
push: core_push,
|
|
287
|
+
sort: [].sort,
|
|
288
|
+
splice: [].splice
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Give the init function the jQuery prototype for later instantiation
|
|
292
|
+
jQuery.fn.init.prototype = jQuery.fn;
|
|
293
|
+
|
|
294
|
+
jQuery.extend = jQuery.fn.extend = function() {
|
|
295
|
+
var src, copyIsArray, copy, name, options, clone,
|
|
296
|
+
target = arguments[0] || {},
|
|
297
|
+
i = 1,
|
|
298
|
+
length = arguments.length,
|
|
299
|
+
deep = false;
|
|
300
|
+
|
|
301
|
+
// Handle a deep copy situation
|
|
302
|
+
if ( typeof target === "boolean" ) {
|
|
303
|
+
deep = target;
|
|
304
|
+
target = arguments[1] || {};
|
|
305
|
+
// skip the boolean and the target
|
|
306
|
+
i = 2;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Handle case when target is a string or something (possible in deep copy)
|
|
310
|
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
|
311
|
+
target = {};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// extend jQuery itself if only one argument is passed
|
|
315
|
+
if ( length === i ) {
|
|
316
|
+
target = this;
|
|
317
|
+
--i;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
for ( ; i < length; i++ ) {
|
|
321
|
+
// Only deal with non-null/undefined values
|
|
322
|
+
if ( (options = arguments[ i ]) != null ) {
|
|
323
|
+
// Extend the base object
|
|
324
|
+
for ( name in options ) {
|
|
325
|
+
src = target[ name ];
|
|
326
|
+
copy = options[ name ];
|
|
327
|
+
|
|
328
|
+
// Prevent never-ending loop
|
|
329
|
+
if ( target === copy ) {
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Recurse if we're merging plain objects or arrays
|
|
334
|
+
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
|
335
|
+
if ( copyIsArray ) {
|
|
336
|
+
copyIsArray = false;
|
|
337
|
+
clone = src && jQuery.isArray(src) ? src : [];
|
|
338
|
+
|
|
339
|
+
} else {
|
|
340
|
+
clone = src && jQuery.isPlainObject(src) ? src : {};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Never move original objects, clone them
|
|
344
|
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
|
345
|
+
|
|
346
|
+
// Don't bring in undefined values
|
|
347
|
+
} else if ( copy !== undefined ) {
|
|
348
|
+
target[ name ] = copy;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Return the modified object
|
|
355
|
+
return target;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
jQuery.extend({
|
|
359
|
+
// Unique for each copy of jQuery on the page
|
|
360
|
+
// Non-digits removed to match rinlinejQuery
|
|
361
|
+
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
|
|
362
|
+
|
|
363
|
+
noConflict: function( deep ) {
|
|
364
|
+
if ( window.$ === jQuery ) {
|
|
365
|
+
window.$ = _$;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if ( deep && window.jQuery === jQuery ) {
|
|
369
|
+
window.jQuery = _jQuery;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return jQuery;
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
// Is the DOM ready to be used? Set to true once it occurs.
|
|
376
|
+
isReady: false,
|
|
377
|
+
|
|
378
|
+
// A counter to track how many items to wait for before
|
|
379
|
+
// the ready event fires. See #6781
|
|
380
|
+
readyWait: 1,
|
|
381
|
+
|
|
382
|
+
// Hold (or release) the ready event
|
|
383
|
+
holdReady: function( hold ) {
|
|
384
|
+
if ( hold ) {
|
|
385
|
+
jQuery.readyWait++;
|
|
386
|
+
} else {
|
|
387
|
+
jQuery.ready( true );
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
// Handle when the DOM is ready
|
|
392
|
+
ready: function( wait ) {
|
|
393
|
+
|
|
394
|
+
// Abort if there are pending holds or we're already ready
|
|
395
|
+
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
|
400
|
+
if ( !document.body ) {
|
|
401
|
+
return setTimeout( jQuery.ready );
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Remember that the DOM is ready
|
|
405
|
+
jQuery.isReady = true;
|
|
406
|
+
|
|
407
|
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
|
408
|
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// If there are functions bound, to execute
|
|
413
|
+
readyList.resolveWith( document, [ jQuery ] );
|
|
414
|
+
|
|
415
|
+
// Trigger any bound ready events
|
|
416
|
+
if ( jQuery.fn.trigger ) {
|
|
417
|
+
jQuery( document ).trigger("ready").off("ready");
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
// See test/unit/core.js for details concerning isFunction.
|
|
422
|
+
// Since version 1.3, DOM methods and functions like alert
|
|
423
|
+
// aren't supported. They return false on IE (#2968).
|
|
424
|
+
isFunction: function( obj ) {
|
|
425
|
+
return jQuery.type(obj) === "function";
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
isArray: Array.isArray || function( obj ) {
|
|
429
|
+
return jQuery.type(obj) === "array";
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
isWindow: function( obj ) {
|
|
433
|
+
/* jshint eqeqeq: false */
|
|
434
|
+
return obj != null && obj == obj.window;
|
|
435
|
+
},
|
|
436
|
+
|
|
437
|
+
isNumeric: function( obj ) {
|
|
438
|
+
return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
type: function( obj ) {
|
|
442
|
+
if ( obj == null ) {
|
|
443
|
+
return String( obj );
|
|
444
|
+
}
|
|
445
|
+
return typeof obj === "object" || typeof obj === "function" ?
|
|
446
|
+
class2type[ core_toString.call(obj) ] || "object" :
|
|
447
|
+
typeof obj;
|
|
448
|
+
},
|
|
449
|
+
|
|
450
|
+
isPlainObject: function( obj ) {
|
|
451
|
+
var key;
|
|
452
|
+
|
|
453
|
+
// Must be an Object.
|
|
454
|
+
// Because of IE, we also have to check the presence of the constructor property.
|
|
455
|
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
|
456
|
+
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
try {
|
|
461
|
+
// Not own constructor property must be Object
|
|
462
|
+
if ( obj.constructor &&
|
|
463
|
+
!core_hasOwn.call(obj, "constructor") &&
|
|
464
|
+
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
} catch ( e ) {
|
|
468
|
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Support: IE<9
|
|
473
|
+
// Handle iteration over inherited properties before own properties.
|
|
474
|
+
if ( jQuery.support.ownLast ) {
|
|
475
|
+
for ( key in obj ) {
|
|
476
|
+
return core_hasOwn.call( obj, key );
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// Own properties are enumerated firstly, so to speed up,
|
|
481
|
+
// if last one is own, then all properties are own.
|
|
482
|
+
for ( key in obj ) {}
|
|
483
|
+
|
|
484
|
+
return key === undefined || core_hasOwn.call( obj, key );
|
|
485
|
+
},
|
|
486
|
+
|
|
487
|
+
isEmptyObject: function( obj ) {
|
|
488
|
+
var name;
|
|
489
|
+
for ( name in obj ) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
return true;
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
error: function( msg ) {
|
|
496
|
+
throw new Error( msg );
|
|
497
|
+
},
|
|
498
|
+
|
|
499
|
+
// data: string of html
|
|
500
|
+
// context (optional): If specified, the fragment will be created in this context, defaults to document
|
|
501
|
+
// keepScripts (optional): If true, will include scripts passed in the html string
|
|
502
|
+
parseHTML: function( data, context, keepScripts ) {
|
|
503
|
+
if ( !data || typeof data !== "string" ) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
if ( typeof context === "boolean" ) {
|
|
507
|
+
keepScripts = context;
|
|
508
|
+
context = false;
|
|
509
|
+
}
|
|
510
|
+
context = context || document;
|
|
511
|
+
|
|
512
|
+
var parsed = rsingleTag.exec( data ),
|
|
513
|
+
scripts = !keepScripts && [];
|
|
514
|
+
|
|
515
|
+
// Single tag
|
|
516
|
+
if ( parsed ) {
|
|
517
|
+
return [ context.createElement( parsed[1] ) ];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
parsed = jQuery.buildFragment( [ data ], context, scripts );
|
|
521
|
+
if ( scripts ) {
|
|
522
|
+
jQuery( scripts ).remove();
|
|
523
|
+
}
|
|
524
|
+
return jQuery.merge( [], parsed.childNodes );
|
|
525
|
+
},
|
|
526
|
+
|
|
527
|
+
parseJSON: function( data ) {
|
|
528
|
+
// Attempt to parse using the native JSON parser first
|
|
529
|
+
if ( window.JSON && window.JSON.parse ) {
|
|
530
|
+
return window.JSON.parse( data );
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if ( data === null ) {
|
|
534
|
+
return data;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if ( typeof data === "string" ) {
|
|
538
|
+
|
|
539
|
+
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
|
540
|
+
data = jQuery.trim( data );
|
|
541
|
+
|
|
542
|
+
if ( data ) {
|
|
543
|
+
// Make sure the incoming data is actual JSON
|
|
544
|
+
// Logic borrowed from http://json.org/json2.js
|
|
545
|
+
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
|
546
|
+
.replace( rvalidtokens, "]" )
|
|
547
|
+
.replace( rvalidbraces, "")) ) {
|
|
548
|
+
|
|
549
|
+
return ( new Function( "return " + data ) )();
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
jQuery.error( "Invalid JSON: " + data );
|
|
555
|
+
},
|
|
556
|
+
|
|
557
|
+
// Cross-browser xml parsing
|
|
558
|
+
parseXML: function( data ) {
|
|
559
|
+
var xml, tmp;
|
|
560
|
+
if ( !data || typeof data !== "string" ) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
try {
|
|
564
|
+
if ( window.DOMParser ) { // Standard
|
|
565
|
+
tmp = new DOMParser();
|
|
566
|
+
xml = tmp.parseFromString( data , "text/xml" );
|
|
567
|
+
} else { // IE
|
|
568
|
+
xml = new ActiveXObject( "Microsoft.XMLDOM" );
|
|
569
|
+
xml.async = "false";
|
|
570
|
+
xml.loadXML( data );
|
|
571
|
+
}
|
|
572
|
+
} catch( e ) {
|
|
573
|
+
xml = undefined;
|
|
574
|
+
}
|
|
575
|
+
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
|
|
576
|
+
jQuery.error( "Invalid XML: " + data );
|
|
577
|
+
}
|
|
578
|
+
return xml;
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
noop: function() {},
|
|
582
|
+
|
|
583
|
+
// Evaluates a script in a global context
|
|
584
|
+
// Workarounds based on findings by Jim Driscoll
|
|
585
|
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
|
586
|
+
globalEval: function( data ) {
|
|
587
|
+
if ( data && jQuery.trim( data ) ) {
|
|
588
|
+
// We use execScript on Internet Explorer
|
|
589
|
+
// We use an anonymous function so that context is window
|
|
590
|
+
// rather than jQuery in Firefox
|
|
591
|
+
( window.execScript || function( data ) {
|
|
592
|
+
window[ "eval" ].call( window, data );
|
|
593
|
+
} )( data );
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
|
|
597
|
+
// Convert dashed to camelCase; used by the css and data modules
|
|
598
|
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
|
599
|
+
camelCase: function( string ) {
|
|
600
|
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
nodeName: function( elem, name ) {
|
|
604
|
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
|
605
|
+
},
|
|
606
|
+
|
|
607
|
+
// args is for internal usage only
|
|
608
|
+
each: function( obj, callback, args ) {
|
|
609
|
+
var value,
|
|
610
|
+
i = 0,
|
|
611
|
+
length = obj.length,
|
|
612
|
+
isArray = isArraylike( obj );
|
|
613
|
+
|
|
614
|
+
if ( args ) {
|
|
615
|
+
if ( isArray ) {
|
|
616
|
+
for ( ; i < length; i++ ) {
|
|
617
|
+
value = callback.apply( obj[ i ], args );
|
|
618
|
+
|
|
619
|
+
if ( value === false ) {
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
} else {
|
|
624
|
+
for ( i in obj ) {
|
|
625
|
+
value = callback.apply( obj[ i ], args );
|
|
626
|
+
|
|
627
|
+
if ( value === false ) {
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// A special, fast, case for the most common use of each
|
|
634
|
+
} else {
|
|
635
|
+
if ( isArray ) {
|
|
636
|
+
for ( ; i < length; i++ ) {
|
|
637
|
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
|
638
|
+
|
|
639
|
+
if ( value === false ) {
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
} else {
|
|
644
|
+
for ( i in obj ) {
|
|
645
|
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
|
646
|
+
|
|
647
|
+
if ( value === false ) {
|
|
648
|
+
break;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return obj;
|
|
655
|
+
},
|
|
656
|
+
|
|
657
|
+
// Use native String.trim function wherever possible
|
|
658
|
+
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
|
|
659
|
+
function( text ) {
|
|
660
|
+
return text == null ?
|
|
661
|
+
"" :
|
|
662
|
+
core_trim.call( text );
|
|
663
|
+
} :
|
|
664
|
+
|
|
665
|
+
// Otherwise use our own trimming functionality
|
|
666
|
+
function( text ) {
|
|
667
|
+
return text == null ?
|
|
668
|
+
"" :
|
|
669
|
+
( text + "" ).replace( rtrim, "" );
|
|
670
|
+
},
|
|
671
|
+
|
|
672
|
+
// results is for internal usage only
|
|
673
|
+
makeArray: function( arr, results ) {
|
|
674
|
+
var ret = results || [];
|
|
675
|
+
|
|
676
|
+
if ( arr != null ) {
|
|
677
|
+
if ( isArraylike( Object(arr) ) ) {
|
|
678
|
+
jQuery.merge( ret,
|
|
679
|
+
typeof arr === "string" ?
|
|
680
|
+
[ arr ] : arr
|
|
681
|
+
);
|
|
682
|
+
} else {
|
|
683
|
+
core_push.call( ret, arr );
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
return ret;
|
|
688
|
+
},
|
|
689
|
+
|
|
690
|
+
inArray: function( elem, arr, i ) {
|
|
691
|
+
var len;
|
|
692
|
+
|
|
693
|
+
if ( arr ) {
|
|
694
|
+
if ( core_indexOf ) {
|
|
695
|
+
return core_indexOf.call( arr, elem, i );
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
len = arr.length;
|
|
699
|
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
|
700
|
+
|
|
701
|
+
for ( ; i < len; i++ ) {
|
|
702
|
+
// Skip accessing in sparse arrays
|
|
703
|
+
if ( i in arr && arr[ i ] === elem ) {
|
|
704
|
+
return i;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return -1;
|
|
710
|
+
},
|
|
711
|
+
|
|
712
|
+
merge: function( first, second ) {
|
|
713
|
+
var l = second.length,
|
|
714
|
+
i = first.length,
|
|
715
|
+
j = 0;
|
|
716
|
+
|
|
717
|
+
if ( typeof l === "number" ) {
|
|
718
|
+
for ( ; j < l; j++ ) {
|
|
719
|
+
first[ i++ ] = second[ j ];
|
|
720
|
+
}
|
|
721
|
+
} else {
|
|
722
|
+
while ( second[j] !== undefined ) {
|
|
723
|
+
first[ i++ ] = second[ j++ ];
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
first.length = i;
|
|
728
|
+
|
|
729
|
+
return first;
|
|
730
|
+
},
|
|
731
|
+
|
|
732
|
+
grep: function( elems, callback, inv ) {
|
|
733
|
+
var retVal,
|
|
734
|
+
ret = [],
|
|
735
|
+
i = 0,
|
|
736
|
+
length = elems.length;
|
|
737
|
+
inv = !!inv;
|
|
738
|
+
|
|
739
|
+
// Go through the array, only saving the items
|
|
740
|
+
// that pass the validator function
|
|
741
|
+
for ( ; i < length; i++ ) {
|
|
742
|
+
retVal = !!callback( elems[ i ], i );
|
|
743
|
+
if ( inv !== retVal ) {
|
|
744
|
+
ret.push( elems[ i ] );
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return ret;
|
|
749
|
+
},
|
|
750
|
+
|
|
751
|
+
// arg is for internal usage only
|
|
752
|
+
map: function( elems, callback, arg ) {
|
|
753
|
+
var value,
|
|
754
|
+
i = 0,
|
|
755
|
+
length = elems.length,
|
|
756
|
+
isArray = isArraylike( elems ),
|
|
757
|
+
ret = [];
|
|
758
|
+
|
|
759
|
+
// Go through the array, translating each of the items to their
|
|
760
|
+
if ( isArray ) {
|
|
761
|
+
for ( ; i < length; i++ ) {
|
|
762
|
+
value = callback( elems[ i ], i, arg );
|
|
763
|
+
|
|
764
|
+
if ( value != null ) {
|
|
765
|
+
ret[ ret.length ] = value;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Go through every key on the object,
|
|
770
|
+
} else {
|
|
771
|
+
for ( i in elems ) {
|
|
772
|
+
value = callback( elems[ i ], i, arg );
|
|
773
|
+
|
|
774
|
+
if ( value != null ) {
|
|
775
|
+
ret[ ret.length ] = value;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// Flatten any nested arrays
|
|
781
|
+
return core_concat.apply( [], ret );
|
|
782
|
+
},
|
|
783
|
+
|
|
784
|
+
// A global GUID counter for objects
|
|
785
|
+
guid: 1,
|
|
786
|
+
|
|
787
|
+
// Bind a function to a context, optionally partially applying any
|
|
788
|
+
// arguments.
|
|
789
|
+
proxy: function( fn, context ) {
|
|
790
|
+
var args, proxy, tmp;
|
|
791
|
+
|
|
792
|
+
if ( typeof context === "string" ) {
|
|
793
|
+
tmp = fn[ context ];
|
|
794
|
+
context = fn;
|
|
795
|
+
fn = tmp;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// Quick check to determine if target is callable, in the spec
|
|
799
|
+
// this throws a TypeError, but we will just return undefined.
|
|
800
|
+
if ( !jQuery.isFunction( fn ) ) {
|
|
801
|
+
return undefined;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// Simulated bind
|
|
805
|
+
args = core_slice.call( arguments, 2 );
|
|
806
|
+
proxy = function() {
|
|
807
|
+
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
|
811
|
+
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
|
812
|
+
|
|
813
|
+
return proxy;
|
|
814
|
+
},
|
|
815
|
+
|
|
816
|
+
// Multifunctional method to get and set values of a collection
|
|
817
|
+
// The value/s can optionally be executed if it's a function
|
|
818
|
+
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
819
|
+
var i = 0,
|
|
820
|
+
length = elems.length,
|
|
821
|
+
bulk = key == null;
|
|
822
|
+
|
|
823
|
+
// Sets many values
|
|
824
|
+
if ( jQuery.type( key ) === "object" ) {
|
|
825
|
+
chainable = true;
|
|
826
|
+
for ( i in key ) {
|
|
827
|
+
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// Sets one value
|
|
831
|
+
} else if ( value !== undefined ) {
|
|
832
|
+
chainable = true;
|
|
833
|
+
|
|
834
|
+
if ( !jQuery.isFunction( value ) ) {
|
|
835
|
+
raw = true;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if ( bulk ) {
|
|
839
|
+
// Bulk operations run against the entire set
|
|
840
|
+
if ( raw ) {
|
|
841
|
+
fn.call( elems, value );
|
|
842
|
+
fn = null;
|
|
843
|
+
|
|
844
|
+
// ...except when executing function values
|
|
845
|
+
} else {
|
|
846
|
+
bulk = fn;
|
|
847
|
+
fn = function( elem, key, value ) {
|
|
848
|
+
return bulk.call( jQuery( elem ), value );
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
if ( fn ) {
|
|
854
|
+
for ( ; i < length; i++ ) {
|
|
855
|
+
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
return chainable ?
|
|
861
|
+
elems :
|
|
862
|
+
|
|
863
|
+
// Gets
|
|
864
|
+
bulk ?
|
|
865
|
+
fn.call( elems ) :
|
|
866
|
+
length ? fn( elems[0], key ) : emptyGet;
|
|
867
|
+
},
|
|
868
|
+
|
|
869
|
+
now: function() {
|
|
870
|
+
return ( new Date() ).getTime();
|
|
871
|
+
},
|
|
872
|
+
|
|
873
|
+
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
|
874
|
+
// Note: this method belongs to the css module but it's needed here for the support module.
|
|
875
|
+
// If support gets modularized, this method should be moved back to the css module.
|
|
876
|
+
swap: function( elem, options, callback, args ) {
|
|
877
|
+
var ret, name,
|
|
878
|
+
old = {};
|
|
879
|
+
|
|
880
|
+
// Remember the old values, and insert the new ones
|
|
881
|
+
for ( name in options ) {
|
|
882
|
+
old[ name ] = elem.style[ name ];
|
|
883
|
+
elem.style[ name ] = options[ name ];
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
ret = callback.apply( elem, args || [] );
|
|
887
|
+
|
|
888
|
+
// Revert the old values
|
|
889
|
+
for ( name in options ) {
|
|
890
|
+
elem.style[ name ] = old[ name ];
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
return ret;
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
jQuery.ready.promise = function( obj ) {
|
|
898
|
+
if ( !readyList ) {
|
|
899
|
+
|
|
900
|
+
readyList = jQuery.Deferred();
|
|
901
|
+
|
|
902
|
+
// Catch cases where $(document).ready() is called after the browser event has already occurred.
|
|
903
|
+
// we once tried to use readyState "interactive" here, but it caused issues like the one
|
|
904
|
+
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
|
|
905
|
+
if ( document.readyState === "complete" ) {
|
|
906
|
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
|
907
|
+
setTimeout( jQuery.ready );
|
|
908
|
+
|
|
909
|
+
// Standards-based browsers support DOMContentLoaded
|
|
910
|
+
} else if ( document.addEventListener ) {
|
|
911
|
+
// Use the handy event callback
|
|
912
|
+
document.addEventListener( "DOMContentLoaded", completed, false );
|
|
913
|
+
|
|
914
|
+
// A fallback to window.onload, that will always work
|
|
915
|
+
window.addEventListener( "load", completed, false );
|
|
916
|
+
|
|
917
|
+
// If IE event model is used
|
|
918
|
+
} else {
|
|
919
|
+
// Ensure firing before onload, maybe late but safe also for iframes
|
|
920
|
+
document.attachEvent( "onreadystatechange", completed );
|
|
921
|
+
|
|
922
|
+
// A fallback to window.onload, that will always work
|
|
923
|
+
window.attachEvent( "onload", completed );
|
|
924
|
+
|
|
925
|
+
// If IE and not a frame
|
|
926
|
+
// continually check to see if the document is ready
|
|
927
|
+
var top = false;
|
|
928
|
+
|
|
929
|
+
try {
|
|
930
|
+
top = window.frameElement == null && document.documentElement;
|
|
931
|
+
} catch(e) {}
|
|
932
|
+
|
|
933
|
+
if ( top && top.doScroll ) {
|
|
934
|
+
(function doScrollCheck() {
|
|
935
|
+
if ( !jQuery.isReady ) {
|
|
936
|
+
|
|
937
|
+
try {
|
|
938
|
+
// Use the trick by Diego Perini
|
|
939
|
+
// http://javascript.nwbox.com/IEContentLoaded/
|
|
940
|
+
top.doScroll("left");
|
|
941
|
+
} catch(e) {
|
|
942
|
+
return setTimeout( doScrollCheck, 50 );
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// detach all dom ready events
|
|
946
|
+
detach();
|
|
947
|
+
|
|
948
|
+
// and execute any waiting functions
|
|
949
|
+
jQuery.ready();
|
|
950
|
+
}
|
|
951
|
+
})();
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return readyList.promise( obj );
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
// Populate the class2type map
|
|
959
|
+
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
|
960
|
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
function isArraylike( obj ) {
|
|
964
|
+
var length = obj.length,
|
|
965
|
+
type = jQuery.type( obj );
|
|
966
|
+
|
|
967
|
+
if ( jQuery.isWindow( obj ) ) {
|
|
968
|
+
return false;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
if ( obj.nodeType === 1 && length ) {
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
return type === "array" || type !== "function" &&
|
|
976
|
+
( length === 0 ||
|
|
977
|
+
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// All jQuery objects should point back to these
|
|
981
|
+
rootjQuery = jQuery(document);
|