r8855@llin: dpavlin | 2005-11-14 01:49:57 +0100
[webpac2] / web / iwf / testers / iwfajax.html
diff --git a/web/iwf/testers/iwfajax.html b/web/iwf/testers/iwfajax.html
new file mode 100644 (file)
index 0000000..f087cd8
--- /dev/null
@@ -0,0 +1,97 @@
+<html>\r
+       <head>\r
+               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+               <style>\r
+                       .altrow { background-color: lightgrey; }\r
+               </style>\r
+\r
+               <script type='text/javascript' src='../iwfcore.js'></script>\r
+               <script type='text/javascript' src='../iwfxml.js'></script>\r
+               <script type='text/javascript' src='../iwfgui.js'></script>\r
+               <script type='text/javascript' src='../iwfajax.js'></script>\r
+\r
+               <script type='text/javascript'>\r
+\r
+                       function testError(s){\r
+                                       alert("Test page error: Could not locate element with id of '" + s + "'");\r
+                                       return false;\r
+                       }\r
+\r
+                       function getSource(id){\r
+                               var el = iwfGetById(id);\r
+                               if (!el){\r
+                                       return testError(id);\r
+                               } else {\r
+                                       return el;\r
+                               }\r
+                       }\r
+\r
+                       function getTarget(id){\r
+                               var el = getSource(id);\r
+                               if (el){\r
+                                       var tgt = iwfGetById(el.value);\r
+                                       if (!tgt){\r
+                                               alert('No element exists on this page with an id attribute of "' + el.value + '"');\r
+                                               return false;\r
+                                       } else {\r
+                                               return tgt;\r
+                                       }\r
+                               }\r
+                               return false;\r
+                       }\r
+\r
+                       function testGetById(){\r
+                               var tgt = getTarget('txtGetById');\r
+                               if (tgt){\r
+                                       alert(iwfElementToString(tgt));\r
+                               }\r
+                       }\r
+\r
+                       function testXmlEncode(){\r
+                               var el = getSource('txtXmlEncode');\r
+                               if (el){\r
+                                       alert(iwfXmlEncode(el.innerText));\r
+                               }\r
+\r
+                       }\r
+\r
+\r
+                       function test(w){\r
+                               alert(w);\r
+                               for(var i=0;i<w.attributes.length;i++){\r
+                                       alert(w.getAttribute(i));\r
+                               }\r
+                       }\r
+               </script>\r
+\r
+       </head>\r
+       <body onclick2='javascript:iwfMoveTo("moveme", iwfEvent(event).X, iwfEvent(event).Y, 10)'>\r
+               <h1>Tester for iwfajax.js</h1>\r
+               <a href='javascript:iwfAlignTo("moveme", "formSubmitResults", "tc", "bc", 30);'>Align orange to Result</a><br />\r
+               <a href='javascript:iwfDockTo("moveme", "iwfContent", "tc", "bc", 30); '>Dock orange to iwfContent</a><br />\r
+               <a href='javascript:iwfUnDockFrom("moveme", "iwfContent", 30); '>Undock orange from iwfContent</a><br />\r
+               <a href='javascript:iwfMoveTo("iwfContent", 300, 300, 10); '>Move iwfContent</a><br />\r
+               <a href='javascript:iwfMoveTo("iwfContent", 100, 500, 10); '>Reset iwfContent</a><br />\r
+               <div id='moveme' style='background-color:orange; width:100px; top:10px; left:50px;position:absolute'>This should move</div><br />\r
+               <a href='javascript:iwfMoveTo("moveme", 0, 0, 20); iwfShowGently("moveme", 5)'>reset orange box</a><br />\r
+               <form action='iwfajaxpost.php' method='get' name='frmGet' iwfTarget='formSubmitResults'>\r
+                       <input type='hidden' value='hidden get value' name='hidValue' />\r
+                       <input type='button' value='HTTP GET'  name='btnGet' onclick='javascript:iwfRequest(this);' />\r
+                       <a href='javascript:iwfRequest("frmGet")'> GET via anchor</a>\r
+               </form>\r
+               <form action='iwfajaxpost.php' method='post' id='frmPost' iwfTarget='formSubmitResults'>\r
+                       <input type='hidden' value='hidden post value' name='hidValue' />\r
+                       <input type='button' value='HTTP POST'  name='btnPost' onclick='javascript:iwfRequest(this);' />\r
+                       <a href='javascript:iwfRequest("frmPost", "formSubmitResults")'> POST via anchor</a>\r
+               </form>\r
+               <p>\r
+                       <button onclick='javascript:iwfShowLog()'>Show IWF Log</button>\r
+               </p>\r
+               <div id='formSubmitResults' style='border:1px solid black;'>\r
+                       Results of form submittal should show up here.\r
+               </div>\r
+               <div id='iwfContent' style='border:3px solid blue; position:absolute;top:500px;left:100px;'>\r
+                       If they show up here, there is problems!  iwfTarget is not being recognized...\r
+               </div>\r
+       </body>\r
+</html>
\ No newline at end of file