Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
ee22c8b3
Commit
ee22c8b3
authored
Jan 23, 2011
by
jaubourg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code style fixes.
parent
dd5bf421
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
ajax.js
src/ajax.js
+7
-7
jsonp.js
src/ajax/jsonp.js
+2
-3
script.js
src/ajax/script.js
+1
-1
No files found.
src/ajax.js
View file @
ee22c8b3
...
@@ -255,7 +255,7 @@ jQuery.extend({
...
@@ -255,7 +255,7 @@ jQuery.extend({
// If options is not an object,
// If options is not an object,
// we simulate pre-1.5 signature
// we simulate pre-1.5 signature
if
(
typeof
(
options
)
!==
"object"
)
{
if
(
typeof
options
!==
"object"
)
{
options
=
url
;
options
=
url
;
url
=
undefined
;
url
=
undefined
;
}
}
...
@@ -423,7 +423,7 @@ jQuery.extend({
...
@@ -423,7 +423,7 @@ jQuery.extend({
statusCode
=
undefined
;
statusCode
=
undefined
;
if
(
s
.
global
)
{
if
(
s
.
global
)
{
globalEventContext
.
trigger
(
"ajax"
+
(
isSuccess
?
"Success"
:
"Error"
)
,
globalEventContext
.
trigger
(
"ajax"
+
(
isSuccess
?
"Success"
:
"Error"
),
[
jXHR
,
s
,
isSuccess
?
success
:
error
]
);
[
jXHR
,
s
,
isSuccess
?
success
:
error
]
);
}
}
...
@@ -455,7 +455,7 @@ jQuery.extend({
...
@@ -455,7 +455,7 @@ jQuery.extend({
}
}
}
else
{
}
else
{
tmp
=
map
[
jXHR
.
status
];
tmp
=
map
[
jXHR
.
status
];
jXHR
.
then
(
tmp
,
tmp
);
jXHR
.
then
(
tmp
,
tmp
);
}
}
}
}
return
this
;
return
this
;
...
@@ -702,7 +702,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, dat
...
@@ -702,7 +702,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, dat
selected
=
list
[
i
](
options
,
originalOptions
);
selected
=
list
[
i
](
options
,
originalOptions
);
// If we got redirected to a different dataType,
// If we got redirected to a different dataType,
// we add it and switch to the corresponding list
// we add it and switch to the corresponding list
if
(
typeof
(
selected
)
===
"string"
&&
selected
!==
dataType
)
{
if
(
typeof
selected
===
"string"
&&
selected
!==
dataType
)
{
options
.
dataTypes
.
unshift
(
selected
);
options
.
dataTypes
.
unshift
(
selected
);
selected
=
inspectPrefiltersOrTransports
(
selected
=
inspectPrefiltersOrTransports
(
structure
,
options
,
originalOptions
,
selected
,
tested
);
structure
,
options
,
originalOptions
,
selected
,
tested
);
...
@@ -757,7 +757,7 @@ function prefiltersOrTransports( structure, arg1, arg2, type /* internal */ ) {
...
@@ -757,7 +757,7 @@ function prefiltersOrTransports( structure, arg1, arg2, type /* internal */ ) {
return
inspectPrefiltersOrTransports
(
structure
,
arg1
,
arg2
);
return
inspectPrefiltersOrTransports
(
structure
,
arg1
,
arg2
);
}
else
{
}
else
{
// We're requested to add to the structure
// We're requested to add to the structure
// Signature is ( dataTypeExpression
, function )
// Signature is ( dataTypeExpression, function )
// with dataTypeExpression being optional and
// with dataTypeExpression being optional and
// defaulting to auto ("*")
// defaulting to auto ("*")
type
=
(
type
===
"function"
);
type
=
(
type
===
"function"
);
...
@@ -818,11 +818,11 @@ function ajaxHandleResponses( s, jXHR, responses ) {
...
@@ -818,11 +818,11 @@ function ajaxHandleResponses( s, jXHR, responses ) {
}
else
{
}
else
{
// Try convertible dataTypes
// Try convertible dataTypes
for
(
type
in
responses
)
{
for
(
type
in
responses
)
{
if
(
!
dataTypes
[
0
]
||
s
.
converters
[
type
+
" "
+
dataTypes
[
0
]
]
)
{
if
(
!
dataTypes
[
0
]
||
s
.
converters
[
type
+
" "
+
dataTypes
[
0
]
]
)
{
finalDataType
=
type
;
finalDataType
=
type
;
break
;
break
;
}
}
if
(
!
firstDataType
)
{
if
(
!
firstDataType
)
{
firstDataType
=
type
;
firstDataType
=
type
;
}
}
}
}
...
...
src/ajax/jsonp.js
View file @
ee22c8b3
...
@@ -12,10 +12,9 @@ jQuery.ajaxSetup({
...
@@ -12,10 +12,9 @@ jQuery.ajaxSetup({
});
});
// Detect, normalize options and install callbacks for jsonp requests
// Detect, normalize options and install callbacks for jsonp requests
// (dataIsString is used internally)
jQuery
.
ajaxPrefilter
(
"json jsonp"
,
function
(
s
,
originalSettings
,
dataIsString
/* internal */
)
{
jQuery
.
ajaxPrefilter
(
"json jsonp"
,
function
(
s
,
originalSettings
,
dataIsString
)
{
dataIsString
=
(
typeof
(
s
.
data
)
===
"string"
);
dataIsString
=
(
typeof
s
.
data
===
"string"
);
if
(
s
.
dataTypes
[
0
]
===
"jsonp"
||
if
(
s
.
dataTypes
[
0
]
===
"jsonp"
||
originalSettings
.
jsonpCallback
||
originalSettings
.
jsonpCallback
||
...
...
src/ajax/script.js
View file @
ee22c8b3
...
@@ -14,7 +14,7 @@ jQuery.ajaxSetup({
...
@@ -14,7 +14,7 @@ jQuery.ajaxSetup({
});
});
// Handle cache's special case and global
// Handle cache's special case and global
jQuery
.
ajaxPrefilter
(
"script"
,
function
(
s
)
{
jQuery
.
ajaxPrefilter
(
"script"
,
function
(
s
)
{
if
(
s
.
cache
===
undefined
)
{
if
(
s
.
cache
===
undefined
)
{
s
.
cache
=
false
;
s
.
cache
=
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment