Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F1125718
manager.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
manager.html
View Options
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<
html
>
<
head
>
<
title
>
Dijit manager unit test
</
title
>
<
style
type
=
"text/css"
>
@
import
"../../../dojo/resources/dojo.css"
;
@
import
"../css/dijitTests.css"
;
</
style
>
<
script
type
=
"text/javascript"
src
=
"../../../dojo/dojo.js"
djConfig
=
"isDebug: true, parseOnLoad: true"
></
script
>
<
script
type
=
"text/javascript"
src
=
"../_testCommon.js"
></
script
>
<
script
type
=
"text/javascript"
>
dojo
.
require
(
"doh.runner"
);
dojo
.
require
(
"dijit.dijit"
);
dojo
.
declare
(
"foo"
,
dijit
.
_Widget
,
{
name
:
""
,
attr1
:
0
,
attr2
:
0
});
dojo
.
declare
(
"bar"
,
dijit
.
_Widget
,
{
name
:
""
,
attr1
:
0
,
attr2
:
0
});
dojo
.
addOnLoad
(
function
(){
doh
.
register
(
"dijit._base.manager"
,
[
function
forEachTest
(
t
){
var
names
=
[];
dijit
.
registry
.
forEach
(
function
(
widget
){
names
.
push
(
widget
.
name
);
});
t
.
is
(
names
.
join
(
" "
),
"bob is your uncle"
);
},
function
filterTest
(
t
){
var
names
=
[];
dijit
.
registry
.
filter
(
function
(
widget
){
return
widget
.
attr1
==
10
;
}).
forEach
(
function
(
widget
){
names
.
push
(
widget
.
name
);
});
t
.
is
(
names
.
join
(
" "
),
"bob uncle"
);
},
function
byId
(
t
){
t
.
is
(
dijit
.
byId
(
"three"
).
name
,
"your"
);
},
function
byClass
(
t
){
var
names
=
[];
dijit
.
registry
.
byClass
(
"bar"
).
forEach
(
function
(
widget
){
names
.
push
(
widget
.
name
);
});
t
.
is
(
names
.
join
(
" "
),
"your uncle"
);
},
function
deleteTest
(
t
){
var
names
=
[];
dijit
.
byId
(
"two"
).
destroy
();
dijit
.
byId
(
"four"
).
destroy
();
var
names
=
[];
dijit
.
registry
.
forEach
(
function
(
widget
){
names
.
push
(
widget
.
name
);
});
t
.
is
(
names
.
join
(
" "
),
"bob your"
);
},
function
getEnclosingWidgetTest
(
t
){
t
.
is
(
dijit
.
getEnclosingWidget
(
dojo
.
byId
(
"not-a-widget"
)),
null
);
t
.
is
(
dijit
.
getEnclosingWidget
(
dojo
.
byId
(
"three"
)).
name
,
"your"
);
t
.
is
(
dijit
.
getEnclosingWidget
(
dojo
.
byId
(
"three.one"
)).
name
,
"your"
);
t
.
is
(
dijit
.
getEnclosingWidget
(
dojo
.
byId
(
"three.one.one"
)).
name
,
"your"
);
}
]
);
doh
.
run
();
});
</
script
>
</
head
>
<
body
>
<
h1
>
Dijit Manager Unit Test
</
h1
>
<
div
dojoType
=
"foo"
id
=
"one"
name
=
"bob"
attr1
=
"10"
attr2
=
"10"
></
div
>
<
div
dojoType
=
"foo"
id
=
"two"
name
=
"is"
attr1
=
"5"
attr2
=
"10"
></
div
>
<
div
dojoType
=
"bar"
id
=
"three"
name
=
"your"
attr1
=
"5"
attr2
=
"5"
>
<
div
id
=
"three.one"
>
<
div
id
=
"three.one.one"
></
div
>
</
div
>
</
div
>
<
div
dojoType
=
"bar"
id
=
"four"
name
=
"uncle"
attr1
=
"10"
attr2
=
"5"
></
div
>
<
div
id
=
"not-a-widget"
></
div
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Wed, Jun 18, 06:57 (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24730
Default Alt Text
manager.html (2 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment