Renamed more-icons-per-row-5x4-flare576
[webos-internals:adamrmcd-modifications.git] / messaging / messagelandscape.patch
1 Formats the messages to landscape when phone is rotated.
2 Index: /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
3 ===================================================================
4 --- .orig/usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
5 +++ /usr/palm/applications/com.palm.app.email/app/controllers/accounts-assistant.js
6 @@ -53,6 +53,7 @@ var AccountsAssistant = Class.create(App
7                 EmailAppDepot.depot.isShowFavorites(AccountsAssistant.kFavoriteFoldersAccountID, this.depotGetFavExpanded.bind(this));
8  
9                 this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.keypressHandler.bind(this));
10 +                this.controller.window.PalmSystem.setWindowOrientation("free");
11         },
12  
13         cleanup: function() {
14 Index: /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
15 ===================================================================
16 --- .orig/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
17 +++ /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
18 @@ -186,6 +186,7 @@ var ComposeAssistant = Class.create({
19  
20                 // Delayed a little, since we want the header part of render as quickly as possible
21                 ComposeAssistant.onLoad.defer(this.controller, this.email);
22 +                this.controller.window.PalmSystem.setWindowOrientation("free");
23         },
24  
25         cleanup: function() {
26 @@ -641,7 +642,8 @@ ComposeAssistant.onLoad = function(contr
27         var bodyText = email.text;
28         var originalText = email.originalText;
29         // Reduce bad scripts, styles, and margin settings by removing the html up to (and including) the body tag.
30 -       var splitIndex = originalText.indexOf("<body");
31 +       /* -START- REPLACE BY D2GLOBALINC MODIFICATION TO FIX REPLY-FORWARD FORMATTING
32 +        var splitIndex = originalText.indexOf("<body");
33         if (splitIndex > 0) {
34                 splitIndex = originalText.indexOf('>', splitIndex);
35                 if (splitIndex > 0) {
36 @@ -651,7 +653,23 @@ ComposeAssistant.onLoad = function(contr
37                 }
38         }
39  
40 -       // Truncate to 100K if the message is too long. 
41 +       */
42 +        // -END- REPLACE BY D2GLOBALINC MODIFICATION TO FIX REPLY-FORWARD FORMATTING
43 +
44 +        // FIX BROKEN FORMATTING IN REPLAY-FORWARD
45 +        var splitIndex = originalText.indexOf("<body");
46 +        if (splitIndex > 0) {
47 +                splitIndex = originalText.indexOf('>', splitIndex);
48 +                if (splitIndex > 0) {
49 +                        splitIndex++;
50 +                        Mojo.Log.info("Slicing header starting at", splitIndex);
51 +                        originalText = originalText.slice(splitIndex);
52 +                }
53 +        } else {
54 +                originalText = originalText.gsub("\n","<br/>");
55 +        }
56 +
57 +        // Truncate to 100K if the message is too long. 
58         // cutting it off conservatively).
59         var maxBodyLength = 100000;
60         if (originalText.length > maxBodyLength) {
61 Index: /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
62 ===================================================================
63 --- .orig/usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
64 +++ /usr/palm/applications/com.palm.app.email/app/controllers/list-assistant.js
65 @@ -37,6 +37,7 @@ var ListAssistant = Class.create(App.Sce
66                                 {label:$L('Update'), icon:'sync', command:'sync'}
67                         ]};
68         this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
69 +        this.controller.window.PalmSystem.setWindowOrientation("free");
70    },
71  
72    // NOTE: this is called by app_scene's _setup function