updates and new patches by rod
[webos-internals:modifications.git] / browser / browser-mega-mix.patch
1 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/page-applicationmenu.js b/usr/palm/applications/com.palm.app.browser/app/controllers/page-applicationmenu.js
2 index 9030f4d..cfadec6 100644
3 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/page-applicationmenu.js
4 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/page-applicationmenu.js
5 @@ -10,7 +10,19 @@ MenuData.ApplicationMenu = {
6                 label: $L('New Card'),
7                 command: 'new-page-cmd'
8         },
9 +
10 +       EnableGesture: {
11 +               label: $L('Enable Gesture'),
12 +               command: 'enable-gesture-cmd',
13 +               checkEnabled: true
14 +       },
15         
16 +       DisableGesture: {
17 +               label: $L('Disable Gesture'),
18 +               command: 'disable-gesture-cmd',
19 +               checkEnabled: true
20 +       },      
21 +               
22         SharePage: {
23                 label: $L('Share'),
24                 command: 'share-page-cmd',
25 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js b/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
26 index 09c898f..ec6f7a3 100644
27 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
28 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
29 @@ -92,7 +92,7 @@ PageAssistant.prototype.setup = function() {
30                 this._updateOrientation();
31  
32                 // Allow override of 'back' gesture in landscape mode.
33 -               this.controller.useLandscapePageUpDown(true);
34 +               this.controller.useLandscapePageUpDown(false);
35  
36                 // Create the browser server status control.
37                 this._browserServerStatus = new BrowserServerStatus(this.controller);
38 @@ -300,6 +300,9 @@ PageAssistant.prototype.activate = function(message) {
39                 
40                 this._updateOrientation();
41                 
42 +               // FullScreen Browser
43 +        this.controller.enableFullScreenMode(true);            
44 +               
45                 // Update any pending web preferences changes
46                 AppAssistant.WebPreferences.activate(this._webView.mojo);
47  
48 @@ -786,16 +789,26 @@ PageAssistant.prototype._setupMenus = function() {
49                 this.appMenuModel = {
50                         visible: true,
51                         items: [
52 -                               MenuData.ApplicationMenu.NewCard,
53 -                               MenuData.ApplicationMenu.AddBookmark,
54 +                               {
55 +                                       label: $L("On/Off Gesture"),
56 +                                       items: [
57 +                                           {label:$L('Enable Gesture'),     shortcut:'e', command:'enable-gesture-cmd'},
58 +                        {label:$L('Disable Gesture'),     shortcut:'d', command:'disable-gesture-cmd'},
59 +                                                  ]
60 +                               },      
61 +                               {label:$L('New Card'),     shortcut:'n', command:'new-page-cmd'},
62 +                               {label:$L('Add Bookmark'),     shortcut:'m', command:'add-bookmark-cmd'},
63                                 {
64                                         label: $L("Page"),
65                                         items: [
66 -                                               MenuData.ApplicationMenu.AddToLauncher,
67 -                                               MenuData.ApplicationMenu.SharePage]
68 +                                               {label:$L('Add To Launcher'),     shortcut:'l', command:'add-launch-icon-cmd'},
69 +                                               {label:$L('Share Page'),     shortcut:'s', command:'share-page-cmd'},
70 +                       {label:$L('Refresh Page'),     shortcut:'r', command:'refresh'},
71 +                           ]
72                                 },
73 -                               MenuData.ApplicationMenu.ShowBookmarks,
74 -                               MenuData.ApplicationMenu.ShowHistory]
75 +                               {label:$L('Bookmarks'),     shortcut:'b', command:'show-bookmarks-cmd'},
76 +                               {label:$L('History'),     shortcut:'h', command:'show-history-cmd'},
77 +                           ]
78                 };
79  
80                 this.controller.setupWidget(Mojo.Menu.appMenu, undefined, this.appMenuModel);
81 @@ -1893,6 +1906,7 @@ PageAssistant.prototype.moved = function() {
82                         this._addressBar.hide();
83                         this.chrome.hide();
84  
85 +               this.controller.enableFullScreenMode(true);
86                         // Only focus this webview widget if this assistant has
87                         // focus. All page-assisants can receive 'moved' events
88                         // so we have to be careful when explicitly setting the
89 @@ -1917,6 +1931,7 @@ PageAssistant.prototype.moved = function() {
90                 this._addressBar.show();
91                 this.chrome.show();
92  
93 +               this.controller.enableFullScreenMode(false);
94         } else {
95                 //Mojo.Log.info("-> TOP == 0 Do Nothing.");
96                 // Do nothing.
97 @@ -2106,7 +2121,15 @@ PageAssistant.prototype.handleCommand = function(event) {
98                                 case MenuData.ApplicationMenu.NewCard.command:
99                                         this._newBrowserPage();
100                                         break;
101 +                                       
102 +                               case MenuData.ApplicationMenu.EnableGesture.command:
103 +                                       this.controller.useLandscapePageUpDown(true);
104 +                                       break;  
105  
106 +                               case MenuData.ApplicationMenu.DisableGesture.command:
107 +                                       this.controller.useLandscapePageUpDown(false);
108 +                                       break;
109 +                                       
110                                 case MenuData.ApplicationMenu.AddBookmark.command:
111                                         urlReference = new UrlReference(this.currentUrl, this.currentTitle, new Date());
112                                         this._createDefaultBookmarkImages(urlReference);
113 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js b/usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js
114 index 965e167..ad50838 100644
115 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js
116 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js
117 @@ -98,7 +98,8 @@ PageControls = Class.create({
118                         type: 'idle',
119                         label: MenuData.NavigationMenu.Reload.label,
120                         icon: MenuData.NavigationMenu.Reload.icon,
121 -                       command: MenuData.NavigationMenu.Reload.command
122 +                       command: MenuData.NavigationMenu.Reload.command,
123 +
124                 };
125  
126                 if (this._animation) {
127 @@ -111,6 +112,7 @@ PageControls = Class.create({
128                 // The spacer... right aligns the following button.
129                 this._model.items.push(idleModel);
130                 this._controller.modelChanged(this._model);
131 +               this._controller.setMenuVisible(Mojo.Menu.commandMenu, false);
132  
133                 this._currentPageModel = idleModel;
134         },
135 @@ -141,6 +143,7 @@ PageControls = Class.create({
136                         this._model.items.push(progressModel);
137                         this._controller.modelChanged(this._model);
138                         this._animation.start(0);
139 +                       this._controller.setMenuVisible(Mojo.Menu.commandMenu, true);
140  
141                         this._currentPageModel = progressModel;
142  
143 @@ -186,6 +189,7 @@ PageControls = Class.create({
144                         this._model.items.push(searchModel);
145                         this._controller.modelChanged(this._model);
146                         this._animation.start();
147 +                       this._controller.setMenuVisible(Mojo.Menu.commandMenu, true);
148  
149                         this._currentPageModel = searchModel;
150  
151 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/startpage-assistant.js b/usr/palm/applications/com.palm.app.browser/app/controllers/startpage-assistant.js
152 index 1d890db..8dc6ecf 100644
153 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/startpage-assistant.js
154 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/startpage-assistant.js
155 @@ -23,7 +23,7 @@ StartpageAssistant.prototype.setup = function() {
156         this._updateOrientation();
157  
158         // Allow override of 'back' gesture in landscape mode.
159 -       this.controller.useLandscapePageUpDown(true);
160 +       this.controller.useLandscapePageUpDown(false);
161  
162         // Listen for scene scope keyboard events.
163         this.controller.listen(this.controller.sceneElement, Mojo.Event.keydown, this._onKeyDownEventHandler);
164 @@ -42,6 +42,13 @@ StartpageAssistant.prototype.setup = function() {
165         this.appMenuModel = {
166                 visible: true,
167                 items: [
168 +                               {
169 +                                       label: $L("On/Off Gesture"),
170 +                                       items: [
171 +                                           {label:$L('Enable Gesture'),     shortcut:'e', command:'enable-gesture-cmd'},
172 +                        {label:$L('Disable Gesture'),     shortcut:'d', command:'disable-gesture-cmd'},
173 +                                                  ]
174 +                               },      
175                         MenuData.ApplicationMenu.NewCard,
176                         MenuData.ApplicationMenu.AddBookmark,
177                         {
178 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/widget_webview.js b/usr/palm/applications/com.palm.app.browser/app/controllers/widget_webview.js
179 index 6f1811c..301d890 100644
180 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/widget_webview.js
181 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/widget_webview.js
182 @@ -537,7 +537,7 @@ Mojo.Widget.WebView = Class.create({
183                         // This browser page was purged when the application was not in the foreground.
184                         // Now that we're active again let's reconnect and reload the page.
185                         Mojo.Log.info("Reconnecting adapter to server.");
186 -                       this._connectAdapterToServer();
187 +                       this._connectAdapterToServer(false);
188                 }
189         },
190