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
495ecb70
Commit
495ecb70
authored
Feb 05, 2007
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #907
parent
2c99c186
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
dashboard.xml
build/test/data/dashboard.xml
+2
-2
coreTest.js
src/jquery/coreTest.js
+7
-1
jquery.js
src/jquery/jquery.js
+10
-2
No files found.
build/test/data/dashboard.xml
View file @
495ecb70
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<dashboard>
<dashboard>
<locations
>
<locations
class=
"foo"
>
<location>
<location
for=
"bar"
>
<infowindowtab>
<infowindowtab>
<tab
title=
"Location"
>
<![CDATA[blabla]]>
</tab>
<tab
title=
"Location"
>
<![CDATA[blabla]]>
</tab>
<tab
title=
"Users"
>
<![CDATA[blublu]]>
</tab>
<tab
title=
"Users"
>
<![CDATA[blublu]]>
</tab>
...
...
src/jquery/coreTest.js
View file @
495ecb70
...
@@ -74,7 +74,7 @@ test("index(Object)", function() {
...
@@ -74,7 +74,7 @@ test("index(Object)", function() {
});
});
test
(
"attr(String)"
,
function
()
{
test
(
"attr(String)"
,
function
()
{
expect
(
1
3
);
expect
(
1
5
);
ok
(
$
(
'#text1'
).
attr
(
'value'
)
==
"Test"
,
'Check for value attribute'
);
ok
(
$
(
'#text1'
).
attr
(
'value'
)
==
"Test"
,
'Check for value attribute'
);
ok
(
$
(
'#text1'
).
attr
(
'type'
)
==
"text"
,
'Check for type attribute'
);
ok
(
$
(
'#text1'
).
attr
(
'type'
)
==
"text"
,
'Check for type attribute'
);
ok
(
$
(
'#radio1'
).
attr
(
'type'
)
==
"radio"
,
'Check for type attribute'
);
ok
(
$
(
'#radio1'
).
attr
(
'type'
)
==
"radio"
,
'Check for type attribute'
);
...
@@ -88,6 +88,12 @@ test("attr(String)", function() {
...
@@ -88,6 +88,12 @@ test("attr(String)", function() {
ok
(
$
(
'#text1'
).
attr
(
'name'
)
==
"action"
,
'Check for name attribute'
);
ok
(
$
(
'#text1'
).
attr
(
'name'
)
==
"action"
,
'Check for name attribute'
);
ok
(
$
(
'#form'
).
attr
(
'action'
).
indexOf
(
"formaction"
)
>=
0
,
'Check for action attribute'
);
ok
(
$
(
'#form'
).
attr
(
'action'
).
indexOf
(
"formaction"
)
>=
0
,
'Check for action attribute'
);
ok
(
$
(
'#anchor2'
).
attr
(
'href'
)
==
"#2"
,
'Check for non-absolute href (an anchor)'
);
ok
(
$
(
'#anchor2'
).
attr
(
'href'
)
==
"#2"
,
'Check for non-absolute href (an anchor)'
);
stop
();
$
.
get
(
"data/dashboard.xml"
,
function
(
xml
)
{
ok
(
$
(
"locations"
,
xml
).
attr
(
"class"
)
==
"foo"
,
"Check class attribute in XML document"
);
ok
(
$
(
"location"
,
xml
).
attr
(
"for"
)
==
"bar"
,
"Check for attribute in XML document"
);
start
();
});
});
});
test
(
"attr(String, Function)"
,
function
()
{
test
(
"attr(String, Function)"
,
function
()
{
...
...
src/jquery/jquery.js
View file @
495ecb70
...
@@ -1228,6 +1228,11 @@ jQuery.extend({
...
@@ -1228,6 +1228,11 @@ jQuery.extend({
return
!!
fn
&&
typeof
fn
!=
"string"
&&
return
!!
fn
&&
typeof
fn
!=
"string"
&&
typeof
fn
[
0
]
==
"undefined"
&&
/function/i
.
test
(
fn
+
""
);
typeof
fn
[
0
]
==
"undefined"
&&
/function/i
.
test
(
fn
+
""
);
},
},
// check if an element is in a XML document
isXMLDoc
:
function
(
elem
)
{
return
elem
.
tagName
&&
elem
.
ownerDocument
&&
!
elem
.
ownerDocument
.
body
;
},
nodeName
:
function
(
elem
,
name
)
{
nodeName
:
function
(
elem
,
name
)
{
return
elem
.
nodeName
&&
elem
.
nodeName
.
toUpperCase
()
==
name
.
toUpperCase
();
return
elem
.
nodeName
&&
elem
.
nodeName
.
toUpperCase
()
==
name
.
toUpperCase
();
...
@@ -1476,7 +1481,7 @@ jQuery.extend({
...
@@ -1476,7 +1481,7 @@ jQuery.extend({
},
},
attr
:
function
(
elem
,
name
,
value
){
attr
:
function
(
elem
,
name
,
value
){
var
fix
=
{
var
fix
=
jQuery
.
isXMLDoc
(
elem
)
?
{}
:
{
"for"
:
"htmlFor"
,
"for"
:
"htmlFor"
,
"class"
:
"className"
,
"class"
:
"className"
,
"float"
:
jQuery
.
browser
.
msie
?
"styleFloat"
:
"cssFloat"
,
"float"
:
jQuery
.
browser
.
msie
?
"styleFloat"
:
"cssFloat"
,
...
@@ -1507,6 +1512,8 @@ jQuery.extend({
...
@@ -1507,6 +1512,8 @@ jQuery.extend({
// Mozilla doesn't play well with opacity 1
// Mozilla doesn't play well with opacity 1
if
(
name
==
"opacity"
&&
jQuery
.
browser
.
mozilla
&&
value
==
1
)
if
(
name
==
"opacity"
&&
jQuery
.
browser
.
mozilla
&&
value
==
1
)
value
=
0.9999
;
value
=
0.9999
;
//
// Certain attributes only work when accessed via the old DOM 0 way
// Certain attributes only work when accessed via the old DOM 0 way
if
(
fix
[
name
]
)
{
if
(
fix
[
name
]
)
{
...
@@ -1518,7 +1525,8 @@ jQuery.extend({
...
@@ -1518,7 +1525,8 @@ jQuery.extend({
// IE elem.getAttribute passes even for style
// IE elem.getAttribute passes even for style
else
if
(
elem
.
tagName
)
{
else
if
(
elem
.
tagName
)
{
if
(
value
!=
undefined
)
elem
.
setAttribute
(
name
,
value
);
if
(
value
!=
undefined
)
elem
.
setAttribute
(
name
,
value
);
return
elem
.
getAttribute
(
name
);
return
elem
.
getAttribute
(
name
);
}
else
{
}
else
{
...
...
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