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
f519539d
Commit
f519539d
authored
Sep 28, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket: Compress core and data modules
(cherry picked from commit
b31bd4c0
) Conflicts: src/core.js src/data.js
parent
33c80f3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
48 deletions
+48
-48
core.js
src/core.js
+42
-42
data.js
src/data.js
+6
-6
No files found.
src/core.js
View file @
f519539d
...
...
@@ -58,13 +58,13 @@ jQuery.fn = jQuery.prototype = {
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get
:
function
(
num
)
{
return
num
=
=
null
?
return
num
!
=
null
?
// Return a 'clean' array
this
.
toArray
(
)
:
(
num
<
0
?
this
[
num
+
this
.
length
]
:
this
[
num
]
)
:
// 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
...
...
@@ -89,6 +89,12 @@ jQuery.fn = jQuery.prototype = {
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
()
{
return
this
.
pushStack
(
slice
.
apply
(
this
,
arguments
)
);
},
...
...
@@ -107,12 +113,6 @@ jQuery.fn = jQuery.prototype = {
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
()
{
return
this
.
prevObject
||
this
.
constructor
(
null
);
},
...
...
@@ -134,9 +134,10 @@ jQuery.extend = jQuery.fn.extend = function() {
// Handle a deep copy situation
if
(
typeof
target
===
"boolean"
)
{
deep
=
target
;
target
=
arguments
[
1
]
||
{};
// 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)
...
...
@@ -145,9 +146,9 @@ jQuery.extend = jQuery.fn.extend = function() {
}
// extend jQuery itself if only one argument is passed
if
(
length
===
i
)
{
if
(
i
===
length
)
{
target
=
this
;
--
i
;
i
--
;
}
for
(
;
i
<
length
;
i
++
)
{
...
...
@@ -195,6 +196,12 @@ jQuery.extend({
// Assume jQuery is ready without the ready module
isReady
:
true
,
error
:
function
(
msg
)
{
throw
new
Error
(
msg
);
},
noop
:
function
()
{},
noConflict
:
function
(
deep
)
{
if
(
window
.
$
===
jQuery
)
{
window
.
$
=
_$
;
...
...
@@ -227,16 +234,6 @@ jQuery.extend({
return
obj
-
parseFloat
(
obj
)
>=
0
;
},
type
:
function
(
obj
)
{
if
(
obj
==
null
)
{
return
String
(
obj
);
}
// Support: Android < 4.0, iOS < 6 (functionish RegExp)
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
typeof
obj
;
},
isPlainObject
:
function
(
obj
)
{
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
...
...
@@ -272,12 +269,16 @@ jQuery.extend({
return
true
;
},
error
:
function
(
msg
)
{
throw
new
Error
(
msg
);
type
:
function
(
obj
)
{
if
(
obj
==
null
)
{
return
obj
+
""
;
}
// Support: Android < 4.0, iOS < 6 (functionish RegExp)
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
typeof
obj
;
},
noop
:
function
()
{},
// Evaluates a script in a global context
globalEval
:
function
(
code
)
{
var
script
,
...
...
@@ -401,23 +402,23 @@ jQuery.extend({
return
first
;
},
grep
:
function
(
elems
,
callback
,
inv
)
{
var
retVal
,
ret
=
[],
grep
:
function
(
elems
,
callback
,
inv
ert
)
{
var
callbackInverse
,
matches
=
[],
i
=
0
,
length
=
elems
.
length
;
inv
=
!!
inv
;
length
=
elems
.
length
,
callbackExpect
=
!
invert
;
// Go through the array, only saving the items
// that pass the validator function
for
(
;
i
<
length
;
i
++
)
{
retVal
=
!
!
callback
(
elems
[
i
],
i
);
if
(
inv
!==
retVal
)
{
ret
.
push
(
elems
[
i
]
);
callbackInverse
=
!
callback
(
elems
[
i
],
i
);
if
(
callbackInverse
!==
callbackExpect
)
{
matches
.
push
(
elems
[
i
]
);
}
}
return
ret
;
return
matches
;
},
// arg is for internal usage only
...
...
@@ -434,7 +435,7 @@ jQuery.extend({
value
=
callback
(
elems
[
i
],
i
,
arg
);
if
(
value
!=
null
)
{
ret
[
ret
.
length
]
=
value
;
ret
.
push
(
value
)
;
}
}
...
...
@@ -444,7 +445,7 @@ jQuery.extend({
value
=
callback
(
elems
[
i
],
i
,
arg
);
if
(
value
!=
null
)
{
ret
[
ret
.
length
]
=
value
;
ret
.
push
(
value
)
;
}
}
}
...
...
@@ -501,7 +502,7 @@ function isArraylike( obj ) {
var
length
=
obj
.
length
,
type
=
jQuery
.
type
(
obj
);
if
(
jQuery
.
isWindow
(
obj
)
)
{
if
(
type
===
"function"
||
jQuery
.
isWindow
(
obj
)
)
{
return
false
;
}
...
...
@@ -509,9 +510,8 @@ function isArraylike( obj ) {
return
true
;
}
return
type
===
"array"
||
type
!==
"function"
&&
(
length
===
0
||
typeof
length
===
"number"
&&
length
>
0
&&
(
length
-
1
)
in
obj
);
return
type
===
"array"
||
length
===
0
||
typeof
length
===
"number"
&&
length
>
0
&&
(
length
-
1
)
in
obj
;
}
return
jQuery
;
...
...
src/data.js
View file @
f519539d
...
...
@@ -17,7 +17,7 @@ define([
5. Avoid exposing implementation details on user objects (eg. expando properties)
6. Provide a clear path for implementation upgrade to WeakMap in 2014
*/
var
rbrace
=
/
(?:\{[\
s\S]
*
\}
|
\[[\s\S
]
*
\])
$/
,
var
rbrace
=
/
(?:\{[\
w\W]
*
\}
|
\[[\w\W
]
*
\])
$/
,
rmultiDash
=
/
([
A-Z
])
/g
;
function
dataAttr
(
elem
,
key
,
data
)
{
...
...
@@ -75,10 +75,10 @@ jQuery.extend({
jQuery
.
fn
.
extend
({
data
:
function
(
key
,
value
)
{
var
attrs
,
name
,
var
i
,
name
,
data
=
null
,
elem
=
this
[
0
],
i
=
0
,
data
=
null
;
attrs
=
elem
&&
elem
.
attributes
;
// Gets all values
if
(
key
===
undefined
)
{
...
...
@@ -86,8 +86,8 @@ jQuery.fn.extend({
data
=
data_user
.
get
(
elem
);
if
(
elem
.
nodeType
===
1
&&
!
data_priv
.
get
(
elem
,
"hasDataAttrs"
)
)
{
attrs
=
elem
.
attributes
;
for
(
;
i
<
attrs
.
length
;
i
++
)
{
i
=
attrs
.
length
;
while
(
i
--
)
{
name
=
attrs
[
i
].
name
;
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