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
25205d3f
Commit
25205d3f
authored
Sep 13, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing topic.js as it will be a plugin
parent
4092e3d2
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1 addition
and
126 deletions
+1
-126
Makefile
Makefile
+0
-1
topic.js
src/topic.js
+0
-45
absolute.html
test/data/offset/absolute.html
+0
-1
body.html
test/data/offset/body.html
+0
-1
fixed.html
test/data/offset/fixed.html
+0
-1
relative.html
test/data/offset/relative.html
+0
-1
scroll.html
test/data/offset/scroll.html
+0
-1
static.html
test/data/offset/static.html
+0
-1
table.html
test/data/offset/table.html
+0
-1
selector.html
test/data/selector.html
+1
-0
bodyBackground.html
test/data/support/bodyBackground.html
+0
-1
boxModelIE.html
test/data/support/boxModelIE.html
+0
-1
hiddenIFrameFF.html
test/data/support/hiddenIFrameFF.html
+0
-1
index.html
test/index.html
+0
-2
topic.js
test/unit/topic.js
+0
-68
No files found.
Makefile
View file @
25205d3f
...
@@ -12,7 +12,6 @@ POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
...
@@ -12,7 +12,6 @@ POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
BASE_FILES
=
${
SRC_DIR
}
/core.js
\
BASE_FILES
=
${
SRC_DIR
}
/core.js
\
${
SRC_DIR
}
/callbacks.js
\
${
SRC_DIR
}
/callbacks.js
\
${
SRC_DIR
}
/deferred.js
\
${
SRC_DIR
}
/deferred.js
\
${
SRC_DIR
}
/topic.js
\
${
SRC_DIR
}
/support.js
\
${
SRC_DIR
}
/support.js
\
${
SRC_DIR
}
/data.js
\
${
SRC_DIR
}
/data.js
\
${
SRC_DIR
}
/queue.js
\
${
SRC_DIR
}
/queue.js
\
...
...
src/topic.js
deleted
100644 → 0
View file @
4092e3d2
(
function
(
jQuery
)
{
var
topics
=
{},
sliceTopic
=
[].
slice
;
jQuery
.
Topic
=
function
(
id
)
{
var
callbacks
,
method
,
topic
=
id
&&
topics
[
id
];
if
(
!
topic
)
{
callbacks
=
jQuery
.
Callbacks
();
topic
=
{
publish
:
callbacks
.
fire
,
subscribe
:
callbacks
.
add
,
unsubscribe
:
callbacks
.
remove
};
if
(
id
)
{
topics
[
id
]
=
topic
;
}
}
return
topic
;
};
jQuery
.
extend
({
subscribe
:
function
(
id
)
{
var
topic
=
jQuery
.
Topic
(
id
),
args
=
sliceTopic
.
call
(
arguments
,
1
);
topic
.
subscribe
.
apply
(
topic
,
args
);
return
{
topic
:
topic
,
args
:
args
};
},
unsubscribe
:
function
(
id
)
{
var
topic
=
id
&&
id
.
topic
||
jQuery
.
Topic
(
id
);
topic
.
unsubscribe
.
apply
(
topic
,
id
&&
id
.
args
||
sliceTopic
.
call
(
arguments
,
1
)
);
},
publish
:
function
(
id
)
{
var
topic
=
jQuery
.
Topic
(
id
);
topic
.
publish
.
apply
(
topic
,
sliceTopic
.
call
(
arguments
,
1
)
);
}
});
})(
jQuery
);
test/data/offset/absolute.html
View file @
25205d3f
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/body.html
View file @
25205d3f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/fixed.html
View file @
25205d3f
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/relative.html
View file @
25205d3f
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/scroll.html
View file @
25205d3f
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/static.html
View file @
25205d3f
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/offset/table.html
View file @
25205d3f
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle/sizzle.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
<script
src=
"../../../src/sizzle-jquery.js"
></script>
...
...
test/data/selector.html
View file @
25205d3f
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<title>
jQuery selector
</title>
<title>
jQuery selector
</title>
<script
src=
"../../src/core.js"
></script>
<script
src=
"../../src/core.js"
></script>
<script
src=
"../../src/callbacks.js"
></script>
<script
src=
"../../src/deferred.js"
></script>
<script
src=
"../../src/deferred.js"
></script>
<script
src=
"../../src/support.js"
></script>
<script
src=
"../../src/support.js"
></script>
<script
src=
"../../src/data.js"
></script>
<script
src=
"../../src/data.js"
></script>
...
...
test/data/support/bodyBackground.html
View file @
25205d3f
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
...
...
test/data/support/boxModelIE.html
View file @
25205d3f
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
...
...
test/data/support/hiddenIFrameFF.html
View file @
25205d3f
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/core.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/callbacks.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/deferred.js"
></script>
<script
src=
"../../../src/topic.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/support.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/data.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
<script
src=
"../../../src/queue.js"
></script>
...
...
test/index.html
View file @
25205d3f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
<script
src=
"../src/core.js"
></script>
<script
src=
"../src/core.js"
></script>
<script
src=
"../src/callbacks.js"
></script>
<script
src=
"../src/callbacks.js"
></script>
<script
src=
"../src/deferred.js"
></script>
<script
src=
"../src/deferred.js"
></script>
<script
src=
"../src/topic.js"
></script>
<script
src=
"../src/support.js"
></script>
<script
src=
"../src/support.js"
></script>
<script
src=
"../src/data.js"
></script>
<script
src=
"../src/data.js"
></script>
<script
src=
"../src/queue.js"
></script>
<script
src=
"../src/queue.js"
></script>
...
@@ -39,7 +38,6 @@
...
@@ -39,7 +38,6 @@
<script
src=
"unit/support.js"
></script>
<script
src=
"unit/support.js"
></script>
<script
src=
"unit/callbacks.js"
></script>
<script
src=
"unit/callbacks.js"
></script>
<script
src=
"unit/deferred.js"
></script>
<script
src=
"unit/deferred.js"
></script>
<script
src=
"unit/topic.js"
></script>
<script
src=
"unit/data.js"
></script>
<script
src=
"unit/data.js"
></script>
<script
src=
"unit/queue.js"
></script>
<script
src=
"unit/queue.js"
></script>
<script
src=
"unit/attributes.js"
></script>
<script
src=
"unit/attributes.js"
></script>
...
...
test/unit/topic.js
deleted
100644 → 0
View file @
4092e3d2
module
(
"topic"
,
{
teardown
:
moduleTeardown
});
test
(
"jQuery.Topic - Anonymous Topic"
,
function
()
{
expect
(
4
);
var
topic
=
jQuery
.
Topic
(),
count
=
0
;
function
firstCallback
(
value
)
{
strictEqual
(
count
,
1
,
"Callback called when needed"
);
strictEqual
(
value
,
"test"
,
"Published value received"
);
}
count
++
;
topic
.
subscribe
(
firstCallback
);
topic
.
publish
(
"test"
);
topic
.
unsubscribe
(
firstCallback
);
count
++
;
topic
.
subscribe
(
function
(
value
)
{
strictEqual
(
count
,
2
,
"Callback called when needed"
);
strictEqual
(
value
,
"test"
,
"Published value received"
);
});
topic
.
publish
(
"test"
);
});
test
(
"jQuery.Topic - Named Topic"
,
function
()
{
expect
(
2
);
function
callback
(
value
)
{
ok
(
true
,
"Callback called"
);
strictEqual
(
value
,
"test"
,
"Proper value received"
);
}
jQuery
.
Topic
(
"test"
).
subscribe
(
callback
);
jQuery
.
Topic
(
"test"
).
publish
(
"test"
);
jQuery
.
Topic
(
"test"
).
unsubscribe
(
callback
);
jQuery
.
Topic
(
"test"
).
publish
(
"test"
);
});
test
(
"jQuery.Topic - Helpers"
,
function
()
{
expect
(
4
);
function
callback
(
value
)
{
ok
(
true
,
"Callback called"
);
strictEqual
(
value
,
"test"
,
"Proper value received"
);
}
jQuery
.
subscribe
(
"test"
,
callback
);
jQuery
.
publish
(
"test"
,
"test"
);
jQuery
.
unsubscribe
(
"test"
,
callback
);
jQuery
.
publish
(
"test"
,
"test"
);
var
test
=
true
,
subscription
=
jQuery
.
subscribe
(
"test"
,
function
()
{
ok
(
test
,
"first callback called"
);
},
function
()
{
ok
(
test
,
"second callback called"
);
});
jQuery
.
publish
(
"test"
);
test
=
false
;
jQuery
.
unsubscribe
(
subscription
);
jQuery
.
publish
(
"test"
);
});
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