23 more patches ported to 1.3.5
[webos-internals:modifications.git] / messaging / messaging-enable-landscape-messaging.patch
1 diff --git a/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js b/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
2 index aa6a2b7..792b7ce 100644
3 --- a/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
4 +++ b/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
5 @@ -128,6 +128,9 @@ var ChatviewAssistant = Class.create({
6                 Mojo.Log.info("++++++ChatviewAssistant::setup");
7                 this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
8                 
9 +               // enable free orientation
10 +               this.controller.window.PalmSystem.setWindowOrientation("free");
11 +               
12                 var messageTextWidgetAttributes = {
13                         modelProperty: 'value',
14                         hintText: $L('Enter message here...'),
15 @@ -232,6 +235,14 @@ var ChatviewAssistant = Class.create({
16                 }
17         },
18  
19 +       orientationChanged: function(orientation) {
20 +               if (orientation === "left" || orientation === "right") {
21 +                       this.controller.sceneElement.addClassName('landscape');
22 +               } else {
23 +                       this.controller.sceneElement.removeClassName('landscape');
24 +               }
25 +       },
26 +
27         cleanup: function() {
28                 this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
29                 this.chatListWidget.stopObserving(Mojo.Event.listTap, this.handleMessageTap);
30 diff --git a/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js b/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
31 index 9715c78..83a4521 100644
32 --- a/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
33 +++ b/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
34 @@ -81,6 +81,9 @@ var ComposeAssistant = Class.create({
35    setup: function() {
36      this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
37  
38 +       // enable free orientation
39 +       this.controller.window.PalmSystem.setWindowOrientation("free");
40 +
41         this.searchList = {
42                 "property": "to$A",
43                 "includeEmails": false,
44 @@ -400,6 +403,14 @@ var ComposeAssistant = Class.create({
45         this.setCharacterCounterMaxLength();
46    },
47    
48 +       orientationChanged: function(orientation) {
49 +               if (orientation === "left" || orientation === "right") {
50 +                       this.controller.sceneElement.addClassName('landscape');
51 +               } else {
52 +                       this.controller.sceneElement.removeClassName('landscape');
53 +               }
54 +       },
55 +
56    cleanup: function() {
57      var that = this;
58         
59 diff --git a/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js b/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
60 index 5058e58..b7a22cf 100644
61 --- a/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
62 +++ b/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
63 @@ -214,7 +214,9 @@ var ListviewAssistant = Class.create(App.Scene, {
64                         items: this.commandMenuModel
65                 };
66         
67 -               this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);
68 +               this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
69 +               // enable free orientation
70 +               this.controller.window.PalmSystem.setWindowOrientation("free");
71         
72                 this.filterField = this.controller.get('filterField');
73                 this.buddyListHeader = this.controller.get('buddyListHeader');
74 @@ -1094,6 +1096,14 @@ var ListviewAssistant = Class.create(App.Scene, {
75                 this.controller.stageController.pushScene('debug');
76         },
77         
78 +       orientationChanged: function(orientation) {
79 +               if (orientation === "left" || orientation === "right") {
80 +                       this.controller.sceneElement.addClassName('landscape');
81 +               } else {
82 +                       this.controller.sceneElement.removeClassName('landscape');
83 +               }
84 +       },
85 +       
86         cleanup: function() {
87                 // save the listview state
88                 MessagingMojoService.setIsHistoryViewSelected(this.controller, (this.currentListView == this.Messaging.Views.HISTORY));
89 diff --git a/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css b/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
90 index 73af153..ea73f5e 100644
91 --- a/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
92 +++ b/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
93 @@ -605,10 +605,10 @@ img.avatar-overlay {
94  }
95  
96  .their-chat .message-container {
97 -       width: 255px;
98 +       width: 85%;
99  }
100  .my-chat .message-container {
101 -       width: 280px;
102 +       width: 95%;
103  }
104  .chat-entry .chat-balloon {
105         min-height: 26px;
106 @@ -839,7 +839,7 @@ img.avatar-overlay {
107         position: fixed;
108         bottom:0px;
109         left:0px;
110 -       width: 320px;
111 +       width: 100%;
112  }
113  
114  /* Force addressing widget to sit on top of