Commits

Federico Pietta  committed 1eb0210

added template to preferences

  • Participants
  • Parent commits 4b339a6

Comments (0)

Files changed (2)

File app/assistants/preferences-assistant.js

 	/* setup widgets here */
 	
 	/* add event handlers to listen to events from widgets */
+	this.controller.get('preferences-title').innerHTML = $L("Preferences");
+	this.controller.get('preferences-sub').innerHTML = Mojo.appInfo.title + $L(" version: ") + Mojo.appInfo.version ;
+	
+	this.controller.get('autoplay').innerHTML = $L("Autoplay");
+	var toggleAttr = {trueValue: "on", trueLabel: "On",
+		falseValue: "off", falseLabel: "Off"};
+	this.toggleModel = { value: off, disabled: false };
+	this.controller.setupWidget("autoplaytoggle", toggleAttr, this.toggleModel);
+	this.controller.get('autoplaytxt').innerHTML = $L("Autoplay");
+	
+	this.controller.get('twitterclient').innerHTML = $L("Client Twitter");
+	this.controller.setupWidget("clientlist",
+		this.attributes = {
+			//label = $L("Client Twitter"),
+			choices: [
+				{label: "Twitter.com", value: "twitter"},
+				{label: "Spaz", value: "spaz"},
+				{label: "Spaz HD", value: "spaz-hd"},
+				{label: "Glimpse", value: "glimpse"},
+			]		
+		},
+		this.clientmodel = {
+			value: twitter,
+			disabled: false
+		}
+	); 
+	this.controller.get('twitterclienttxt').innerHTML = $L("Client Twitter");
+
+	
+
+	// setup icon
+	this.iconElement = this.controller.get('back');
+	this.iconTapHandler = this.iconTap.bindAsEventListener(this);
+	this.controller.listen(this.iconElement, Mojo.Event.tap, this.iconTapHandler);
+	
+	
+};
+
+PreferencesAssistant.prototype.iconTap = function(event)
+{
+	if (Mojo.Environment.DeviceInfo.modelNameAscii == 'TouchPad') this.controller.stageController.popScene();
 };
 
 PreferencesAssistant.prototype.activate = function(event) {
 PreferencesAssistant.prototype.cleanup = function(event) {
 	/* this function should do any cleanup needed before the scene is destroyed as 
 	   a result of being popped off the scene stack */
+	this.controller.stopListening(this.iconElement,  Mojo.Event.tap,
+								  this.iconTapHandler);
 };

File app/views/preferences/preferences-scene.html

-<!-- TODO: replace the contents of this file with your own html -->
-<div class="palm-body-text">
-	This scene "preferences" was generated on 2011-12-18 at 10:06:11.
+
+ <div class="preferences">
+         <div class="palm-page-header multi-line">
+                 <div class="palm-page-header-wrapper">
+                         <div class="icon" id="icon"></div>
+                         <div class="title main" id="preferences-title"></div>
+                         	<div class="title sub" id="preferences-sub"></div>
+                         <div class="back" id="back"></div>
+                 </div>
+         </div>
+         
+         <div class="palm-group">
+		<div class="palm-group-title" id="autoplay">Autoplay</div>
+		<div class="palm-list">
+			<div class="palm-row single">
+				<div class="palm-row-wrapper">
+					<div class="label left" id="autoplaytxt">Autoplay</div>
+					<div id="autoplaytoggle" x-mojo-element="ToggleButton"></div>
+				</div>
+			</div>
+               </div>
+        </div>
+         
+        <div class="palm-group">
+                <div class="palm-group-title" id="twitterclient">Twitter Client</div>
+		<div class="palm-list">
+			<div class="palm-row single">
+				<div class="palm-row-wrapper">
+					<div class="label left" id="twitterclienttxt">Twitter Client</div>
+					<div id="clientlist" x-mojo-element="ListSelector"></div>
+				</div>
+			</div>
+		</div>             
+        </div>
+        
 </div>