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
b31bd4c0
Commit
b31bd4c0
authored
Sep 28, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket: Compress core and data modules
parent
9bf6aaf4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
42 deletions
+42
-42
core.js
src/core.js
+36
-36
data.js
src/data.js
+6
-6
No files found.
src/core.js
View file @
b31bd4c0
...
@@ -58,13 +58,13 @@ jQuery.fn = jQuery.prototype = {
...
@@ -58,13 +58,13 @@ jQuery.fn = jQuery.prototype = {
// Get the Nth element in the matched element set OR
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
// Get the whole matched element set as a clean array
get
:
function
(
num
)
{
get
:
function
(
num
)
{
return
num
=
=
null
?
return
num
!
=
null
?
// Return a 'clean' array
// Return a 'clean' array
this
.
toArray
(
)
:
(
num
<
0
?
this
[
num
+
this
.
length
]
:
this
[
num
]
)
:
// Return just the object
// Return just the object
(
num
<
0
?
this
[
this
.
length
+
num
]
:
this
[
num
]
);
slice
.
call
(
this
);
},
},
// Take an array of elements and push it onto the stack
// Take an array of elements and push it onto the stack
...
@@ -89,6 +89,12 @@ jQuery.fn = jQuery.prototype = {
...
@@ -89,6 +89,12 @@ jQuery.fn = jQuery.prototype = {
return
jQuery
.
each
(
this
,
callback
,
args
);
return
jQuery
.
each
(
this
,
callback
,
args
);
},
},
map
:
function
(
callback
)
{
return
this
.
pushStack
(
jQuery
.
map
(
this
,
function
(
elem
,
i
)
{
return
callback
.
call
(
elem
,
i
,
elem
);
}));
},
slice
:
function
()
{
slice
:
function
()
{
return
this
.
pushStack
(
slice
.
apply
(
this
,
arguments
)
);
return
this
.
pushStack
(
slice
.
apply
(
this
,
arguments
)
);
},
},
...
@@ -107,12 +113,6 @@ jQuery.fn = jQuery.prototype = {
...
@@ -107,12 +113,6 @@ jQuery.fn = jQuery.prototype = {
return
this
.
pushStack
(
j
>=
0
&&
j
<
len
?
[
this
[
j
]
]
:
[]
);
return
this
.
pushStack
(
j
>=
0
&&
j
<
len
?
[
this
[
j
]
]
:
[]
);
},
},
map
:
function
(
callback
)
{
return
this
.
pushStack
(
jQuery
.
map
(
this
,
function
(
elem
,
i
)
{
return
callback
.
call
(
elem
,
i
,
elem
);
}));
},
end
:
function
()
{
end
:
function
()
{
return
this
.
prevObject
||
this
.
constructor
(
null
);
return
this
.
prevObject
||
this
.
constructor
(
null
);
},
},
...
@@ -134,9 +134,10 @@ jQuery.extend = jQuery.fn.extend = function() {
...
@@ -134,9 +134,10 @@ jQuery.extend = jQuery.fn.extend = function() {
// Handle a deep copy situation
// Handle a deep copy situation
if
(
typeof
target
===
"boolean"
)
{
if
(
typeof
target
===
"boolean"
)
{
deep
=
target
;
deep
=
target
;
target
=
arguments
[
1
]
||
{};
// skip the boolean and the target
// skip the boolean and the target
i
=
2
;
target
=
arguments
[
i
]
||
{};
i
++
;
}
}
// Handle case when target is a string or something (possible in deep copy)
// Handle case when target is a string or something (possible in deep copy)
...
@@ -145,9 +146,9 @@ jQuery.extend = jQuery.fn.extend = function() {
...
@@ -145,9 +146,9 @@ jQuery.extend = jQuery.fn.extend = function() {
}
}
// extend jQuery itself if only one argument is passed
// extend jQuery itself if only one argument is passed
if
(
length
===
i
)
{
if
(
i
===
length
)
{
target
=
this
;
target
=
this
;
--
i
;
i
--
;
}
}
for
(
;
i
<
length
;
i
++
)
{
for
(
;
i
<
length
;
i
++
)
{
...
@@ -195,6 +196,12 @@ jQuery.extend({
...
@@ -195,6 +196,12 @@ jQuery.extend({
// Assume jQuery is ready without the ready module
// Assume jQuery is ready without the ready module
isReady
:
true
,
isReady
:
true
,
error
:
function
(
msg
)
{
throw
new
Error
(
msg
);
},
noop
:
function
()
{},
noConflict
:
function
(
deep
)
{
noConflict
:
function
(
deep
)
{
if
(
window
.
$
===
jQuery
)
{
if
(
window
.
$
===
jQuery
)
{
window
.
$
=
_$
;
window
.
$
=
_$
;
...
@@ -277,19 +284,13 @@ jQuery.extend({
...
@@ -277,19 +284,13 @@ jQuery.extend({
type
:
function
(
obj
)
{
type
:
function
(
obj
)
{
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
String
(
obj
)
;
return
obj
+
""
;
}
}
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
typeof
obj
;
typeof
obj
;
},
},
error
:
function
(
msg
)
{
throw
new
Error
(
msg
);
},
noop
:
function
()
{},
// Evaluates a script in a global context
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
...
@@ -441,23 +442,23 @@ jQuery.extend({
...
@@ -441,23 +442,23 @@ jQuery.extend({
return
first
;
return
first
;
},
},
grep
:
function
(
elems
,
callback
,
inv
)
{
grep
:
function
(
elems
,
callback
,
inv
ert
)
{
var
retVal
,
var
callbackInverse
,
ret
=
[],
matches
=
[],
i
=
0
,
i
=
0
,
length
=
elems
.
length
;
length
=
elems
.
length
,
inv
=
!!
inv
;
callbackExpect
=
!
invert
;
// Go through the array, only saving the items
// Go through the array, only saving the items
// that pass the validator function
// that pass the validator function
for
(
;
i
<
length
;
i
++
)
{
for
(
;
i
<
length
;
i
++
)
{
retVal
=
!
!
callback
(
elems
[
i
],
i
);
callbackInverse
=
!
callback
(
elems
[
i
],
i
);
if
(
inv
!==
retVal
)
{
if
(
callbackInverse
!==
callbackExpect
)
{
ret
.
push
(
elems
[
i
]
);
matches
.
push
(
elems
[
i
]
);
}
}
}
}
return
ret
;
return
matches
;
},
},
// arg is for internal usage only
// arg is for internal usage only
...
@@ -474,7 +475,7 @@ jQuery.extend({
...
@@ -474,7 +475,7 @@ jQuery.extend({
value
=
callback
(
elems
[
i
],
i
,
arg
);
value
=
callback
(
elems
[
i
],
i
,
arg
);
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
ret
[
ret
.
length
]
=
value
;
ret
.
push
(
value
)
;
}
}
}
}
...
@@ -484,7 +485,7 @@ jQuery.extend({
...
@@ -484,7 +485,7 @@ jQuery.extend({
value
=
callback
(
elems
[
i
],
i
,
arg
);
value
=
callback
(
elems
[
i
],
i
,
arg
);
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
ret
[
ret
.
length
]
=
value
;
ret
.
push
(
value
)
;
}
}
}
}
}
}
...
@@ -526,7 +527,7 @@ jQuery.extend({
...
@@ -526,7 +527,7 @@ jQuery.extend({
},
},
now
:
function
()
{
now
:
function
()
{
return
(
new
Date
()
).
getTime
(
);
return
+
(
new
Date
()
);
},
},
// jQuery.support is not used in Core but other projects attach their
// jQuery.support is not used in Core but other projects attach their
...
@@ -543,7 +544,7 @@ function isArraylike( obj ) {
...
@@ -543,7 +544,7 @@ function isArraylike( obj ) {
var
length
=
obj
.
length
,
var
length
=
obj
.
length
,
type
=
jQuery
.
type
(
obj
);
type
=
jQuery
.
type
(
obj
);
if
(
jQuery
.
isWindow
(
obj
)
)
{
if
(
type
===
"function"
||
jQuery
.
isWindow
(
obj
)
)
{
return
false
;
return
false
;
}
}
...
@@ -551,9 +552,8 @@ function isArraylike( obj ) {
...
@@ -551,9 +552,8 @@ function isArraylike( obj ) {
return
true
;
return
true
;
}
}
return
type
===
"array"
||
type
!==
"function"
&&
return
type
===
"array"
||
length
===
0
||
(
length
===
0
||
typeof
length
===
"number"
&&
length
>
0
&&
(
length
-
1
)
in
obj
;
typeof
length
===
"number"
&&
length
>
0
&&
(
length
-
1
)
in
obj
);
}
}
return
jQuery
;
return
jQuery
;
...
...
src/data.js
View file @
b31bd4c0
...
@@ -5,7 +5,7 @@ define([
...
@@ -5,7 +5,7 @@ define([
"./data/accepts"
"./data/accepts"
],
function
(
jQuery
,
deletedIds
,
support
)
{
],
function
(
jQuery
,
deletedIds
,
support
)
{
var
rbrace
=
/
(?:\{[\
s\S]
*
\}
|
\[[\s\S
]
*
\])
$/
,
var
rbrace
=
/
(?:\{[\
w\W]
*
\}
|
\[[\w\W
]
*
\])
$/
,
rmultiDash
=
/
([
A-Z
])
/g
;
rmultiDash
=
/
([
A-Z
])
/g
;
function
dataAttr
(
elem
,
key
,
data
)
{
function
dataAttr
(
elem
,
key
,
data
)
{
...
@@ -272,10 +272,10 @@ jQuery.extend({
...
@@ -272,10 +272,10 @@ jQuery.extend({
jQuery
.
fn
.
extend
({
jQuery
.
fn
.
extend
({
data
:
function
(
key
,
value
)
{
data
:
function
(
key
,
value
)
{
var
attrs
,
name
,
var
i
,
name
,
data
=
null
,
data
=
null
,
i
=
0
,
elem
=
this
[
0
]
,
elem
=
this
[
0
]
;
attrs
=
elem
&&
elem
.
attributes
;
// Special expections of .data basically thwart jQuery.access,
// Special expections of .data basically thwart jQuery.access,
// so implement the relevant behavior ourselves
// so implement the relevant behavior ourselves
...
@@ -286,8 +286,8 @@ jQuery.fn.extend({
...
@@ -286,8 +286,8 @@ jQuery.fn.extend({
data
=
jQuery
.
data
(
elem
);
data
=
jQuery
.
data
(
elem
);
if
(
elem
.
nodeType
===
1
&&
!
jQuery
.
_data
(
elem
,
"parsedAttrs"
)
)
{
if
(
elem
.
nodeType
===
1
&&
!
jQuery
.
_data
(
elem
,
"parsedAttrs"
)
)
{
attrs
=
elem
.
attributes
;
i
=
attrs
.
length
;
for
(
;
i
<
attrs
.
length
;
i
++
)
{
while
(
i
--
)
{
name
=
attrs
[
i
].
name
;
name
=
attrs
[
i
].
name
;
if
(
name
.
indexOf
(
"data-"
)
===
0
)
{
if
(
name
.
indexOf
(
"data-"
)
===
0
)
{
...
...
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