| 1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
<html data-dojo-textdir="rtl"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 6 |
<title>DOH complex inheritance test</title> |
| 7 |
|
| 8 |
<style type="text/css"> |
| 9 |
@import "../../../../dojo/resources/dojo.css"; |
| 10 |
@import "../../../../dijit/themes/claro/claro.css"; |
| 11 |
</style> |
| 12 |
|
| 13 |
|
| 14 |
<script type="text/javascript" src="../../../../dojo/dojo.js" |
| 15 |
data-dojo-config="isDebug: true, has: { 'dojo-bidi': true }"> |
| 16 |
</script> |
| 17 |
|
| 18 |
<script type="text/javascript"> |
| 19 |
dojo.require("dijit.layout.AccordionContainer"); |
| 20 |
dojo.require("dijit.layout.ContentPane"); |
| 21 |
dojo.require("dijit.layout.BorderContainer"); |
| 22 |
dojo.require("dijit.layout.TabContainer"); |
| 23 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
| 24 |
dojo.require("dijit.form.FilteringSelect"); |
| 25 |
dojo.require("dijit.form.SimpleTextarea"); |
| 26 |
dojo.require("dijit.form.Textarea"); |
| 27 |
dojo.require("dijit.form.TextBox"); |
| 28 |
dojo.require("doh.runner"); |
| 29 |
|
| 30 |
dojo.ready(function(){ |
| 31 |
|
| 32 |
doh.register("parse", function(){ |
| 33 |
dojo.parser.parse(); |
| 34 |
}); |
| 35 |
|
| 36 |
doh.register("before MarkupAccordion textBox", [ |
| 37 |
{ |
| 38 |
name: "text direction of 'beforeMarkupAccordion'", |
| 39 |
|
| 40 |
setUp: function(){ |
| 41 |
textBox = dijit.byId("beforeMarkupAccordion"); |
| 42 |
}, |
| 43 |
|
| 44 |
runTest: function(){ |
| 45 |
doh.is("rtl",textBox.focusNode.dir,"direction of :" + textBox.id); |
| 46 |
textBox.set('value','\u05e9\u05d9\u05de\u05d5\u05e9\u0020\u05d1\u05ea\u05d2\u05d9\u05d5\u05ea\u002e'); |
| 47 |
doh.is("rtl",textBox.focusNode.dir,"direction of :" + textBox.id); |
| 48 |
} |
| 49 |
} |
| 50 |
]); |
| 51 |
|
| 52 |
doh.register("test 'A Simple Pane'.", [ |
| 53 |
{ |
| 54 |
name:"check combo textDir.", |
| 55 |
|
| 56 |
runTest:function(){ |
| 57 |
combo = dijit.byId("selectInPane"); |
| 58 |
doh.is("rtl", combo.textDir, combo.id); |
| 59 |
} |
| 60 |
}, |
| 61 |
{ |
| 62 |
name: "check input field text direction", |
| 63 |
|
| 64 |
runTest: function(){ |
| 65 |
var textBox = dijit.byId("simpleTextbox"); |
| 66 |
|
| 67 |
doh.is("rtl", textBox.textDir,textBox.id); |
| 68 |
} |
| 69 |
} |
| 70 |
]); |
| 71 |
|
| 72 |
doh.register("test 'BorderContainer Pane'", [ |
| 73 |
{ |
| 74 |
name: "textDir of the panes", |
| 75 |
|
| 76 |
runTest: function(){ |
| 77 |
var bContainer = dijit.byId("borderContainerPane"), |
| 78 |
cPane1 = dijit.byId("contentPane1"), |
| 79 |
cPane2 = dijit.byId("contentPane2"); |
| 80 |
|
| 81 |
doh.is("auto",bContainer.textDir,"'borderContainerPane' textDir"); |
| 82 |
doh.is("ltr",cPane1.textDir,"'contentPane1' textDir"); |
| 83 |
doh.is("auto",cPane2.textDir,"'contentPane2' textDir"); |
| 84 |
|
| 85 |
} |
| 86 |
}, |
| 87 |
{ |
| 88 |
name: "textDir of textBoxes in the 'contentPane1' textDir='ltr'", |
| 89 |
|
| 90 |
runTest: function(){ |
| 91 |
var select = dijit.byId("selectL"), |
| 92 |
input1 = dijit.byId("inputLHeb"), |
| 93 |
input2 = dijit.byId("inputLEn"); |
| 94 |
|
| 95 |
doh.is("ltr",select.textDir,"'selectL' textDir"); |
| 96 |
doh.is("ltr",input1.textDir,"'inputLHeb' textDir"); |
| 97 |
doh.is("ltr",input2.textDir,"'inputLEn' textDir"); |
| 98 |
} |
| 99 |
}, |
| 100 |
{ |
| 101 |
name: "textDir of textBoxes in the 'contentPane2' textDir='auto'", |
| 102 |
|
| 103 |
runTest: function(){ |
| 104 |
var selectA = dijit.byId("selectA"), |
| 105 |
input1 = dijit.byId("inputAHeb"), |
| 106 |
input2 = dijit.byId("inputAEn"); |
| 107 |
|
| 108 |
doh.is("auto",selectA.textDir,"'selectA' textDir"); |
| 109 |
doh.is("auto",input1.textDir,"'inputAHeb' textDir"); |
| 110 |
doh.is("auto",input2.textDir,"'inputAEn' textDir"); |
| 111 |
|
| 112 |
doh.is("",selectA.dir,"'selectA' dir"); |
| 113 |
doh.is("rtl",input1.focusNode.dir,"'inputAHeb' textDir"); |
| 114 |
doh.is("ltr",input2.focusNode.dir,"'inputAEn' textDir"); |
| 115 |
} |
| 116 |
} |
| 117 |
]); |
| 118 |
|
| 119 |
doh.register("test 'Tags & panes with TextBoxesAreas'", [ |
| 120 |
{ |
| 121 |
name: "textDir of the panes", |
| 122 |
|
| 123 |
runTest: function(){ |
| 124 |
doh.is("auto",dijit.byId("embeddedLayoutPane").textDir,"'embeddedLayoutPane' textDir"); |
| 125 |
doh.is("ltr",dijit.byId("bContainer").textDir,"'bContainer' textDir"); |
| 126 |
doh.is("ltr",dijit.byId("contentPane3").textDir,"'contentPane3' textDir"); |
| 127 |
doh.is("auto",dijit.byId("contentPane4").textDir,"'contentPane4' textDir"); |
| 128 |
doh.is("auto",dijit.byId("tContainer").textDir,"'tContainer' textDir"); |
| 129 |
doh.is("rtl",dijit.byId("contentPane5").textDir,"'contentPane5' textDir"); |
| 130 |
doh.is("auto",dijit.byId("contentPane6").textDir,"'contentPane6' textDir"); |
| 131 |
} |
| 132 |
}, |
| 133 |
{ |
| 134 |
name: "textDir of textBoxes", |
| 135 |
|
| 136 |
runTest: function(){ |
| 137 |
doh.is("ltr",dijit.byId("ltrSimpleTexarea").textDir,"'ltrSimpleTexarea' textDir"); |
| 138 |
doh.is("ltr",dijit.byId("ltrSimpleTexarea").focusNode.dir,"'ltrSimpleTexarea' dir"); |
| 139 |
|
| 140 |
doh.is("auto",dijit.byId("autoSimpleTexarea").textDir,"'autoSimpleTexarea' textDir"); |
| 141 |
doh.is("rtl",dijit.byId("autoSimpleTexarea").focusNode.dir,"'autoSimpleTexarea' dir"); |
| 142 |
|
| 143 |
doh.is("rtl",dijit.byId("rtlSimpleTexarea").textDir,"'rtlSimpleTexarea' textDir"); |
| 144 |
doh.is("rtl",dijit.byId("rtlSimpleTexarea").focusNode.dir,"'rtlSimpleTexarea' dir"); |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
doh.is("auto",dijit.byId("texarea1").textDir,"'texarea1' textDir"); |
| 149 |
doh.is("rtl",dijit.byId("texarea1").focusNode.dir,"'texarea1' dir"); |
| 150 |
|
| 151 |
doh.is("auto",dijit.byId("texarea2").textDir,"'texarea2' textDir"); |
| 152 |
doh.is("ltr",dijit.byId("texarea2").focusNode.dir,"'texarea2' dir"); |
| 153 |
} |
| 154 |
} |
| 155 |
]); |
| 156 |
|
| 157 |
doh.run(); |
| 158 |
}); |
| 159 |
</script> |
| 160 |
|
| 161 |
</head> |
| 162 |
<body class="claro" data-dojo-textdir="rtl"> |
| 163 |
|
| 164 |
<h1 class="testTitle">AccordionContainer Tests textDir="rtl" - defined in body tag.</h1> |
| 165 |
<h2>Accordion from markup:</h2> |
| 166 |
<input id="beforeMarkupAccordion" data-dojo-type="dijit/form/TextBox" data-dojo-props='name:"ltrMSimpleTexarea", |
| 167 |
value:"Markup Testing.", rows:"1", cols:"20"'/> |
| 168 |
|
| 169 |
<div id="markupAccordion" data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props='style:"width:500px; height:600px; overflow:hidden"' > |
| 170 |
<div id="pane1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='selected:"true", title:"A Simple Pane"'> |
| 171 |
<select id= "selectInPane" data-dojo-type="dijit/form/FilteringSelect"> |
| 172 |
<option value="1">foo.</option> |
| 173 |
<option value="2">בר.</option> |
| 174 |
<option value="3">baz.</option> |
| 175 |
</select> |
| 176 |
<p> |
| 177 |
<input id="simpleTextbox" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"שלום!"'/> |
| 178 |
</p> |
| 179 |
</div> |
| 180 |
|
| 181 |
<div data-dojo-textdir="auto"> |
| 182 |
<div id="borderContainerPane" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props='title:"BorderContainer Pane"'> |
| 183 |
<div id="contentPane1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"left", style:"width:50%", splitter:"true", textDir:"ltr"'> |
| 184 |
<p> |
| 185 |
This Pane ovverrides the body defined textDir="rtl" to textDir="ltr". |
| 186 |
See some examples: |
| 187 |
</p> |
| 188 |
<select id="selectL" data-dojo-type="dijit/form/FilteringSelect"> |
| 189 |
<option value="1">foo.</option> |
| 190 |
<option value="2">בר.</option> |
| 191 |
<option value="3">baz.</option> |
| 192 |
</select> |
| 193 |
<p> |
| 194 |
<input id="inputLHeb" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"שלום!"'/> |
| 195 |
</p> |
| 196 |
<p> |
| 197 |
<input id="inputLEn" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"Hello!"'/> |
| 198 |
</p> |
| 199 |
</div> |
| 200 |
<div id="contentPane2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"center"'> |
| 201 |
<p> |
| 202 |
This Pane inherits its textDir from the dijit.layout.BorderContainer, and now textDir="auto". |
| 203 |
See some examples: |
| 204 |
</p> |
| 205 |
<select id="selectA" data-dojo-type="dijit/form/FilteringSelect"> |
| 206 |
<option value="1">foo.</option> |
| 207 |
<option value="2">בר.</option> |
| 208 |
<option value="3">baz.</option> |
| 209 |
</select> |
| 210 |
<p> |
| 211 |
<input id="inputAHeb" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"שלום!"'/> |
| 212 |
</p> |
| 213 |
<p> |
| 214 |
<input id="inputAEn" data-dojo-type="dijit/form/TextBox" data-dojo-props='value:"Hello!"'/> |
| 215 |
</p> |
| 216 |
</div> |
| 217 |
</div> |
| 218 |
</div> |
| 219 |
|
| 220 |
<div id="embeddedLayoutPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Tags & panes with TextBoxesAreas", |
| 221 |
textDir:"auto"'> |
| 222 |
<p> |
| 223 |
Here's a BorderContainer: textDir= contextual |
| 224 |
</p> |
| 225 |
<div data-dojo-textdir="ltr"> |
| 226 |
<div id="bContainer" data-dojo-type ="dijit.layout.BorderContainer" data-dojo-props='style:"height:200px; width:300px" '> |
| 227 |
<div id="contentPane3" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"left", style:"width:125px", splitter:"true"'> |
| 228 |
Left Pane: |
| 229 |
<textarea id="ltrSimpleTexarea" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props='name:"ltrSimpleTexarea", |
| 230 |
rows:"8", cols:"13"'> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt. |
| 231 |
</textarea> |
| 232 |
</div> |
| 233 |
<div id="contentPane4" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"center",textDir:"auto"'> |
| 234 |
Right Pane: |
| 235 |
<textarea id="autoSimpleTexarea" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props='name:"autoSimpleTexarea", rows:"8", cols:"13" |
| 236 |
'> לורם איפסום דולור סיט אמט, קונסקטורר אדיפיסינג אלית מוסן מנת. |
| 237 |
</textarea> |
| 238 |
</div> |
| 239 |
</div> |
| 240 |
</div> |
| 241 |
<p> |
| 242 |
And a TabContainer: |
| 243 |
</p> |
| 244 |
<div id="tContainer" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='style:"height:170px; width:450px"' > |
| 245 |
<div id="contentPane5" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Tab 1 textDir=rtl", textDir:"rtl"'> |
| 246 |
<textarea id="rtlSimpleTexarea" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props='name:"rtlSimpleTexarea", |
| 247 |
rows:"4", cols:"15" '>jhkjkh.</textarea> |
| 248 |
</div> |
| 249 |
<div id="contentPane6" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Tab 2 textDir=inherited from ContentPane"' > |
| 250 |
<textarea id="texarea1" data-dojo-type="dijit/form/Textarea" data-dojo-props='name:"texarea1", rows:"4", cols:"14" |
| 251 |
'>מבחן.</textarea> |
| 252 |
<textarea id="texarea2" data-dojo-type="dijit/form/Textarea" data-dojo-props='name:"texarea2", rows:"4", cols:"14" |
| 253 |
'>Test.</textarea> |
| 254 |
</div> |
| 255 |
</div> |
| 256 |
</div> |
| 257 |
</div> |
| 258 |
</body> |
| 259 |
</html> |