r20446: rename swat directory to swat.obsolete; keeping it around since there is...
[samba.git] / swat.obsolete / apps / qooxdoo-examples / example / Iframe_1.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo</title>
5   <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/qx.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15     <p>Iframe implementation. Elastic.</p>
16   </div>
17
18   <script type="text/javascript">
19     qx.core.Init.getInstance().defineMain(function()
20     {
21       var d = qx.ui.core.ClientDocument.getInstance();
22
23       //----------
24       // qx.ui.embed.Iframe
25       //----------
26
27       w1 = new qx.ui.embed.Iframe();
28
29       w1.addEventListener("load", function(e) {
30         this.debug("Loaded: " + this.getSource());
31       });
32
33       // elastic
34       w1.set( { left: 20, top: 96, right: 335, bottom: 48 } );
35       w1.setSource("http://www.google.com");
36
37       d.add(w1);
38
39
40       function changeURL(e) {
41
42         this.setSource(e.getData());
43       };
44
45       // make qx.ui.embed.Iframe react to event "surfTo" via function changeURL()
46       d.addEventListener("surfTo", changeURL, w1);
47
48
49       //-------------
50       // radio group
51       //-------------
52
53       var rd1 = new qx.ui.form.RadioButton("Google", "http://www.google.com");
54       var rd2 = new qx.ui.form.RadioButton("Yahoo", "http://www.yahoo.com");
55
56       rd1.set( { left: 20, top: 48, checked: true } );
57       rd2.set( { left: 120, top: 48 } );
58
59       var rbm = new qx.manager.selection.RadioManager( name, [rd1, rd2]);
60
61       // elements of radio group fire event "surfTo"
62       rbm.addEventListener("changeSelected", function(e)
63       {
64         d.dispatchEvent( new qx.event.type.DataEvent("surfTo", e.getData().getValue() ) );
65       });
66
67       d.add(rd1, rd2);
68     });
69   </script>
70 </body>
71 </html>