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
c14a6b38
Commit
c14a6b38
authored
Jul 23, 2012
by
Richard Gibson
Committed by
Dave Methvin
Jul 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up regexen; use common regex for numbers. Close gh-862.
parent
74cc5b09
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
25 deletions
+27
-25
ajax.js
src/ajax.js
+1
-1
attributes.js
src/attributes.js
+2
-2
core.js
src/core.js
+5
-2
css.js
src/css.js
+11
-12
deprecated.js
src/deprecated.js
+2
-2
effects.js
src/effects.js
+1
-1
event.js
src/event.js
+4
-4
manipulation.js
src/manipulation.js
+1
-1
No files found.
src/ajax.js
View file @
c14a6b38
...
...
@@ -12,7 +12,7 @@ var // Document location
rquery
=
/
\?
/
,
rscript
=
/<script
\b[^
<
]
*
(?:(?!
<
\/
script>
)
<
[^
<
]
*
)
*<
\/
script>/gi
,
rts
=
/
([
?&
])
_=
[^
&
]
*/
,
rurl
=
/^
([\w\+\.\-]
+:
)(?:\/\/([^\/
?#:
]
*
)(?:
:
(\d
+
)
)?)?
/
,
rurl
=
/^
([\w\+\.\-]
+:
)(?:\/\/([^\/
?#:
]
*
)(?:
:
(\d
+
)
|
)
|
)
/
,
// Keep a copy of the old load method
_load
=
jQuery
.
fn
.
load
,
...
...
src/attributes.js
View file @
c14a6b38
var
nodeHook
,
boolHook
,
fixSpecified
,
rclass
=
/
[\
n\t\r
]
/g
,
rclass
=
/
[\
t\r\n
]
/g
,
rreturn
=
/
\r
/g
,
rtype
=
/^
(?:
button|input
)
$/i
,
rfocusable
=
/^
(?:
button|input|object|select|textarea
)
$/i
,
rclickable
=
/^a
(?:
rea
)?
$/i
,
rclickable
=
/^a
(?:
rea
|
)
$/i
,
rboolean
=
/^
(?:
autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected
)
$/i
,
getSetAttribute
=
jQuery
.
support
.
getSetAttribute
;
...
...
src/core.js
View file @
c14a6b38
...
...
@@ -30,6 +30,9 @@ var
return
new
jQuery
.
fn
.
init
(
selector
,
context
,
rootjQuery
);
},
// Used for matching numbers
core_pnum
=
/
[\-
+
]?(?:\d
*
\.
|
)\d
+
(?:[
eE
][\-
+
]?\d
+|
)
/
.
source
,
// Used for detecting and trimming whitespace
core_rnotwhite
=
/
\S
/
,
core_rspace
=
/
\s
+/
,
...
...
@@ -42,13 +45,13 @@ var
rquickExpr
=
/^
(?:[^
#<
]
*
(
<
[\w\W]
+>
)[^
>
]
*$|#
([\w\-]
*
)
$
)
/
,
// Match a standalone tag
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>
)?
$/
,
rsingleTag
=
/^<
(\w
+
)\s
*
\/?
>
(?:
<
\/\1
>
|
)
$/
,
// JSON RegExp
rvalidchars
=
/^
[\]
,:{}
\s]
*$/
,
rvalidbraces
=
/
(?:
^|:|,
)(?:\s
*
\[)
+/g
,
rvalidescape
=
/
\\(?:[
"
\\\/
bfnrt
]
|u
[\d
a-fA-F
]{4})
/g
,
rvalidtokens
=
/"
[^
"
\\\
n\r]
*"|true|false|null|-
?\d
+
(?:\.\d
*
)?(?:[
eE
][
+
\-]?\d
+
)?
/g
,
rvalidtokens
=
/"
[^
"
\\\
r\n]
*"|true|false|null|-
?(?:\d\d
*
\.
|
)\d
+
(?:[
eE
][\-
+
]?\d
+|
)
/g
,
// Matches dashed string for camelizing
rmsPrefix
=
/^-ms-/
,
...
...
src/css.js
View file @
c14a6b38
var
curCSS
,
iframe
,
iframeDoc
,
ralpha
=
/alpha
\([^
)
]
*
\)
/i
,
ropacity
=
/opacity=
([^
)
]
*
)
/
,
rnumsplit
=
/^
([\-
+
]?(?:\d
*
\.)?\d
+
)(
.*
)
$/i
,
rnumnonpx
=
/^-
?(?:\d
*
\.)?\d
+
(?!
px
)[^\d\s]
+$/i
,
rrelNum
=
/^
([\-
+
])
=
([\-
+.
\d
e
]
+
)
/
,
rposition
=
/^
(
top|right|bottom|left
)
$/
,
rmargin
=
/^margin/
,
rnumsplit
=
new
RegExp
(
"^("
+
core_pnum
+
")(.*)$"
,
"i"
),
rnumnonpx
=
new
RegExp
(
"^("
+
core_pnum
+
")(?!px)[a-z%]+$"
,
"i"
),
rrelNum
=
new
RegExp
(
"^([-+])=("
+
core_pnum
+
")"
,
"i"
),
elemdisplay
=
{},
cssShow
=
{
position
:
"absolute"
,
visibility
:
"hidden"
,
display
:
"block"
},
// order is important!
cssExpand
=
[
"Top"
,
"Right"
,
"Bottom"
,
"Left"
],
cssPrefixes
=
[
"Webkit"
,
"O"
,
"Moz"
,
"ms"
],
rposition
=
/^
(
top|right|bottom|left
)
$/
,
eventsToggle
=
jQuery
.
fn
.
toggle
,
cssShow
=
{
position
:
"absolute"
,
visibility
:
"hidden"
,
display
:
"block"
},
cssNormalTransform
=
{
letterSpacing
:
0
,
fontWeight
:
400
,
lineHeight
:
1
};
},
cssExpand
=
[
"Top"
,
"Right"
,
"Bottom"
,
"Left"
],
cssPrefixes
=
[
"Webkit"
,
"O"
,
"Moz"
,
"ms"
],
eventsToggle
=
jQuery
.
fn
.
toggle
;
// return a css property mapped to a potentially vendor prefixed property
function
vendorPropName
(
style
,
name
)
{
...
...
src/deprecated.js
View file @
c14a6b38
...
...
@@ -11,9 +11,9 @@ jQuery.uaMatch = function( ua ) {
var
match
=
/
(
chrome
)[
\/]([\w
.
]
+
)
/
.
exec
(
ua
)
||
/
(
webkit
)[
\/]([\w
.
]
+
)
/
.
exec
(
ua
)
||
/
(
opera
)(?:
.*version
)?
[
\/]([\w
.
]
+
)
/
.
exec
(
ua
)
||
/
(
opera
)(?:
.*version
|
)
[
\/]([\w
.
]
+
)
/
.
exec
(
ua
)
||
/
(
msie
)
([\w
.
]
+
)
/
.
exec
(
ua
)
||
ua
.
indexOf
(
"compatible"
)
<
0
&&
/
(
mozilla
)(?:
.*
?
rv:
([\w
.
]
+
)
)?
/
.
exec
(
ua
)
||
ua
.
indexOf
(
"compatible"
)
<
0
&&
/
(
mozilla
)(?:
.*
?
rv:
([\w
.
]
+
)
|
)
/
.
exec
(
ua
)
||
[];
return
{
...
...
src/effects.js
View file @
c14a6b38
var
fxNow
,
timerId
,
rfxtypes
=
/^
(?:
toggle|show|hide
)
$/
,
rfxnum
=
/^
(?:([\-
+
])
=
)?([\d
+.
\-]
+
)([
a-z%
]
*
)
$/i
,
rfxnum
=
new
RegExp
(
"^(?:([-+])=|)("
+
core_pnum
+
")([a-z%]*)$"
,
"i"
)
,
rrun
=
/queueHooks$/
,
animationPrefilters
=
[
defaultPrefilter
],
tweeners
=
{
...
...
src/event.js
View file @
c14a6b38
var
rformElems
=
/^
(?:
textarea|input|select
)
$/i
,
rtypenamespace
=
/^
([^\.]
*
)?(?:\.(
.+
))?
$/
,
rhoverHack
=
/
(?:
^|
\s)
hover
(\.\S
+
)?
\b
/
,
rtypenamespace
=
/^
([^\.]
*
|
)(?:\.(
.+
)
|
)
$/
,
rhoverHack
=
/
(?:
^|
\s)
hover
(\.\S
+
|
)
\b
/
,
rkeyEvent
=
/^key/
,
rmouseEvent
=
/^
(?:
mouse|contextmenu
)
|click/
,
rfocusMorph
=
/^
(?:
focusinfocus|focusoutblur
)
$/
,
...
...
@@ -157,7 +157,7 @@ jQuery.event = {
type
=
(
selector
?
special
.
delegateType
:
special
.
bindType
)
||
type
;
eventType
=
events
[
type
]
||
[];
origCount
=
eventType
.
length
;
namespaces
=
namespaces
?
new
RegExp
(
"(^|
\\
.)"
+
namespaces
.
split
(
"."
).
sort
().
join
(
"
\\
.(?:.*
\\
.
)?
"
)
+
"(
\\
.|$)"
)
:
null
;
namespaces
=
namespaces
?
new
RegExp
(
"(^|
\\
.)"
+
namespaces
.
split
(
"."
).
sort
().
join
(
"
\\
.(?:.*
\\
.
|)
"
)
+
"(
\\
.|$)"
)
:
null
;
// Remove matching events
for
(
j
=
0
;
j
<
eventType
.
length
;
j
++
)
{
...
...
@@ -254,7 +254,7 @@ jQuery.event = {
event
.
isTrigger
=
true
;
event
.
exclusive
=
exclusive
;
event
.
namespace
=
namespaces
.
join
(
"."
);
event
.
namespace_re
=
event
.
namespace
?
new
RegExp
(
"(^|
\\
.)"
+
namespaces
.
join
(
"
\\
.(?:.*
\\
.
)?
"
)
+
"(
\\
.|$)"
)
:
null
;
event
.
namespace_re
=
event
.
namespace
?
new
RegExp
(
"(^|
\\
.)"
+
namespaces
.
join
(
"
\\
.(?:.*
\\
.
|)
"
)
+
"(
\\
.|$)"
)
:
null
;
ontype
=
type
.
indexOf
(
":"
)
<
0
?
"on"
+
type
:
""
;
// Handle a global trigger
...
...
src/manipulation.js
View file @
c14a6b38
...
...
@@ -14,7 +14,7 @@ function createSafeFragment( document ) {
var
nodeNames
=
"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"
+
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video"
,
rinlinejQuery
=
/ jQuery
\d
+="
(?:
\d
+|null
)
"/g
,
rinlinejQuery
=
/ jQuery
\d
+="
(?:
null|
\d
+
)
"/g
,
rleadingWhitespace
=
/^
\s
+/
,
rxhtmlTag
=
/<
(?!
area|br|col|embed|hr|img|input|link|meta|param
)(([\w
:
]
+
)[^
>
]
*
)\/
>/gi
,
rtagName
=
/<
([\w
:
]
+
)
/
,
...
...
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