Changeset 7370
- Timestamp:
- 02/19/07 21:04:15 (21 months ago)
- Location:
- branches/0.4/tests
- Files:
-
- 8 modified
-
style/test_absolutePosition.html (modified) (2 diffs)
-
style/test_absolutePositionStrict.html (modified) (2 diffs)
-
style/test_sizing.html (modified) (1 diff)
-
style/test_style_css_insert.html (modified) (5 diffs)
-
style/test_style_getBox.html (modified) (4 diffs)
-
style/test_style_metrics.html (modified) (4 diffs)
-
test_behavior.html (modified) (1 diff)
-
test_html_selection.html (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/tests/style/test_absolutePosition.html
r6494 r7370 29 29 scroll.left + ", " + scroll.top; 30 30 } 31 dojo.addOnLoad(function(){ 32 dojo.event.connect(document.documentElement, "onmousemove", "onMouseMove"); 33 }); 31 34 </script> 32 35 </head> … … 68 71 <tr><td>dojo.html.getScrollLeft()/Top()</td><td id="s"></td></tr> 69 72 </table> 70 <script>71 dojo.event.connect(document.documentElement, "onmousemove", "onMouseMove");72 </script>73 73 <p>HTML after</p> 74 74 <p>HTML after</p> -
branches/0.4/tests/style/test_absolutePositionStrict.html
r6494 r7370 30 30 scroll.left + ", " + scroll.top; 31 31 } 32 33 dojo.addOnLoad(function(){ 34 dojo.event.connect(document.documentElement, "onmousemove", "onMouseMove"); 35 }); 32 36 </script> 33 37 </head> … … 69 73 <tr><td>dojo.html.getScrollLeft()/Top()</td><td id="s"></td></tr> 70 74 </table> 71 <script>72 dojo.event.connect(document.documentElement, "onmousemove", "onMouseMove");73 </script>74 75 <p>HTML after</p> 75 76 <p>HTML after</p> -
branches/0.4/tests/style/test_sizing.html
r4798 r7370 18 18 </script> 19 19 <script> 20 var tests = [21 { name: "outer size", func: dojo.html.getMarginBox, expected: { w: 110, h: 60 } },22 { name: "inner size", func: dojo.html.getBorderBox, expected: { w: 100, h: 50 } },23 { name: "content size", func: dojo.html.getContentBox, expected: { w: 80, h: 30 } }24 ];25 20 26 21 function onLoad(){ 22 var tests = [ 23 { name: "outer size", func: dojo.html.getMarginBox, expected: { w: 110, h: 60 } }, 24 { name: "inner size", func: dojo.html.getBorderBox, expected: { w: 100, h: 50 } }, 25 { name: "content size", func: dojo.html.getContentBox, expected: { w: 80, h: 30 } } 26 ]; 27 27 var objNames = [ "mytable", "mydiv" ]; 28 28 for(var on=0; on<objNames.length; on++) { -
branches/0.4/tests/style/test_style_css_insert.html
r4798 r7370 53 53 <pre id="cssAfter"></pre> 54 54 <script type="text/javascript"> 55 55 dojo.addOnLoad(function(){ 56 56 var success = true; 57 57 var css = '/*css before change*/\r\n' … … 109 109 debug("Success in all test for fixPathsInCssText", "green"); 110 110 } 111 111 }); 112 112 </script> 113 113 … … 116 116 <span id="insertCssText"/></span> 117 117 <script type="text/javascript"> 118 dojo.addOnLoad(function(){ 118 119 var success = true; 119 120 var span = dojo.byId("insertCssText"); … … 138 139 debug("Success in all test for insertCssText", "green"); 139 140 } 140 141 }); 141 142 </script> 142 143 <!----------------------------------------------------------------------------> 143 144 <span id="insertCssFile"></span> 144 145 <script type="text/javascript"> 145 146 dojo.addOnLoad(function(){ 146 147 var success = true; 147 148 var span = dojo.byId("insertCssFile"); … … 165 166 } 166 167 document.body.style.cursor = "default"; 168 }); 167 169 </script> 168 170 -
branches/0.4/tests/style/test_style_getBox.html
r4798 r7370 9 9 dojo.require("dojo.html.layout"); 10 10 dojo.require("dojo.event"); 11 function $ (id) { return dojo.lang.isString(id) ? document.getElementById(id) : id; }12 13 11 </script> 14 12 <style type="text/css"> … … 30 28 31 29 <script type="text/javascript"> 32 var contentBox = document.getElementById('contentBox'); 33 contentBox.innerHTML = 'ASSERT content-box == ' + dojo.html.getBoxSizing(contentBox); 34 35 var borderBox = document.getElementById('borderBox'); 36 borderBox.innerHTML = 'ASSERT border-box == ' + dojo.html.getBoxSizing(borderBox); 30 dojo.addOnLoad(function(){ 31 var contentBox = document.getElementById('contentBox'); 32 contentBox.innerHTML = 'ASSERT content-box == ' + dojo.html.getBoxSizing(contentBox); 33 34 var borderBox = document.getElementById('borderBox'); 35 borderBox.innerHTML = 'ASSERT border-box == ' + dojo.html.getBoxSizing(borderBox); 36 }); 37 37 </script> 38 38 … … 57 57 58 58 <script type="text/javascript"> 59 dojo.addOnLoad(function(){ 60 59 61 var sizes = [ '', 'width: auto; height: auto;', 'width: 450px; height: 80px;', 'width: 15em; height: 6em;' ]; 60 62 var margins = [ '', 'margin: 0;', 'margin: auto;', 'margin: 8px;', 'margin: 1em;' ]; … … 180 182 return '<pre>' + metrics.join('<br>') + '</pre>'; 181 183 } 184 }); 182 185 </script> 183 186 184 </script>185 187 -
branches/0.4/tests/style/test_style_metrics.html
r4798 r7370 9 9 dojo.require("dojo.html.layout"); 10 10 dojo.require("dojo.event"); 11 function $ (id) { return dojo.lang.isString(id) ? document.getElementById(id) : id; }12 13 11 </script> 14 12 <style type="text/css"> … … 27 25 28 26 <script type="text/javascript"> 29 var contentBox = document.getElementById('contentBox'); 30 contentBox.innerHTML = 'ASSERT content-box == ' + dojo.html.getBoxSizing(contentBox); 31 var borderBox = document.getElementById('borderBox'); 32 borderBox.innerHTML = 'ASSERT border-box == ' + dojo.html.getBoxSizing(borderBox); 27 dojo.addOnLoad(function(){ 28 var contentBox = document.getElementById('contentBox'); 29 contentBox.innerHTML = 'ASSERT content-box == ' + dojo.html.getBoxSizing(contentBox); 30 var borderBox = document.getElementById('borderBox'); 31 borderBox.innerHTML = 'ASSERT border-box == ' + dojo.html.getBoxSizing(borderBox); 32 }); 33 33 </script> 34 34 … … 46 46 47 47 <script type="text/javascript"> 48 dojo.addOnLoad(function(){ 48 49 var sizes = [ '', 'width: auto; height: auto;', 'width: 450px; height: 80px;', 'width: 15em; height: 6em;' ]; 49 50 var margins = [ '', 'margin: 0;', 'margin: auto;', 'margin: 8px;', 'margin: 1em;' ]; … … 123 124 return '<pre>' + metrics.join('<br>') + '</pre>'; 124 125 } 126 }); 125 127 </script> 126 128 127 </script>128 129 -
branches/0.4/tests/test_behavior.html
r3377 r7370 14 14 dojo.require("dojo.behavior"); 15 15 16 dojo.behavior.add({ 17 "border": function(elem){ 18 with(elem.style){ 19 border = "3px solid blue"; 20 padding = "5px"; 21 margin = "5px"; 22 } 23 }, 24 "clickSet": { 25 "onclick": function(evt){ 26 alert("clicked!"); 27 } 28 }, 29 "topicClickSet": { "onclick": "/foo/bar" }, 30 "addNodesButton": { "onclick": function(evt){ 31 var tNode = document.createElement("div"); 32 tNode.id = "border"; 33 document.body.appendChild(tNode); 34 tNode.innerHTML = "this should get a border when you hit the re-apply button"; 35 36 tNode = document.createElement("div"); 37 tNode.id = "clickSet"; 38 document.body.appendChild(tNode); 39 tNode.innerHTML = "this will become clickable when you hit the re-apply button"; 40 41 } }, 42 "reApplyButton": { "onclick": { targetObj: dojo.behavior, targetFunc: "apply" } } 43 }); 44 45 dojo.event.topic.subscribe("/foo/bar", function(){ 46 alert("event handled via the /foo/bar topic"); 47 }); 48 49 50 dojo.event.connect(dojo.behavior, "apply", function(){ 51 dojo.profile.dump(true); 16 dojo.addOnLoad(function(){ 17 dojo.behavior.add({ 18 "border": function(elem){ 19 with(elem.style){ 20 border = "3px solid blue"; 21 padding = "5px"; 22 margin = "5px"; 23 } 24 }, 25 "clickSet": { 26 "onclick": function(evt){ 27 alert("clicked!"); 28 } 29 }, 30 "topicClickSet": { "onclick": "/foo/bar" }, 31 "addNodesButton": { "onclick": function(evt){ 32 var tNode = document.createElement("div"); 33 tNode.id = "border"; 34 document.body.appendChild(tNode); 35 tNode.innerHTML = "this should get a border when you hit the re-apply button"; 36 37 tNode = document.createElement("div"); 38 tNode.id = "clickSet"; 39 document.body.appendChild(tNode); 40 tNode.innerHTML = "this will become clickable when you hit the re-apply button"; 41 42 } }, 43 "reApplyButton": { "onclick": { targetObj: dojo.behavior, targetFunc: "apply" } } 44 }); 45 46 dojo.event.topic.subscribe("/foo/bar", function(){ 47 alert("event handled via the /foo/bar topic"); 48 }); 49 50 51 dojo.event.connect(dojo.behavior, "apply", function(){ 52 dojo.profile.dump(true); 53 }); 52 54 }); 53 55 </script> -
branches/0.4/tests/test_html_selection.html
r4798 r7370 19 19 20 20 <script type="text/javascript"> 21 dojo.event.connect($("clearSelection"), "onmouseover", function (e) { 22 dojo.html.clearSelection(); 21 dojo.addOnLoad(function(){ 22 dojo.event.connect($("clearSelection"), "onmouseover", function (e) { 23 dojo.html.clearSelection(); 24 }); 23 25 }); 24 26 </script> … … 30 32 31 33 <script type="text/javascript"> 32 dojo.event.connect($("toggleSelection"), "onchange", function (e) { 33 if ($("toggleSelection").checked) { 34 dojo.html.disableSelection($("enabletest")); 35 } else { 36 dojo.html.enableSelection($("enabletest")); 37 } 34 dojo.addOnLoad(function(){ 35 dojo.event.connect($("toggleSelection"), "onchange", function (e) { 36 if ($("toggleSelection").checked) { 37 dojo.html.disableSelection($("enabletest")); 38 } else { 39 dojo.html.enableSelection($("enabletest")); 40 } 41 }); 38 42 }); 39 43 </script> … … 45 49 46 50 <script type="text/javascript"> 47 dojo.event.connect($("selectElement"), "onclick", function (e) { 48 dojo.html.selectElement($("selectElementtest")); 51 dojo.addOnLoad(function(){ 52 dojo.event.connect($("selectElement"), "onclick", function (e) { 53 dojo.html.selection.selectElementChildren($("selectElementtest")); 54 }); 49 55 }); 50 56 </script> 51 57 52 <h2><code> isSelectionCollapsed and other information</code></h2>58 <h2><code>dojo.html.selection.isCollapsed and other information</code></h2> 53 59 54 60 <p>selection collapsed: <b id="selectionCollapsed"></b></p> … … 58 64 dojo.addOnLoad(function(){ 59 65 setInterval(function () { 60 $("selectionCollapsed").innerHTML = dojo.html. isSelectionCollapsed();66 $("selectionCollapsed").innerHTML = dojo.html.selection.isCollapsed(); 61 67 var p = dojo.html.selection.getParentElement(); 62 68 if(p) … … 72 78 <p><span id="deleteSelection" onmouseover="">The current selection should be deleted when you mouse over this text span.</span></p> 73 79 <script type="text/javascript"> 74 dojo.event.connect($("deleteSelection"), "onmouseover", function (e) { 75 dojo.html.selection.remove(); 80 dojo.addOnLoad(function(){ 81 dojo.event.connect($("deleteSelection"), "onmouseover", function (e) { 82 dojo.html.selection.remove(); 83 }); 76 84 }); 77 85 </script>