middleman 2.0.0.rc8 → 2.0.0.rc91
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -1
- data/bin/mm-server +1 -1
- data/features/asset_host.feature +2 -0
- data/features/automatic_image_sizes.feature +2 -0
- data/features/builder.feature +4 -1
- data/features/cache_buster.feature +4 -0
- data/features/coffee-script.feature +6 -1
- data/features/dynamic_pages.feature +24 -0
- data/features/minify_css.feature +2 -0
- data/features/minify_javascript.feature +3 -0
- data/features/page_alias_and_layouts.feature +5 -0
- data/features/relative_assets.feature +33 -1
- data/features/step_definitions/asset_host_steps.rb +4 -6
- data/features/step_definitions/builder_steps.rb +5 -0
- data/features/step_definitions/middleman_steps.rb +11 -8
- data/features/step_definitions/page_layout_steps.rb +7 -11
- data/features/tiny_src.feature +2 -0
- data/fixtures/test-app/config.rb +10 -0
- data/fixtures/test-app/source/images/Child folder/regular_file(example).txt +1 -0
- data/fixtures/test-app/source/images/Read me (example).txt +1 -0
- data/fixtures/test-app/source/img/blank.gif +0 -0
- data/fixtures/test-app/source/javascripts/broken-coffee.js.coffee +3 -0
- data/fixtures/test-app/source/real.html +1 -0
- data/fixtures/test-app/source/real/index.html.erb +5 -0
- data/fixtures/test-app/source/relative_image.html.erb +1 -0
- data/fixtures/test-app/source/spaces in file.html.erb +1 -0
- data/lib/middleman/base.rb +9 -6
- data/lib/middleman/builder.rb +7 -4
- data/lib/middleman/core_extensions/compass.rb +45 -16
- data/lib/middleman/core_extensions/front_matter.rb +2 -1
- data/lib/middleman/core_extensions/routing.rb +21 -9
- data/lib/middleman/features/asset_host.rb +2 -2
- data/lib/middleman/features/blog.rb +8 -5
- data/lib/middleman/features/cache_buster.rb +8 -10
- data/lib/middleman/features/minify_css.rb +2 -2
- data/lib/middleman/guard.rb +8 -2
- data/lib/middleman/templates.rb +3 -6
- data/lib/middleman/templates/blog.rb +17 -0
- data/lib/middleman/templates/blog/config.ru +9 -0
- data/lib/middleman/templates/blog/config.tt +18 -0
- data/lib/middleman/templates/blog/source/2011/01/01/new-article.html.markdown +6 -0
- data/lib/middleman/templates/blog/source/archives/index.html.erb +10 -0
- data/lib/middleman/templates/blog/source/feed.xml.builder +23 -0
- data/lib/middleman/templates/blog/source/index.html.erb +9 -0
- data/lib/middleman/templates/blog/source/layout.erb +30 -0
- data/lib/middleman/templates/default.rb +6 -4
- data/lib/middleman/templates/default/source/index.html.erb +5 -0
- data/lib/middleman/templates/default/source/layout.erb +19 -0
- data/lib/middleman/templates/default/source/stylesheets/site.css.scss +36 -0
- data/lib/middleman/templates/html5.rb +6 -3
- data/lib/middleman/templates/html5/source/404.html +28 -18
- data/lib/middleman/templates/html5/source/apple-touch-icon-114x114-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-57x57-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-72x72-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon.png +0 -0
- data/lib/middleman/templates/html5/source/crossdomain.xml +0 -0
- data/lib/middleman/templates/html5/source/css/handheld.css +0 -0
- data/lib/middleman/templates/html5/source/css/style.css +40 -36
- data/lib/middleman/templates/html5/source/favicon.ico +0 -0
- data/lib/middleman/templates/html5/source/humans.txt +0 -0
- data/lib/middleman/templates/html5/source/{images → img}/.gitignore +0 -0
- data/lib/middleman/templates/html5/source/index.html +26 -27
- data/lib/middleman/templates/html5/source/js/libs/dd_belatedpng.js +0 -0
- data/lib/middleman/templates/html5/source/js/libs/{jquery-1.5.0.js → jquery-1.5.1.js} +549 -409
- data/lib/middleman/templates/html5/source/js/libs/jquery-1.5.1.min.js +16 -0
- data/lib/middleman/templates/html5/source/js/libs/modernizr-1.7.min.js +2 -0
- data/lib/middleman/templates/html5/source/js/mylibs/.gitignore +0 -0
- data/lib/middleman/templates/html5/source/js/plugins.js +3 -1
- data/lib/middleman/templates/html5/source/js/script.js +0 -0
- data/lib/middleman/templates/html5/source/robots.txt +0 -0
- data/lib/middleman/templates/html5/source/test/index.html +31 -0
- data/lib/middleman/templates/html5/source/test/qunit/qunit.css +148 -0
- data/lib/middleman/templates/html5/source/test/qunit/qunit.js +1265 -0
- data/lib/middleman/templates/html5/source/test/tests.js +27 -0
- data/lib/middleman/templates/{default → shared}/config.ru +0 -0
- data/lib/middleman/templates/{default → shared}/config.tt +36 -8
- data/lib/middleman/version.rb +1 -1
- data/middleman.gemspec +6 -6
- metadata +188 -35
- data/.document +0 -5
- data/.gitmodules +0 -0
- data/lib/middleman/templates/compass.rb +0 -18
- data/lib/middleman/templates/default/source/index.html.haml +0 -4
- data/lib/middleman/templates/default/source/layout.haml +0 -21
- data/lib/middleman/templates/default/source/stylesheets/site.css.sass +0 -34
- data/lib/middleman/templates/html5/config.ru +0 -4
- data/lib/middleman/templates/html5/config.tt +0 -53
- data/lib/middleman/templates/html5/source/js/libs/jquery-1.5.0.min.js +0 -16
- data/lib/middleman/templates/html5/source/js/libs/modernizr-1.6.min.js +0 -30
- data/lib/middleman/templates/xhtml.rb +0 -16
- data/lib/middleman/templates/xhtml/config.ru +0 -4
- data/lib/middleman/templates/xhtml/config.tt +0 -68
- data/lib/middleman/templates/xhtml/source/index.html.haml +0 -4
- data/lib/middleman/templates/xhtml/source/layout.haml +0 -13
- data/lib/middleman/templates/xhtml/source/stylesheets/site.css.sass +0 -34
@@ -0,0 +1,19 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
|
6
|
+
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag "site.css" %>
|
9
|
+
<%= yield_content :head %>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body class="<%= page_classes %>">
|
13
|
+
|
14
|
+
<section id="main" role="main">
|
15
|
+
<%= yield %>
|
16
|
+
</section>
|
17
|
+
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@import "compass";
|
2
|
+
@import "susy";
|
3
|
+
|
4
|
+
$link-color: #0388a6;
|
5
|
+
$link-hover-color: #009ce0;
|
6
|
+
$link-focus-color: false;
|
7
|
+
$link-active-color: false;
|
8
|
+
$link-visited-color: false;
|
9
|
+
|
10
|
+
$font-color: #2a2a2a;
|
11
|
+
$font-family: sans-serif;
|
12
|
+
$base-font-size: 12px;
|
13
|
+
$base-line-height: 18px;
|
14
|
+
|
15
|
+
$total-cols: 12;
|
16
|
+
$col-width: 4em;
|
17
|
+
$gutter-width: 1em;
|
18
|
+
$side-gutter-width: $gutter-width;
|
19
|
+
|
20
|
+
@include global-reset;
|
21
|
+
@include establish-baseline;
|
22
|
+
|
23
|
+
body {
|
24
|
+
font-family: $font-family;
|
25
|
+
color: $font-color;
|
26
|
+
}
|
27
|
+
|
28
|
+
a {
|
29
|
+
@include link-colors($link-color, $link-hover-color, $link-focus-color, $link-active-color, $link-visited-color);
|
30
|
+
}
|
31
|
+
|
32
|
+
#main {
|
33
|
+
padding: 50px;
|
34
|
+
@include container;
|
35
|
+
@include susy-grid-background;
|
36
|
+
}
|
@@ -1,11 +1,14 @@
|
|
1
1
|
class Middleman::Templates::Html5 < Middleman::Templates::Base
|
2
|
+
class_option :css_dir, :default => "css"
|
3
|
+
class_option :js_dir, :default => "js"
|
4
|
+
|
2
5
|
def self.source_root
|
3
|
-
File.
|
6
|
+
File.dirname(__FILE__)
|
4
7
|
end
|
5
8
|
|
6
9
|
def build_scaffold
|
7
|
-
template "config.tt", File.join(location, "config.rb")
|
8
|
-
directory "source", File.join(location, "source")
|
10
|
+
template "shared/config.tt", File.join(location, "config.rb")
|
11
|
+
directory "html5/source", File.join(location, "source")
|
9
12
|
empty_directory File.join(location, "source")
|
10
13
|
end
|
11
14
|
end
|
@@ -1,22 +1,32 @@
|
|
1
1
|
<!doctype html>
|
2
|
-
<title>
|
3
|
-
|
2
|
+
<title>Page Not Found</title>
|
4
3
|
<style>
|
5
|
-
body { text-align: center;}
|
6
|
-
h1 { font-size: 50px; }
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
body { text-align: center;}
|
5
|
+
h1 { font-size: 50px; text-align: center }
|
6
|
+
span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
|
7
|
+
body { font: 20px Constantia, "Hoefler Text", "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
|
8
|
+
::-moz-selection{ background:#FF5E99; color:#fff; }
|
9
|
+
::selection { background:#FF5E99; color:#fff; }
|
10
|
+
article {display:block; text-align: left; width: 500px; margin: 0 auto; }
|
11
|
+
|
12
|
+
a { color: rgb(36, 109, 56); text-decoration:none; }
|
13
|
+
a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
|
14
14
|
</style>
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
</
|
16
|
+
<article>
|
17
|
+
<h1>Not found <span frown>:(</span></h1>
|
18
|
+
<div>
|
19
|
+
<p>Sorry, but the page you were trying to view does not exist.</p>
|
20
|
+
<p>It looks like this was the result of either:</p>
|
21
|
+
<ul>
|
22
|
+
<li>a mistyped address</li>
|
23
|
+
<li>an out-of-date link</li>
|
24
|
+
</ul>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
var GOOG_FIXURL_LANG = (navigator.language || "").slice(0,2),
|
29
|
+
GOOG_FIXURL_SITE = location.host;
|
30
|
+
</script>
|
31
|
+
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
|
32
|
+
</article>
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
@@ -42,7 +42,7 @@ footer, header, hgroup, menu, nav, section {
|
|
42
42
|
blockquote, q { quotes: none; }
|
43
43
|
|
44
44
|
blockquote:before, blockquote:after,
|
45
|
-
q:before, q:after { content:
|
45
|
+
q:before, q:after { content: ""; content: none; }
|
46
46
|
|
47
47
|
ins { background-color: #ff9; color: #000; text-decoration: none; }
|
48
48
|
|
@@ -63,7 +63,7 @@ input, select { vertical-align: middle; }
|
|
63
63
|
* Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
|
64
64
|
*/
|
65
65
|
|
66
|
-
body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity
|
66
|
+
body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
|
67
67
|
select, input, textarea, button { font:99% sans-serif; }
|
68
68
|
|
69
69
|
/* Normalize monospace sizing:
|
@@ -75,31 +75,16 @@ pre, code, kbd, samp { font-family: monospace, sans-serif; }
|
|
75
75
|
* Minimal base styles.
|
76
76
|
*/
|
77
77
|
|
78
|
-
|
79
|
-
/* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
|
80
|
-
color: #444;
|
81
|
-
/* Set your base font here, to apply evenly. */
|
82
|
-
/* font-family: Georgia, serif; */
|
83
|
-
}
|
84
|
-
|
85
|
-
/* Headers (h1, h2, etc) have no default font-size or margin. Define those yourself. */
|
86
|
-
h1, h2, h3, h4, h5, h6 { font-weight: bold; }
|
87
|
-
|
88
|
-
/* Always force a scrollbar in non-IE: */
|
78
|
+
/* Always force a scrollbar in non-IE */
|
89
79
|
html { overflow-y: scroll; }
|
90
80
|
|
91
|
-
|
92
81
|
/* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
|
93
82
|
a:hover, a:active { outline: none; }
|
94
83
|
|
95
|
-
a, a:active, a:visited { color: #607890; }
|
96
|
-
a:hover { color: #036; }
|
97
|
-
|
98
|
-
|
99
84
|
ul, ol { margin-left: 2em; }
|
100
85
|
ol { list-style-type: decimal; }
|
101
86
|
|
102
|
-
/* Remove margins for navigation lists
|
87
|
+
/* Remove margins for navigation lists */
|
103
88
|
nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
|
104
89
|
|
105
90
|
small { font-size: 85%; }
|
@@ -114,13 +99,13 @@ sub { bottom: -0.25em; }
|
|
114
99
|
|
115
100
|
pre {
|
116
101
|
/* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
|
117
|
-
white-space: pre; white-space: pre-wrap;
|
102
|
+
white-space: pre; white-space: pre-wrap; word-wrap: break-word;
|
118
103
|
padding: 15px;
|
119
104
|
}
|
120
105
|
|
121
106
|
textarea { overflow: auto; } /* www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */
|
122
107
|
|
123
|
-
.ie6 legend, .ie7 legend { margin-left: -7px; }
|
108
|
+
.ie6 legend, .ie7 legend { margin-left: -7px; }
|
124
109
|
|
125
110
|
/* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
|
126
111
|
input[type="radio"] { vertical-align: text-bottom; }
|
@@ -128,23 +113,23 @@ input[type="checkbox"] { vertical-align: bottom; }
|
|
128
113
|
.ie7 input[type="checkbox"] { vertical-align: baseline; }
|
129
114
|
.ie6 input { vertical-align: text-bottom; }
|
130
115
|
|
131
|
-
/* Hand cursor on clickable input elements
|
116
|
+
/* Hand cursor on clickable input elements */
|
132
117
|
label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
|
133
118
|
|
134
|
-
/* Webkit browsers add a 2px margin outside the chrome of form elements
|
119
|
+
/* Webkit browsers add a 2px margin outside the chrome of form elements */
|
135
120
|
button, input, select, textarea { margin: 0; }
|
136
121
|
|
137
|
-
/* Colors for form validity
|
122
|
+
/* Colors for form validity */
|
138
123
|
input:valid, textarea:valid { }
|
139
124
|
input:invalid, textarea:invalid {
|
140
|
-
|
125
|
+
border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;
|
141
126
|
}
|
142
127
|
.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
|
143
128
|
|
144
129
|
|
145
|
-
/* These selection declarations have to be separate
|
130
|
+
/* These selection declarations have to be separate
|
146
131
|
No text-shadow: twitter.com/miketaylr/status/12228805301
|
147
|
-
Also: hot pink
|
132
|
+
Also: hot pink! */
|
148
133
|
::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
|
149
134
|
::selection { background:#FF5E99; color:#fff; text-shadow: none; }
|
150
135
|
|
@@ -159,9 +144,26 @@ button { width: auto; overflow: visible; }
|
|
159
144
|
code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
|
160
145
|
.ie7 img { -ms-interpolation-mode: bicubic; }
|
161
146
|
|
147
|
+
/**
|
148
|
+
* You might tweak these..
|
149
|
+
*/
|
150
|
+
|
151
|
+
body, select, input, textarea {
|
152
|
+
/* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
|
153
|
+
color: #444;
|
154
|
+
/* Set your base font here, to apply evenly */
|
155
|
+
/* font-family: Georgia, serif; */
|
156
|
+
}
|
157
|
+
|
158
|
+
/* Headers (h1, h2, etc) have no default font-size or margin; define those yourself */
|
159
|
+
h1, h2, h3, h4, h5, h6 { font-weight: bold; }
|
160
|
+
|
161
|
+
a, a:active, a:visited { color: #607890; }
|
162
|
+
a:hover { color: #036; }
|
163
|
+
|
162
164
|
|
163
165
|
/**
|
164
|
-
* Primary styles
|
166
|
+
* Primary styles
|
165
167
|
*
|
166
168
|
* Author:
|
167
169
|
*/
|
@@ -185,7 +187,7 @@ button { width: auto; overflow: visible; }
|
|
185
187
|
* Non-semantic helper classes: please define your styles before this section.
|
186
188
|
*/
|
187
189
|
|
188
|
-
/* For image replacement
|
190
|
+
/* For image replacement */
|
189
191
|
.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
|
190
192
|
|
191
193
|
/* Hide for both screenreaders and browsers:
|
@@ -195,13 +197,16 @@ button { width: auto; overflow: visible; }
|
|
195
197
|
/* Hide only visually, but have it available for screenreaders: by Jon Neal.
|
196
198
|
www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
|
197
199
|
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
200
|
+
/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: drupal.org/node/897638 */
|
201
|
+
.visuallyhidden.focusable:active,
|
202
|
+
.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
|
198
203
|
|
199
|
-
/* Hide visually and from screenreaders, but maintain layout
|
204
|
+
/* Hide visually and from screenreaders, but maintain layout */
|
200
205
|
.invisible { visibility: hidden; }
|
201
206
|
|
202
207
|
/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements.
|
203
208
|
j.mp/bestclearfix */
|
204
|
-
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0;
|
209
|
+
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
|
205
210
|
.clearfix:after { clear: both; }
|
206
211
|
/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
|
207
212
|
.clearfix { zoom: 1; }
|
@@ -215,12 +220,12 @@ button { width: auto; overflow: visible; }
|
|
215
220
|
*/
|
216
221
|
|
217
222
|
@media all and (orientation:portrait) {
|
218
|
-
/* Style adjustments for portrait mode goes here
|
223
|
+
/* Style adjustments for portrait mode goes here */
|
219
224
|
|
220
225
|
}
|
221
226
|
|
222
227
|
@media all and (orientation:landscape) {
|
223
|
-
/* Style adjustments for landscape mode goes here
|
228
|
+
/* Style adjustments for landscape mode goes here */
|
224
229
|
|
225
230
|
}
|
226
231
|
|
@@ -229,8 +234,7 @@ button { width: auto; overflow: visible; }
|
|
229
234
|
@media screen and (max-device-width: 480px) {
|
230
235
|
|
231
236
|
|
232
|
-
/* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you:
|
233
|
-
j.mp/textsizeadjust */
|
237
|
+
/* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you: j.mp/textsizeadjust */
|
234
238
|
/* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
|
235
239
|
}
|
236
240
|
|
@@ -246,7 +250,7 @@ button { width: auto; overflow: visible; }
|
|
246
250
|
a, a:visited { color: #444 !important; text-decoration: underline; }
|
247
251
|
a[href]:after { content: " (" attr(href) ")"; }
|
248
252
|
abbr[title]:after { content: " (" attr(title) ")"; }
|
249
|
-
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links
|
253
|
+
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
|
250
254
|
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
251
255
|
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
|
252
256
|
tr, img { page-break-inside: avoid; }
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,13 +1,13 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
|
3
|
-
<!--[if lt IE 7 ]> <html class="no-js ie6"> <![endif]-->
|
4
|
-
<!--[if IE 7 ]> <html class="no-js ie7"> <![endif]-->
|
5
|
-
<!--[if IE 8 ]> <html class="no-js ie8"> <![endif]-->
|
6
|
-
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
|
1
|
+
<!doctype html>
|
2
|
+
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
|
3
|
+
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
|
4
|
+
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
|
5
|
+
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
|
6
|
+
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
7
7
|
<head>
|
8
8
|
<meta charset="utf-8">
|
9
9
|
|
10
|
-
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
|
10
|
+
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
|
11
11
|
Remove this if you use the .htaccess -->
|
12
12
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
13
13
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<meta name="description" content="">
|
16
16
|
<meta name="author" content="">
|
17
17
|
|
18
|
-
<!--
|
18
|
+
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
|
19
19
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
20
20
|
|
21
21
|
<!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
|
@@ -23,27 +23,26 @@
|
|
23
23
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
24
24
|
|
25
25
|
|
26
|
-
<!-- CSS
|
26
|
+
<!-- CSS: implied media="all" -->
|
27
27
|
<link rel="stylesheet" href="css/style.css?v=2">
|
28
28
|
|
29
29
|
<!-- Uncomment if you are specifically targeting less enabled mobile browsers
|
30
30
|
<link rel="stylesheet" media="handheld" href="css/handheld.css?v=2"> -->
|
31
|
-
|
31
|
+
|
32
32
|
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
|
33
|
-
<script src="js/libs/modernizr-1.
|
33
|
+
<script src="js/libs/modernizr-1.7.min.js"></script>
|
34
34
|
|
35
35
|
</head>
|
36
36
|
|
37
|
-
<body
|
37
|
+
<body>
|
38
38
|
|
39
39
|
<div id="container">
|
40
40
|
<header>
|
41
41
|
|
42
42
|
</header>
|
43
|
-
|
44
43
|
<div id="main" role="main">
|
44
|
+
|
45
45
|
</div>
|
46
|
-
|
47
46
|
<footer>
|
48
47
|
|
49
48
|
</footer>
|
@@ -52,30 +51,30 @@
|
|
52
51
|
|
53
52
|
<!-- JavaScript at the bottom for fast page loading -->
|
54
53
|
|
55
|
-
<!-- Grab Google CDN's jQuery
|
56
|
-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.
|
57
|
-
<script
|
58
|
-
|
59
|
-
|
54
|
+
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
|
55
|
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
|
56
|
+
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>\x3C/script>")</script>
|
57
|
+
|
58
|
+
|
60
59
|
<!-- scripts concatenated and minified via ant build script-->
|
61
60
|
<script src="js/plugins.js"></script>
|
62
61
|
<script src="js/script.js"></script>
|
63
|
-
<!-- end
|
64
|
-
|
65
|
-
|
62
|
+
<!-- end scripts-->
|
63
|
+
|
64
|
+
|
66
65
|
<!--[if lt IE 7 ]>
|
67
66
|
<script src="js/libs/dd_belatedpng.js"></script>
|
68
|
-
<script>DD_belatedPNG.fix(
|
67
|
+
<script>DD_belatedPNG.fix("img, .png_bg"); // Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb </script>
|
69
68
|
<![endif]-->
|
70
69
|
|
71
70
|
|
72
71
|
<!-- mathiasbynens.be/notes/async-analytics-snippet Change UA-XXXXX-X to be your site's ID -->
|
73
72
|
<script>
|
74
|
-
var _gaq=[[
|
73
|
+
var _gaq=[["_setAccount","UA-XXXXX-X"],["_trackPageview"]];
|
75
74
|
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
|
76
|
-
g.src=(
|
77
|
-
s.parentNode.insertBefore(g,s)}(document,
|
75
|
+
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
|
76
|
+
s.parentNode.insertBefore(g,s)}(document,"script"));
|
78
77
|
</script>
|
79
|
-
|
78
|
+
|
80
79
|
</body>
|
81
80
|
</html>
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* jQuery JavaScript Library v1.5
|
2
|
+
* jQuery JavaScript Library v1.5.1
|
3
3
|
* http://jquery.com/
|
4
4
|
*
|
5
5
|
* Copyright 2011, John Resig
|
@@ -11,7 +11,7 @@
|
|
11
11
|
* Copyright 2011, The Dojo Foundation
|
12
12
|
* Released under the MIT, BSD, and GPL Licenses.
|
13
13
|
*
|
14
|
-
* Date:
|
14
|
+
* Date: Wed Feb 23 13:55:29 2011 -0500
|
15
15
|
*/
|
16
16
|
(function( window, undefined ) {
|
17
17
|
|
@@ -202,7 +202,7 @@ jQuery.fn = jQuery.prototype = {
|
|
202
202
|
selector: "",
|
203
203
|
|
204
204
|
// The current version of jQuery being used
|
205
|
-
jquery: "1.5",
|
205
|
+
jquery: "1.5.1",
|
206
206
|
|
207
207
|
// The default length of a jQuery object is 0
|
208
208
|
length: 0,
|
@@ -313,7 +313,7 @@ jQuery.fn = jQuery.prototype = {
|
|
313
313
|
jQuery.fn.init.prototype = jQuery.fn;
|
314
314
|
|
315
315
|
jQuery.extend = jQuery.fn.extend = function() {
|
316
|
-
|
316
|
+
var options, name, src, copy, copyIsArray, clone,
|
317
317
|
target = arguments[0] || {},
|
318
318
|
i = 1,
|
319
319
|
length = arguments.length,
|
@@ -585,10 +585,8 @@ jQuery.extend({
|
|
585
585
|
if ( data && rnotwhite.test(data) ) {
|
586
586
|
// Inspired by code by Andrea Giammarchi
|
587
587
|
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
588
|
-
var head = document.getElementsByTagName("head")[0] || document.documentElement,
|
589
|
-
script = document.createElement("script");
|
590
|
-
|
591
|
-
script.type = "text/javascript";
|
588
|
+
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
|
589
|
+
script = document.createElement( "script" );
|
592
590
|
|
593
591
|
if ( jQuery.support.scriptEval() ) {
|
594
592
|
script.appendChild( document.createTextNode( data ) );
|
@@ -864,6 +862,12 @@ jQuery.extend({
|
|
864
862
|
callbacks.shift().apply( context, args );
|
865
863
|
}
|
866
864
|
}
|
865
|
+
// We have to add a catch block for
|
866
|
+
// IE prior to 8 or else the finally
|
867
|
+
// block will never get executed
|
868
|
+
catch (e) {
|
869
|
+
throw e;
|
870
|
+
}
|
867
871
|
finally {
|
868
872
|
fired = [ context, args ];
|
869
873
|
firing = 0;
|
@@ -911,22 +915,22 @@ jQuery.extend({
|
|
911
915
|
isRejected: failDeferred.isResolved,
|
912
916
|
// Get a promise for this deferred
|
913
917
|
// If obj is provided, the promise aspect is added to the object
|
914
|
-
promise: function( obj
|
918
|
+
promise: function( obj ) {
|
915
919
|
if ( obj == null ) {
|
916
920
|
if ( promise ) {
|
917
921
|
return promise;
|
918
922
|
}
|
919
923
|
promise = obj = {};
|
920
924
|
}
|
921
|
-
i = promiseMethods.length;
|
925
|
+
var i = promiseMethods.length;
|
922
926
|
while( i-- ) {
|
923
|
-
obj[ promiseMethods[
|
927
|
+
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
|
924
928
|
}
|
925
929
|
return obj;
|
926
930
|
}
|
927
931
|
} );
|
928
932
|
// Make sure only one callback list will be used
|
929
|
-
deferred.
|
933
|
+
deferred.done( failDeferred.cancel ).fail( deferred.cancel );
|
930
934
|
// Unexpose cancel
|
931
935
|
delete deferred.cancel;
|
932
936
|
// Call given func if any
|
@@ -938,24 +942,34 @@ jQuery.extend({
|
|
938
942
|
|
939
943
|
// Deferred helper
|
940
944
|
when: function( object ) {
|
941
|
-
var
|
942
|
-
|
943
|
-
deferred = length <= 1 && object && jQuery.isFunction( object.promise ) ?
|
945
|
+
var lastIndex = arguments.length,
|
946
|
+
deferred = lastIndex <= 1 && object && jQuery.isFunction( object.promise ) ?
|
944
947
|
object :
|
945
948
|
jQuery.Deferred(),
|
946
|
-
promise = deferred.promise()
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
949
|
+
promise = deferred.promise();
|
950
|
+
|
951
|
+
if ( lastIndex > 1 ) {
|
952
|
+
var array = slice.call( arguments, 0 ),
|
953
|
+
count = lastIndex,
|
954
|
+
iCallback = function( index ) {
|
955
|
+
return function( value ) {
|
956
|
+
array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;
|
957
|
+
if ( !( --count ) ) {
|
958
|
+
deferred.resolveWith( promise, array );
|
959
|
+
}
|
960
|
+
};
|
961
|
+
};
|
962
|
+
while( ( lastIndex-- ) ) {
|
963
|
+
object = array[ lastIndex ];
|
964
|
+
if ( object && jQuery.isFunction( object.promise ) ) {
|
965
|
+
object.promise().then( iCallback(lastIndex), deferred.reject );
|
966
|
+
} else {
|
967
|
+
--count;
|
968
|
+
}
|
969
|
+
}
|
970
|
+
if ( !count ) {
|
971
|
+
deferred.resolveWith( promise, array );
|
972
|
+
}
|
959
973
|
} else if ( deferred !== object ) {
|
960
974
|
deferred.resolve( object );
|
961
975
|
}
|
@@ -1071,7 +1085,7 @@ function doScrollCheck() {
|
|
1071
1085
|
}
|
1072
1086
|
|
1073
1087
|
// Expose jQuery to the global object
|
1074
|
-
return
|
1088
|
+
return jQuery;
|
1075
1089
|
|
1076
1090
|
})();
|
1077
1091
|
|
@@ -1088,7 +1102,8 @@ return (window.jQuery = window.$ = jQuery);
|
|
1088
1102
|
var all = div.getElementsByTagName("*"),
|
1089
1103
|
a = div.getElementsByTagName("a")[0],
|
1090
1104
|
select = document.createElement("select"),
|
1091
|
-
opt = select.appendChild( document.createElement("option") )
|
1105
|
+
opt = select.appendChild( document.createElement("option") ),
|
1106
|
+
input = div.getElementsByTagName("input")[0];
|
1092
1107
|
|
1093
1108
|
// Can't get basic test support
|
1094
1109
|
if ( !all || !all.length || !a ) {
|
@@ -1127,7 +1142,7 @@ return (window.jQuery = window.$ = jQuery);
|
|
1127
1142
|
// Make sure that if no value is specified for a checkbox
|
1128
1143
|
// that it defaults to "on".
|
1129
1144
|
// (WebKit defaults to "" instead)
|
1130
|
-
checkOn:
|
1145
|
+
checkOn: input.value === "on",
|
1131
1146
|
|
1132
1147
|
// Make sure that a selected-by-default option has a working selected property.
|
1133
1148
|
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
@@ -1137,26 +1152,29 @@ return (window.jQuery = window.$ = jQuery);
|
|
1137
1152
|
deleteExpando: true,
|
1138
1153
|
optDisabled: false,
|
1139
1154
|
checkClone: false,
|
1140
|
-
_scriptEval: null,
|
1141
1155
|
noCloneEvent: true,
|
1156
|
+
noCloneChecked: true,
|
1142
1157
|
boxModel: null,
|
1143
1158
|
inlineBlockNeedsLayout: false,
|
1144
1159
|
shrinkWrapBlocks: false,
|
1145
1160
|
reliableHiddenOffsets: true
|
1146
1161
|
};
|
1147
1162
|
|
1163
|
+
input.checked = true;
|
1164
|
+
jQuery.support.noCloneChecked = input.cloneNode( true ).checked;
|
1165
|
+
|
1148
1166
|
// Make sure that the options inside disabled selects aren't marked as disabled
|
1149
1167
|
// (WebKit marks them as diabled)
|
1150
1168
|
select.disabled = true;
|
1151
1169
|
jQuery.support.optDisabled = !opt.disabled;
|
1152
1170
|
|
1171
|
+
var _scriptEval = null;
|
1153
1172
|
jQuery.support.scriptEval = function() {
|
1154
|
-
if (
|
1173
|
+
if ( _scriptEval === null ) {
|
1155
1174
|
var root = document.documentElement,
|
1156
1175
|
script = document.createElement("script"),
|
1157
1176
|
id = "script" + jQuery.now();
|
1158
1177
|
|
1159
|
-
script.type = "text/javascript";
|
1160
1178
|
try {
|
1161
1179
|
script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
|
1162
1180
|
} catch(e) {}
|
@@ -1167,10 +1185,10 @@ return (window.jQuery = window.$ = jQuery);
|
|
1167
1185
|
// tag with appendChild/createTextNode
|
1168
1186
|
// (IE doesn't support this, fails, and uses .text instead)
|
1169
1187
|
if ( window[ id ] ) {
|
1170
|
-
|
1188
|
+
_scriptEval = true;
|
1171
1189
|
delete window[ id ];
|
1172
1190
|
} else {
|
1173
|
-
|
1191
|
+
_scriptEval = false;
|
1174
1192
|
}
|
1175
1193
|
|
1176
1194
|
root.removeChild( script );
|
@@ -1178,7 +1196,7 @@ return (window.jQuery = window.$ = jQuery);
|
|
1178
1196
|
root = script = id = null;
|
1179
1197
|
}
|
1180
1198
|
|
1181
|
-
return
|
1199
|
+
return _scriptEval;
|
1182
1200
|
};
|
1183
1201
|
|
1184
1202
|
// Test to see if it's possible to delete an expando from an element
|
@@ -1190,7 +1208,7 @@ return (window.jQuery = window.$ = jQuery);
|
|
1190
1208
|
jQuery.support.deleteExpando = false;
|
1191
1209
|
}
|
1192
1210
|
|
1193
|
-
if ( div.attachEvent && div.fireEvent ) {
|
1211
|
+
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
|
1194
1212
|
div.attachEvent("onclick", function click() {
|
1195
1213
|
// Cloning a node shouldn't copy over any
|
1196
1214
|
// bound event handlers (IE does this)
|
@@ -1321,7 +1339,7 @@ jQuery.extend({
|
|
1321
1339
|
hasData: function( elem ) {
|
1322
1340
|
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
|
1323
1341
|
|
1324
|
-
return !!elem && !
|
1342
|
+
return !!elem && !isEmptyDataObject( elem );
|
1325
1343
|
},
|
1326
1344
|
|
1327
1345
|
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
|
@@ -1361,11 +1379,18 @@ jQuery.extend({
|
|
1361
1379
|
|
1362
1380
|
if ( !cache[ id ] ) {
|
1363
1381
|
cache[ id ] = {};
|
1382
|
+
|
1383
|
+
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
|
1384
|
+
// metadata on plain JS objects when the object is serialized using
|
1385
|
+
// JSON.stringify
|
1386
|
+
if ( !isNode ) {
|
1387
|
+
cache[ id ].toJSON = jQuery.noop;
|
1388
|
+
}
|
1364
1389
|
}
|
1365
1390
|
|
1366
1391
|
// An object can be passed to jQuery.data instead of a key/value pair; this gets
|
1367
1392
|
// shallow copied over onto the existing cache
|
1368
|
-
if ( typeof name === "object" ) {
|
1393
|
+
if ( typeof name === "object" || typeof name === "function" ) {
|
1369
1394
|
if ( pvt ) {
|
1370
1395
|
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
|
1371
1396
|
} else {
|
@@ -1427,7 +1452,7 @@ jQuery.extend({
|
|
1427
1452
|
|
1428
1453
|
// If there is no data left in the cache, we want to continue
|
1429
1454
|
// and let the cache object itself get destroyed
|
1430
|
-
if ( !
|
1455
|
+
if ( !isEmptyDataObject(thisCache) ) {
|
1431
1456
|
return;
|
1432
1457
|
}
|
1433
1458
|
}
|
@@ -1439,7 +1464,7 @@ jQuery.extend({
|
|
1439
1464
|
|
1440
1465
|
// Don't destroy the parent cache unless the internal data object
|
1441
1466
|
// had been the only thing left in it
|
1442
|
-
if ( !
|
1467
|
+
if ( !isEmptyDataObject(cache[ id ]) ) {
|
1443
1468
|
return;
|
1444
1469
|
}
|
1445
1470
|
}
|
@@ -1460,6 +1485,13 @@ jQuery.extend({
|
|
1460
1485
|
// data if it existed
|
1461
1486
|
if ( internalCache ) {
|
1462
1487
|
cache[ id ] = {};
|
1488
|
+
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
|
1489
|
+
// metadata on plain JS objects when the object is serialized using
|
1490
|
+
// JSON.stringify
|
1491
|
+
if ( !isNode ) {
|
1492
|
+
cache[ id ].toJSON = jQuery.noop;
|
1493
|
+
}
|
1494
|
+
|
1463
1495
|
cache[ id ][ internalKey ] = internalCache;
|
1464
1496
|
|
1465
1497
|
// Otherwise, we need to eliminate the expando on the node to avoid
|
@@ -1588,6 +1620,19 @@ function dataAttr( elem, key, data ) {
|
|
1588
1620
|
return data;
|
1589
1621
|
}
|
1590
1622
|
|
1623
|
+
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
|
1624
|
+
// property to be considered empty objects; this property always exists in
|
1625
|
+
// order to make sure JSON.stringify does not expose internal metadata
|
1626
|
+
function isEmptyDataObject( obj ) {
|
1627
|
+
for ( var name in obj ) {
|
1628
|
+
if ( name !== "toJSON" ) {
|
1629
|
+
return false;
|
1630
|
+
}
|
1631
|
+
}
|
1632
|
+
|
1633
|
+
return true;
|
1634
|
+
}
|
1635
|
+
|
1591
1636
|
|
1592
1637
|
|
1593
1638
|
|
@@ -1888,6 +1933,11 @@ jQuery.fn.extend({
|
|
1888
1933
|
}
|
1889
1934
|
}
|
1890
1935
|
|
1936
|
+
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
|
1937
|
+
if ( one && !values.length && options.length ) {
|
1938
|
+
return jQuery( options[ index ] ).val();
|
1939
|
+
}
|
1940
|
+
|
1891
1941
|
return values;
|
1892
1942
|
}
|
1893
1943
|
|
@@ -2081,8 +2131,7 @@ var rnamespaces = /\.(.*)$/,
|
|
2081
2131
|
rescape = /[^\w\s.|`]/g,
|
2082
2132
|
fcleanup = function( nm ) {
|
2083
2133
|
return nm.replace(rescape, "\\$&");
|
2084
|
-
}
|
2085
|
-
eventKey = "events";
|
2134
|
+
};
|
2086
2135
|
|
2087
2136
|
/*
|
2088
2137
|
* A number of helper functions used for managing events.
|
@@ -2098,17 +2147,22 @@ jQuery.event = {
|
|
2098
2147
|
return;
|
2099
2148
|
}
|
2100
2149
|
|
2101
|
-
//
|
2102
|
-
//
|
2103
|
-
|
2104
|
-
|
2150
|
+
// TODO :: Use a try/catch until it's safe to pull this out (likely 1.6)
|
2151
|
+
// Minor release fix for bug #8018
|
2152
|
+
try {
|
2153
|
+
// For whatever reason, IE has trouble passing the window object
|
2154
|
+
// around, causing it to be cloned in the process
|
2155
|
+
if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
|
2156
|
+
elem = window;
|
2157
|
+
}
|
2105
2158
|
}
|
2159
|
+
catch ( e ) {}
|
2106
2160
|
|
2107
2161
|
if ( handler === false ) {
|
2108
2162
|
handler = returnFalse;
|
2109
2163
|
} else if ( !handler ) {
|
2110
2164
|
// Fixes bug #7229. Fix recommended by jdalton
|
2111
|
-
|
2165
|
+
return;
|
2112
2166
|
}
|
2113
2167
|
|
2114
2168
|
var handleObjIn, handleObj;
|
@@ -2132,23 +2186,10 @@ jQuery.event = {
|
|
2132
2186
|
return;
|
2133
2187
|
}
|
2134
2188
|
|
2135
|
-
var events = elemData
|
2189
|
+
var events = elemData.events,
|
2136
2190
|
eventHandle = elemData.handle;
|
2137
2191
|
|
2138
|
-
if (
|
2139
|
-
// On plain objects events is a fn that holds the the data
|
2140
|
-
// which prevents this data from being JSON serialized
|
2141
|
-
// the function does not need to be called, it just contains the data
|
2142
|
-
eventHandle = events.handle;
|
2143
|
-
events = events.events;
|
2144
|
-
|
2145
|
-
} else if ( !events ) {
|
2146
|
-
if ( !elem.nodeType ) {
|
2147
|
-
// On plain objects, create a fn that acts as the holder
|
2148
|
-
// of the values to avoid JSON serialization of event data
|
2149
|
-
elemData[ eventKey ] = elemData = function(){};
|
2150
|
-
}
|
2151
|
-
|
2192
|
+
if ( !events ) {
|
2152
2193
|
elemData.events = events = {};
|
2153
2194
|
}
|
2154
2195
|
|
@@ -2249,17 +2290,12 @@ jQuery.event = {
|
|
2249
2290
|
|
2250
2291
|
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
|
2251
2292
|
elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
|
2252
|
-
events = elemData && elemData
|
2293
|
+
events = elemData && elemData.events;
|
2253
2294
|
|
2254
2295
|
if ( !elemData || !events ) {
|
2255
2296
|
return;
|
2256
2297
|
}
|
2257
2298
|
|
2258
|
-
if ( typeof events === "function" ) {
|
2259
|
-
elemData = events;
|
2260
|
-
events = events.events;
|
2261
|
-
}
|
2262
|
-
|
2263
2299
|
// types is actually an event object here
|
2264
2300
|
if ( types && types.type ) {
|
2265
2301
|
handler = types.handler;
|
@@ -2359,10 +2395,7 @@ jQuery.event = {
|
|
2359
2395
|
delete elemData.events;
|
2360
2396
|
delete elemData.handle;
|
2361
2397
|
|
2362
|
-
if (
|
2363
|
-
jQuery.removeData( elem, eventKey, true );
|
2364
|
-
|
2365
|
-
} else if ( jQuery.isEmptyObject( elemData ) ) {
|
2398
|
+
if ( jQuery.isEmptyObject( elemData ) ) {
|
2366
2399
|
jQuery.removeData( elem, undefined, true );
|
2367
2400
|
}
|
2368
2401
|
}
|
@@ -2403,7 +2436,7 @@ jQuery.event = {
|
|
2403
2436
|
// points to jQuery.expando
|
2404
2437
|
var internalKey = jQuery.expando,
|
2405
2438
|
internalCache = this[ internalKey ];
|
2406
|
-
if ( internalCache && internalCache.events && internalCache.events[type] ) {
|
2439
|
+
if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
|
2407
2440
|
jQuery.event.trigger( event, data, internalCache.handle.elem );
|
2408
2441
|
}
|
2409
2442
|
});
|
@@ -2429,9 +2462,7 @@ jQuery.event = {
|
|
2429
2462
|
event.currentTarget = elem;
|
2430
2463
|
|
2431
2464
|
// Trigger the event, it is assumed that "handle" is a function
|
2432
|
-
var handle =
|
2433
|
-
jQuery._data( elem, "handle" ) :
|
2434
|
-
(jQuery._data( elem, eventKey ) || {}).handle;
|
2465
|
+
var handle = jQuery._data( elem, "handle" );
|
2435
2466
|
|
2436
2467
|
if ( handle ) {
|
2437
2468
|
handle.apply( elem, data );
|
@@ -2509,11 +2540,7 @@ jQuery.event = {
|
|
2509
2540
|
|
2510
2541
|
event.namespace = event.namespace || namespace_sort.join(".");
|
2511
2542
|
|
2512
|
-
events = jQuery._data(this,
|
2513
|
-
|
2514
|
-
if ( typeof events === "function" ) {
|
2515
|
-
events = events.events;
|
2516
|
-
}
|
2543
|
+
events = jQuery._data(this, "events");
|
2517
2544
|
|
2518
2545
|
handlers = (events || {})[ event.type ];
|
2519
2546
|
|
@@ -2680,7 +2707,7 @@ jQuery.Event = function( src ) {
|
|
2680
2707
|
|
2681
2708
|
// Events bubbling up the document may have been marked as prevented
|
2682
2709
|
// by a handler lower down the tree; reflect the correct value.
|
2683
|
-
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
|
2710
|
+
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
|
2684
2711
|
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
|
2685
2712
|
|
2686
2713
|
// Event type
|
@@ -2755,6 +2782,12 @@ var withinElement = function( event ) {
|
|
2755
2782
|
// Firefox sometimes assigns relatedTarget a XUL element
|
2756
2783
|
// which we cannot access the parentNode property of
|
2757
2784
|
try {
|
2785
|
+
|
2786
|
+
// Chrome does something similar, the parentNode property
|
2787
|
+
// can be accessed but is null.
|
2788
|
+
if ( parent !== document && !parent.parentNode ) {
|
2789
|
+
return;
|
2790
|
+
}
|
2758
2791
|
// Traverse up the tree
|
2759
2792
|
while ( parent && parent !== this ) {
|
2760
2793
|
parent = parent.parentNode;
|
@@ -2805,8 +2838,7 @@ if ( !jQuery.support.submitBubbles ) {
|
|
2805
2838
|
type = elem.type;
|
2806
2839
|
|
2807
2840
|
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
|
2808
|
-
|
2809
|
-
return trigger( "submit", this, arguments );
|
2841
|
+
trigger( "submit", this, arguments );
|
2810
2842
|
}
|
2811
2843
|
});
|
2812
2844
|
|
@@ -2815,8 +2847,7 @@ if ( !jQuery.support.submitBubbles ) {
|
|
2815
2847
|
type = elem.type;
|
2816
2848
|
|
2817
2849
|
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
|
2818
|
-
|
2819
|
-
return trigger( "submit", this, arguments );
|
2850
|
+
trigger( "submit", this, arguments );
|
2820
2851
|
}
|
2821
2852
|
});
|
2822
2853
|
|
@@ -2879,7 +2910,7 @@ if ( !jQuery.support.changeBubbles ) {
|
|
2879
2910
|
if ( data != null || val ) {
|
2880
2911
|
e.type = "change";
|
2881
2912
|
e.liveFired = undefined;
|
2882
|
-
|
2913
|
+
jQuery.event.trigger( e, arguments[1], elem );
|
2883
2914
|
}
|
2884
2915
|
};
|
2885
2916
|
|
@@ -2893,7 +2924,7 @@ if ( !jQuery.support.changeBubbles ) {
|
|
2893
2924
|
var elem = e.target, type = elem.type;
|
2894
2925
|
|
2895
2926
|
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
|
2896
|
-
|
2927
|
+
testChange.call( this, e );
|
2897
2928
|
}
|
2898
2929
|
},
|
2899
2930
|
|
@@ -2905,7 +2936,7 @@ if ( !jQuery.support.changeBubbles ) {
|
|
2905
2936
|
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
|
2906
2937
|
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
|
2907
2938
|
type === "select-multiple" ) {
|
2908
|
-
|
2939
|
+
testChange.call( this, e );
|
2909
2940
|
}
|
2910
2941
|
},
|
2911
2942
|
|
@@ -2944,8 +2975,18 @@ if ( !jQuery.support.changeBubbles ) {
|
|
2944
2975
|
}
|
2945
2976
|
|
2946
2977
|
function trigger( type, elem, args ) {
|
2947
|
-
|
2948
|
-
|
2978
|
+
// Piggyback on a donor event to simulate a different one.
|
2979
|
+
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
2980
|
+
// simulated event prevents default then we do the same on the donor.
|
2981
|
+
// Don't pass args or remember liveFired; they apply to the donor event.
|
2982
|
+
var event = jQuery.extend( {}, args[ 0 ] );
|
2983
|
+
event.type = type;
|
2984
|
+
event.originalEvent = {};
|
2985
|
+
event.liveFired = undefined;
|
2986
|
+
jQuery.event.handle.call( elem, event );
|
2987
|
+
if ( event.isDefaultPrevented() ) {
|
2988
|
+
args[ 0 ].preventDefault();
|
2989
|
+
}
|
2949
2990
|
}
|
2950
2991
|
|
2951
2992
|
// Create "bubbling" focus and blur events
|
@@ -2954,8 +2995,8 @@ if ( document.addEventListener ) {
|
|
2954
2995
|
jQuery.event.special[ fix ] = {
|
2955
2996
|
setup: function() {
|
2956
2997
|
this.addEventListener( orig, handler, true );
|
2957
|
-
},
|
2958
|
-
teardown: function() {
|
2998
|
+
},
|
2999
|
+
teardown: function() {
|
2959
3000
|
this.removeEventListener( orig, handler, true );
|
2960
3001
|
}
|
2961
3002
|
};
|
@@ -3148,11 +3189,7 @@ function liveHandler( event ) {
|
|
3148
3189
|
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
|
3149
3190
|
elems = [],
|
3150
3191
|
selectors = [],
|
3151
|
-
events = jQuery._data( this,
|
3152
|
-
|
3153
|
-
if ( typeof events === "function" ) {
|
3154
|
-
events = events.events;
|
3155
|
-
}
|
3192
|
+
events = jQuery._data( this, "events" );
|
3156
3193
|
|
3157
3194
|
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
|
3158
3195
|
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
|
@@ -3186,7 +3223,7 @@ function liveHandler( event ) {
|
|
3186
3223
|
for ( j = 0; j < live.length; j++ ) {
|
3187
3224
|
handleObj = live[j];
|
3188
3225
|
|
3189
|
-
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
|
3226
|
+
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
|
3190
3227
|
elem = close.elem;
|
3191
3228
|
related = null;
|
3192
3229
|
|
@@ -3269,7 +3306,9 @@ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[
|
|
3269
3306
|
done = 0,
|
3270
3307
|
toString = Object.prototype.toString,
|
3271
3308
|
hasDuplicate = false,
|
3272
|
-
baseHasDuplicate = true
|
3309
|
+
baseHasDuplicate = true,
|
3310
|
+
rBackslash = /\\/g,
|
3311
|
+
rNonWord = /\W/;
|
3273
3312
|
|
3274
3313
|
// Here we check if the JavaScript engine is using some sort of
|
3275
3314
|
// optimization where it does not always call our comparision
|
@@ -3468,7 +3507,7 @@ Sizzle.find = function( expr, context, isXML ) {
|
|
3468
3507
|
match.splice( 1, 1 );
|
3469
3508
|
|
3470
3509
|
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
3471
|
-
match[1] = (match[1] || "").replace(
|
3510
|
+
match[1] = (match[1] || "").replace( rBackslash, "" );
|
3472
3511
|
set = Expr.find[ type ]( match, context, isXML );
|
3473
3512
|
|
3474
3513
|
if ( set != null ) {
|
@@ -3607,13 +3646,16 @@ var Expr = Sizzle.selectors = {
|
|
3607
3646
|
attrHandle: {
|
3608
3647
|
href: function( elem ) {
|
3609
3648
|
return elem.getAttribute( "href" );
|
3649
|
+
},
|
3650
|
+
type: function( elem ) {
|
3651
|
+
return elem.getAttribute( "type" );
|
3610
3652
|
}
|
3611
3653
|
},
|
3612
3654
|
|
3613
3655
|
relative: {
|
3614
3656
|
"+": function(checkSet, part){
|
3615
3657
|
var isPartStr = typeof part === "string",
|
3616
|
-
isTag = isPartStr &&
|
3658
|
+
isTag = isPartStr && !rNonWord.test( part ),
|
3617
3659
|
isPartStrNotTag = isPartStr && !isTag;
|
3618
3660
|
|
3619
3661
|
if ( isTag ) {
|
@@ -3641,7 +3683,7 @@ var Expr = Sizzle.selectors = {
|
|
3641
3683
|
i = 0,
|
3642
3684
|
l = checkSet.length;
|
3643
3685
|
|
3644
|
-
if ( isPartStr &&
|
3686
|
+
if ( isPartStr && !rNonWord.test( part ) ) {
|
3645
3687
|
part = part.toLowerCase();
|
3646
3688
|
|
3647
3689
|
for ( ; i < l; i++ ) {
|
@@ -3675,7 +3717,7 @@ var Expr = Sizzle.selectors = {
|
|
3675
3717
|
doneName = done++,
|
3676
3718
|
checkFn = dirCheck;
|
3677
3719
|
|
3678
|
-
if ( typeof part === "string" &&
|
3720
|
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
3679
3721
|
part = part.toLowerCase();
|
3680
3722
|
nodeCheck = part;
|
3681
3723
|
checkFn = dirNodeCheck;
|
@@ -3689,7 +3731,7 @@ var Expr = Sizzle.selectors = {
|
|
3689
3731
|
doneName = done++,
|
3690
3732
|
checkFn = dirCheck;
|
3691
3733
|
|
3692
|
-
if ( typeof part === "string" &&
|
3734
|
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
3693
3735
|
part = part.toLowerCase();
|
3694
3736
|
nodeCheck = part;
|
3695
3737
|
checkFn = dirNodeCheck;
|
@@ -3732,7 +3774,7 @@ var Expr = Sizzle.selectors = {
|
|
3732
3774
|
},
|
3733
3775
|
preFilter: {
|
3734
3776
|
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
3735
|
-
match = " " + match[1].replace(
|
3777
|
+
match = " " + match[1].replace( rBackslash, "" ) + " ";
|
3736
3778
|
|
3737
3779
|
if ( isXML ) {
|
3738
3780
|
return match;
|
@@ -3755,11 +3797,11 @@ var Expr = Sizzle.selectors = {
|
|
3755
3797
|
},
|
3756
3798
|
|
3757
3799
|
ID: function( match ) {
|
3758
|
-
return match[1].replace(
|
3800
|
+
return match[1].replace( rBackslash, "" );
|
3759
3801
|
},
|
3760
3802
|
|
3761
3803
|
TAG: function( match, curLoop ) {
|
3762
|
-
return match[1].toLowerCase();
|
3804
|
+
return match[1].replace( rBackslash, "" ).toLowerCase();
|
3763
3805
|
},
|
3764
3806
|
|
3765
3807
|
CHILD: function( match ) {
|
@@ -3790,14 +3832,14 @@ var Expr = Sizzle.selectors = {
|
|
3790
3832
|
},
|
3791
3833
|
|
3792
3834
|
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
3793
|
-
var name = match[1] = match[1].replace(
|
3835
|
+
var name = match[1] = match[1].replace( rBackslash, "" );
|
3794
3836
|
|
3795
3837
|
if ( !isXML && Expr.attrMap[name] ) {
|
3796
3838
|
match[1] = Expr.attrMap[name];
|
3797
3839
|
}
|
3798
3840
|
|
3799
3841
|
// Handle if an un-quoted value was used
|
3800
|
-
match[4] = ( match[4] || match[5] || "" ).replace(
|
3842
|
+
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
|
3801
3843
|
|
3802
3844
|
if ( match[2] === "~=" ) {
|
3803
3845
|
match[4] = " " + match[4] + " ";
|
@@ -3852,7 +3894,9 @@ var Expr = Sizzle.selectors = {
|
|
3852
3894
|
selected: function( elem ) {
|
3853
3895
|
// Accessing this property makes selected-by-default
|
3854
3896
|
// options in Safari work properly
|
3855
|
-
elem.parentNode
|
3897
|
+
if ( elem.parentNode ) {
|
3898
|
+
elem.parentNode.selectedIndex;
|
3899
|
+
}
|
3856
3900
|
|
3857
3901
|
return elem.selected === true;
|
3858
3902
|
},
|
@@ -3874,7 +3918,9 @@ var Expr = Sizzle.selectors = {
|
|
3874
3918
|
},
|
3875
3919
|
|
3876
3920
|
text: function( elem ) {
|
3877
|
-
|
3921
|
+
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
|
3922
|
+
// use getAttribute instead to test this case
|
3923
|
+
return "text" === elem.getAttribute( 'type' );
|
3878
3924
|
},
|
3879
3925
|
radio: function( elem ) {
|
3880
3926
|
return "radio" === elem.type;
|
@@ -4407,7 +4453,8 @@ if ( document.querySelectorAll ) {
|
|
4407
4453
|
// and working up from there (Thanks to Andrew Dupont for the technique)
|
4408
4454
|
// IE 8 doesn't work on object elements
|
4409
4455
|
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
4410
|
-
var
|
4456
|
+
var oldContext = context,
|
4457
|
+
old = context.getAttribute( "id" ),
|
4411
4458
|
nid = old || id,
|
4412
4459
|
hasParent = context.parentNode,
|
4413
4460
|
relativeHierarchySelector = /^\s*[+~]/.test( query );
|
@@ -4429,7 +4476,7 @@ if ( document.querySelectorAll ) {
|
|
4429
4476
|
} catch(pseudoError) {
|
4430
4477
|
} finally {
|
4431
4478
|
if ( !old ) {
|
4432
|
-
|
4479
|
+
oldContext.removeAttribute( "id" );
|
4433
4480
|
}
|
4434
4481
|
}
|
4435
4482
|
}
|
@@ -4845,11 +4892,11 @@ jQuery.each({
|
|
4845
4892
|
}, function( name, fn ) {
|
4846
4893
|
jQuery.fn[ name ] = function( until, selector ) {
|
4847
4894
|
var ret = jQuery.map( this, fn, until ),
|
4848
|
-
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4852
|
-
|
4895
|
+
// The variable 'args' was introduced in
|
4896
|
+
// https://github.com/jquery/jquery/commit/52a0238
|
4897
|
+
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
|
4898
|
+
// http://code.google.com/p/v8/issues/detail?id=1050
|
4899
|
+
args = slice.call(arguments);
|
4853
4900
|
|
4854
4901
|
if ( !runtil.test( name ) ) {
|
4855
4902
|
selector = until;
|
@@ -4959,7 +5006,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
|
4959
5006
|
rtbody = /<tbody/i,
|
4960
5007
|
rhtml = /<|&#?\w+;/,
|
4961
5008
|
rnocache = /<(?:script|object|embed|option|style)/i,
|
4962
|
-
// checked="checked" or checked
|
5009
|
+
// checked="checked" or checked
|
4963
5010
|
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
4964
5011
|
wrapMap = {
|
4965
5012
|
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
@@ -5111,7 +5158,7 @@ jQuery.fn.extend({
|
|
5111
5158
|
}
|
5112
5159
|
|
5113
5160
|
if ( elem.parentNode ) {
|
5114
|
-
|
5161
|
+
elem.parentNode.removeChild( elem );
|
5115
5162
|
}
|
5116
5163
|
}
|
5117
5164
|
}
|
@@ -5136,7 +5183,7 @@ jQuery.fn.extend({
|
|
5136
5183
|
},
|
5137
5184
|
|
5138
5185
|
clone: function( dataAndEvents, deepDataAndEvents ) {
|
5139
|
-
dataAndEvents = dataAndEvents == null ?
|
5186
|
+
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5140
5187
|
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5141
5188
|
|
5142
5189
|
return this.map( function () {
|
@@ -5305,8 +5352,8 @@ function cloneCopyEvent( src, dest ) {
|
|
5305
5352
|
}
|
5306
5353
|
|
5307
5354
|
var internalKey = jQuery.expando,
|
5308
|
-
|
5309
|
-
|
5355
|
+
oldData = jQuery.data( src ),
|
5356
|
+
curData = jQuery.data( dest, oldData );
|
5310
5357
|
|
5311
5358
|
// Switch to use the internal data object, if it exists, for the next
|
5312
5359
|
// stage of data copying
|
@@ -5320,7 +5367,7 @@ function cloneCopyEvent( src, dest ) {
|
|
5320
5367
|
|
5321
5368
|
for ( var type in events ) {
|
5322
5369
|
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
|
5323
|
-
jQuery.event.add( dest, type, events[ type ][ i ], events[ type ][ i ].data );
|
5370
|
+
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
|
5324
5371
|
}
|
5325
5372
|
}
|
5326
5373
|
}
|
@@ -5441,6 +5488,18 @@ jQuery.each({
|
|
5441
5488
|
};
|
5442
5489
|
});
|
5443
5490
|
|
5491
|
+
function getAll( elem ) {
|
5492
|
+
if ( "getElementsByTagName" in elem ) {
|
5493
|
+
return elem.getElementsByTagName( "*" );
|
5494
|
+
|
5495
|
+
} else if ( "querySelectorAll" in elem ) {
|
5496
|
+
return elem.querySelectorAll( "*" );
|
5497
|
+
|
5498
|
+
} else {
|
5499
|
+
return [];
|
5500
|
+
}
|
5501
|
+
}
|
5502
|
+
|
5444
5503
|
jQuery.extend({
|
5445
5504
|
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
5446
5505
|
var clone = elem.cloneNode(true),
|
@@ -5448,17 +5507,20 @@ jQuery.extend({
|
|
5448
5507
|
destElements,
|
5449
5508
|
i;
|
5450
5509
|
|
5451
|
-
if ( !jQuery.support.noCloneEvent
|
5510
|
+
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
|
5511
|
+
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
5452
5512
|
// IE copies events bound via attachEvent when using cloneNode.
|
5453
5513
|
// Calling detachEvent on the clone will also remove the events
|
5454
5514
|
// from the original. In order to get around this, we use some
|
5455
5515
|
// proprietary methods to clear the events. Thanks to MooTools
|
5456
5516
|
// guys for this hotness.
|
5457
5517
|
|
5518
|
+
cloneFixAttributes( elem, clone );
|
5519
|
+
|
5458
5520
|
// Using Sizzle here is crazy slow, so we use getElementsByTagName
|
5459
5521
|
// instead
|
5460
|
-
srcElements = elem
|
5461
|
-
destElements = clone
|
5522
|
+
srcElements = getAll( elem );
|
5523
|
+
destElements = getAll( clone );
|
5462
5524
|
|
5463
5525
|
// Weird iteration because IE will replace the length property
|
5464
5526
|
// with an element if you are cloning the body and one of the
|
@@ -5466,30 +5528,25 @@ jQuery.extend({
|
|
5466
5528
|
for ( i = 0; srcElements[i]; ++i ) {
|
5467
5529
|
cloneFixAttributes( srcElements[i], destElements[i] );
|
5468
5530
|
}
|
5469
|
-
|
5470
|
-
cloneFixAttributes( elem, clone );
|
5471
5531
|
}
|
5472
5532
|
|
5473
5533
|
// Copy the events from the original to the clone
|
5474
5534
|
if ( dataAndEvents ) {
|
5475
|
-
|
5476
5535
|
cloneCopyEvent( elem, clone );
|
5477
5536
|
|
5478
|
-
if ( deepDataAndEvents
|
5537
|
+
if ( deepDataAndEvents ) {
|
5538
|
+
srcElements = getAll( elem );
|
5539
|
+
destElements = getAll( clone );
|
5479
5540
|
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
if ( srcElements.length ) {
|
5484
|
-
for ( i = 0; srcElements[i]; ++i ) {
|
5485
|
-
cloneCopyEvent( srcElements[i], destElements[i] );
|
5486
|
-
}
|
5541
|
+
for ( i = 0; srcElements[i]; ++i ) {
|
5542
|
+
cloneCopyEvent( srcElements[i], destElements[i] );
|
5487
5543
|
}
|
5488
5544
|
}
|
5489
5545
|
}
|
5546
|
+
|
5490
5547
|
// Return the cloned set
|
5491
5548
|
return clone;
|
5492
|
-
|
5549
|
+
},
|
5493
5550
|
clean: function( elems, context, fragment, scripts ) {
|
5494
5551
|
context = context || document;
|
5495
5552
|
|
@@ -5910,7 +5967,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
|
5910
5967
|
|
5911
5968
|
if ( document.documentElement.currentStyle ) {
|
5912
5969
|
currentStyle = function( elem, name ) {
|
5913
|
-
var left,
|
5970
|
+
var left,
|
5914
5971
|
ret = elem.currentStyle && elem.currentStyle[ name ],
|
5915
5972
|
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
|
5916
5973
|
style = elem.style;
|
@@ -5988,8 +6045,10 @@ var r20 = /%20/g,
|
|
5988
6045
|
rbracket = /\[\]$/,
|
5989
6046
|
rCRLF = /\r?\n/g,
|
5990
6047
|
rhash = /#.*$/,
|
5991
|
-
rheaders = /^(.*?)
|
6048
|
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
5992
6049
|
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
6050
|
+
// #7653, #8125, #8152: local protocol detection
|
6051
|
+
rlocalProtocol = /(?:^file|^widget|\-extension):$/,
|
5993
6052
|
rnoContent = /^(?:GET|HEAD)$/,
|
5994
6053
|
rprotocol = /^\/\//,
|
5995
6054
|
rquery = /\?/,
|
@@ -5997,7 +6056,11 @@ var r20 = /%20/g,
|
|
5997
6056
|
rselectTextarea = /^(?:select|textarea)/i,
|
5998
6057
|
rspacesAjax = /\s+/,
|
5999
6058
|
rts = /([?&])_=[^&]*/,
|
6000
|
-
|
6059
|
+
rucHeaders = /(^|\-)([a-z])/g,
|
6060
|
+
rucHeadersFunc = function( _, $1, $2 ) {
|
6061
|
+
return $1 + $2.toUpperCase();
|
6062
|
+
},
|
6063
|
+
rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,
|
6001
6064
|
|
6002
6065
|
// Keep a copy of the old load method
|
6003
6066
|
_load = jQuery.fn.load,
|
@@ -6018,7 +6081,28 @@ var r20 = /%20/g,
|
|
6018
6081
|
* 2) the catchall symbol "*" can be used
|
6019
6082
|
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
6020
6083
|
*/
|
6021
|
-
transports = {}
|
6084
|
+
transports = {},
|
6085
|
+
|
6086
|
+
// Document location
|
6087
|
+
ajaxLocation,
|
6088
|
+
|
6089
|
+
// Document location segments
|
6090
|
+
ajaxLocParts;
|
6091
|
+
|
6092
|
+
// #8138, IE may throw an exception when accessing
|
6093
|
+
// a field from document.location if document.domain has been set
|
6094
|
+
try {
|
6095
|
+
ajaxLocation = document.location.href;
|
6096
|
+
} catch( e ) {
|
6097
|
+
// Use the href attribute of an A element
|
6098
|
+
// since IE will modify it given document.location
|
6099
|
+
ajaxLocation = document.createElement( "a" );
|
6100
|
+
ajaxLocation.href = "";
|
6101
|
+
ajaxLocation = ajaxLocation.href;
|
6102
|
+
}
|
6103
|
+
|
6104
|
+
// Segment location into parts
|
6105
|
+
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() );
|
6022
6106
|
|
6023
6107
|
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
6024
6108
|
function addToPrefiltersOrTransports( structure ) {
|
@@ -6057,7 +6141,7 @@ function addToPrefiltersOrTransports( structure ) {
|
|
6057
6141
|
}
|
6058
6142
|
|
6059
6143
|
//Base inspection function for prefilters and transports
|
6060
|
-
function inspectPrefiltersOrTransports( structure, options, originalOptions,
|
6144
|
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
|
6061
6145
|
dataType /* internal */, inspected /* internal */ ) {
|
6062
6146
|
|
6063
6147
|
dataType = dataType || options.dataTypes[ 0 ];
|
@@ -6072,16 +6156,16 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jXH
|
|
6072
6156
|
selection;
|
6073
6157
|
|
6074
6158
|
for(; i < length && ( executeOnly || !selection ); i++ ) {
|
6075
|
-
selection = list[ i ]( options, originalOptions,
|
6159
|
+
selection = list[ i ]( options, originalOptions, jqXHR );
|
6076
6160
|
// If we got redirected to another dataType
|
6077
|
-
// we try there if not done already
|
6161
|
+
// we try there if executing only and not done already
|
6078
6162
|
if ( typeof selection === "string" ) {
|
6079
|
-
if ( inspected[ selection ] ) {
|
6163
|
+
if ( !executeOnly || inspected[ selection ] ) {
|
6080
6164
|
selection = undefined;
|
6081
6165
|
} else {
|
6082
6166
|
options.dataTypes.unshift( selection );
|
6083
6167
|
selection = inspectPrefiltersOrTransports(
|
6084
|
-
structure, options, originalOptions,
|
6168
|
+
structure, options, originalOptions, jqXHR, selection, inspected );
|
6085
6169
|
}
|
6086
6170
|
}
|
6087
6171
|
}
|
@@ -6089,7 +6173,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jXH
|
|
6089
6173
|
// we try the catchall dataType if not done already
|
6090
6174
|
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
|
6091
6175
|
selection = inspectPrefiltersOrTransports(
|
6092
|
-
structure, options, originalOptions,
|
6176
|
+
structure, options, originalOptions, jqXHR, "*", inspected );
|
6093
6177
|
}
|
6094
6178
|
// unnecessary when only executing (prefilters)
|
6095
6179
|
// but it'll be ignored by the caller in that case
|
@@ -6121,7 +6205,7 @@ jQuery.fn.extend({
|
|
6121
6205
|
if ( jQuery.isFunction( params ) ) {
|
6122
6206
|
// We assume that it's the callback
|
6123
6207
|
callback = params;
|
6124
|
-
params =
|
6208
|
+
params = undefined;
|
6125
6209
|
|
6126
6210
|
// Otherwise, build a param string
|
6127
6211
|
} else if ( typeof params === "object" ) {
|
@@ -6139,14 +6223,14 @@ jQuery.fn.extend({
|
|
6139
6223
|
dataType: "html",
|
6140
6224
|
data: params,
|
6141
6225
|
// Complete callback (responseText is used internally)
|
6142
|
-
complete: function(
|
6143
|
-
// Store the response as specified by the
|
6144
|
-
responseText =
|
6226
|
+
complete: function( jqXHR, status, responseText ) {
|
6227
|
+
// Store the response as specified by the jqXHR object
|
6228
|
+
responseText = jqXHR.responseText;
|
6145
6229
|
// If successful, inject the HTML into all the matched elements
|
6146
|
-
if (
|
6230
|
+
if ( jqXHR.isResolved() ) {
|
6147
6231
|
// #4825: Get the actual response in case
|
6148
6232
|
// a dataFilter is present in ajaxSettings
|
6149
|
-
|
6233
|
+
jqXHR.done(function( r ) {
|
6150
6234
|
responseText = r;
|
6151
6235
|
});
|
6152
6236
|
// See if a selector was specified
|
@@ -6165,7 +6249,7 @@ jQuery.fn.extend({
|
|
6165
6249
|
}
|
6166
6250
|
|
6167
6251
|
if ( callback ) {
|
6168
|
-
self.each( callback, [ responseText, status,
|
6252
|
+
self.each( callback, [ responseText, status, jqXHR ] );
|
6169
6253
|
}
|
6170
6254
|
}
|
6171
6255
|
});
|
@@ -6213,7 +6297,7 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
|
6213
6297
|
if ( jQuery.isFunction( data ) ) {
|
6214
6298
|
type = type || callback;
|
6215
6299
|
callback = data;
|
6216
|
-
data =
|
6300
|
+
data = undefined;
|
6217
6301
|
}
|
6218
6302
|
|
6219
6303
|
return jQuery.ajax({
|
@@ -6229,22 +6313,39 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
|
6229
6313
|
jQuery.extend({
|
6230
6314
|
|
6231
6315
|
getScript: function( url, callback ) {
|
6232
|
-
return jQuery.get( url,
|
6316
|
+
return jQuery.get( url, undefined, callback, "script" );
|
6233
6317
|
},
|
6234
6318
|
|
6235
6319
|
getJSON: function( url, data, callback ) {
|
6236
6320
|
return jQuery.get( url, data, callback, "json" );
|
6237
6321
|
},
|
6238
6322
|
|
6239
|
-
|
6240
|
-
|
6241
|
-
|
6242
|
-
|
6323
|
+
// Creates a full fledged settings object into target
|
6324
|
+
// with both ajaxSettings and settings fields.
|
6325
|
+
// If target is omitted, writes into ajaxSettings.
|
6326
|
+
ajaxSetup: function ( target, settings ) {
|
6327
|
+
if ( !settings ) {
|
6328
|
+
// Only one parameter, we extend ajaxSettings
|
6329
|
+
settings = target;
|
6330
|
+
target = jQuery.extend( true, jQuery.ajaxSettings, settings );
|
6331
|
+
} else {
|
6332
|
+
// target was provided, we extend into it
|
6333
|
+
jQuery.extend( true, target, jQuery.ajaxSettings, settings );
|
6243
6334
|
}
|
6335
|
+
// Flatten fields we don't want deep extended
|
6336
|
+
for( var field in { context: 1, url: 1 } ) {
|
6337
|
+
if ( field in settings ) {
|
6338
|
+
target[ field ] = settings[ field ];
|
6339
|
+
} else if( field in jQuery.ajaxSettings ) {
|
6340
|
+
target[ field ] = jQuery.ajaxSettings[ field ];
|
6341
|
+
}
|
6342
|
+
}
|
6343
|
+
return target;
|
6244
6344
|
},
|
6245
6345
|
|
6246
6346
|
ajaxSettings: {
|
6247
|
-
url:
|
6347
|
+
url: ajaxLocation,
|
6348
|
+
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
6248
6349
|
global: true,
|
6249
6350
|
type: "GET",
|
6250
6351
|
contentType: "application/x-www-form-urlencoded",
|
@@ -6306,9 +6407,8 @@ jQuery.extend({
|
|
6306
6407
|
// Main method
|
6307
6408
|
ajax: function( url, options ) {
|
6308
6409
|
|
6309
|
-
// If
|
6310
|
-
|
6311
|
-
if ( typeof options !== "object" ) {
|
6410
|
+
// If url is an object, simulate pre-1.5 signature
|
6411
|
+
if ( typeof url === "object" ) {
|
6312
6412
|
options = url;
|
6313
6413
|
url = undefined;
|
6314
6414
|
}
|
@@ -6317,19 +6417,22 @@ jQuery.extend({
|
|
6317
6417
|
options = options || {};
|
6318
6418
|
|
6319
6419
|
var // Create the final options object
|
6320
|
-
s = jQuery.
|
6321
|
-
// Callbacks
|
6322
|
-
|
6323
|
-
//
|
6324
|
-
//
|
6325
|
-
|
6326
|
-
|
6327
|
-
|
6420
|
+
s = jQuery.ajaxSetup( {}, options ),
|
6421
|
+
// Callbacks context
|
6422
|
+
callbackContext = s.context || s,
|
6423
|
+
// Context for global events
|
6424
|
+
// It's the callbackContext if one was provided in the options
|
6425
|
+
// and if it's a DOM node or a jQuery collection
|
6426
|
+
globalEventContext = callbackContext !== s &&
|
6427
|
+
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
|
6428
|
+
jQuery( callbackContext ) : jQuery.event,
|
6328
6429
|
// Deferreds
|
6329
6430
|
deferred = jQuery.Deferred(),
|
6330
6431
|
completeDeferred = jQuery._Deferred(),
|
6331
6432
|
// Status-dependent callbacks
|
6332
6433
|
statusCode = s.statusCode || {},
|
6434
|
+
// ifModified key
|
6435
|
+
ifModifiedKey,
|
6333
6436
|
// Headers (they are sent all at once)
|
6334
6437
|
requestHeaders = {},
|
6335
6438
|
// Response headers
|
@@ -6340,22 +6443,22 @@ jQuery.extend({
|
|
6340
6443
|
// timeout handle
|
6341
6444
|
timeoutTimer,
|
6342
6445
|
// Cross-domain detection vars
|
6343
|
-
loc = document.location,
|
6344
|
-
protocol = loc.protocol || "http:",
|
6345
6446
|
parts,
|
6346
|
-
// The
|
6447
|
+
// The jqXHR state
|
6347
6448
|
state = 0,
|
6449
|
+
// To know if global events are to be dispatched
|
6450
|
+
fireGlobals,
|
6348
6451
|
// Loop variable
|
6349
6452
|
i,
|
6350
6453
|
// Fake xhr
|
6351
|
-
|
6454
|
+
jqXHR = {
|
6352
6455
|
|
6353
6456
|
readyState: 0,
|
6354
6457
|
|
6355
6458
|
// Caches the header
|
6356
6459
|
setRequestHeader: function( name, value ) {
|
6357
|
-
if ( state
|
6358
|
-
requestHeaders[ name.toLowerCase() ] = value;
|
6460
|
+
if ( !state ) {
|
6461
|
+
requestHeaders[ name.toLowerCase().replace( rucHeaders, rucHeadersFunc ) ] = value;
|
6359
6462
|
}
|
6360
6463
|
return this;
|
6361
6464
|
},
|
@@ -6377,7 +6480,15 @@ jQuery.extend({
|
|
6377
6480
|
}
|
6378
6481
|
match = responseHeaders[ key.toLowerCase() ];
|
6379
6482
|
}
|
6380
|
-
return match
|
6483
|
+
return match === undefined ? null : match;
|
6484
|
+
},
|
6485
|
+
|
6486
|
+
// Overrides response content-type header
|
6487
|
+
overrideMimeType: function( type ) {
|
6488
|
+
if ( !state ) {
|
6489
|
+
s.mimeType = type;
|
6490
|
+
}
|
6491
|
+
return this;
|
6381
6492
|
},
|
6382
6493
|
|
6383
6494
|
// Cancel the request
|
@@ -6394,7 +6505,7 @@ jQuery.extend({
|
|
6394
6505
|
// Callback for when everything is done
|
6395
6506
|
// It is defined here because jslint complains if it is declared
|
6396
6507
|
// at the end of the function (which would be more logical and readable)
|
6397
|
-
function done( status, statusText, responses, headers) {
|
6508
|
+
function done( status, statusText, responses, headers ) {
|
6398
6509
|
|
6399
6510
|
// Called once
|
6400
6511
|
if ( state === 2 ) {
|
@@ -6410,19 +6521,19 @@ jQuery.extend({
|
|
6410
6521
|
}
|
6411
6522
|
|
6412
6523
|
// Dereference transport for early garbage collection
|
6413
|
-
// (no matter how long the
|
6524
|
+
// (no matter how long the jqXHR object will be used)
|
6414
6525
|
transport = undefined;
|
6415
6526
|
|
6416
6527
|
// Cache response headers
|
6417
6528
|
responseHeadersString = headers || "";
|
6418
6529
|
|
6419
6530
|
// Set readyState
|
6420
|
-
|
6531
|
+
jqXHR.readyState = status ? 4 : 0;
|
6421
6532
|
|
6422
6533
|
var isSuccess,
|
6423
6534
|
success,
|
6424
6535
|
error,
|
6425
|
-
response = responses ? ajaxHandleResponses( s,
|
6536
|
+
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
|
6426
6537
|
lastModified,
|
6427
6538
|
etag;
|
6428
6539
|
|
@@ -6432,11 +6543,11 @@ jQuery.extend({
|
|
6432
6543
|
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
6433
6544
|
if ( s.ifModified ) {
|
6434
6545
|
|
6435
|
-
if ( ( lastModified =
|
6436
|
-
jQuery.lastModified[
|
6546
|
+
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
|
6547
|
+
jQuery.lastModified[ ifModifiedKey ] = lastModified;
|
6437
6548
|
}
|
6438
|
-
if ( ( etag =
|
6439
|
-
jQuery.etag[
|
6549
|
+
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
|
6550
|
+
jQuery.etag[ ifModifiedKey ] = etag;
|
6440
6551
|
}
|
6441
6552
|
}
|
6442
6553
|
|
@@ -6463,7 +6574,7 @@ jQuery.extend({
|
|
6463
6574
|
// We extract error from statusText
|
6464
6575
|
// then normalize statusText and status for non-aborts
|
6465
6576
|
error = statusText;
|
6466
|
-
if( status ) {
|
6577
|
+
if( !statusText || status ) {
|
6467
6578
|
statusText = "error";
|
6468
6579
|
if ( status < 0 ) {
|
6469
6580
|
status = 0;
|
@@ -6472,30 +6583,30 @@ jQuery.extend({
|
|
6472
6583
|
}
|
6473
6584
|
|
6474
6585
|
// Set data for the fake xhr object
|
6475
|
-
|
6476
|
-
|
6586
|
+
jqXHR.status = status;
|
6587
|
+
jqXHR.statusText = statusText;
|
6477
6588
|
|
6478
6589
|
// Success/Error
|
6479
6590
|
if ( isSuccess ) {
|
6480
|
-
deferred.resolveWith( callbackContext, [ success, statusText,
|
6591
|
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
6481
6592
|
} else {
|
6482
|
-
deferred.rejectWith( callbackContext, [
|
6593
|
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
6483
6594
|
}
|
6484
6595
|
|
6485
6596
|
// Status-dependent callbacks
|
6486
|
-
|
6597
|
+
jqXHR.statusCode( statusCode );
|
6487
6598
|
statusCode = undefined;
|
6488
6599
|
|
6489
|
-
if (
|
6600
|
+
if ( fireGlobals ) {
|
6490
6601
|
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
|
6491
|
-
[
|
6602
|
+
[ jqXHR, s, isSuccess ? success : error ] );
|
6492
6603
|
}
|
6493
6604
|
|
6494
6605
|
// Complete
|
6495
|
-
completeDeferred.resolveWith( callbackContext, [
|
6606
|
+
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
|
6496
6607
|
|
6497
|
-
if (
|
6498
|
-
globalEventContext.trigger( "ajaxComplete", [
|
6608
|
+
if ( fireGlobals ) {
|
6609
|
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
|
6499
6610
|
// Handle the global AJAX counter
|
6500
6611
|
if ( !( --jQuery.active ) ) {
|
6501
6612
|
jQuery.event.trigger( "ajaxStop" );
|
@@ -6504,13 +6615,13 @@ jQuery.extend({
|
|
6504
6615
|
}
|
6505
6616
|
|
6506
6617
|
// Attach deferreds
|
6507
|
-
deferred.promise(
|
6508
|
-
|
6509
|
-
|
6510
|
-
|
6618
|
+
deferred.promise( jqXHR );
|
6619
|
+
jqXHR.success = jqXHR.done;
|
6620
|
+
jqXHR.error = jqXHR.fail;
|
6621
|
+
jqXHR.complete = completeDeferred.done;
|
6511
6622
|
|
6512
6623
|
// Status-dependent callbacks
|
6513
|
-
|
6624
|
+
jqXHR.statusCode = function( map ) {
|
6514
6625
|
if ( map ) {
|
6515
6626
|
var tmp;
|
6516
6627
|
if ( state < 2 ) {
|
@@ -6518,8 +6629,8 @@ jQuery.extend({
|
|
6518
6629
|
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
|
6519
6630
|
}
|
6520
6631
|
} else {
|
6521
|
-
tmp = map[
|
6522
|
-
|
6632
|
+
tmp = map[ jqXHR.status ];
|
6633
|
+
jqXHR.then( tmp, tmp );
|
6523
6634
|
}
|
6524
6635
|
}
|
6525
6636
|
return this;
|
@@ -6528,7 +6639,7 @@ jQuery.extend({
|
|
6528
6639
|
// Remove hash character (#7531: and string promotion)
|
6529
6640
|
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
6530
6641
|
// We also use the url parameter if available
|
6531
|
-
s.url = (
|
6642
|
+
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
6532
6643
|
|
6533
6644
|
// Extract dataTypes list
|
6534
6645
|
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
|
@@ -6537,9 +6648,9 @@ jQuery.extend({
|
|
6537
6648
|
if ( !s.crossDomain ) {
|
6538
6649
|
parts = rurl.exec( s.url.toLowerCase() );
|
6539
6650
|
s.crossDomain = !!( parts &&
|
6540
|
-
( parts[ 1 ] !=
|
6651
|
+
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
|
6541
6652
|
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
6542
|
-
(
|
6653
|
+
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
6543
6654
|
);
|
6544
6655
|
}
|
6545
6656
|
|
@@ -6549,7 +6660,15 @@ jQuery.extend({
|
|
6549
6660
|
}
|
6550
6661
|
|
6551
6662
|
// Apply prefilters
|
6552
|
-
inspectPrefiltersOrTransports( prefilters, s, options,
|
6663
|
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
6664
|
+
|
6665
|
+
// If request was aborted inside a prefiler, stop there
|
6666
|
+
if ( state === 2 ) {
|
6667
|
+
return false;
|
6668
|
+
}
|
6669
|
+
|
6670
|
+
// We can fire global events as of now if asked to
|
6671
|
+
fireGlobals = s.global;
|
6553
6672
|
|
6554
6673
|
// Uppercase the type
|
6555
6674
|
s.type = s.type.toUpperCase();
|
@@ -6558,7 +6677,7 @@ jQuery.extend({
|
|
6558
6677
|
s.hasContent = !rnoContent.test( s.type );
|
6559
6678
|
|
6560
6679
|
// Watch for a new set of requests
|
6561
|
-
if (
|
6680
|
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
6562
6681
|
jQuery.event.trigger( "ajaxStart" );
|
6563
6682
|
}
|
6564
6683
|
|
@@ -6570,6 +6689,9 @@ jQuery.extend({
|
|
6570
6689
|
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
6571
6690
|
}
|
6572
6691
|
|
6692
|
+
// Get ifModifiedKey before adding the anti-cache parameter
|
6693
|
+
ifModifiedKey = s.url;
|
6694
|
+
|
6573
6695
|
// Add anti-cache in url if needed
|
6574
6696
|
if ( s.cache === false ) {
|
6575
6697
|
|
@@ -6584,77 +6706,77 @@ jQuery.extend({
|
|
6584
6706
|
|
6585
6707
|
// Set the correct header, if data is being sent
|
6586
6708
|
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
6587
|
-
requestHeaders[ "
|
6709
|
+
requestHeaders[ "Content-Type" ] = s.contentType;
|
6588
6710
|
}
|
6589
6711
|
|
6590
6712
|
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
6591
6713
|
if ( s.ifModified ) {
|
6592
|
-
|
6593
|
-
|
6714
|
+
ifModifiedKey = ifModifiedKey || s.url;
|
6715
|
+
if ( jQuery.lastModified[ ifModifiedKey ] ) {
|
6716
|
+
requestHeaders[ "If-Modified-Since" ] = jQuery.lastModified[ ifModifiedKey ];
|
6594
6717
|
}
|
6595
|
-
if ( jQuery.etag[
|
6596
|
-
requestHeaders[ "
|
6718
|
+
if ( jQuery.etag[ ifModifiedKey ] ) {
|
6719
|
+
requestHeaders[ "If-None-Match" ] = jQuery.etag[ ifModifiedKey ];
|
6597
6720
|
}
|
6598
6721
|
}
|
6599
6722
|
|
6600
6723
|
// Set the Accepts header for the server, depending on the dataType
|
6601
|
-
requestHeaders.
|
6724
|
+
requestHeaders.Accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
6602
6725
|
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
|
6603
6726
|
s.accepts[ "*" ];
|
6604
6727
|
|
6605
6728
|
// Check for headers option
|
6606
6729
|
for ( i in s.headers ) {
|
6607
|
-
|
6730
|
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
6608
6731
|
}
|
6609
6732
|
|
6610
6733
|
// Allow custom headers/mimetypes and early abort
|
6611
|
-
if ( s.beforeSend && ( s.beforeSend.call( callbackContext,
|
6734
|
+
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
6612
6735
|
// Abort if not done already
|
6613
|
-
|
6614
|
-
|
6615
|
-
jXHR = false;
|
6736
|
+
jqXHR.abort();
|
6737
|
+
return false;
|
6616
6738
|
|
6617
|
-
}
|
6739
|
+
}
|
6618
6740
|
|
6619
|
-
|
6620
|
-
|
6621
|
-
|
6622
|
-
|
6741
|
+
// Install callbacks on deferreds
|
6742
|
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
6743
|
+
jqXHR[ i ]( s[ i ] );
|
6744
|
+
}
|
6623
6745
|
|
6624
|
-
|
6625
|
-
|
6746
|
+
// Get transport
|
6747
|
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
6626
6748
|
|
6627
|
-
|
6628
|
-
|
6629
|
-
|
6630
|
-
|
6631
|
-
|
6632
|
-
|
6633
|
-
|
6634
|
-
|
6635
|
-
|
6636
|
-
|
6637
|
-
|
6638
|
-
|
6639
|
-
|
6640
|
-
|
6641
|
-
|
6642
|
-
}
|
6749
|
+
// If no transport, we auto-abort
|
6750
|
+
if ( !transport ) {
|
6751
|
+
done( -1, "No Transport" );
|
6752
|
+
} else {
|
6753
|
+
jqXHR.readyState = 1;
|
6754
|
+
// Send global event
|
6755
|
+
if ( fireGlobals ) {
|
6756
|
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
6757
|
+
}
|
6758
|
+
// Timeout
|
6759
|
+
if ( s.async && s.timeout > 0 ) {
|
6760
|
+
timeoutTimer = setTimeout( function(){
|
6761
|
+
jqXHR.abort( "timeout" );
|
6762
|
+
}, s.timeout );
|
6763
|
+
}
|
6643
6764
|
|
6644
|
-
|
6645
|
-
|
6646
|
-
|
6647
|
-
|
6648
|
-
|
6649
|
-
|
6650
|
-
|
6651
|
-
|
6652
|
-
|
6653
|
-
|
6765
|
+
try {
|
6766
|
+
state = 1;
|
6767
|
+
transport.send( requestHeaders, done );
|
6768
|
+
} catch (e) {
|
6769
|
+
// Propagate exception as error if not done
|
6770
|
+
if ( status < 2 ) {
|
6771
|
+
done( -1, e );
|
6772
|
+
// Simply rethrow otherwise
|
6773
|
+
} else {
|
6774
|
+
jQuery.error( e );
|
6654
6775
|
}
|
6655
6776
|
}
|
6656
6777
|
}
|
6657
|
-
|
6778
|
+
|
6779
|
+
return jqXHR;
|
6658
6780
|
},
|
6659
6781
|
|
6660
6782
|
// Serialize an array of form elements or a set of
|
@@ -6673,7 +6795,7 @@ jQuery.extend({
|
|
6673
6795
|
}
|
6674
6796
|
|
6675
6797
|
// If an array was passed in, assume that it is an array of form elements.
|
6676
|
-
if ( jQuery.isArray( a ) || a.jquery ) {
|
6798
|
+
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
6677
6799
|
// Serialize the form elements
|
6678
6800
|
jQuery.each( a, function() {
|
6679
6801
|
add( this.name, this.value );
|
@@ -6720,9 +6842,9 @@ function buildParams( prefix, obj, traditional, add ) {
|
|
6720
6842
|
|
6721
6843
|
// Serialize object item.
|
6722
6844
|
} else {
|
6723
|
-
|
6724
|
-
buildParams( prefix + "[" +
|
6725
|
-
}
|
6845
|
+
for ( var name in obj ) {
|
6846
|
+
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
6847
|
+
}
|
6726
6848
|
}
|
6727
6849
|
|
6728
6850
|
} else {
|
@@ -6749,7 +6871,7 @@ jQuery.extend({
|
|
6749
6871
|
* - finds the right dataType (mediates between content-type and expected dataType)
|
6750
6872
|
* - returns the corresponding response
|
6751
6873
|
*/
|
6752
|
-
function ajaxHandleResponses( s,
|
6874
|
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
6753
6875
|
|
6754
6876
|
var contents = s.contents,
|
6755
6877
|
dataTypes = s.dataTypes,
|
@@ -6762,7 +6884,7 @@ function ajaxHandleResponses( s, jXHR, responses ) {
|
|
6762
6884
|
// Fill responseXXX fields
|
6763
6885
|
for( type in responseFields ) {
|
6764
6886
|
if ( type in responses ) {
|
6765
|
-
|
6887
|
+
jqXHR[ responseFields[type] ] = responses[ type ];
|
6766
6888
|
}
|
6767
6889
|
}
|
6768
6890
|
|
@@ -6770,7 +6892,7 @@ function ajaxHandleResponses( s, jXHR, responses ) {
|
|
6770
6892
|
while( dataTypes[ 0 ] === "*" ) {
|
6771
6893
|
dataTypes.shift();
|
6772
6894
|
if ( ct === undefined ) {
|
6773
|
-
ct =
|
6895
|
+
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
|
6774
6896
|
}
|
6775
6897
|
}
|
6776
6898
|
|
@@ -6822,8 +6944,9 @@ function ajaxConvert( s, response ) {
|
|
6822
6944
|
}
|
6823
6945
|
|
6824
6946
|
var dataTypes = s.dataTypes,
|
6825
|
-
converters =
|
6947
|
+
converters = {},
|
6826
6948
|
i,
|
6949
|
+
key,
|
6827
6950
|
length = dataTypes.length,
|
6828
6951
|
tmp,
|
6829
6952
|
// Current and previous dataTypes
|
@@ -6840,6 +6963,16 @@ function ajaxConvert( s, response ) {
|
|
6840
6963
|
// For each dataType in the chain
|
6841
6964
|
for( i = 1; i < length; i++ ) {
|
6842
6965
|
|
6966
|
+
// Create converters map
|
6967
|
+
// with lowercased keys
|
6968
|
+
if ( i === 1 ) {
|
6969
|
+
for( key in s.converters ) {
|
6970
|
+
if( typeof key === "string" ) {
|
6971
|
+
converters[ key.toLowerCase() ] = s.converters[ key ];
|
6972
|
+
}
|
6973
|
+
}
|
6974
|
+
}
|
6975
|
+
|
6843
6976
|
// Get the dataTypes
|
6844
6977
|
prev = current;
|
6845
6978
|
current = dataTypes[ i ];
|
@@ -6902,9 +7035,9 @@ jQuery.ajaxSetup({
|
|
6902
7035
|
});
|
6903
7036
|
|
6904
7037
|
// Detect, normalize options and install callbacks for jsonp requests
|
6905
|
-
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings,
|
7038
|
+
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
6906
7039
|
|
6907
|
-
dataIsString = ( typeof s.data === "string" );
|
7040
|
+
var dataIsString = ( typeof s.data === "string" );
|
6908
7041
|
|
6909
7042
|
if ( s.dataTypes[ 0 ] === "jsonp" ||
|
6910
7043
|
originalSettings.jsonpCallback ||
|
@@ -6918,7 +7051,15 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString
|
|
6918
7051
|
previous = window[ jsonpCallback ],
|
6919
7052
|
url = s.url,
|
6920
7053
|
data = s.data,
|
6921
|
-
replace = "$1" + jsonpCallback + "$2"
|
7054
|
+
replace = "$1" + jsonpCallback + "$2",
|
7055
|
+
cleanUp = function() {
|
7056
|
+
// Set callback back to previous value
|
7057
|
+
window[ jsonpCallback ] = previous;
|
7058
|
+
// Call if it was a function and we have a response
|
7059
|
+
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
7060
|
+
window[ jsonpCallback ]( responseContainer[ 0 ] );
|
7061
|
+
}
|
7062
|
+
};
|
6922
7063
|
|
6923
7064
|
if ( s.jsonp !== false ) {
|
6924
7065
|
url = url.replace( jsre, replace );
|
@@ -6936,32 +7077,17 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString
|
|
6936
7077
|
s.url = url;
|
6937
7078
|
s.data = data;
|
6938
7079
|
|
7080
|
+
// Install callback
|
6939
7081
|
window[ jsonpCallback ] = function( response ) {
|
6940
7082
|
responseContainer = [ response ];
|
6941
7083
|
};
|
6942
7084
|
|
6943
|
-
|
6944
|
-
|
6945
|
-
// Set callback back to previous value
|
6946
|
-
window[ jsonpCallback ] = previous;
|
6947
|
-
|
6948
|
-
// Call if it was a function and we have a response
|
6949
|
-
if ( previous) {
|
6950
|
-
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
6951
|
-
window[ jsonpCallback ] ( responseContainer[ 0 ] );
|
6952
|
-
}
|
6953
|
-
} else {
|
6954
|
-
// else, more memory leak avoidance
|
6955
|
-
try{
|
6956
|
-
delete window[ jsonpCallback ];
|
6957
|
-
} catch( e ) {}
|
6958
|
-
}
|
6959
|
-
|
6960
|
-
}, s.complete ];
|
7085
|
+
// Install cleanUp function
|
7086
|
+
jqXHR.then( cleanUp, cleanUp );
|
6961
7087
|
|
6962
7088
|
// Use data converter to retrieve json after script execution
|
6963
7089
|
s.converters["script json"] = function() {
|
6964
|
-
if ( !
|
7090
|
+
if ( !responseContainer ) {
|
6965
7091
|
jQuery.error( jsonpCallback + " was not called" );
|
6966
7092
|
}
|
6967
7093
|
return responseContainer[ 0 ];
|
@@ -6981,10 +7107,10 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString
|
|
6981
7107
|
// Install script dataType
|
6982
7108
|
jQuery.ajaxSetup({
|
6983
7109
|
accepts: {
|
6984
|
-
script: "text/javascript, application/javascript"
|
7110
|
+
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
6985
7111
|
},
|
6986
7112
|
contents: {
|
6987
|
-
script: /javascript/
|
7113
|
+
script: /javascript|ecmascript/
|
6988
7114
|
},
|
6989
7115
|
converters: {
|
6990
7116
|
"text script": function( text ) {
|
@@ -7012,7 +7138,7 @@ jQuery.ajaxTransport( "script", function(s) {
|
|
7012
7138
|
if ( s.crossDomain ) {
|
7013
7139
|
|
7014
7140
|
var script,
|
7015
|
-
head = document.getElementsByTagName( "head" )[
|
7141
|
+
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
7016
7142
|
|
7017
7143
|
return {
|
7018
7144
|
|
@@ -7067,18 +7193,36 @@ jQuery.ajaxTransport( "script", function(s) {
|
|
7067
7193
|
|
7068
7194
|
|
7069
7195
|
|
7070
|
-
var //
|
7196
|
+
var // #5280: next active xhr id and list of active xhrs' callbacks
|
7071
7197
|
xhrId = jQuery.now(),
|
7072
|
-
|
7073
|
-
// active xhrs
|
7074
|
-
xhrs = {},
|
7075
|
-
|
7076
|
-
// #5280: see below
|
7077
|
-
xhrUnloadAbortInstalled,
|
7198
|
+
xhrCallbacks,
|
7078
7199
|
|
7079
7200
|
// XHR used to determine supports properties
|
7080
7201
|
testXHR;
|
7081
7202
|
|
7203
|
+
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
7204
|
+
function xhrOnUnloadAbort() {
|
7205
|
+
jQuery( window ).unload(function() {
|
7206
|
+
// Abort all pending requests
|
7207
|
+
for ( var key in xhrCallbacks ) {
|
7208
|
+
xhrCallbacks[ key ]( 0, 1 );
|
7209
|
+
}
|
7210
|
+
});
|
7211
|
+
}
|
7212
|
+
|
7213
|
+
// Functions to create xhrs
|
7214
|
+
function createStandardXHR() {
|
7215
|
+
try {
|
7216
|
+
return new window.XMLHttpRequest();
|
7217
|
+
} catch( e ) {}
|
7218
|
+
}
|
7219
|
+
|
7220
|
+
function createActiveXHR() {
|
7221
|
+
try {
|
7222
|
+
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
|
7223
|
+
} catch( e ) {}
|
7224
|
+
}
|
7225
|
+
|
7082
7226
|
// Create the request object
|
7083
7227
|
// (This is still attached to ajaxSettings for backward compatibility)
|
7084
7228
|
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
@@ -7089,27 +7233,13 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
|
7089
7233
|
* we need a fallback.
|
7090
7234
|
*/
|
7091
7235
|
function() {
|
7092
|
-
|
7093
|
-
try {
|
7094
|
-
return new window.XMLHttpRequest();
|
7095
|
-
} catch( xhrError ) {}
|
7096
|
-
}
|
7097
|
-
|
7098
|
-
try {
|
7099
|
-
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
7100
|
-
} catch( activeError ) {}
|
7236
|
+
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
7101
7237
|
} :
|
7102
7238
|
// For all other browsers, use the standard XMLHttpRequest object
|
7103
|
-
|
7104
|
-
return new window.XMLHttpRequest();
|
7105
|
-
};
|
7239
|
+
createStandardXHR;
|
7106
7240
|
|
7107
7241
|
// Test if we can create an xhr object
|
7108
|
-
|
7109
|
-
testXHR = jQuery.ajaxSettings.xhr();
|
7110
|
-
} catch( xhrCreationException ) {}
|
7111
|
-
|
7112
|
-
//Does this browser support XHR requests?
|
7242
|
+
testXHR = jQuery.ajaxSettings.xhr();
|
7113
7243
|
jQuery.support.ajax = !!testXHR;
|
7114
7244
|
|
7115
7245
|
// Does this browser support crossDomain XHR requests
|
@@ -7130,26 +7260,10 @@ if ( jQuery.support.ajax ) {
|
|
7130
7260
|
return {
|
7131
7261
|
send: function( headers, complete ) {
|
7132
7262
|
|
7133
|
-
// #5280: we need to abort on unload or IE will keep connections alive
|
7134
|
-
if ( !xhrUnloadAbortInstalled ) {
|
7135
|
-
|
7136
|
-
xhrUnloadAbortInstalled = 1;
|
7137
|
-
|
7138
|
-
jQuery(window).bind( "unload", function() {
|
7139
|
-
|
7140
|
-
// Abort all pending requests
|
7141
|
-
jQuery.each( xhrs, function( _, xhr ) {
|
7142
|
-
if ( xhr.onreadystatechange ) {
|
7143
|
-
xhr.onreadystatechange( 1 );
|
7144
|
-
}
|
7145
|
-
} );
|
7146
|
-
|
7147
|
-
} );
|
7148
|
-
}
|
7149
|
-
|
7150
7263
|
// Get a new xhr
|
7151
7264
|
var xhr = s.xhr(),
|
7152
|
-
handle
|
7265
|
+
handle,
|
7266
|
+
i;
|
7153
7267
|
|
7154
7268
|
// Open the socket
|
7155
7269
|
// Passing null username, generates a login popup on Opera (#2865)
|
@@ -7159,19 +7273,31 @@ if ( jQuery.support.ajax ) {
|
|
7159
7273
|
xhr.open( s.type, s.url, s.async );
|
7160
7274
|
}
|
7161
7275
|
|
7276
|
+
// Apply custom fields if provided
|
7277
|
+
if ( s.xhrFields ) {
|
7278
|
+
for ( i in s.xhrFields ) {
|
7279
|
+
xhr[ i ] = s.xhrFields[ i ];
|
7280
|
+
}
|
7281
|
+
}
|
7282
|
+
|
7283
|
+
// Override mime type if needed
|
7284
|
+
if ( s.mimeType && xhr.overrideMimeType ) {
|
7285
|
+
xhr.overrideMimeType( s.mimeType );
|
7286
|
+
}
|
7287
|
+
|
7162
7288
|
// Requested-With header
|
7163
7289
|
// Not set for crossDomain requests with no content
|
7164
7290
|
// (see why at http://trac.dojotoolkit.org/ticket/9486)
|
7165
7291
|
// Won't change header if already provided
|
7166
|
-
if ( !( s.crossDomain && !s.hasContent ) && !headers["
|
7167
|
-
headers[ "
|
7292
|
+
if ( !( s.crossDomain && !s.hasContent ) && !headers["X-Requested-With"] ) {
|
7293
|
+
headers[ "X-Requested-With" ] = "XMLHttpRequest";
|
7168
7294
|
}
|
7169
7295
|
|
7170
7296
|
// Need an extra try/catch for cross domain requests in Firefox 3
|
7171
7297
|
try {
|
7172
|
-
|
7173
|
-
xhr.setRequestHeader(
|
7174
|
-
}
|
7298
|
+
for ( i in headers ) {
|
7299
|
+
xhr.setRequestHeader( i, headers[ i ] );
|
7300
|
+
}
|
7175
7301
|
} catch( _ ) {}
|
7176
7302
|
|
7177
7303
|
// Do send the request
|
@@ -7182,75 +7308,79 @@ if ( jQuery.support.ajax ) {
|
|
7182
7308
|
// Listener
|
7183
7309
|
callback = function( _, isAbort ) {
|
7184
7310
|
|
7185
|
-
|
7186
|
-
|
7311
|
+
var status,
|
7312
|
+
statusText,
|
7313
|
+
responseHeaders,
|
7314
|
+
responses,
|
7315
|
+
xml;
|
7187
7316
|
|
7188
|
-
|
7189
|
-
|
7317
|
+
// Firefox throws exceptions when accessing properties
|
7318
|
+
// of an xhr when a network error occured
|
7319
|
+
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
7320
|
+
try {
|
7190
7321
|
|
7191
|
-
//
|
7192
|
-
if (
|
7193
|
-
xhr.onreadystatechange = jQuery.noop;
|
7194
|
-
delete xhrs[ handle ];
|
7195
|
-
}
|
7322
|
+
// Was never called and is aborted or complete
|
7323
|
+
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
7196
7324
|
|
7197
|
-
|
7198
|
-
|
7199
|
-
|
7200
|
-
|
7201
|
-
|
7325
|
+
// Only called once
|
7326
|
+
callback = undefined;
|
7327
|
+
|
7328
|
+
// Do not keep as active anymore
|
7329
|
+
if ( handle ) {
|
7330
|
+
xhr.onreadystatechange = jQuery.noop;
|
7331
|
+
delete xhrCallbacks[ handle ];
|
7202
7332
|
}
|
7203
|
-
|
7204
|
-
//
|
7205
|
-
|
7206
|
-
|
7207
|
-
|
7208
|
-
|
7333
|
+
|
7334
|
+
// If it's an abort
|
7335
|
+
if ( isAbort ) {
|
7336
|
+
// Abort it manually if needed
|
7337
|
+
if ( xhr.readyState !== 4 ) {
|
7338
|
+
xhr.abort();
|
7339
|
+
}
|
7340
|
+
} else {
|
7341
|
+
status = xhr.status;
|
7342
|
+
responseHeaders = xhr.getAllResponseHeaders();
|
7343
|
+
responses = {};
|
7209
7344
|
xml = xhr.responseXML;
|
7210
7345
|
|
7211
|
-
|
7212
|
-
|
7213
|
-
|
7214
|
-
|
7215
|
-
|
7216
|
-
|
7217
|
-
|
7218
|
-
|
7219
|
-
|
7220
|
-
|
7221
|
-
|
7222
|
-
|
7223
|
-
|
7346
|
+
// Construct response list
|
7347
|
+
if ( xml && xml.documentElement /* #4958 */ ) {
|
7348
|
+
responses.xml = xml;
|
7349
|
+
}
|
7350
|
+
responses.text = xhr.responseText;
|
7351
|
+
|
7352
|
+
// Firefox throws an exception when accessing
|
7353
|
+
// statusText for faulty cross-domain requests
|
7354
|
+
try {
|
7355
|
+
statusText = xhr.statusText;
|
7356
|
+
} catch( e ) {
|
7357
|
+
// We normalize with Webkit giving an empty statusText
|
7358
|
+
statusText = "";
|
7359
|
+
}
|
7360
|
+
|
7361
|
+
// Filter status for non standard behaviors
|
7362
|
+
|
7363
|
+
// If the request is local and we have data: assume a success
|
7364
|
+
// (success with no data won't get notified, that's the best we
|
7365
|
+
// can do given current implementations)
|
7366
|
+
if ( !status && s.isLocal && !s.crossDomain ) {
|
7367
|
+
status = responses.text ? 200 : 404;
|
7368
|
+
// IE - #1450: sometimes returns 1223 when it should be 204
|
7369
|
+
} else if ( status === 1223 ) {
|
7370
|
+
status = 204;
|
7371
|
+
}
|
7224
7372
|
}
|
7225
|
-
|
7226
|
-
|
7227
|
-
|
7228
|
-
|
7229
|
-
// Webkit returns 0 for failing cross-domain no matter the real status
|
7230
|
-
status === 0 ?
|
7231
|
-
(
|
7232
|
-
// Webkit, Firefox: filter out faulty cross-domain requests
|
7233
|
-
!s.crossDomain || statusText ?
|
7234
|
-
(
|
7235
|
-
// Opera: filter out real aborts #6060
|
7236
|
-
responseHeaders ?
|
7237
|
-
304 :
|
7238
|
-
0
|
7239
|
-
) :
|
7240
|
-
// We assume 302 but could be anything cross-domain related
|
7241
|
-
302
|
7242
|
-
) :
|
7243
|
-
(
|
7244
|
-
// IE sometimes returns 1223 when it should be 204 (see #1450)
|
7245
|
-
status == 1223 ?
|
7246
|
-
204 :
|
7247
|
-
status
|
7248
|
-
);
|
7249
|
-
|
7250
|
-
// Call complete
|
7251
|
-
complete( status, statusText, responses, responseHeaders );
|
7373
|
+
}
|
7374
|
+
} catch( firefoxAccessException ) {
|
7375
|
+
if ( !isAbort ) {
|
7376
|
+
complete( -1, firefoxAccessException );
|
7252
7377
|
}
|
7253
7378
|
}
|
7379
|
+
|
7380
|
+
// Call complete if needed
|
7381
|
+
if ( responses ) {
|
7382
|
+
complete( status, statusText, responses, responseHeaders );
|
7383
|
+
}
|
7254
7384
|
};
|
7255
7385
|
|
7256
7386
|
// if we're in sync mode or it's in cache
|
@@ -7259,10 +7389,15 @@ if ( jQuery.support.ajax ) {
|
|
7259
7389
|
if ( !s.async || xhr.readyState === 4 ) {
|
7260
7390
|
callback();
|
7261
7391
|
} else {
|
7262
|
-
//
|
7392
|
+
// Create the active xhrs callbacks list if needed
|
7393
|
+
// and attach the unload handler
|
7394
|
+
if ( !xhrCallbacks ) {
|
7395
|
+
xhrCallbacks = {};
|
7396
|
+
xhrOnUnloadAbort();
|
7397
|
+
}
|
7398
|
+
// Add to list of active xhrs callbacks
|
7263
7399
|
handle = xhrId++;
|
7264
|
-
|
7265
|
-
xhr.onreadystatechange = callback;
|
7400
|
+
xhr.onreadystatechange = xhrCallbacks[ handle ] = callback;
|
7266
7401
|
}
|
7267
7402
|
},
|
7268
7403
|
|
@@ -7464,11 +7599,11 @@ jQuery.fn.extend({
|
|
7464
7599
|
|
7465
7600
|
} else {
|
7466
7601
|
var parts = rfxnum.exec(val),
|
7467
|
-
start = e.cur()
|
7602
|
+
start = e.cur();
|
7468
7603
|
|
7469
7604
|
if ( parts ) {
|
7470
7605
|
var end = parseFloat( parts[2] ),
|
7471
|
-
unit = parts[3] || "px";
|
7606
|
+
unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" );
|
7472
7607
|
|
7473
7608
|
// We need to compute starting value
|
7474
7609
|
if ( unit !== "px" ) {
|
@@ -7615,8 +7750,12 @@ jQuery.fx.prototype = {
|
|
7615
7750
|
return this.elem[ this.prop ];
|
7616
7751
|
}
|
7617
7752
|
|
7618
|
-
var
|
7619
|
-
|
7753
|
+
var parsed,
|
7754
|
+
r = jQuery.css( this.elem, this.prop );
|
7755
|
+
// Empty strings, null, undefined and "auto" are converted to 0,
|
7756
|
+
// complex values such as "rotate(1rad)" are returned as is,
|
7757
|
+
// simple values such as "10px" are parsed to Float.
|
7758
|
+
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
|
7620
7759
|
},
|
7621
7760
|
|
7622
7761
|
// Start an animation from one number to another
|
@@ -7627,7 +7766,7 @@ jQuery.fx.prototype = {
|
|
7627
7766
|
this.startTime = jQuery.now();
|
7628
7767
|
this.start = from;
|
7629
7768
|
this.end = to;
|
7630
|
-
this.unit = unit || this.unit || "px";
|
7769
|
+
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
7631
7770
|
this.now = this.start;
|
7632
7771
|
this.pos = this.state = 0;
|
7633
7772
|
|
@@ -8078,7 +8217,7 @@ jQuery.each( ["Left", "Top"], function( i, name ) {
|
|
8078
8217
|
if ( win ) {
|
8079
8218
|
win.scrollTo(
|
8080
8219
|
!i ? val : jQuery(win).scrollLeft(),
|
8081
|
-
|
8220
|
+
i ? val : jQuery(win).scrollTop()
|
8082
8221
|
);
|
8083
8222
|
|
8084
8223
|
} else {
|
@@ -8173,4 +8312,5 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
|
|
8173
8312
|
});
|
8174
8313
|
|
8175
8314
|
|
8315
|
+
window.jQuery = window.$ = jQuery;
|
8176
8316
|
})(window);
|