/[webpac2]/trunk/web/iwf/testers/iwfajax.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/web/iwf/testers/iwfajax.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69 - (hide annotations)
Sat Nov 19 23:48:19 2005 UTC (18 years, 6 months ago) by dpavlin
File MIME type: text/html
File size: 4152 byte(s)
 r8979@llin:  dpavlin | 2005-11-20 00:39:43 +0100
 another fix for checkboxes, added textarea, checkbox and radio buttons to
 tests

1 dpavlin 46 <html>
2     <head>
3     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
4     <style>
5     .altrow { background-color: lightgrey; }
6     </style>
7    
8     <script type='text/javascript' src='../iwfcore.js'></script>
9     <script type='text/javascript' src='../iwfxml.js'></script>
10     <script type='text/javascript' src='../iwfgui.js'></script>
11     <script type='text/javascript' src='../iwfajax.js'></script>
12    
13     <script type='text/javascript'>
14    
15     function testError(s){
16     alert("Test page error: Could not locate element with id of '" + s + "'");
17     return false;
18     }
19    
20     function getSource(id){
21     var el = iwfGetById(id);
22     if (!el){
23     return testError(id);
24     } else {
25     return el;
26     }
27     }
28    
29     function getTarget(id){
30     var el = getSource(id);
31     if (el){
32     var tgt = iwfGetById(el.value);
33     if (!tgt){
34     alert('No element exists on this page with an id attribute of "' + el.value + '"');
35     return false;
36     } else {
37     return tgt;
38     }
39     }
40     return false;
41     }
42    
43     function testGetById(){
44     var tgt = getTarget('txtGetById');
45     if (tgt){
46     alert(iwfElementToString(tgt));
47     }
48     }
49    
50     function testXmlEncode(){
51     var el = getSource('txtXmlEncode');
52     if (el){
53     alert(iwfXmlEncode(el.innerText));
54     }
55    
56     }
57    
58    
59     function test(w){
60     alert(w);
61     for(var i=0;i<w.attributes.length;i++){
62     alert(w.getAttribute(i));
63     }
64     }
65     </script>
66    
67     </head>
68     <body onclick2='javascript:iwfMoveTo("moveme", iwfEvent(event).X, iwfEvent(event).Y, 10)'>
69     <h1>Tester for iwfajax.js</h1>
70     <a href='javascript:iwfAlignTo("moveme", "formSubmitResults", "tc", "bc", 30);'>Align orange to Result</a><br />
71     <a href='javascript:iwfDockTo("moveme", "iwfContent", "tc", "bc", 30); '>Dock orange to iwfContent</a><br />
72     <a href='javascript:iwfUnDockFrom("moveme", "iwfContent", 30); '>Undock orange from iwfContent</a><br />
73     <a href='javascript:iwfMoveTo("iwfContent", 300, 300, 10); '>Move iwfContent</a><br />
74     <a href='javascript:iwfMoveTo("iwfContent", 100, 500, 10); '>Reset iwfContent</a><br />
75     <div id='moveme' style='background-color:orange; width:100px; top:10px; left:50px;position:absolute'>This should move</div><br />
76     <a href='javascript:iwfMoveTo("moveme", 0, 0, 20); iwfShowGently("moveme", 5)'>reset orange box</a><br />
77     <form action='iwfajaxpost.php' method='get' name='frmGet' iwfTarget='formSubmitResults'>
78     <input type='hidden' value='hidden get value' name='hidValue' />
79 dpavlin 69 <textarea name="textarea_content" cols="30" rows="2">sample text area content</textarea>
80     <br/><input type="checkbox" name="checkbox_test" /> checkbox
81     <br/><input type="radio" name="radio_test" value="first radio button"> first
82     <br/><input type="radio" name="radio_test" value="second radio button"> second
83     <br/>
84 dpavlin 46 <input type='button' value='HTTP GET' name='btnGet' onclick='javascript:iwfRequest(this);' />
85     <a href='javascript:iwfRequest("frmGet")'> GET via anchor</a>
86     </form>
87     <form action='iwfajaxpost.php' method='post' id='frmPost' iwfTarget='formSubmitResults'>
88     <input type='hidden' value='hidden post value' name='hidValue' />
89 dpavlin 69 <textarea name="textarea_content" cols="30" rows="2">sample text area content</textarea>
90     <br/><input type="checkbox" name="checkbox_test" /> checkbox
91     <br/><input type="radio" name="radio_test" value="first radio button"> first
92     <br/><input type="radio" name="radio_test" value="second radio button"> second
93     <br/>
94 dpavlin 46 <input type='button' value='HTTP POST' name='btnPost' onclick='javascript:iwfRequest(this);' />
95     <a href='javascript:iwfRequest("frmPost", "formSubmitResults")'> POST via anchor</a>
96     </form>
97     <p>
98     <button onclick='javascript:iwfShowLog()'>Show IWF Log</button>
99     </p>
100     <div id='formSubmitResults' style='border:1px solid black;'>
101     Results of form submittal should show up here.
102     </div>
103     <div id='iwfContent' style='border:3px solid blue; position:absolute;top:500px;left:100px;'>
104     If they show up here, there is problems! iwfTarget is not being recognized...
105     </div>
106     </body>
107 dpavlin 69 </html>

Properties

Name Value
svn:mime-type text/html

  ViewVC Help
Powered by ViewVC 1.1.26