Outstanding patches from Jason
[webos-internals:modifications.git] / browser / browser-new-card-button.patch
1 Name: New Card Button In Browser
2 Version: 1.3.5-1
3 Author: Jason Robitaille
4 Description: Adds a new card button in the browser that opens up new browser cards  (MIT license)
5
6 --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/page-navigationmenu.js
7 +++ /usr/palm/applications/com.palm.app.browser/app/controllers/page-navigationmenu.js
8 @@ -22,6 +22,12 @@
9                 command: 'stop'
10         },
11         
12 +       NewCard: {
13 +               label: $L('New Card'),
14 +               icon: 'new',
15 +               command: 'new-page-cmd'
16 +       },
17 +       
18         Reload: {
19                 label: $L('Reload'),
20                 icon: 'refresh',
21 --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js
22 +++ /usr/palm/applications/com.palm.app.browser/app/controllers/page-controls.js
23 @@ -25,6 +25,13 @@
24                         icon: MenuData.NavigationMenu.Forward.icon,
25                         command: MenuData.NavigationMenu.Forward.command
26                 };
27 +               
28 +               this._newcardModel = {
29 +                       disabled: false,
30 +                       label: MenuData.NavigationMenu.NewCard.label,
31 +                       icon: MenuData.NavigationMenu.NewCard.icon,
32 +                       command: MenuData.NavigationMenu.NewCard.command
33 +               };
34  
35                 this._model = {
36                         visible: true,
37 @@ -48,6 +55,7 @@
38                         this._model.items.push(idleModel);
39                 }
40  
41 +               this._model.items.push(this._newcardModel);
42                 this._controller.setupWidget(Mojo.Menu.commandMenu, {menuClass: 'no-fade'}, this._model);
43         },
44  
45 @@ -74,6 +82,7 @@
46  
47                 // The spacer... right aligns the following button.
48                 items.push({});
49 +               items.push(this._newcardModel);
50  
51                 this._back = back;
52                 this._forward = forward;