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
4a90bced
Commit
4a90bced
authored
Jul 09, 2012
by
Rick Waldron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update grunt:selector task to handle new Sizzle EXPOSE block
parent
7fae98c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
grunt.js
grunt.js
+36
-3
No files found.
grunt.js
View file @
4a90bced
...
@@ -156,10 +156,43 @@ module.exports = function( grunt ) {
...
@@ -156,10 +156,43 @@ module.exports = function( grunt ) {
api
:
file
.
read
(
files
[
0
]
),
api
:
file
.
read
(
files
[
0
]
),
src
:
file
.
read
(
files
[
1
]
)
src
:
file
.
read
(
files
[
1
]
)
},
},
compiled
;
compiled
,
parts
;
/**
sizzle-jquery.js -> sizzle between "EXPOSE" blocks,
replace define & window.Sizzle assignment
// EXPOSE
if ( typeof define === "function" && define.amd ) {
define(function() { return Sizzle; });
} else {
window.Sizzle = Sizzle;
}
// EXPOSE
Becomes...
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
*/
// Break into 3 pieces
parts
=
sizzle
.
src
.
split
(
"// EXPOSE"
);
// Replace the if/else block with api
parts
[
1
]
=
sizzle
.
api
;
// Rejoin the pieces
compiled
=
parts
.
join
(
""
);
// sizzle-jquery.js -> sizzle after "EXPOSE", replace window.Sizzle
compiled
=
sizzle
.
src
.
replace
(
"window.Sizzle = Sizzle;"
,
sizzle
.
api
);
verbose
.
write
(
"Injected sizzle-jquery.js into sizzle.js"
);
verbose
.
write
(
"Injected sizzle-jquery.js into sizzle.js"
);
// Write concatenated source to file
// Write concatenated source to file
...
...
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