Author: scottbw
Date: Tue Mar 15 15:19:39 2011
New Revision: 1081814

URL: http://svn.apache.org/viewvc?rev=1081814&view=rev
Log:
simplified the JQM template using the code currently working in the Freeder 
widget

Modified:
    incubator/wookie/trunk/widgets/widget-template/jqueryMobile/index.html
    
incubator/wookie/trunk/widgets/widget-template/jqueryMobile/scripts/properties.js

Modified: incubator/wookie/trunk/widgets/widget-template/jqueryMobile/index.html
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/widget-template/jqueryMobile/index.html?rev=1081814&r1=1081813&r2=1081814&view=diff
==============================================================================
--- incubator/wookie/trunk/widgets/widget-template/jqueryMobile/index.html 
(original)
+++ incubator/wookie/trunk/widgets/widget-template/jqueryMobile/index.html Tue 
Mar 15 15:19:39 2011
@@ -24,12 +24,12 @@
                <title>@widget.shortname@</title>
        </head>
        <body onLoad="Controller.init()">
-               <div data-role="page" data-theme="b" id="jqm-home">
+               <div data-role="page" data-theme="b" id="home">
                
-                   <div data-role="header" data-position="fixed">
+                   <div data-role="header">
                                <h4>Hello World</h4>
                                <a onClick="Controller.update()" 
data-role="button" data-icon="refresh" data-iconpos="notext">Refresh</a>
-                               <a href="#settings" data-role="button" 
data-icon="gear" data-iconpos="notext">Settings</a>
+                               <a href="#settings" data-role="button" 
data-rel="dialog" data-transition="pop" data-icon="gear" 
data-iconpos="notext">Settings</a>
                        </div> <!-- /header -->
                
                        <div data-role="content" class="ui-content">    
@@ -43,31 +43,12 @@
                                  <p>I'm not open by default, so you must have 
clicked on me to see this.</p>
                                </div>
                                
-                               <p><a href="#helloWorld">Say Hello</a></p>
-                       </div><!-- /content -->
-               
-                       <!--
-                       <div data-role="footer" data-position="fixed">
-                               <h4>Footer</h4>
-                       </div> /footer -->
-               </div><!-- /page -->
-               
-               <div data-role="page" id="helloWorld">
-               
-                   <div data-role="header" data-position="fixed">
-                               <h4>Hello World</h4>
-                               <a onClick="Controller.update()" 
data-role="button" data-icon="refresh" data-iconpos="notext">Refresh</a>
-                               <a href="#settings" data-role="button" 
data-icon="gear" data-iconpos="notext">Settings</a>
-                       </div> <!-- /header -->
-               
-                       <div data-role="content" class="ui-content">    
                                <p id="helloMessage">
                                  Hello. (this message will be replaced 
dynamically by the code).
                                </p>
                                
                                <p>Last Updated: <span 
id="lastUpdatedTime">00:00:00</span></p>
                                
-                               <p><a href="#home">Back Home</a></p>
                        </div><!-- /content -->
                
                        <!--
@@ -76,9 +57,10 @@
                        </div> /footer -->
                </div><!-- /page -->
                
-               <div data-role="page" id="settings">
                
-                       <div data-role="header" data-position="fixed">
+               <div data-role="dialog" id="settings">
+               
+                       <div data-role="header">
                                <h4>Settings</h4>
                        </div> <!-- /header -->
                
@@ -89,7 +71,8 @@
                                        <input type="url" name="name" id="name" 
 />
                                        </div>
                                        <div data-role="fieldcontain">
-                                               <button type="submit" 
onClick="Properties.submitForm(this.form)" value="save-settings" 
name="save-settings">Save</button>
+                                               <div data-role="button" 
onClick="Properties.submitForm()">Save</div>
+                                               <a href="#home" 
data-transition="pop" data-direction="reverse" data-role="button">Cancel</div>
                                        </div>
                        </form>
                        </div><!-- /content -->

Modified: 
incubator/wookie/trunk/widgets/widget-template/jqueryMobile/scripts/properties.js
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/widget-template/jqueryMobile/scripts/properties.js?rev=1081814&r1=1081813&r2=1081814&view=diff
==============================================================================
--- 
incubator/wookie/trunk/widgets/widget-template/jqueryMobile/scripts/properties.js
 (original)
+++ 
incubator/wookie/trunk/widgets/widget-template/jqueryMobile/scripts/properties.js
 Tue Mar 15 15:19:39 2011
@@ -24,7 +24,7 @@ var Properties = {
                var msg = "Hello " + dwr.util.getValue("name");
                Widget.preferences.setItem("message", msg);
                Controller.update();
-               $.mobile.changePage("#helloWorld");
+        $.mobile.changePage("#home", "pop", true);
        },
 
        /**
@@ -33,7 +33,7 @@ var Properties = {
        getMessage: function() {
                var msg = Widget.preferences.getItem("message");
                if (msg == undefined) {
-                       msg = 'Hello, tell us your name by editing the <a 
href="#settings" data-role="button" data-inline="true" 
data-icon="gear">Settings</a>';
+                       msg = 'Hello, tell us your name by clicking the 
Settings icon in the top-right</a>';
                }
                return msg;
        }               


Reply via email to