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
15b5dbfe
Commit
15b5dbfe
authored
Sep 18, 2012
by
Richard Gibson
Committed by
Dave Methvin
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12229, size/consistency improvements. Close gh-887.
parent
e8e3e90a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
24 deletions
+21
-24
ajax.js
src/ajax.js
+8
-11
attributes.js
src/attributes.js
+5
-5
core.js
src/core.js
+3
-3
data.js
src/data.js
+3
-3
event.js
src/event.js
+2
-2
No files found.
src/ajax.js
View file @
15b5dbfe
var
// Document location
var
ajaxLocation
,
// Document location
// Document location segments
ajaxLocParts
,
ajaxLocParts
,
ajaxLocation
,
rhash
=
/#.*$/
,
rhash
=
/#.*$/
,
rheaders
=
/^
(
.*
?)
:
[
\t]
*
([^\r\n]
*
)\r?
$/mg
,
// IE leaves an \r character at EOL
rheaders
=
/^
(
.*
?)
:
[
\t]
*
([^\r\n]
*
)\r?
$/mg
,
// IE leaves an \r character at EOL
...
@@ -518,7 +518,7 @@ jQuery.extend({
...
@@ -518,7 +518,7 @@ jQuery.extend({
// Set data for the fake xhr object
// Set data for the fake xhr object
jqXHR
.
status
=
status
;
jqXHR
.
status
=
status
;
jqXHR
.
statusText
=
""
+
(
nativeStatusText
||
statusText
)
;
jqXHR
.
statusText
=
(
nativeStatusText
||
statusText
)
+
""
;
// Success/Error
// Success/Error
if
(
isSuccess
)
{
if
(
isSuccess
)
{
...
@@ -578,14 +578,11 @@ jQuery.extend({
...
@@ -578,14 +578,11 @@ jQuery.extend({
// Extract dataTypes list
// Extract dataTypes list
s
.
dataTypes
=
jQuery
.
trim
(
s
.
dataType
||
"*"
).
toLowerCase
().
split
(
core_rspace
);
s
.
dataTypes
=
jQuery
.
trim
(
s
.
dataType
||
"*"
).
toLowerCase
().
split
(
core_rspace
);
//
Determine if a cross-domain request is in order
//
A cross-domain request is in order when we have a protocol:host:port mismatch
if
(
s
.
crossDomain
==
null
)
{
if
(
s
.
crossDomain
==
null
)
{
parts
=
rurl
.
exec
(
s
.
url
.
toLowerCase
()
);
parts
=
rurl
.
exec
(
s
.
url
.
toLowerCase
()
)
||
false
;
s
.
crossDomain
=
!!
(
parts
&&
s
.
crossDomain
=
parts
&&
(
parts
.
join
(
":"
)
+
(
parts
[
3
]
?
""
:
parts
[
1
]
===
"http:"
?
80
:
443
)
)
!==
(
parts
[
1
]
!=
ajaxLocParts
[
1
]
||
parts
[
2
]
!=
ajaxLocParts
[
2
]
||
(
ajaxLocParts
.
join
(
":"
)
+
(
ajaxLocParts
[
3
]
?
""
:
ajaxLocParts
[
1
]
===
"http:"
?
80
:
443
)
);
(
parts
[
3
]
||
(
parts
[
1
]
===
"http:"
?
80
:
443
)
)
!=
(
ajaxLocParts
[
3
]
||
(
ajaxLocParts
[
1
]
===
"http:"
?
80
:
443
)
)
)
);
}
}
// Convert data if not already a string
// Convert data if not already a string
...
...
src/attributes.js
View file @
15b5dbfe
...
@@ -57,7 +57,7 @@ jQuery.fn.extend({
...
@@ -57,7 +57,7 @@ jQuery.fn.extend({
setClass
=
" "
+
elem
.
className
+
" "
;
setClass
=
" "
+
elem
.
className
+
" "
;
for
(
c
=
0
,
cl
=
classNames
.
length
;
c
<
cl
;
c
++
)
{
for
(
c
=
0
,
cl
=
classNames
.
length
;
c
<
cl
;
c
++
)
{
if
(
!~
setClass
.
indexOf
(
" "
+
classNames
[
c
]
+
" "
)
)
{
if
(
setClass
.
indexOf
(
" "
+
classNames
[
c
]
+
" "
)
<
0
)
{
setClass
+=
classNames
[
c
]
+
" "
;
setClass
+=
classNames
[
c
]
+
" "
;
}
}
}
}
...
@@ -90,7 +90,7 @@ jQuery.fn.extend({
...
@@ -90,7 +90,7 @@ jQuery.fn.extend({
// loop over each item in the removal list
// loop over each item in the removal list
for
(
c
=
0
,
cl
=
removes
.
length
;
c
<
cl
;
c
++
)
{
for
(
c
=
0
,
cl
=
removes
.
length
;
c
<
cl
;
c
++
)
{
// Remove until there is nothing to remove,
// Remove until there is nothing to remove,
while
(
className
.
indexOf
(
" "
+
removes
[
c
]
+
" "
)
>
-
1
)
{
while
(
className
.
indexOf
(
" "
+
removes
[
c
]
+
" "
)
>
=
0
)
{
className
=
className
.
replace
(
" "
+
removes
[
c
]
+
" "
,
" "
);
className
=
className
.
replace
(
" "
+
removes
[
c
]
+
" "
,
" "
);
}
}
}
}
...
@@ -144,7 +144,7 @@ jQuery.fn.extend({
...
@@ -144,7 +144,7 @@ jQuery.fn.extend({
i
=
0
,
i
=
0
,
l
=
this
.
length
;
l
=
this
.
length
;
for
(
;
i
<
l
;
i
++
)
{
for
(
;
i
<
l
;
i
++
)
{
if
(
this
[
i
].
nodeType
===
1
&&
(
" "
+
this
[
i
].
className
+
" "
).
replace
(
rclass
,
" "
).
indexOf
(
className
)
>
-
1
)
{
if
(
this
[
i
].
nodeType
===
1
&&
(
" "
+
this
[
i
].
className
+
" "
).
replace
(
rclass
,
" "
).
indexOf
(
className
)
>
=
0
)
{
return
true
;
return
true
;
}
}
}
}
...
@@ -322,7 +322,7 @@ jQuery.extend({
...
@@ -322,7 +322,7 @@ jQuery.extend({
return
ret
;
return
ret
;
}
else
{
}
else
{
elem
.
setAttribute
(
name
,
""
+
value
);
elem
.
setAttribute
(
name
,
value
+
""
);
return
value
;
return
value
;
}
}
...
@@ -586,7 +586,7 @@ if ( !jQuery.support.style ) {
...
@@ -586,7 +586,7 @@ if ( !jQuery.support.style ) {
return
elem
.
style
.
cssText
.
toLowerCase
()
||
undefined
;
return
elem
.
style
.
cssText
.
toLowerCase
()
||
undefined
;
},
},
set
:
function
(
elem
,
value
)
{
set
:
function
(
elem
,
value
)
{
return
(
elem
.
style
.
cssText
=
""
+
value
);
return
(
elem
.
style
.
cssText
=
value
+
""
);
}
}
};
};
}
}
...
...
src/core.js
View file @
15b5dbfe
...
@@ -559,7 +559,7 @@ jQuery.extend({
...
@@ -559,7 +559,7 @@ jQuery.extend({
},
},
nodeName
:
function
(
elem
,
name
)
{
nodeName
:
function
(
elem
,
name
)
{
return
elem
.
nodeName
&&
elem
.
nodeName
.
to
UpperCase
()
===
name
.
toUpp
erCase
();
return
elem
.
nodeName
&&
elem
.
nodeName
.
to
LowerCase
()
===
name
.
toLow
erCase
();
},
},
// args is for internal usage only
// args is for internal usage only
...
@@ -616,7 +616,7 @@ jQuery.extend({
...
@@ -616,7 +616,7 @@ jQuery.extend({
function
(
text
)
{
function
(
text
)
{
return
text
==
null
?
return
text
==
null
?
""
:
""
:
text
.
toString
(
).
replace
(
rtrim
,
""
);
(
text
+
""
).
replace
(
rtrim
,
""
);
},
},
// results is for internal usage only
// results is for internal usage only
...
@@ -762,7 +762,7 @@ jQuery.extend({
...
@@ -762,7 +762,7 @@ jQuery.extend({
};
};
// Set the guid of unique handler to the same of original handler, so it can be removed
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy
.
guid
=
fn
.
guid
=
fn
.
guid
||
proxy
.
guid
||
jQuery
.
guid
++
;
proxy
.
guid
=
fn
.
guid
=
fn
.
guid
||
jQuery
.
guid
++
;
return
proxy
;
return
proxy
;
},
},
...
...
src/data.js
View file @
15b5dbfe
...
@@ -6,7 +6,7 @@ jQuery.extend({
...
@@ -6,7 +6,7 @@ jQuery.extend({
deletedIds
:
[],
deletedIds
:
[],
//
Please use with caution
//
Remove at next major release (1.9/2.0)
uuid
:
0
,
uuid
:
0
,
// Unique for each copy of jQuery on the page
// Unique for each copy of jQuery on the page
...
@@ -58,7 +58,7 @@ jQuery.extend({
...
@@ -58,7 +58,7 @@ jQuery.extend({
// Only DOM nodes need a new unique ID for each element since their data
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
// ends up in the global cache
if
(
isNode
)
{
if
(
isNode
)
{
elem
[
internalKey
]
=
id
=
jQuery
.
deletedIds
.
pop
()
||
++
jQuery
.
uuid
;
elem
[
internalKey
]
=
id
=
jQuery
.
deletedIds
.
pop
()
||
jQuery
.
guid
++
;
}
else
{
}
else
{
id
=
internalKey
;
id
=
internalKey
;
}
}
...
@@ -232,7 +232,7 @@ jQuery.fn.extend({
...
@@ -232,7 +232,7 @@ jQuery.fn.extend({
for
(
l
=
attr
.
length
;
i
<
l
;
i
++
)
{
for
(
l
=
attr
.
length
;
i
<
l
;
i
++
)
{
name
=
attr
[
i
].
name
;
name
=
attr
[
i
].
name
;
if
(
name
.
indexOf
(
"data-"
)
===
0
)
{
if
(
!
name
.
indexOf
(
"data-"
)
)
{
name
=
jQuery
.
camelCase
(
name
.
substring
(
5
)
);
name
=
jQuery
.
camelCase
(
name
.
substring
(
5
)
);
dataAttr
(
elem
,
name
,
data
[
name
]
);
dataAttr
(
elem
,
name
,
data
[
name
]
);
...
...
src/event.js
View file @
15b5dbfe
...
@@ -365,7 +365,7 @@ jQuery.event = {
...
@@ -365,7 +365,7 @@ jQuery.event = {
var
i
,
j
,
cur
,
ret
,
selMatch
,
matched
,
matches
,
handleObj
,
sel
,
related
,
var
i
,
j
,
cur
,
ret
,
selMatch
,
matched
,
matches
,
handleObj
,
sel
,
related
,
handlers
=
(
(
jQuery
.
_data
(
this
,
"events"
)
||
{}
)[
event
.
type
]
||
[]),
handlers
=
(
(
jQuery
.
_data
(
this
,
"events"
)
||
{}
)[
event
.
type
]
||
[]),
delegateCount
=
handlers
.
delegateCount
,
delegateCount
=
handlers
.
delegateCount
,
args
=
[].
slice
.
call
(
arguments
),
args
=
core_
slice
.
call
(
arguments
),
run_all
=
!
event
.
exclusive
&&
!
event
.
namespace
,
run_all
=
!
event
.
exclusive
&&
!
event
.
namespace
,
special
=
jQuery
.
event
.
special
[
event
.
type
]
||
{},
special
=
jQuery
.
event
.
special
[
event
.
type
]
||
{},
handlerQueue
=
[];
handlerQueue
=
[];
...
@@ -966,7 +966,7 @@ jQuery.fn.extend({
...
@@ -966,7 +966,7 @@ jQuery.fn.extend({
},
},
undelegate
:
function
(
selector
,
types
,
fn
)
{
undelegate
:
function
(
selector
,
types
,
fn
)
{
// ( namespace ) or ( selector, types [, fn] )
// ( namespace ) or ( selector, types [, fn] )
return
arguments
.
length
==
1
?
this
.
off
(
selector
,
"**"
)
:
this
.
off
(
types
,
selector
||
"**"
,
fn
);
return
arguments
.
length
==
=
1
?
this
.
off
(
selector
,
"**"
)
:
this
.
off
(
types
,
selector
||
"**"
,
fn
);
},
},
trigger
:
function
(
type
,
data
)
{
trigger
:
function
(
type
,
data
)
{
...
...
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