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
2e544e9e
Commit
2e544e9e
authored
Oct 11, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 2 of 3 fixes of #164
parent
6de5a6b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
dashboard.xml
build/test/data/dashboard.xml
+2
-6
ajax.js
src/ajax/ajax.js
+12
-0
jquery.js
src/jquery/jquery.js
+16
-3
No files found.
build/test/data/dashboard.xml
View file @
2e544e9e
...
@@ -3,12 +3,8 @@
...
@@ -3,12 +3,8 @@
<locations>
<locations>
<location>
<location>
<infowindowtab>
<infowindowtab>
<tab
title=
"Location"
>
<tab
title=
"Location"
>
<![CDATA[blabla]]>
</tab>
<![CDATA[blabla]]>
<tab
title=
"Users"
>
<![CDATA[blublu]]>
</tab>
</tab>
<tab
title=
"Users"
>
<![CDATA[blublu]]>
</tab>
</infowindowtab>
</infowindowtab>
</location>
</location>
</locations>
</locations>
...
...
src/ajax/ajax.js
View file @
2e544e9e
...
@@ -288,6 +288,18 @@ jQuery.extend({
...
@@ -288,6 +288,18 @@ jQuery.extend({
* }
* }
* )
* )
*
*
* @test stop();
* $.get('data/dashboard.xml', function(xml) {
* var content = [];
* $('tab', xml).each(function() {
* content.push($(this).text());
* });
* ok( content[0] == 'blabla', 'Check first tab');
* ok( content[1] == 'blublu', 'Check second tab');
* start();
* });
*
*
* @name $.get
* @name $.get
* @type jQuery
* @type jQuery
* @param String url The URL of the page to load.
* @param String url The URL of the page to load.
...
...
src/jquery/jquery.js
View file @
2e544e9e
...
@@ -50,8 +50,10 @@ jQuery = function(a,c) {
...
@@ -50,8 +50,10 @@ jQuery = function(a,c) {
return
new
jQuery
(
a
,
c
);
return
new
jQuery
(
a
,
c
);
// Handle HTML strings
// Handle HTML strings
if
(
typeof
a
==
"string"
)
{
var
m
=
/^
[^
<
]
*
(
<.+>
)[^
>
]
*$/
.
exec
(
a
);
var
m
=
/^
[^
<
]
*
(
<.+>
)[^
>
]
*$/
.
exec
(
a
);
if
(
m
)
a
=
jQuery
.
clean
(
[
m
[
1
]
]
);
if
(
m
)
a
=
jQuery
.
clean
(
[
m
[
1
]
]
);
}
// Watch for when an array is passed in
// Watch for when an array is passed in
this
.
get
(
a
.
constructor
==
Array
||
a
.
length
&&
!
a
.
nodeType
&&
a
[
0
]
!=
undefined
&&
a
[
0
].
nodeType
?
this
.
get
(
a
.
constructor
==
Array
||
a
.
length
&&
!
a
.
nodeType
&&
a
[
0
]
!=
undefined
&&
a
[
0
].
nodeType
?
...
@@ -446,6 +448,17 @@ jQuery.fn = jQuery.prototype = {
...
@@ -446,6 +448,17 @@ jQuery.fn = jQuery.prototype = {
* $("#check2").attr('checked', false);
* $("#check2").attr('checked', false);
* ok( document.getElementById('check2').checked == false, 'Set checked attribute' );
* ok( document.getElementById('check2').checked == false, 'Set checked attribute' );
*
*
* @test stop();
* $.get('data/dashboard.xml', function(xml) {
* var titles = [];
* $('tab', xml).each(function() {
* titles.push($(this).attr('title'));
* });
* ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );
* ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );
* start();
* });
*
* @name attr
* @name attr
* @type jQuery
* @type jQuery
* @param String key The name of the property to set.
* @param String key The name of the property to set.
...
@@ -1558,7 +1571,7 @@ jQuery.extend({
...
@@ -1558,7 +1571,7 @@ jQuery.extend({
empty
:
"!a.childNodes.length"
,
empty
:
"!a.childNodes.length"
,
// Text Check
// Text Check
contains
:
"(a.innerText||a.innerHTML).indexOf(m[3])>=0"
,
contains
:
"(
(a.firstChild && a.firstChild.nodeValue)||
a.innerText||a.innerHTML).indexOf(m[3])>=0"
,
// Visibility
// Visibility
visible
:
"a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'"
,
visible
:
"a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'"
,
...
...
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