| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
|
| 5 |
<title>RadioGroup (Animated StackContainer) Widget Test</title> |
| 6 |
|
| 7 |
|
| 8 |
<link rel="stylesheet" id="themeStyles" href="../../../dijit/themes/claro/claro.css"> |
| 9 |
<link rel="stylesheet" href="../resources/RadioGroup.css"> |
| 10 |
|
| 11 |
|
| 12 |
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug:true, parseOnLoad: true"></script> |
| 13 |
|
| 14 |
|
| 15 |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
| 16 |
|
| 17 |
<script language="JavaScript" type="text/javascript"> |
| 18 |
dojo.require("dojox.layout.RadioGroup"); |
| 19 |
dojo.require("dojo.parser"); |
| 20 |
dojo.require("dijit.layout.ContentPane"); |
| 21 |
dojo.require("dijit.form.ComboBox"); |
| 22 |
dojo.require("dijit.form.Button"); |
| 23 |
</script> |
| 24 |
|
| 25 |
<style type="text/css"> |
| 26 |
@import "../../../dojo/resources/dojo.css"; |
| 27 |
@import "../../../dijit/tests/css/dijitTests.css"; |
| 28 |
|
| 29 |
body { background:#a0a0a0 !important; } |
| 30 |
|
| 31 |
.dojoPane { |
| 32 |
background:#eee url('../../../util/resources/logo/positive/dojo.logo.png') no-repeat center center !important; |
| 33 |
} |
| 34 |
.dojoxPane { |
| 35 |
background:#ededed url('../../../util/resources/logo/positive/dojox.logo.png') no-repeat center center !important; |
| 36 |
} |
| 37 |
.dijitPane { |
| 38 |
background:#fefefe url('../../../util/resources/logo/positive/dijit.logo.png') no-repeat center center !important; |
| 39 |
} |
| 40 |
|
| 41 |
#newestone .dijitContentPane { |
| 42 |
background:#fff; |
| 43 |
} |
| 44 |
#newestone .dijitContentPane p { |
| 45 |
padding:20px; |
| 46 |
font-size:200%; |
| 47 |
} |
| 48 |
</style> |
| 49 |
|
| 50 |
</head> |
| 51 |
<body class="claro"> |
| 52 |
|
| 53 |
<h1 class="testTitle">dojox.layout.RadioGroup test</h1> |
| 54 |
|
| 55 |
<div style="width:915px; margin:0 auto; height:300px;"> |
| 56 |
<div id="firstGroup" dojoType="dojox.layout.RadioGroup" style="width:300px; height:300px; float:left;" hasButtons="true"> |
| 57 |
<div dojoType="dijit.layout.ContentPane" title="Dojo" class="dojoPane" style="width:300px; height:300px; "></div> |
| 58 |
<div dojoType="dijit.layout.ContentPane" title="Dijit" class="dijitPane" style="width:300px; height:300px; "></div> |
| 59 |
<div dojoType="dijit.layout.ContentPane" title="Dojox" class="dojoxPane" style="width:300px; height:300px; "></div> |
| 60 |
</div> |
| 61 |
|
| 62 |
<div id="firstFade" dojoType="dojox.layout.RadioGroupFade" style="width:300px; height:300px; float:left" hasButtons="true"> |
| 63 |
<div dojoType="dijit.layout.ContentPane" title="Dojo" class="dojoPane" style="width:300px; height:300px; "></div> |
| 64 |
<div dojoType="dijit.layout.ContentPane" title="Dijit" class="dijitPane" style="width:300px; height:300px; "></div> |
| 65 |
<div dojoType="dijit.layout.ContentPane" title="Dojox" class="dojoxPane" style="width:300px; height:300px; "></div> |
| 66 |
</div> |
| 67 |
|
| 68 |
<div id="firstSlide" dojoType="dojox.layout.RadioGroupSlide" style="width:300px; height:300px;" hasButtons="true"> |
| 69 |
<div dojoType="dijit.layout.ContentPane" title="Dojo" class="dojoPane" style="width:300px; height:300px; "></div> |
| 70 |
<div dojoType="dijit.layout.ContentPane" title="Dijit" class="dijitPane" style="width:300px; height:300px; "></div> |
| 71 |
<div dojoType="dijit.layout.ContentPane" title="Dojox" class="dojoxPane" style="width:300px; height:300px; "></div> |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
|
| 75 |
<br style="margin-top:30px; clear:both"> |
| 76 |
|
| 77 |
<div> |
| 78 |
<button dojoType="dijit.form.Button">add children |
| 79 |
<script type="dojo/method" data-dojo-event="onClick"> |
| 80 |
dojo.forEach(["firstGroup","firstFade","firstSlide"], function(id){ |
| 81 |
var w = dijit.byId(id); |
| 82 |
w.addChild( |
| 83 |
new dijit.layout.ContentPane({ |
| 84 |
title:"Added", href:"_lorem.html", |
| 85 |
style:"padding:8px; background-color:#fff" |
| 86 |
}) |
| 87 |
); |
| 88 |
}) |
| 89 |
</script> |
| 90 |
</button> |
| 91 |
|
| 92 |
<button dojoType="dijit.form.Button">remove one from each |
| 93 |
<script type="dojo/method" data-dojo-event="onClick"> |
| 94 |
dijit.registry.filter(function(w){ |
| 95 |
return w.declaredClass.match(/dojox\.layout\.RadioGroup/); |
| 96 |
}).forEach(function(w){ |
| 97 |
var child = w.selectedChildWidget; |
| 98 |
if(child){ |
| 99 |
w.removeChild(child); |
| 100 |
} |
| 101 |
}); |
| 102 |
</script> |
| 103 |
</button> |
| 104 |
</div> |
| 105 |
|
| 106 |
<div id="proggy" style="width:915px; margin:0 auto; height:300px;"> |
| 107 |
<div dojoType="dojox.layout.RadioGroupSlide" style="width:300px; height:300px; float:left" hasButtons="true"> |
| 108 |
<div dojoType="dijit.layout.ContentPane" slideFrom="top" title="Dojo" class="dojoPane" style="width:300px; height:300px; "><p>1</p></div> |
| 109 |
<div dojoType="dijit.layout.ContentPane" slideFrom="top" title="Dijit" class="dijitPane" style="width:300px; height:300px; "><p>2</p></div> |
| 110 |
<div dojoType="dijit.layout.ContentPane" slideFrom="top" title="Dojox" class="dojoxPane" style="width:300px; height:300px; "><p>3</p></div> |
| 111 |
</div> |
| 112 |
|
| 113 |
<div dojoType="dojox.layout.RadioGroupSlide" style="width:300px; height:300px;" hasButtons="true"> |
| 114 |
<div dojoType="dijit.layout.ContentPane" slideFrom="left" title="Dojo" class="dojoPane" style="width:300px; height:300px; "><p>1</p></div> |
| 115 |
<div dojoType="dijit.layout.ContentPane" slideFrom="bottom" title="Dijit" class="dijitPane" style="width:300px; height:300px; "><p>2</p></div> |
| 116 |
<div dojoType="dijit.layout.ContentPane" slideFrom="right" title="Dojox" class="dojoxPane" style="width:300px; height:300px; "><p>3</p></div> |
| 117 |
</div> |
| 118 |
</div> |
| 119 |
|
| 120 |
<script> |
| 121 |
dojo.addOnLoad(function(){ |
| 122 |
|
| 123 |
var x = 0, lorem = function(){ |
| 124 |
return "<p>Pane" + (++x) + " Content!</p>"; |
| 125 |
}; |
| 126 |
|
| 127 |
// basic programatic instantiation |
| 128 |
var g = new dojox.layout.RadioGroupSlide({ |
| 129 |
style:"width:300px; height:300px; float:left", |
| 130 |
hasButtons:true, |
| 131 |
id:"newestone" |
| 132 |
}).placeAt("proggy"); |
| 133 |
|
| 134 |
new dijit.layout.ContentPane({ title:"one", content:lorem() }).placeAt(g); |
| 135 |
new dijit.layout.ContentPane({ title:"two", content:lorem() }).placeAt(g); |
| 136 |
|
| 137 |
g.startup(); |
| 138 |
|
| 139 |
// testing addchild after startup |
| 140 |
new dijit.layout.ContentPane({ title:"after", content:lorem() }).placeAt(g); |
| 141 |
|
| 142 |
}); |
| 143 |
</script> |
| 144 |
|
| 145 |
<br style="margin-top:30px; clear:both"> |
| 146 |
|
| 147 |
<h2>Has no buttons (auto rotating via code)</h2> |
| 148 |
|
| 149 |
<div id="hasnobuttons" style="width:915px; margin:0 auto; height:300px;"> |
| 150 |
<div id="bfirstGroup" dojoType="dojox.layout.RadioGroup" style="width:300px; height:300px; float:left;"> |
| 151 |
<div dojoType="dijit.layout.ContentPane" href="doc0.html" title="Dojo" class="dojoPane" style="width:300px; height:300px;"></div> |
| 152 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dijit" class="dijitPane" style="width:300px; height:300px;"></div> |
| 153 |
<div dojoType="dijit.layout.ContentPane" href="doc0.html" title="Dojox" class="dojoxPane" style="width:300px; height:300px;"></div> |
| 154 |
</div> |
| 155 |
|
| 156 |
<div id="bfirstFade" dojoType="dojox.layout.RadioGroupFade" style="width:300px; height:300px; float:left"> |
| 157 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dojo" class="dojoPane" style="width:300px; height:300px;"></div> |
| 158 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dijit" class="dijitPane" style="width:300px; height:300px;"></div> |
| 159 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dojox" class="dojoxPane" style="width:300px; height:300px;"></div> |
| 160 |
</div> |
| 161 |
|
| 162 |
<div id="bfirstSlide" dojoType="dojox.layout.RadioGroupSlide" style="width:300px; height:300px;"> |
| 163 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dojo" class="dojoPane" style="width:300px; height:300px;"></div> |
| 164 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dijit" class="dijitPane" style="width:300px; height:300px;"></div> |
| 165 |
<div dojoType="dijit.layout.ContentPane" href="_lorem.html" title="Dojox" class="dojoxPane" style="width:300px; height:300px;"></div> |
| 166 |
</div> |
| 167 |
</div> |
| 168 |
<script> |
| 169 |
// make all the 3 RadioGroups above loop through their children. |
| 170 |
dojo.ready(function(){ |
| 171 |
var rnd = 500; |
| 172 |
dojo.query("#hasnobuttons > div").forEach(function(n){ |
| 173 |
var widget = dijit.byNode(n); |
| 174 |
setTimeout(function(){ |
| 175 |
setInterval(function(){ |
| 176 |
widget.forward(); |
| 177 |
}, 3000); |
| 178 |
}, rnd); |
| 179 |
rnd += 500; |
| 180 |
}); |
| 181 |
}); |
| 182 |
</script> |
| 183 |
|
| 184 |
</body> |
| 185 |
</html> |