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
749d41f7
Commit
749d41f7
authored
Jan 31, 2011
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename jQuery.subclass() to jQuery.sub().
parent
d2384ad0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+6
-6
No files found.
src/core.js
View file @
749d41f7
...
@@ -957,7 +957,7 @@ jQuery.extend({
...
@@ -957,7 +957,7 @@ jQuery.extend({
return
{
browser
:
match
[
1
]
||
""
,
version
:
match
[
2
]
||
"0"
};
return
{
browser
:
match
[
1
]
||
""
,
version
:
match
[
2
]
||
"0"
};
},
},
sub
class
:
function
()
{
sub
:
function
()
{
function
jQuerySubclass
(
selector
,
context
)
{
function
jQuerySubclass
(
selector
,
context
)
{
return
new
jQuerySubclass
.
fn
.
init
(
selector
,
context
);
return
new
jQuerySubclass
.
fn
.
init
(
selector
,
context
);
}
}
...
...
test/unit/core.js
View file @
749d41f7
...
@@ -1129,9 +1129,9 @@ test("jQuery.when() - joined", function() {
...
@@ -1129,9 +1129,9 @@ test("jQuery.when() - joined", function() {
});
});
});
});
test
(
"jQuery.sub
clas
s"
,
function
(){
test
(
"jQuery.sub
() - Static Method
s"
,
function
(){
expect
(
18
);
expect
(
18
);
var
Subclass
=
jQuery
.
sub
class
();
var
Subclass
=
jQuery
.
sub
();
Subclass
.
extend
({
Subclass
.
extend
({
topLevelMethod
:
function
()
{
return
this
.
debug
;},
topLevelMethod
:
function
()
{
return
this
.
debug
;},
debug
:
false
,
debug
:
false
,
...
@@ -1151,7 +1151,7 @@ test("jQuery.subclass", function(){
...
@@ -1151,7 +1151,7 @@ test("jQuery.subclass", function(){
equal
(
jQuery
.
ajax
,
Subclass
.
ajax
,
'The subclass failed to get all top level methods'
);
equal
(
jQuery
.
ajax
,
Subclass
.
ajax
,
'The subclass failed to get all top level methods'
);
//Create a SubSubclass
//Create a SubSubclass
var
SubSubclass
=
Subclass
.
sub
class
();
var
SubSubclass
=
Subclass
.
sub
();
//Make Sure the SubSubclass inherited properly
//Make Sure the SubSubclass inherited properly
ok
(
SubSubclass
.
topLevelMethod
()
===
false
,
'SubSubclass.topLevelMethod thought debug was true'
);
ok
(
SubSubclass
.
topLevelMethod
()
===
false
,
'SubSubclass.topLevelMethod thought debug was true'
);
...
@@ -1178,11 +1178,11 @@ test("jQuery.subclass", function(){
...
@@ -1178,11 +1178,11 @@ test("jQuery.subclass", function(){
equal
(
jQuery
.
ajax
,
Subclass
.
ajax
,
'The subclass failed to get all top level methods'
);
equal
(
jQuery
.
ajax
,
Subclass
.
ajax
,
'The subclass failed to get all top level methods'
);
});
});
test
(
"jQuery.sub
class()
"
,
function
(){
test
(
"jQuery.sub
() - .fn Methods
"
,
function
(){
expect
(
378
);
expect
(
378
);
var
Subclass
=
jQuery
.
sub
class
(),
var
Subclass
=
jQuery
.
sub
(),
SubclassSubclass
=
Subclass
.
sub
class
(),
SubclassSubclass
=
Subclass
.
sub
(),
jQueryDocument
=
jQuery
(
document
),
jQueryDocument
=
jQuery
(
document
),
selectors
,
contexts
,
methods
,
method
,
arg
,
description
;
selectors
,
contexts
,
methods
,
method
,
arg
,
description
;
...
...
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