Updated patches and some new tap radius versions.
[webos-internals:skurriers-modifications.git] / app-launcher / app-launcher-advanced-configuration-for-app-launcher.patch
1 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/app-info-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/app-info-assistant.js
2 index 6b3e351..85032f1 100644
3 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/app-info-assistant.js
4 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/app-info-assistant.js
5 @@ -7,7 +7,10 @@ var AppInfoAssistant = Class.create({
6                 this.isDynamic = this.isDynamicLaunchPoint(this.appInfo);
7                 this.closeCallback = closeCallback;
8  
9 -               this.onDone = this.onDone.bind(this);
10 +               this.action = "";
11 +
12 +               this.onMove = this.onDone.bind(this, "move");
13 +               this.onDone = this.onDone.bind(this, "done");
14         },
15         
16         setup: function(widget) {
17 @@ -86,6 +89,7 @@ var AppInfoAssistant = Class.create({
18         
19         setupButtons: function() {
20                 
21 +               var moveModel = {buttonLabel: $L('Move')}               
22                 var doneModel = {buttonLabel: $L('Done')}
23                 
24                 if (this.appInfo.removable) {
25 @@ -100,6 +104,9 @@ var AppInfoAssistant = Class.create({
26                         this.sceneController.setupWidget('delete-btn', {type: Mojo.Widget.activityButton}, this.deleteModel);
27                         this.sceneController.listen('delete-btn', Mojo.Event.tap, this.onDelete.bindAsEventListener(this));
28                         this.sceneController.get('delete-btn').show();
29 +
30 +                       // mode button
31 +                       moveModel.buttonClass = 'dismiss';
32                         
33                         // done button
34                         doneModel.buttonClass = 'dismiss';
35 @@ -108,6 +115,9 @@ var AppInfoAssistant = Class.create({
36                         this.sceneController.get('delete-btn').hide();
37                 }
38                 
39 +               this.sceneController.setupWidget('move-btn', undefined, moveModel);
40 +               this.sceneController.listen('move-btn', Mojo.Event.tap, this.onMove);
41 +
42                 this.sceneController.setupWidget('done-btn', undefined, doneModel);
43                 this.sceneController.listen('done-btn', Mojo.Event.tap, this.onDone);
44         },
45 @@ -136,7 +146,9 @@ var AppInfoAssistant = Class.create({
46                 }
47         },
48  
49 -       onDone: function() {
50 +       onDone: function(action) {
51 +               this.action = action;
52 +               
53                 var deleteBtn = this.sceneController.get('delete-btn');
54                 if (deleteBtn && deleteBtn.mojo && deleteBtn.mojo.deactivate) {
55                         deleteBtn.mojo.deactivate();
56 @@ -163,6 +175,6 @@ var AppInfoAssistant = Class.create({
57                         this.appSizeRequest.cancel();
58                         this.appSizeRequest = undefined;
59                 }
60 -               this.closeCallback();
61 +               this.closeCallback(this.action);
62         }
63  });
64 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
65 index b9db2c2..ea19fec 100644
66 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
67 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
68 @@ -249,9 +249,6 @@ GlobalSearchAssistant = Class.create({
69                         SystemManagerService.showLauncher(false);
70                         this.launcherHiddenAtFirstKeydown = false;
71                 }
72 -               else {
73 -                       SystemManagerService.showQuickLaunch(true);
74 -               }
75                 
76                 this.galInit();
77         },
78 @@ -265,15 +262,13 @@ GlobalSearchAssistant = Class.create({
79         },
80         
81         onKeyDown: function(event) {
82 -               
83 -               this.searchField.mojo.focus();
84  
85                 // block key events from global search
86 -               if (!this.searchEnabled) {
87 -                       event.stop();
88 +               if (!this.searchEnabled)
89                         return;
90 -               }
91                 
92 +               this.searchField.mojo.focus();
93 +
94                 // track whether we should hide the launcher when exiting global search
95                 if (this.searchTerm.length === 0 && !Mojo.Controller.stageController.isActiveAndHasScenes()) {                  
96                         this.launcherHiddenAtFirstKeydown = true;
97 @@ -283,10 +278,8 @@ GlobalSearchAssistant = Class.create({
98         onKeyUp: function(event) {
99                 
100                 // block key events from global search
101 -               if (!this.searchEnabled) {
102 -                       event.stop();
103 +               if (!this.searchEnabled)
104                         return;
105 -               }
106         
107                 // first key no longer being held
108                 this.searchPressHoldTerm = "";
109 @@ -299,6 +292,10 @@ GlobalSearchAssistant = Class.create({
110         
111         onKeyPress: function(event) {
112                 
113 +               // block key events from global search
114 +               if (!this.searchEnabled)
115 +                       return;
116 +                               
117                 if(this.searchPressHoldTerm && this.searchPressHoldTerm.length > 0 && event.keyCode != this.searchPressHoldTerm.charCodeAt(0)) {
118                 // first key no longer being held
119              this.searchPressHoldTerm = "";
120 @@ -310,8 +307,7 @@ GlobalSearchAssistant = Class.create({
121          } 
122  
123                 // block key events from global search and from repeating until the first key has been processed
124 -               if (!this.searchEnabled || 
125 -                       this.searchPressHoldTerm.length !== 0 ||
126 +               if (this.searchPressHoldTerm.length !== 0 ||
127                         (event.keyCode === Mojo.Char.spaceBar && !this.searchActive)) {
128                         
129                         event.stop();
130 @@ -341,6 +337,10 @@ GlobalSearchAssistant = Class.create({
131         
132         onSearchTermChanged: function(event) {
133                 
134 +               // block key events from global search
135 +               if (!this.searchEnabled)
136 +                       return;
137 +               
138                 if (event.originalEvent && event.originalEvent.keyCode === Mojo.Char.enter) {
139                         if (this.currentFilter.length > 0) {
140                                 // i'm feeling lucky
141 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
142 index 9057138..3c64702 100644
143 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
144 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
145 @@ -8,7 +8,7 @@ var LauncherAssistant = Class.create({
146          * hardcoding the quick launch height until we can find a better way. 
147          * This value = ql graphic height - the offset from the top (small fade area)
148          */
149 -       kQuickLaunchHeight: 67,
150 +       kQuickLaunchHeight: 0,
151         
152         kPageIndicatorSpacing: 6,       /* spacing between each page indicator */
153         kPageMargin: 10, /* 10 pixel margin on each side of a page */
154 @@ -23,11 +23,25 @@ var LauncherAssistant = Class.create({
155                 visible: true,
156                 label: $L('Launcher'),
157          items: [
158 -                       /*{ label: $L('New page'), command: 'newpage' },
159 -                       { label: $L('Delete page'), command: 'deletepage' },*/
160                         Mojo.Menu.editItem,
161 -                       { label: $L('List Apps...'), command: 'listapps' },
162 -                       { label: $L('Default Applications'), command: 'defaultapps'},
163 +                       { label: $L('App Launcher'),
164 +                               items: [
165 +                                       { label: $L('Enter Edit Mode'), command: 'toggleedit' },
166 +                                       { label: $L('Show Page Names'), command: 'togglenames' },
167 +                                       { label: $L('Set As Default Page'), command: 'togglepage' },
168 +                                       { label: $L('Enable Position Reset'), command: 'togglereset' },
169 +                                       { label: $L('Enable Page Wrapping'), command: 'togglewrap' }
170 +                               ]
171 +                       },
172 +                       { label: $L('Quick Launch Bar'), 
173 +                               items: [
174 +                                       { label: $L('Always Visible'), command: 'qlvisible', disabled: false },
175 +                                       { label: $L('Always Hidden'), command: 'qlhidden', disabled: false },
176 +                                       { label: $L('Hide in Launcher'), command: 'qlmixed', disabled: false }
177 +                               ]
178 +                       },
179 +                       { label: $L('List All Applications'), command: 'listapps' },
180 +                       { label: $L('Default Applications'), command: 'defaultapps' },
181                         Mojo.Menu.helpItem
182                 ]
183      },
184 @@ -59,10 +73,44 @@ var LauncherAssistant = Class.create({
185                 
186                 this.dragStartHandler = this.onDragStart.bindAsEventListener(this);
187                 this.launchApp = this.launchApp.bind(this);
188 +
189 +               this.pageText = "";
190 +
191 +               this.activePageIndex = 0;
192 +               
193 +               this.pagingAnimating = false;
194 +               
195 +               this.appLauncherCfg = {header: false, reset: false, wrap: false, page: "default", pages: []};
196 +               
197 +               this.quickLaunchCfg = {mode: "visible"};
198         },
199         
200         setup: function() {
201                 
202 +               this.getPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
203 +                       method: 'getPreferences', parameters: {subscribe: false, keys: ['appLauncherCfg', 'quickLaunchCfg']},
204 +                       onSuccess: this.handlePreferences.bind(this) });
205 +
206 +               this.viewMenuModel = {visible: false,
207 +                       items: [ 
208 +                               {items: [
209 +                                       { icon: "new", command: "addnewpage"},
210 +                                       { icon: 'delete', command: 'deletepage'}
211 +                               ]},
212 +                               { label: "Rename", command: "renamepage"},
213 +                               {items: [
214 +                                       { icon: "back", command: "movepageleft"},
215 +                                       { icon: 'forward', command: 'movepageright'}
216 +                               ]}
217 +                       ]
218 +               };
219 +
220 +               this.controller.setupWidget(Mojo.Menu.commandMenu, {spacerHeight: 0, menuClass: 'no-fade'},
221 +                       this.viewMenuModel);
222 +
223 +               Mojo.listen($('page_header'), Mojo.Event.tap, this.handleHeaderTap.bindAsEventListener(this));
224 +               
225 +               Mojo.listen(this.controller.document, Mojo.Event.activate, this.onActivate.bindAsEventListener(this));
226                 Mojo.listen(this.controller.document, Mojo.Event.deactivate, this.onDeactivate.bindAsEventListener(this));
227                 Mojo.listen(this.controller.window, 'resize', this.onResize.bindAsEventListener(this));
228                 
229 @@ -83,11 +131,21 @@ var LauncherAssistant = Class.create({
230                 
231                 this.controller.setupWidget('launcher_root', undefined, this.launcherRootModel);
232                 
233 +               this.controller.listen('page_text', Mojo.Event.propertyChange, this.handlePageRename.bindAsEventListener(this));
234 +               
235                 this.reorderController = new ReorderController(this, this.onReorderFinished.bind(this));
236 -               Mojo.listen($('launcher_root'), Mojo.Event.propertyChange, this.onPageChange.bindAsEventListener(this));
237                 
238 -               this.controller.setupWidget(Mojo.Menu.appMenu, {omitDefaultItems:true}, this.appMenuModel);
239 +               this.pageChangeHandler = this.onPageChange.bindAsEventListener(this);
240 +               Mojo.listen($('launcher_root'), Mojo.Event.propertyChange, this.pageChangeHandler);
241 +               
242 +               this.scrollStartingHandler = this.scrollStarting.bindAsEventListener(this);
243  
244 +               this.controller.setupWidget(Mojo.Menu.appMenu, {omitDefaultItems:true}, this.appMenuModel);
245 +               
246 +               this.pageNameModel = { value: this.pageText };
247 +               
248 +               this.controller.setupWidget('page_text', {disabled: false, autoFocus: false}, this.pageNameModel);
249 +               
250                 // pre-calculate commonly used measurements
251                 this.kPageWidth = $('launcher_root').getWidth();
252                 this.kPageWidthNoMargin = (this.kPageWidth - this.kPageMargin * 2);
253 @@ -121,21 +179,49 @@ var LauncherAssistant = Class.create({
254                                 case 'defaultapps':
255                                         ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.defaultAppParams);
256                                         break;
257 -                               /*
258 -                               case 'newpage':
259 -                                       if (this.pageDivs.length < 10) {
260 -                                               this.insertPage(this.activePageIndex, true);
261 +                               case 'qlvisible':
262 +                                       this.setupQuickLaunch("visible");
263 +                                       break;
264 +                               case 'qlhidden':
265 +                                       this.setupQuickLaunch("hidden");
266 +                                       break;
267 +                               case 'qlmixed':
268 +                                       this.setupQuickLaunch("mixed");
269 +                                       break;
270 +                               case 'addnewpage':
271 +                                       if (this.pageDivs.length < 12) {
272 +                                               this.insertPage(this.pageDivs.length, true);
273                                         }
274                                         break;
275                                 case 'deletepage':
276                                         if (this.pageDivs.length > 1) {
277 -                                               this.deletePage(this.activePageIndex);
278 -                                               if (this.activePageIndex >= this.pageDivs.length) {
279 -                                                       this.activePageIndex = this.pageDivs.length - 1;
280 -                                               }
281 +                                               this.confirmDelete();
282                                         }
283                                         break;
284 -                               */
285 +                               case 'renamepage':
286 +                                       this.startPageRename();
287 +                                       break;
288 +                               case 'movepageleft':
289 +                                       this.movePage("left");
290 +                                       break;
291 +                               case 'movepageright':
292 +                                       this.movePage("right");
293 +                                       break;                                  
294 +                               case 'toggleedit':
295 +                                       this.setupAppLauncher(event, "edit");
296 +                                       break;
297 +                               case 'togglenames':
298 +                                       this.setupAppLauncher(event, "names");
299 +                                       break;
300 +                               case 'togglepage':
301 +                                       this.setupAppLauncher(event, "page");
302 +                                       break;
303 +                               case 'togglewrap':
304 +                                       this.setupAppLauncher(event, "wrap");
305 +                                       break;
306 +                               case 'togglereset':
307 +                                       this.setupAppLauncher(event, "reset");
308 +                                       break;
309                         }
310                 }
311                 else if (event.type === Mojo.Event.commandEnable) {
312 @@ -157,11 +243,486 @@ var LauncherAssistant = Class.create({
313                         }
314                 }
315         },
316 +       
317 +       handlePreferences: function(payload) {
318 +               if(payload != undefined) {
319 +                       if(payload.appLauncherCfg != undefined)
320 +                               this.appLauncherCfg = payload.appLauncherCfg;
321 +                       
322 +                       if(payload.quickLaunchCfg != undefined)
323 +                               this.quickLaunchCfg = payload.quickLaunchCfg;
324 +               }
325 +               
326 +               this.updateAppLauncher(true);
327 +               this.updateQuickLaunch(true);
328 +       },
329 +
330 +       setupAppLauncher: function(event, option) {
331 +               if(option == "edit") {
332 +                       var chooseCallback = this.selectPage.bind(this);
333 +               
334 +                       this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
335 +               }
336 +               else {
337 +                       if(option == "names") {
338 +                               if(this.appLauncherCfg.header)
339 +                                       this.appLauncherCfg.header = false;
340 +                               else
341 +                                       this.appLauncherCfg.header = true;
342 +                       }
343 +                       else if(option == "page") {
344 +                               if(this.appLauncherCfg.page == "default")
345 +                                       this.appLauncherCfg.page = this.activePageIndex;
346 +                               else
347 +                                       this.appLauncherCfg.page = "default";
348 +                       }
349 +                       else if(option == "reset") {
350 +                               if(this.appLauncherCfg.reset)
351 +                                       this.appLauncherCfg.reset = false;
352 +                               else
353 +                                       this.appLauncherCfg.reset = true;
354 +                       }
355 +                       else if(option == "wrap") {
356 +                               if(this.appLauncherCfg.wrap)
357 +                                       this.appLauncherCfg.wrap = false;
358 +                               else
359 +                                       this.appLauncherCfg.wrap = true;
360 +                       }
361 +
362 +                       this.updateAppLauncher();
363 +               
364 +                       if(this.setPreferencesRequest)
365 +                               this.setPreferencesRequest.cancel();
366 +               
367 +                       this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
368 +                               method: 'setPreferences', parameters: {'appLauncherCfg': this.appLauncherCfg} });
369 +               }
370 +       },
371 +       
372 +       setupQuickLaunch: function(mode) {
373 +               this.quickLaunchCfg.mode = mode;
374 +
375 +               this.updateQuickLaunch(false);
376 +               
377 +               if(this.setPreferencesRequest)
378 +                       this.setPreferencesRequest.cancel();
379 +                       
380 +               this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
381 +                       method: 'setPreferences', parameters: {'quickLaunchCfg': this.quickLaunchCfg} });
382 +       },
383 +
384 +       updateAppLauncher: function(init) {
385 +               if(this.appLauncherCfg.header) {
386 +                       this.appMenuModel.items[1].items[1].label = "Hide Page Names";
387 +                       this.controller.get('page_header').style.display = "block";
388 +                       this.controller.get('page_name').style.display = "block";
389 +                       
390 +                       this.updatePageHeader();
391 +               }
392 +               else {
393 +                       this.appMenuModel.items[1].items[1].label = "Show Page Names";
394 +                       this.controller.get('page_header').style.display = "none";
395 +                       this.controller.get('page_name').style.display = "none";
396 +               }
397 +
398 +               if(this.appLauncherCfg.page != "default")
399 +                       this.appMenuModel.items[1].items[2].label = "Unset Default Page";
400 +               else 
401 +                       this.appMenuModel.items[1].items[2].label = "Set As Default Page";
402 +
403 +               if(this.appLauncherCfg.reset)
404 +                       this.appMenuModel.items[1].items[3].label = "Disable Position Reset";
405 +               else 
406 +                       this.appMenuModel.items[1].items[3].label = "Enable Position Reset";
407 +
408 +               if(this.appLauncherCfg.wrap) {
409 +                       this.appMenuModel.items[1].items[4].label = "Disable Page Wrapping";
410 +                       
411 +                       Mojo.listen($('launcher_root'), Mojo.Event.scrollStarting, this.scrollStartingHandler);
412 +               }
413 +               else {
414 +                       this.appMenuModel.items[1].items[4].label = "Enable Page Wrapping";
415 +                       
416 +                       Mojo.stopListening($('launcher_root'), Mojo.Event.scrollStarting, this.scrollStartingHandler);
417 +               }
418 +
419 +               for(var i = 0; i < this.pageDivs.length; i++)
420 +                       this.updatePageLayout(i, 0);
421 +       },
422 +
423 +       updateQuickLaunch: function(init) {
424 +               this.appMenuModel.items[2].items[0].disabled = false;
425 +               this.appMenuModel.items[2].items[1].disabled = false;
426 +               this.appMenuModel.items[2].items[2].disabled = false;
427 +
428 +               if(this.quickLaunchCfg.mode == "visible") {
429 +                       this.appMenuModel.items[2].items[0].disabled = true;
430 +                       SystemManagerService.showQuickLaunch(true);
431 +                       this.kQuickLaunchHeight = 67;
432 +               }       
433 +               else if(this.quickLaunchCfg.mode == "hidden") {
434 +                       this.appMenuModel.items[2].items[1].disabled = true;
435 +                       SystemManagerService.showQuickLaunch(false);
436 +                       this.kQuickLaunchHeight = 0;
437 +               }       
438 +               else if(this.quickLaunchCfg.mode == "mixed") {
439 +                       this.appMenuModel.items[2].items[2].disabled = true;
440 +                       SystemManagerService.showQuickLaunch(init);
441 +                       this.kQuickLaunchHeight = 0;
442 +               }
443 +
444 +               this.adjustLayout();
445 +       },
446 +
447 +       updatePageHeader: function() {
448 +               if(this.appLauncherCfg.header) {
449 +                       var pageName = this.getPageName(this.activePageIndex);
450 +                       
451 +                       this.controller.get('page_name').update(pageName);
452 +
453 +                       this.controller.get('page_text').style.display = "none";
454 +                       this.controller.get('page_name').style.display = "block";
455 +               }
456 +       },
457 +       
458 +       handleHeaderTap: function(event) {
459 +               if((event.up) && ( event.up.altKey || event.up.metaKey )) {
460 +                       var chooseCallback = this.selectPage.bind(this);
461 +
462 +                       this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
463 +               }
464 +               else {
465 +                       var chooseCallback = this.jumpToPage.bind(this);
466 +
467 +                       this.showPageMenus(false, "Jump to Page:", chooseCallback);
468 +               }
469 +       },
470 +       
471 +       startPageRename: function() {
472 +               this.pageNameModel.value = this.getPageName(this.activePageIndex);
473 +               this.controller.modelChanged(this.pageNameModel);
474 +
475 +               var curPos = this.pageNameModel.value.length;
476 +
477 +               this.controller.get('page_name').style.display = "none";
478 +               this.controller.get('page_text').style.display = "block";
479 +
480 +               this.controller.get('page_text').mojo.setCursorPosition(curPos, curPos);
481 +               this.controller.get('page_text').mojo.focus();
482 +       },
483 +       
484 +       handlePageRename: function(event) {
485 +               var chooseCallback = this.selectPage.bind(this);
486 +
487 +               this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
488 +
489 +               this.setPageName(this.activePageIndex, this.pageNameModel.value);
490 +
491 +               if(this.setPreferencesRequest)
492 +                       this.setPreferencesRequest.cancel();
493 +       
494 +               this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
495 +                       method: 'setPreferences', parameters: {'appLauncherCfg': this.appLauncherCfg} });
496 +       },
497 +
498 +       selectPage: function(index) {
499 +               if(index == undefined) {
500 +                       this.hidePageMenus();
501 +               }
502 +               else {
503 +                       this.changePage(index, true);
504 +                       
505 +                       var chooseCallback = this.selectPage.bind(this);
506 +
507 +                       this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
508 +               }
509 +       },
510 +
511 +       jumpToPage: function(index) {
512 +               if(index == undefined) {
513 +                       this.hidePageMenus();
514 +               }
515 +               else {
516 +                       this.changePage(index, true);
517 +                       
518 +                       this.hidePageMenus();           
519 +               }
520 +       },
521 +       
522 +       movePage: function(direction) {
523 +               if(direction == "left") {
524 +                       var newIndex = parseInt(this.activePageIndex) - 1;
525 +                       
526 +                       if(newIndex < 0)
527 +                               return;
528 +               }
529 +               else if(direction == "right") {
530 +                       var newIndex = parseInt(this.activePageIndex) + 1;
531 +
532 +                       if(newIndex == this.pageDivs.length)
533 +                               return;
534 +               }
535 +       
536 +               if(this.appLauncherCfg.page != "default") {
537 +                       if(this.appLauncherCfg.page == this.activePageIndex)
538 +                               this.appLauncherCfg.page = newIndex;                    
539 +               }
540                 
541 +               var oldIndex = parseInt(this.activePageIndex);
542 +
543 +               var tmp = this.appLauncherCfg.pages.splice(oldIndex,1);
544 +
545 +               this.appLauncherCfg.pages.splice(newIndex,0,tmp[0]);
546 +
547 +               this.pagesModel.switchPages(oldIndex, newIndex);
548 +
549 +               this.pagesModel.save();
550 +                                               
551 +               var apps1 = this.getAppContainer(oldIndex).select('.app');
552 +               var apps2 = this.getAppContainer(newIndex).select('.app');
553 +
554 +               var container1 = this.getAppContainer(oldIndex);
555 +               var container2 = this.getAppContainer(newIndex);
556 +
557 +               apps1.each(function(app) {
558 +                       container1.removeChild(app);
559 +                       container2.appendChild(app);
560 +               }.bind(this));
561 +
562 +               apps2.each(function(app) {
563 +                       container2.removeChild(app);
564 +                       container1.appendChild(app);
565 +               }.bind(this));
566 +
567 +               if (apps1.length > 0)
568 +                       this.updatePageLayout(oldIndex, apps1.length);
569 +
570 +               if (apps2.length > 0)
571 +                       this.updatePageLayout(newIndex, apps2.length);
572 +
573 +               this.selectPage(newIndex);
574 +               
575 +               if(this.setPreferencesRequest)
576 +                       this.setPreferencesRequest.cancel();
577 +               
578 +               this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
579 +                       method: 'setPreferences', parameters: {'appLauncherCfg': this.appLauncherCfg} });
580 +       },
581 +       
582 +       movePageApp: function(appInfo, index) {
583 +               if(index == undefined) {
584 +                       this.hidePageMenus();
585 +                       return;
586 +               }
587 +
588 +               if(this.pageDivs[index] != undefined) {
589 +                       var from = this.pagesModel.findApplication(appInfo.launchPointId);
590 +                       var to = {page: parseInt(index), position: -1};
591 +
592 +                       this.moveApp(appInfo.launchPointId, to);
593 +                       this.pagesModel.moveApplication(from, to);
594 +
595 +                       this.pagesModel.save();
596 +               }
597 +
598 +               this.hidePageMenus();
599 +       },
600 +
601 +       changePage: function(index, animate) {
602 +               if(this.appLauncherCfg.reset) {
603 +                       var scroller = this.getPageScroller(this.activePageIndex);
604 +                       
605 +                       if (scroller && scroller.mojo) { scroller.mojo.revealTop(); }
606 +               }
607 +
608 +               if(this.activePageIndex != index) {
609 +                       this.activePageIndex = index;
610 +                       
611 +                       if(this.appLauncherCfg.wrap)
612 +                               $('launcher_root').mojo.scrollTo((index) * -this.kPageWidth, undefined, false, true);
613 +                       else 
614 +                               $('launcher_root').mojo.setSnapIndex(parseInt(index), animate);
615 +               }
616 +       },
617 +
618 +       showPageMenus: function(viewMenu, menuTitle, chooseCallback) {
619 +               Mojo.stopListening($('launcher_root'), Mojo.Event.propertyChange, this.pageChangeHandler);
620 +               
621 +               this.globalSearchAssistant.enable(false);
622 +
623 +               this.controller.get('page_text').style.display = "none";
624 +               this.controller.get('page_name').style.display = "block";
625 +
626 +               if(!this.appLauncherCfg.header) {
627 +                       this.controller.get('page_header').style.display = "block";
628 +                       this.controller.get('page_name').style.display = "block";
629 +               }
630 +               
631 +               var pageItems = [];
632 +
633 +               for(var i = 0; i < this.pageDivs.length; i++) {
634 +                       var pageName = this.getPageName(i);
635 +                       
636 +                       pageItems.push({command: i, label: pageName, chosen: (i == this.activePageIndex)});
637 +               }
638 +
639 +               if(viewMenu)
640 +                       var menuClass = "pageMenu";
641 +               else
642 +                       var menuClass = "jumpMenu";
643 +
644 +               this.controller.popupSubmenu({
645 +                       popupClass: menuClass,
646 +                       scrimClass: "pageMenuScrim",
647 +                       manualPlacement: true,
648 +
649 +                       items: pageItems,
650 +
651 +                       onChoose: chooseCallback
652 +               });
653 +
654 +               this.controller.get('page_name').update(menuTitle);
655 +
656 +               if(this.quickLaunchCfg.mode == "visible") {
657 +                       SystemManagerService.showQuickLaunch(false);
658 +                       this.kQuickLaunchHeight = 0;
659 +                       this.adjustLayout();
660 +               }
661 +
662 +               if(viewMenu) {
663 +                       this.viewMenuModel.visible = true;
664 +                       this.controller.modelChanged(this.viewMenuModel);
665 +               }
666 +       },
667 +       
668 +       hidePageMenus: function() {
669 +               Mojo.listen($('launcher_root'), Mojo.Event.propertyChange, this.pageChangeHandler);
670 +
671 +               this.globalSearchAssistant.enable(true);
672 +               
673 +               if(!this.appLauncherCfg.header) {
674 +                       this.controller.get('page_header').style.display = "none";
675 +                       this.controller.get('page_name').style.display = "none";
676 +               }
677 +
678 +               this.updatePageHeader();
679 +               this.updatePageIndicators();
680 +               
681 +               this.viewMenuModel.visible = false;
682 +               this.controller.modelChanged(this.viewMenuModel);
683 +               
684 +               if(this.quickLaunchCfg.mode == "visible") {
685 +                       SystemManagerService.showQuickLaunch(true);
686 +                       this.kQuickLaunchHeight = 67;
687 +                       this.adjustLayout();
688 +               }
689 +       },
690 +
691 +       getPageName: function(index) {
692 +               if(this.appLauncherCfg.pages[parseInt(index)] == undefined)
693 +                       this.appLauncherCfg.pages[parseInt(index)] = "Launcher Page " + (parseInt(index) + 1);
694 +
695 +               return this.appLauncherCfg.pages[parseInt(index)];
696 +       },
697 +
698 +       setPageName: function(index, pageName) {
699 +               if((pageName.length > 0) && (pageName.split(' ').join('').length > 0))
700 +                       this.appLauncherCfg.pages[parseInt(index)] = this.pageNameModel.value;
701 +               else
702 +                       this.appLauncherCfg.pages[parseInt(index)] = "Launcher Page " + (parseInt(index) + 1);
703 +       },
704 +
705 +       confirmDelete: function() {
706 +               var apps = this.getAppContainer(this.activePageIndex).select('.app');
707 +       
708 +               if(apps.length == 0)
709 +                       this.deletePage(this.activePageIndex);
710 +               else {
711 +                   this.controller.showAlertDialog({
712 +                               title: "Delete Launcher Page",
713 +                               message: "Are you sure that you want to delete the current launcher page?",
714 +                               choices:[
715 +                                       {label:'Cancel', value:"cancel", type:'default'},
716 +                                       {label:'Delete', value:"delete", type:'negative'}],
717 +                               preventCancel: false,
718 +                               allowHTMLMessage: false,
719 +                               onChoose: function(value) {
720 +                                       if(value == "delete")
721 +                                               this.deletePage(this.activePageIndex);
722 +
723 +                                       var chooseCallback = this.selectPage.bind(this);
724 +
725 +                                       this.showPageMenus(true, "Edit Launcher Page:", chooseCallback);
726 +                               }.bind(this)});
727 +               }
728 +       },
729 +
730 +       scrollStarting: function(event) {
731 +//             this.activePageIndex = Math.abs($('launcher_root').mojo.getScrollPosition().left) / this.kPageWidth;
732 +       
733 +               event.scroller.addListener(this);
734 +       },
735 +       
736 +       moved: function(scrollEnded, position) {
737 +               if(scrollEnded) {
738 +                       this.pagingAnimating = false;
739 +               }
740 +               else {
741 +                       this.pagingAnimating = true;
742 +                       
743 +                       if(this.appLauncherCfg.reset) {
744 +                               var scroller = this.getPageScroller(this.activePageIndex);
745 +
746 +                               if(scroller && scroller.mojo) { scroller.mojo.revealTop(); }
747 +                       }
748 +
749 +                       if(Math.abs(position.x) > ((this.pageDivs.length - 1) * this.kPageWidth))
750 +                               $('launcher_root').mojo.scrollTo(0, undefined, false, true);
751 +                       else if(position.x > 0 )
752 +                               $('launcher_root').mojo.scrollTo((this.pageDivs.length - 1) * -this.kPageWidth , undefined, false, true);
753 +                       else if( this.activePageIndex * -this.kPageWidth > position.x )
754 +                               $('launcher_root').mojo.scrollTo( (this.activePageIndex + 1) * -this.kPageWidth, undefined, false, true);
755 +                       else if( this.activePageIndex * -this.kPageWidth < position.x )
756 +                               $('launcher_root').mojo.scrollTo( (this.activePageIndex - 1) * -this.kPageWidth, undefined, false, true);
757 +               }
758 +               
759 +               this.activePageIndex = Math.abs($('launcher_root').mojo.getScrollPosition().left) / this.kPageWidth;
760 +                       
761 +               this.updatePageHeader();
762 +               this.updatePageIndicators();
763 +       },      
764 +
765         /* keep track of which page we are on */
766         onPageChange: function(event) {
767 -               this.activePageIndex = event.value;
768 -               this.updatePageIndicators();
769 +               if(this.appLauncherCfg.reset) {
770 +                       var scroller = this.getPageScroller(this.activePageIndex);
771 +
772 +                       if (scroller && scroller.mojo) { scroller.mojo.revealTop(); }
773 +               }
774 +
775 +               if((!this.appLauncherCfg.wrap) || (this.reorderController.reordering)) {
776 +                       this.activePageIndex = event.value;
777 +                                       
778 +                       this.updatePageHeader();
779 +                       this.updatePageIndicators();
780 +               }
781 +       },
782 +
783 +       /* hide quick launch */
784 +       onActivate: function(event) {
785 +
786 +               if(this.appLauncherCfg.page != "default") {
787 +                       this.changePage(this.appLauncherCfg.page, false);
788 +
789 +                       this.updatePageHeader();
790 +                       this.updatePageIndicators();
791 +               }
792 +               
793 +               if(this.quickLaunchCfg.mode != "visible") {
794 +                       SystemManagerService.showQuickLaunch(false);
795 +                       this.kQuickLaunchHeight = 0;
796 +                       this.adjustLayout();
797 +               }
798         },
799         
800         /* clean and hide global search */
801 @@ -175,7 +736,17 @@ var LauncherAssistant = Class.create({
802                         this.appDialog.mojo.close();
803                 }
804                 
805 -               SystemManagerService.showQuickLaunch(true);
806 +               if(this.appLauncherCfg.page != "default")
807 +                       this.changePage(this.appLauncherCfg.page, false);
808 +               
809 +               this.updatePageHeader();
810 +               this.updatePageIndicators();
811 +               
812 +               if(this.quickLaunchCfg.mode != "hidden") {
813 +                       SystemManagerService.showQuickLaunch(true);
814 +                       this.kQuickLaunchHeight = 67;
815 +                       this.adjustLayout();
816 +               }
817                 
818                 this.launchRequest = undefined;
819         },
820 @@ -202,12 +773,12 @@ var LauncherAssistant = Class.create({
821         
822         /* helper to consolidate all the places accessing these types of elements */
823         getAppContainer: function(pageIndex) {
824 -               Mojo.assert(this.pageDivs.length > pageIndex, "Attempting to access invalid page #{page}", {page: pageIndex});
825 +               Mojo.assert(this.pageDivs.length >= pageIndex, "Attempting to access invalid page #{page}", {page: pageIndex});
826                 return this.pageDivs[pageIndex].down('.page_scroller_container');
827         },
828         
829         getPageScroller: function(pageIndex) {
830 -               Mojo.assert(this.pageDivs.length > pageIndex, "Attempting to access invalid page #{page}", {page: pageIndex});
831 +               Mojo.assert(this.pageDivs.length >= pageIndex, "Attempting to access invalid page #{page}", {page: pageIndex});
832                 return this.pageDivs[pageIndex].down('.page_scroller');
833         },
834         
835 @@ -255,15 +826,51 @@ var LauncherAssistant = Class.create({
836                 
837                 // tell our scroller widget that it has a new page element to snap
838                 this.updatePageSnappingPoints();
839 +
840 +               if(createPage) {
841 +                       this.appLauncherCfg.pages.splice(newPageIndex, 0, "Lancher Page " + (parseInt(newPageIndex) + 1));
842 +
843 +                       this.changePage(newPageIndex, true);
844 +                       
845 +                       var chooseCallback = this.selectPage.bind(this);
846 +
847 +                       this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
848 +                       
849 +                       if(this.setPreferencesRequest)
850 +                               this.setPreferencesRequest.cancel();
851 +               
852 +                       this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
853 +                               method: 'setPreferences', parameters: {'appLauncherCfg': this.appLauncherCfg} });
854 +               }
855         },
856         
857         deletePage: function(pageIndex) {
858 +
859                 // move all apps still on page[pageIndex] to the previous/next page  
860                 var moveIndex = (pageIndex == 0 ? 1 : pageIndex-1);
861                 if (!this.pagesModel.removePage(pageIndex, moveIndex)) {
862                         return false;
863                 }
864                 
865 +               // snap to a valid location
866 +               if (pageIndex >= this.pageDivs.length - 1)
867 +                       this.changePage(this.pageDivs.length - 2, true);
868 +               else
869 +                       this.changePage(pageIndex, true);
870 +
871 +               if(this.appLauncherCfg.page != "default") {
872 +                       if(this.appLauncherCfg.page == pageIndex)
873 +                               this.setupAppLauncher(null, "page");
874 +               }
875 +
876 +               this.appLauncherCfg.pages.splice(pageIndex,1);
877 +
878 +               if(this.setPreferencesRequest)
879 +                       this.setPreferencesRequest.cancel();
880 +               
881 +               this.setPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice/', {
882 +                       method: 'setPreferences', parameters: {'appLauncherCfg': this.appLauncherCfg} });
883 +
884                 // move appDivs over to their new home
885                 var apps = this.getAppContainer(pageIndex).select('.app');
886                 var startIndex = apps.length;
887 @@ -284,7 +891,7 @@ var LauncherAssistant = Class.create({
888                 if (scroller) {
889                         this.controller.setupWidget(scroller.id, undefined, undefined);
890                 }
891 -               
892 +                               
893                 // remove the page div
894                 this.pageDivs[pageIndex].remove();
895                 this.pageDivs = $$('.launcher_page');
896 @@ -294,17 +901,13 @@ var LauncherAssistant = Class.create({
897                 for (var i=pageIndex; i<this.pageDivs.length; i++) {
898                         this.pageDivs[i].style.left = (this.kPageWidth*i)+'px';
899                 }
900 -               
901 +
902                 // remove the pages indicator
903                 this.deletePageIndicator();
904                 
905 -               // snap to a valid location
906 -               if (pageIndex >= this.pageDivs.length) {
907 -                       $('launcher_root').mojo.setSnapIndex(this.pageDivs.length-1, true);
908 -               }
909 -               else {
910 -                       $('launcher_root').mojo.setSnapIndex(pageIndex, true);
911 -               }
912 +               var chooseCallback = this.selectPage.bind(this);
913 +
914 +               this.showPageMenus(true, "Edit Launcher Pages:", chooseCallback);
915                 
916                 this.updatePageSnappingPoints();
917         },
918 @@ -514,6 +1117,10 @@ var LauncherAssistant = Class.create({
919                 for (var i=offset, len = children.length; i<len; i++) {
920                         var item = children[i];
921                         var appPos = this.calculateAppPosition(i);
922 +                       
923 +                       if(this.appLauncherCfg.header)
924 +                               appPos.top = appPos.top + 50;
925 +                       
926                         if (animate) {
927                                 LauncherAnimation.animateApp(item, appPos);
928                         } else {
929 @@ -577,17 +1184,32 @@ var LauncherAssistant = Class.create({
930                                 return;
931                         }
932                 }
933 +
934 +               if(this.quickLaunchCfg.mode == "visible") {
935 +                       SystemManagerService.showQuickLaunch(false);
936 +                       this.kQuickLaunchHeight = 0;
937 +                       this.adjustLayout();
938 +               }
939                 
940 -               SystemManagerService.showQuickLaunch(false);
941                 this.globalSearchAssistant.enable(false);
942                 
943                 var appInfoAssistant = new AppInfoAssistant(appInfo,
944                                                                                                         this.controller,
945 -                                                                                                       function() {
946 +                                                                                                       function(appInfo, action) {
947                                                                                                                 this.appDialog = undefined;
948 -                                                                                                               SystemManagerService.showQuickLaunch(true);
949 -                                                                                                               this.globalSearchAssistant.enable(true);
950 -                                                                                                       }.bind(this));
951 +                                                                                                               if(this.quickLaunchCfg.mode == "visible") {
952 +                                                                                                                       SystemManagerService.showQuickLaunch(true);
953 +                                                                                                                       this.kQuickLaunchHeight = 67;
954 +                                                                                                                       this.adjustLayout();
955 +                                                                                                               }
956 +                                                                                                               if(action == "move") { 
957 +                                                                                                                       var chooseCallback = this.movePageApp.bind(this, appInfo);
958 +                                                                                                                       
959 +                                                                                                                       this.showPageMenus(false, "Move Application:", chooseCallback);
960 +                                                                                                               }
961 +                                                                                                               else
962 +                                                                                                                       this.globalSearchAssistant.enable(true);
963 +                                                                                                       }.bind(this, appInfo));
964  
965                 this.appDialog = this.controller.showDialog({
966                                                         template: 'launcher/dialogs/app-info',
967 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/reorder-controller.js b/usr/lib/luna/system/luna-applauncher/app/controllers/reorder-controller.js
968 index 232582b..71c9f0c 100644
969 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/reorder-controller.js
970 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/reorder-controller.js
971 @@ -239,6 +239,10 @@ var ReorderController = Class.create({
972                 for (var i = 0, len = this.appDivs.length; i < len; ++i) {
973                         
974                         var pos = this.launcherAssistant.calculateAppPosition(i);
975 +                       
976 +                       if(this.launcherAssistant.appLauncherCfg.header)
977 +                               pos.top = pos.top + 50;
978 +                       
979                         var item = new Element('div', {'class': 'droppable'});
980                         item.style.left = pos.left+'px';
981                         item.style.top = pos.top+'px';
982 @@ -314,7 +318,10 @@ var ReorderController = Class.create({
983         
984         _startCyclePage: function(direction) {
985                 if (!this.pagingTimer && !this.pagingAnimating) {
986 -                       this.pagingTimer = this._cyclePage.bind(this, direction).delay(this.kHorizontalPageTimeout);
987 +                       if(this.launcherAssistant.appLauncherCfg.wrap)
988 +                               this.pagingTimer = this._cyclePage.bind(this, direction).delay(this.kHorizontalPageTimeout * 2);
989 +                       else
990 +                               this.pagingTimer = this._cyclePage.bind(this, direction).delay(this.kHorizontalPageTimeout);
991                         
992                         Mojo.listen($('launcher_root'), Mojo.Event.scrollStarting, this.scrollerListenerHandler);
993                 }
994 @@ -427,15 +434,37 @@ var ReorderController = Class.create({
995         _cyclePage: function(direction) {
996                 
997                 var canPage = false;
998 +               var snapIndex = 0;
999 +
1000                 if (direction == -1 && this.activePage.previous() !== null) {
1001                         this.previousPage = this.activePage;
1002                         this.activePage = this.activePage.previous();
1003                         canPage = true;
1004 +                       snapIndex = this.launcherAssistant.activePageIndex + direction;
1005 +               }
1006 +               else if (direction == -1 && this.activePage.previous() == null) {
1007 +                       if(this.launcherAssistant.appLauncherCfg.wrap) {
1008 +                               this.previousPage = this.activePage;
1009 +                               while(this.activePage.next() !== null)
1010 +                                       this.activePage = this.activePage.next();
1011 +                               canPage = true;
1012 +                               snapIndex = this.launcherAssistant.pagesModel.getNumPages() - 1;
1013 +                       }
1014                 }
1015                 else if (direction == 1 && this.activePage.next() !== null) {
1016                         this.previousPage = this.activePage;
1017                         this.activePage = this.activePage.next();
1018                         canPage = true;
1019 +                       snapIndex = this.launcherAssistant.activePageIndex + direction;
1020 +               }
1021 +               else if (direction == 1 && this.activePage.next() == null) {
1022 +                       if(this.launcherAssistant.appLauncherCfg.wrap) {
1023 +                               this.previousPage = this.activePage;
1024 +                               while(this.activePage.previous() !== null)
1025 +                                       this.activePage = this.activePage.previous();
1026 +                               canPage = true;
1027 +                               snapIndex = 0;
1028 +                       }
1029                 }
1030             
1031                 if (canPage) {
1032 @@ -446,7 +475,16 @@ var ReorderController = Class.create({
1033                         this.activePage.show();
1034                         
1035                         this.pagingAnimating = true;
1036 -                       $('launcher_root').mojo.setSnapIndex(this.launcherAssistant.activePageIndex + direction, true);
1037 +                       
1038 +                       this.launcherAssistant.changePage(snapIndex, true);
1039 +                       
1040 +                       if(this.launcherAssistant.appLauncherCfg.wrap) {
1041 +                               this.launcherAssistant.onPageChange({value: snapIndex});
1042 +                               
1043 +                               this.pagingAnimating = false;
1044 +                               var previousPageIndex = this.launcherAssistant.getPageIndex(this.previousPage);
1045 +                               this._pagingComplete(previousPageIndex, this.launcherAssistant.activePageIndex);
1046 +                       }
1047                 }
1048         },
1049         
1050 diff --git a/usr/lib/luna/system/luna-applauncher/app/models/launcher-pages.js b/usr/lib/luna/system/luna-applauncher/app/models/launcher-pages.js
1051 index 062bddd..a6704b8 100644
1052 --- a/usr/lib/luna/system/luna-applauncher/app/models/launcher-pages.js
1053 +++ b/usr/lib/luna/system/luna-applauncher/app/models/launcher-pages.js
1054 @@ -240,6 +240,12 @@ var LauncherPages = Class.create({
1055                 return true;
1056         },
1057         
1058 +       switchPages: function(firstIndex, secondIndex) {
1059 +               var page = this._storedPages.splice(firstIndex, 1);
1060 +
1061 +               this._storedPages.splice(secondIndex, 0, page[0]);
1062 +       },
1063 +       
1064         getNumPages: function() {
1065                 return this._storedPages.length;
1066         },
1067 diff --git a/usr/lib/luna/system/luna-applauncher/app/views/launcher/dialogs/app-info.html b/usr/lib/luna/system/luna-applauncher/app/views/launcher/dialogs/app-info.html
1068 index bdf3824..b9fbfc2 100644
1069 --- a/usr/lib/luna/system/luna-applauncher/app/views/launcher/dialogs/app-info.html
1070 +++ b/usr/lib/luna/system/luna-applauncher/app/views/launcher/dialogs/app-info.html
1071 @@ -9,5 +9,6 @@
1072  <div class="palm-dialog-separator"></div>
1073  <div class="palm-dialog-buttons">
1074         <div id='delete-btn' x-mojo-element="Button"></div>     
1075 +       <div id='move-btn' x-mojo-element="Button"></div>
1076         <div id='done-btn' x-mojo-element="Button"></div>
1077  </div>
1078 diff --git a/usr/lib/luna/system/luna-applauncher/app/views/launcher/launcher-scene.html b/usr/lib/luna/system/luna-applauncher/app/views/launcher/launcher-scene.html
1079 index d34a6a5..294420f 100644
1080 --- a/usr/lib/luna/system/luna-applauncher/app/views/launcher/launcher-scene.html
1081 +++ b/usr/lib/luna/system/luna-applauncher/app/views/launcher/launcher-scene.html
1082 @@ -17,7 +17,11 @@
1083                 <div class="palm-header-spacer strut"></div>\r
1084         </div>\r
1085         \r
1086 -       <div id="launcher-main">\r
1087 +       <div id="launcher-main">
1088 +               <div id="page_header" style="display: none;" class="palm-header center" x-mojo-touch-feedback="immediate">
1089 +                       <div id="page_name" style="display: block;">Launcher Page</div>
1090 +                       <div id="page_text" style="display: none;" x-mojo-element="TextField"></div>
1091 +               </div>
1092                 <div id="launcher_root" x-mojo-element="Scroller">\r
1093                         <div id="pages_container"></div>\r
1094                 </div>\r
1095 diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css b/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
1096 index 45b6546..c14a69d 100644
1097 --- a/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
1098 +++ b/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
1099 @@ -342,3 +342,87 @@ body.palm-default
1100         text-overflow: ellipsis;
1101         white-space: nowrap;
1102  }
1103 +
1104 +/* page names element */
1105 +
1106 +#page_text {
1107 +       min-width: 100%;
1108 +       width: 100%;
1109 +}
1110 +                                                                                                               
1111 +#page_text input {
1112 +       min-width: 100%;
1113 +       font-weight: bold;
1114 +       height: 46px;
1115 +       outline: none;
1116 +       background: none;
1117 +       border-width: 0 0 0 0;
1118 +       font-size: 16px;
1119 +       line-height: 22px;
1120 +       color: white;
1121 +       margin: 0 16px 0 0px;
1122 +       padding: 0;
1123 +       text-align: center;
1124 +}
1125 +
1126 +.jumpMenu {
1127 +       position: fixed;
1128 +       top: 28px;
1129 +       width:300px;
1130 +       left: 10px;
1131 +       z-index: 32;
1132 +}
1133 +
1134 +.pageMenu {
1135 +       position: fixed;
1136 +       top: 28px;
1137 +       width:300px;
1138 +       left: 10px;
1139 +       z-index: 32;
1140 +       max-height: 340px;
1141 +}
1142 +
1143 +.pageMenu .palm-popup-content .palm-list {
1144 +       max-height: 340px;
1145 +}
1146 +
1147 +.jumpMenu .palm-popup-content,
1148 +.pageMenu .palm-popup-content {
1149 +       margin: 12px 8px 10px 8px;
1150 +}
1151 +
1152 +.jumpMenu .palm-popup-content .palm-list .chosen .title,
1153 +.pageMenu .palm-popup-content .palm-list .chosen .title {
1154 +
1155 +       font-weight: bold;
1156 +}
1157 +
1158 +.jumpMenu .palm-popup-content .palm-list .title,
1159 +.pageMenu .palm-popup-content .palm-list .title {
1160 +       line-height: 42px;
1161 +       min-height: 46px;
1162 +       font-size: 18px;
1163 +       text-align: center;
1164 +       margin:0px;
1165 +       padding:0px;
1166 +}
1167 +
1168 +.jumpMenu .palm-popup-content .chosen .popup-item-checkmark,
1169 +.pageMenu .palm-popup-content .chosen .popup-item-checkmark {
1170 +  display: none;
1171 +}
1172 +
1173 +.jumpMenu .palm-popup-content .palm-list .palm-row,
1174 +.pageMenu .palm-popup-content .palm-list .palm-row {
1175 +       line-height: 42px;
1176 +       min-height: 46px;
1177 +       max-height: 46px;
1178 +       margin:0px;
1179 +       padding:0px;
1180 +}
1181 +
1182 +.pageMenuScrim {
1183 +       background: transparent;
1184 +       z-index: 30;
1185 +}
1186 +
1187 diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
1188 index d4ae043..7f5b5f1 100644
1189 --- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
1190 +++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
1191 @@ -32,6 +32,16 @@ var BarAssistant = Class.create({
1192                 
1193                 this.getBuildName();
1194                                                 
1195 +               // Subscribe to the Quick Launch Bar prererences
1196 +               this.quickLaunchMode = "visible";
1197 +
1198 +               this.getPreferencesRequest = new Mojo.Service.Request('palm://com.palm.systemservice', {
1199 +                       method: 'getPreferences', parameters: {"keys":["quickLaunchMode"],"subscribe": true},
1200 +                       onSuccess: function(payload) {
1201 +                               if((payload != undefined) && (payload.quickLaunchMode != undefined))
1202 +                                       this.quickLaunchMode = payload.quickLaunchMode;
1203 +                               }.bind(this) });
1204 +               
1205                 // Initialize the Battery Power Nofication and get the initial value
1206                 this.initOnServerStart("com.palm.power", this.powerInitialize.bind(this), this.powerDeInit.bind(this));
1207                 
1208 @@ -315,6 +325,11 @@ updateAppMenuTitle: function(payload) {
1209                 $('carrier').show();
1210                 this.foregroundAppID=null;
1211         }
1212 +
1213 +       if(this.quickLaunchMode == "hidden") {
1214 +               this.controller.serviceRequest('palm://com.palm.systemmanager', {
1215 +                       method: 'systemUi', parameters: {"quicklaunch": false} });
1216 +       }
1217  },
1218  
1219  updatePhoneAppName: function(){