Difference between revisions of "Patch Messaging Landscape Orientation"

From WebOS Internals
Jump to: navigation, search
Line 1: Line 1:
Landscape Orientation in Messagin app: /usr/palm/applications/com.palm.app.messaging/
+
Landscape Orientation in Messagin App:
  
first file we should edit is '''/app/controllers/compose-assistant.js'''
+
 
around line 390 u will see this:
+
+++PATCH CODE+++
<pre>  var ComposeAssistant = Class.create({
+
<pre>Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
  }
+
===================================================================
this.setCharacterCounterMaxLength();
+
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
  },</pre>
+
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
add this code right under it
+
@@ -97,7 +97,9 @@ var ChatviewAssistant = Class.create({
<pre> orientationChanged: function(orientation) {
+
if (orientation === "left" || orientation === "right") {
+
setup: function(){
this.controller.sceneElement.addClassName('landscape');
+
this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
} else {
+
-
this.controller.sceneElement.removeClassName('landscape');
+
+
}
+
+ // enable free orientation
},</pre>
+
+ this.controller.window.PalmSystem.setWindowOrientation("free");
once you are done it should look like this:
+
var messageTextWidgetAttributes = {
<pre>var ComposeAssistant = Class.create({
+
modelProperty: 'value',
 +
hintText: $L('Enter message here...'),
 +
@@ -196,6 +198,14 @@ var ChatviewAssistant = Class.create({
 +
this.handleFocus();
 +
}
 +
},
 +
+
 +
+ orientationChanged: function(orientation) {
 +
+ if (orientation === "left" || orientation === "right") {
 +
+ this.controller.sceneElement.addClassName('landscape');
 +
+ } else {
 +
+ this.controller.sceneElement.removeClassName('landscape');
 +
+ }
 +
+ },
 +
 +
cleanup: function(){
 +
this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
 +
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
===================================================================
 +
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
 +
@@ -73,7 +73,9 @@ var ComposeAssistant = Class.create({
 +
 +
  setup: function() {
 +
    this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
 +
-
 +
+
 +
+    // enable free orientation
 +
+ this.controller.window.PalmSystem.setWindowOrientation("free");
 +
this.searchList = {
 +
"property": "to$A",
 +
"includeEmails": false,
 +
@@ -386,6 +388,14 @@ var ComposeAssistant = Class.create({
 
     }
 
     }
 
  this.setCharacterCounterMaxLength();
 
  this.setCharacterCounterMaxLength();
 
   },
 
   },
+
+
orientationChanged: function(orientation) {
+
+ orientationChanged: function(orientation) {
if (orientation === "left" || orientation === "right") {
+
+ if (orientation === "left" || orientation === "right") {
this.controller.sceneElement.addClassName('landscape');
+
+ this.controller.sceneElement.addClassName('landscape');
} else {
+
+ } else {
this.controller.sceneElement.removeClassName('landscape');
+
+ this.controller.sceneElement.removeClassName('landscape');
}
+
+ }
},
+
+ },
 
    
 
    
 
   cleanup: function() {
 
   cleanup: function() {
     var that = this;</pre>
+
     var that = this;
now save and exit. next file we should edit is '''listview-assistant.js''' same directory.
+
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
around line 212 under '''var ListviewAssistant = Class.create(App e''' in the line:
+
===================================================================
<pre>this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);</pre>
+
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
edit it so that it looks like this then right under it add:
+
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
<pre>this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+
@@ -212,8 +212,10 @@ var ListviewAssistant = Class.create(App
 
// enable free orientation
 
this.controller.window.PalmSystem.setWindowOrientation("free");</pre>
 
should look like:
 
<pre>var ListviewAssistant = Class.create(App
 
 
  items:this.commandMenuModel  
 
  items:this.commandMenuModel  
 
     };   
 
     };   
 
 
 
 
   this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+
-    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);
+
-
// enable free orientation
+
+   this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
this.controller.window.PalmSystem.setWindowOrientation("free");
+
+
 +
+ // enable free orientation
 +
+ this.controller.window.PalmSystem.setWindowOrientation("free");
 
  this.filterField = this.controller.get('filterField');
 
  this.filterField = this.controller.get('filterField');
 
  this.buddyListHeader = this.controller.get('buddyListHeader');
 
  this.buddyListHeader = this.controller.get('buddyListHeader');
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);</pre>
+
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);
then around line 409 above '''handleCommand: function(event) {''' add :
+
@@ -1086,7 +1088,15 @@ var ListviewAssistant = Class.create(App
<pre>
+
  loadDebugView: function() {
orientationChanged: function(orientation) {
+
    this.controller.stageController.pushScene('debug');
if (orientation === "left" || orientation === "right") {
+
  },  
this.controller.sceneElement.addClassName('landscape');
+
-  
} else {
+
+
this.controller.sceneElement.removeClassName('landscape');
+
orientationChanged: function(orientation) {
}
+
+ if (orientation === "left" || orientation === "right") {
},</pre>
+
+ this.controller.sceneElement.addClassName('landscape');
this is how it should look like:
+
+ } else {
<pre> }
+
+ this.controller.sceneElement.removeClassName('landscape');
}
+
+ }
  },
+
+ },
orientationChanged: function(orientation) {
+
if (orientation === "left" || orientation === "right") {
+
  cleanup: function() {
this.controller.sceneElement.addClassName('landscape');
+
// save the listview state
} else {
+
  MessagingMojoService.setIsHistoryViewSelected(this.controller,(this.currentListView == this.Messaging.Views.HISTORY));
this.controller.sceneElement.removeClassName('landscape');
+
Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
}
+
===================================================================
},
+
--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
 +
+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
 +
@@ -642,10 +642,10 @@ img.avatar-overlay {
 +
}
 +
 +
.their-chat .message-container {
 +
- width: 255px;
 +
+ width: 85%;
 +
}
 +
.my-chat .message-container {
 +
- width: 280px;
 +
+ width: 95%;
 +
}
 +
.chat-entry .chat-balloon {
 +
min-height: 26px;
 +
@@ -823,7 +823,7 @@ img.avatar-overlay {
 +
position: fixed;
 +
bottom:0px;
 +
left:0px;
 +
- width: 320px;
 +
+ width: 100%;
 +
}
 
   
 
   
handleCommand: function(event) {
+
#messageContainer #messageTextWidget {
    // handle menu button command events</pre>
+
</pre>
now save and exit your all done
 
 
 
next would be to fix the chat balloons and the text box size so we get into '''/stylesheet/messaging.css'''
 
once there look for '''.their-chat .message-container''' and '''.my-chat .message-container''' around line 645
 
and change the widths should look like this:
 
<pre>.their-chat .message-container {
 
width: 95%;
 
}
 
.my-chat .message-container {
 
width: 95%;
 
}</pre>
 
after that go down to line 820 and look for '''#messageContainer {''' make it so that it looks like this:
 
<pre>#messageContainer {
 
position: fixed;
 
bottom:0px;
 
left:0px;
 
width: 100%;
 
}</pre>
 

Revision as of 00:08, 17 September 2009

Landscape Orientation in Messagin App:


+++PATCH CODE+++

Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
@@ -97,7 +97,9 @@ var ChatviewAssistant = Class.create({
 	
 	setup: function(){	
 		this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-		
+	
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");		
 		var messageTextWidgetAttributes = {
 			modelProperty: 'value',
 			hintText: $L('Enter message here...'),
@@ -196,6 +198,14 @@ var ChatviewAssistant = Class.create({
 			this.handleFocus();
 		}		
 	},
+ 
+	orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
 
 	cleanup: function(){
 		this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
@@ -73,7 +73,9 @@ var ComposeAssistant = Class.create({
 
   setup: function() {
     this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-
+	
+    // enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.searchList = {
 		"property": "to$A",
 		"includeEmails": false,
@@ -386,6 +388,14 @@ var ComposeAssistant = Class.create({
     }
 	this.setCharacterCounterMaxLength();
   },
+ 
+	orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
   
   cleanup: function() {
     var that = this;
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
@@ -212,8 +212,10 @@ var ListviewAssistant = Class.create(App
 		items:this.commandMenuModel 
     };  
 	
-    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);	
-	
+    this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);	
+			
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.filterField = this.controller.get('filterField');
 	this.buddyListHeader = this.controller.get('buddyListHeader');
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);
@@ -1086,7 +1088,15 @@ var ListviewAssistant = Class.create(App
   loadDebugView: function() {
     this.controller.stageController.pushScene('debug');
   },		  
-	  
+
+  orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
+  
   cleanup: function() {
 	// save the listview state
 	MessagingMojoService.setIsHistoryViewSelected(this.controller,(this.currentListView == this.Messaging.Views.HISTORY));
Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
@@ -642,10 +642,10 @@ img.avatar-overlay {
 }
 
 .their-chat .message-container {
-	width: 255px;
+	width: 85%;
 }
 .my-chat .message-container {
-	width: 280px;
+	width: 95%;
 }
 .chat-entry .chat-balloon {
 	min-height: 26px;
@@ -823,7 +823,7 @@ img.avatar-overlay {
 	position: fixed;
 	bottom:0px;
 	left:0px;
-	width: 320px;
+	width: 100%;
 }
 
 #messageContainer #messageTextWidget {