Commit e85d5188ace3bfc7e5740f23d44b7f6bbceb1bd3

  • avatar
  • dBsooner <daniel.beames @dbt…nk.com>
  • Thu Oct 08 06:35:32 CEST 2009
Dropped Luna category. Sepereated patches to 'Misc', 'Top Bar' and 'Universal Search'.
  
1diff --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
2index ee479ac..115140c 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -2337,7 +2337,9 @@ updateClockEveryMinute: function() {
6 }
7 }
8 format = format.replace(/\s?a\s?/,"");
9- $('clock').innerHTML = Mojo.Format.formatDate(date, {time: format});
10+ var formatDate = Mojo.Format.formatDate(date, {date:'short'});
11+ formatDate = formatDate.substr(0, formatDate.lastIndexOf('/'));
12+ $('clock').innerHTML = formatDate+'&nbsp;&nbsp;&nbsp;'+Mojo.Format.formatDate(date, {time:format});
13 $('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
14 },
15
  
1diff --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
2index ee479ac..f02e1cd 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -2337,7 +2337,7 @@ updateClockEveryMinute: function() {
6 }
7 }
8 format = format.replace(/\s?a\s?/,"");
9- $('clock').innerHTML = Mojo.Format.formatDate(date, {time: format});
10+ $('clock').innerHTML = Mojo.Format.formatDate(date, {date:'short',time: format});
11 $('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
12 },
13
  
1diff --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
2index ee479ac..c2447db 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1430,10 +1430,49 @@ closePbapAlert: function() {
6 }
7 },
8
9+/* Format battery level percent
10+ * We use this function instead of just a variable because
11+ * sometimes this.batteryLevel is used, and sometimes
12+ * payload.percent_ui is
13+ */
14+getBatteryLevelPercent: function(percent, color, image, charging) {
15+ if (color) {
16+ if (charging == 1)
17+ bColor = '#33CCFF';
18+ else if (percent >= 70)
19+ bColor = '#33FF33';
20+ else if(percent <= 69 && percent >= 45)
21+ bColor = '#FFFF33';
22+ else if(percent <= 44 && percent >= 20)
23+ bColor = '#FFCC00';
24+ else if(percent <= 19)
25+ bColor = '#FF0000';
26+ else
27+ bColor = 'white';
28+
29+ // Use span to set color
30+ if (image != undefined)
31+ var fPercent = '<span style="color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
32+ else
33+ var fPercent = '<span style="position: relative; bottom: 2px; color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
34+ }
35+ else {
36+ var fPercent = percent + unescape('%');
37+ }
38+ return fPercent;
39+},
40+
41+
42 /*
43 * Handle power and charging notifications
44 */
45 handlePowerNotifications: function(payload) {
46+ // Replace this with a user definable setting
47+ var batteryLevelImage = 2; // 0 displays image (factory default)
48+ // 1 displays numerical percentage
49+ // 2 displays the image on left and numerical percentage on right (default)
50+
51+ var batteryLevelColor = 1; // Set to 0 for white, 1 for color
52
53 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
54 if(!this.powerdServiceUp) {
55@@ -1453,7 +1492,15 @@ handlePowerNotifications: function(payload) {
56 // Show the battery level if not charging
57 if (!this.isCharging) {
58 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i);
59+ if (batteryLevelImage == 0) {
60 $('power').className = 'battery-' + i;
61+ } else if(batteryLevelImage == 1) {
62+ $('power').className = 'battery-percent';
63+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0);
64+ } else if(batteryLevelImage == 2) {
65+ $('power').className = 'battery-percentimage';
66+ $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor);
67+ }
68
69 //Show Banner Message if the Battery level is below 20%
70 var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
71@@ -1482,10 +1529,23 @@ handlePowerNotifications: function(payload) {
72 }
73 else {
74 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
75- if(payload.percent_ui == 100)
76+ if (batteryLevelImage == 0) {
77+ if (payload.percent_ui == 100)
78 $('power').className = 'battery-charged';
79 else
80 $('power').className = 'battery-charging-' + i;
81+ } else if (batteryLevelImage == 1) {
82+ $('power').className = 'battery-percent';
83+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
84+ } else if(batteryLevelImage == 2) {
85+ if (payload.percent_ui == 100) {
86+ $('power').className = 'battery-percentimage-charged';
87+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
88+ } else {
89+ $('power').className = 'battery-percentimage';
90+ $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
91+ }
92+ }
93
94 }
95
96@@ -1522,10 +1582,23 @@ handlePowerNotifications: function(payload) {
97
98 if (this.isCharging) {
99 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
100- if(this.batteryLevel == 100)
101+ if (batteryLevelImage == 0) {
102+ if (this.batteryLevel == 100)
103 $('power').className = 'battery-charged';
104 else
105 $('power').className = 'battery-charging-' + this.lastBatteryLevel;
106+ } else if(batteryLevelImage == 1) {
107+ $('power').className = 'battery-percent';
108+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
109+ } else if(batteryLevelImage == 2) {
110+ if (this.batteryLevel == 100) {
111+ $('power').className = 'battery-percentimage-charged';
112+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
113+ } else {
114+ $('power').className = 'battery-percentimage';
115+ $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
116+ }
117+ }
118
119 var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert");
120 if (stageController) {
121@@ -1546,7 +1619,17 @@ handlePowerNotifications: function(payload) {
122 else {
123 this.chargingBannerShown = false;
124 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
125+ if (batteryLevelImage == 0) {
126 $('power').className = 'battery-' + this.lastBatteryLevel;
127+ }
128+ else if (batteryLevelImage == 1) {
129+ $('power').className = 'battery-percent';
130+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true);
131+ }
132+ else if(batteryLevelImage == 2) {
133+ $('power').className = 'battery-percentimage';
134+ $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor);
135+ }
136 Mojo.Controller.getAppController().removeBanner('chargingAlert');
137 }
138 }
139diff --git a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
140index 58b22e8..b23eab5 100644
141--- a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
142+++ b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
143@@ -136,6 +136,22 @@ body.palm-default {
144 margin-left: 2px;
145 width: 17px;
146 }
147+
148+/* Begin: Battery Percent / Image w/ Percent */
149+#power.battery-percent {
150+ width: 38px;
151+ background-color: black;
152+}
153+#power.battery-percentimage {
154+ width: 49px;
155+ background-color: black;
156+}
157+#power.battery-percentimage-charged {
158+ width: 49px;
159+ background-color: black;
160+}
161+/* End: Battery Percent / Image w/ Percent */
162+
163 #power.error {
164 background: url(../images/battery-error.png) center center no-repeat;
165 }
  
1diff --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
2index ee479ac..0618d89 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1430,10 +1430,49 @@ closePbapAlert: function() {
6 }
7 },
8
9+/* Format battery level percent
10+ * We use this function instead of just a variable because
11+ * sometimes this.batteryLevel is used, and sometimes
12+ * payload.percent_ui is
13+ */
14+getBatteryLevelPercent: function(percent, color, image, charging) {
15+ if (color) {
16+ if (charging == 1)
17+ bColor = '#33CCFF';
18+ else if (percent >= 70)
19+ bColor = '#33FF33';
20+ else if(percent <= 69 && percent >= 45)
21+ bColor = '#FFFF33';
22+ else if(percent <= 44 && percent >= 20)
23+ bColor = '#FFCC00';
24+ else if(percent <= 19)
25+ bColor = '#FF0000';
26+ else
27+ bColor = 'white';
28+
29+ // Use span to set color
30+ if (image != undefined)
31+ var fPercent = '<span style="color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
32+ else
33+ var fPercent = '<span style="position: relative; bottom: 2px; color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
34+ }
35+ else {
36+ var fPercent = percent + unescape('%');
37+ }
38+ return fPercent;
39+},
40+
41+
42 /*
43 * Handle power and charging notifications
44 */
45 handlePowerNotifications: function(payload) {
46+ // Replace this with a user definable setting
47+ var batteryLevelImage = 1; // 0 displays image (factory default)
48+ // 1 displays numerical percentage
49+ // 2 displays the image on left and numerical percentage on right (default)
50+
51+ var batteryLevelColor = 1; // Set to 0 for white, 1 for color
52
53 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
54 if(!this.powerdServiceUp) {
55@@ -1453,7 +1492,15 @@ handlePowerNotifications: function(payload) {
56 // Show the battery level if not charging
57 if (!this.isCharging) {
58 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i);
59+ if (batteryLevelImage == 0) {
60 $('power').className = 'battery-' + i;
61+ } else if(batteryLevelImage == 1) {
62+ $('power').className = 'battery-percent';
63+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0);
64+ } else if(batteryLevelImage == 2) {
65+ $('power').className = 'battery-percentimage';
66+ $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor);
67+ }
68
69 //Show Banner Message if the Battery level is below 20%
70 var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
71@@ -1482,10 +1529,23 @@ handlePowerNotifications: function(payload) {
72 }
73 else {
74 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
75- if(payload.percent_ui == 100)
76+ if (batteryLevelImage == 0) {
77+ if (payload.percent_ui == 100)
78 $('power').className = 'battery-charged';
79 else
80 $('power').className = 'battery-charging-' + i;
81+ } else if (batteryLevelImage == 1) {
82+ $('power').className = 'battery-percent';
83+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
84+ } else if(batteryLevelImage == 2) {
85+ if (payload.percent_ui == 100) {
86+ $('power').className = 'battery-percentimage-charged';
87+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
88+ } else {
89+ $('power').className = 'battery-percentimage';
90+ $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
91+ }
92+ }
93
94 }
95
96@@ -1522,10 +1582,23 @@ handlePowerNotifications: function(payload) {
97
98 if (this.isCharging) {
99 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
100- if(this.batteryLevel == 100)
101+ if (batteryLevelImage == 0) {
102+ if (this.batteryLevel == 100)
103 $('power').className = 'battery-charged';
104 else
105 $('power').className = 'battery-charging-' + this.lastBatteryLevel;
106+ } else if(batteryLevelImage == 1) {
107+ $('power').className = 'battery-percent';
108+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
109+ } else if(batteryLevelImage == 2) {
110+ if (this.batteryLevel == 100) {
111+ $('power').className = 'battery-percentimage-charged';
112+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
113+ } else {
114+ $('power').className = 'battery-percentimage';
115+ $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
116+ }
117+ }
118
119 var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert");
120 if (stageController) {
121@@ -1546,7 +1619,17 @@ handlePowerNotifications: function(payload) {
122 else {
123 this.chargingBannerShown = false;
124 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
125+ if (batteryLevelImage == 0) {
126 $('power').className = 'battery-' + this.lastBatteryLevel;
127+ }
128+ else if (batteryLevelImage == 1) {
129+ $('power').className = 'battery-percent';
130+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true);
131+ }
132+ else if(batteryLevelImage == 2) {
133+ $('power').className = 'battery-percentimage';
134+ $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor);
135+ }
136 Mojo.Controller.getAppController().removeBanner('chargingAlert');
137 }
138 }
139diff --git a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
140index 58b22e8..b23eab5 100644
141--- a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
142+++ b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
143@@ -136,6 +136,22 @@ body.palm-default {
144 margin-left: 2px;
145 width: 17px;
146 }
147+
148+/* Begin: Battery Percent / Image w/ Percent */
149+#power.battery-percent {
150+ width: 38px;
151+ background-color: black;
152+}
153+#power.battery-percentimage {
154+ width: 49px;
155+ background-color: black;
156+}
157+#power.battery-percentimage-charged {
158+ width: 49px;
159+ background-color: black;
160+}
161+/* End: Battery Percent / Image w/ Percent */
162+
163 #power.error {
164 background: url(../images/battery-error.png) center center no-repeat;
165 }
  
1diff --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
2index 7d94506..1c90d5e 100644
3--- a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
4+++ b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
5@@ -48,6 +48,7 @@ GlobalSearchAssistant = Class.create({
6 this.offset=0;
7 this.limit=40;
8 this.URLs = {
9+ 'keytoss':$L("http://pre.keytoss.com/parse.php5?term="),
10 'google':$L("www.google.com/m/search?client=ms-palm-webOS&channel=iss&q="),
11 'wikipedia':$L("http://en.m.wikipedia.org/wiki/Special:Search?search="),
12 'twitter': $L("http://search.twitter.com/search?q=")
13@@ -1656,6 +1657,7 @@ GlobalSearchAssistant = Class.create({
14 this.expandedSearchDrawer.showExpanded = false;
15 this.controller.modelChanged(this.expandedSearchDrawer);
16 this.searchApps.clear();
17+ $('keytoss').removeClassName('selected');
18 $('google').removeClassName('selected');
19 $('map').removeClassName('selected');
20 $('wikipedia').removeClassName('selected');
21@@ -1761,6 +1763,7 @@ GlobalSearchAssistant = Class.create({
22 }
23 //clear search':
24 $('google').removeClassName('palm-focus');
25+ $('keytoss').removeClassName('palm-focus');
26 $('web').removeClassName('palm-focus');
27 },
28 highlightSelection: function() {
29@@ -1819,19 +1822,23 @@ GlobalSearchAssistant = Class.create({
30 break;
31 case 'search':
32 if (this.webDrawer.showWeb == true) {
33- $('google').removeClassName('palm-focus');
34+ //$('google').removeClassName('palm-focus');
35+ $('keytoss').removeClassName('palm-focus');
36 $('web').addClassName('palm-focus');
37 this.highlightTarget = $('web');
38 }
39 else if(this.expandedSearchDrawer.showExpanded == true){
40- $('google').addClassName('palm-focus');
41+ //$('google').addClassName('palm-focus');
42+ $('keytoss').addClassName('palm-focus');
43 $('web').removeClassName('palm-focus');
44- this.highlightTarget = $('google');
45+ //this.highlightTarget = $('google');
46+ this.highlightTarget = $('keytoss');
47 }
48 break;
49 }
50 if (this.enterKeyActionItem != "search") {
51 $('google').removeClassName('palm-focus');
52+ $('keytoss').removeClassName('palm-focus');
53 $('web').removeClassName('palm-focus');
54 }
55 },
56@@ -1923,7 +1930,8 @@ GlobalSearchAssistant = Class.create({
57 if (this.webDrawer.showWeb == true)
58 this.launchBrowser(this.currentFilter);
59 else {
60- this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
61+ //this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
62+ this.launchBrowser(this.URLs['keytoss'] + encodeURIComponent(this.currentFilter));
63 }
64 break;
65 }
66diff --git a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
67index 7bfc200..00cc1cc 100644
68--- a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
69+++ b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
70@@ -9,6 +9,11 @@
71 </div>
72
73 <div id='expanded_searches_drawer' x-mojo-element="Drawer">
74+ <div class="palm-row" id="keytoss" name="search-identifier" x-mojo-tap-highlight="persistent">
75+ <div class="palm-row-wrapper">
76+ <div class="search-keytoss"></div>
77+ </div>
78+ </div>
79 <div class="palm-row" id="google" name="search-identifier" x-mojo-tap-highlight="persistent">
80 <div class="palm-row-wrapper">
81 <div class="search-google"></div>
82diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
83index 1f10209..5887f9c 100644
84--- a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
85+++ b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
86@@ -119,6 +119,12 @@ Copyright 2009 Palm, Inc. All rights reserved.
87 background: url(../images/search-add.png) center center no-repeat;
88 }
89
90+.palm-group.search .search-keytoss {
91+ width: 100%;
92+ height: 52px;
93+ background: url(../images/search-keytoss.png) center center no-repeat;
94+}
95+
96 .palm-group.search .search-google {
97 width: 100%;
98 height: 52px;
99diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
100index 986f0bb..61d4d0c 100644
101--- a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
102+++ b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
103@@ -58,6 +58,12 @@ function UrlSearchController(controller){
104
105 // Our search providers
106 UrlSearchController.SearchProviders = {
107+ keytoss: {
108+ searchTitle: $L('Search KeyToss'),
109+ searchTemplate: $L('KeyToss "#{search}"'),
110+ urlTemplate: $L('http://pre.keytoss.com/parse.php5?term=#{query}')
111+ },
112+
113 google: {
114 searchTitle: $L('Search Google'),
115 searchTemplate: $L('Google "#{search}"'),
116@@ -218,14 +224,18 @@ UrlSearchController.prototype._addStockSearchItems = function(searchText, withDi
117 this.urlSearchListModel.unshift(item);
118
119 // Google block....
120- url = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
121- title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
122+ //url = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
123+ //title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
124+ url = UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodedUriComponent});
125+ title = UrlSearchController.SearchProviders.keytoss.searchTemplate.interpolate({search: escapedSearchText});
126
127 item = new UrlReference(url, title);
128- item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
129+ //item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
130+ item.subTitle = UrlSearchController.SearchProviders.keytoss.searchTitle;
131 item.iconclass = 'search-image';
132 item.rowclass = 'search first';
133- item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
134+ //item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
135+ item.iconUrl = Mojo.appPath + 'images/list-icon-keytoss.png';
136
137 this.urlSearchListModel.unshift(item);
138
139@@ -382,7 +392,8 @@ UrlSearchController.prototype._handleSelection = function(event) {
140
141 UrlSearchController.formatDefaultSearchUrl = function(query) {
142
143- return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
144+ //return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
145+ return UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodeURIComponent(query)});
146 };
147
148 /**
  
1Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2===================================================================
3--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -817,6 +817,8 @@ handletelephonyNotifications: function(p
6 this.callForwardNotificationSession = null;
7 }
8 }
9+ var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");
10+ stageController.delegateToSceneAssistant("updatePhone");
11 }
12 else if (payload.eventNetwork && this.phoneRadioState) {
13 var networkMsg = payload.eventNetwork;
14@@ -2647,6 +2649,10 @@ getCurrentWiFiState: function() {
15 return this.wifiState;
16 },
17
18+getCurrentPhoneState: function() {
19+ return this.phoneRadioState;
20+},
21+
22 setDeviceMenuAssistant: function(menuassistant) {
23 this.deviceMenuAssistant = menuassistant;
24 },
25Index: /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
26===================================================================
27--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
28+++ /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
29@@ -1,6 +1,6 @@
30 /* Copyright 2009 Palm, Inc. All rights reserved. */
31
32-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});
33+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});
34
35 var DevicemenuAssistant = Class.create({
36
37@@ -39,6 +39,8 @@ var DevicemenuAssistant = Class.create({
38 this.drawerModel = {myOpenProperty:false};
39 this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
40 this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
41+ this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
42+ this.phonedrawer = this.controller.get('phonedetails')
43 this.wifidrawer = this.controller.get('wifidetails');
44 this.btdrawer = this.controller.get('btdetails');
45
46@@ -95,6 +97,17 @@ var DevicemenuAssistant = Class.create({
47 else
48 this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML();
49 }
50+
51+ var phonestate = this.barAssistant.getCurrentPhoneState();
52+ if(phonestate === 'Off') {
53+ this.controller.get('phonemsg').innerHTML = $L('Off');
54+ RadioState.set('phone',false);
55+ }
56+ else {
57+ this.controller.get('phonemsg').innerHTML = $L('On');
58+ RadioState.set('phone',true);
59+ }
60+
61 this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));
62 this.isVisible = true;
63
64@@ -118,6 +131,8 @@ var DevicemenuAssistant = Class.create({
65 this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this));
66 this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));
67 this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));
68+ this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));
69+ this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));
70 this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));
71 this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));
72 this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));
73@@ -177,6 +192,49 @@ var DevicemenuAssistant = Class.create({
74 }
75 this.apModeInProgress = false;
76 },
77+
78+
79+ updatePhone: function() {
80+ if(this.barAssistant.getCurrentPhoneState()) {
81+ this.controller.get('phonemsg').innerHTML = $L('On');
82+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');
83+ RadioState.set('phone', true);
84+ }
85+ else {
86+ this.controller.get('phonemsg').innerHTML = $L('Off');
87+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');
88+ RadioState.set('phone', false);
89+ }
90+ },
91+
92+ togglePhoneRadio: function(event) {
93+ this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {
94+ method: 'vibrate', parameters: { 'period': 0,'duration': 250 }
95+ });
96+ if(RadioState.get('phone'))
97+ TelephonyService.tempPowerSet('off',false,null,null);
98+ else
99+ TelephonyService.tempPowerSet('on',false,null,null);
100+ this.toggleDeviceMenu();
101+ },
102+
103+ togglePhoneList: function(event) {
104+ if(this.apModeInProgress)
105+ return;
106+
107+ if (this.phonedrawer.mojo.getOpenState()) {
108+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));
109+ }
110+ else {
111+ if(RadioState.get('phone'))
112+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');
113+ else
114+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');
115+
116+ this.controller.showWidgetContainer(this.controller.get('phonedetails'));
117+ }
118+ this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState());
119+ },
120
121 toggleBTRadio: function(event) {
122 if(RadioState.get('bluetooth')) {
123@@ -891,6 +949,10 @@ var DevicemenuAssistant = Class.create({
124
125 close: function() {
126
127+ if(this.phonedrawer.mojo.getOpenState()) {
128+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));
129+ this.phonedrawer.mojo.setOpenState(false);
130+ }
131 if (this.btdrawer.mojo.getOpenState()) {
132 this.clearBTList();
133 this.controller.hideWidgetContainer(this.controller.get('btdetails'));
134Index: /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
135===================================================================
136--- .orig/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
137+++ /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
138@@ -94,6 +94,22 @@
139
140 <div class="palm-section-divider"></div>
141
142+ <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
143+ <div class="title truncating-text">
144+ <div class="label right" id="phonemsg">&nbsp;</div>
145+ <span x-mojo-loc=''>Phone</span>
146+ </div>
147+ </div></div>
148+
149+ <div id='phonedetails' x-mojo-element="Drawer">
150+ <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
151+ <div id="phone_radio" class="title truncating-text">
152+ </div>
153+ </div></div>
154+ </div>
155+
156+ <div class="palm-section-divider"></div>
157+
158 <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
159 <div id="dm_airplanemode_status" class="title truncating-text">
160 </div>
  
1While ssh'd into a pre that's suspended, powerd spams all users with messages
2every second or so. This patch silences those.
3
4Index: /usr/sbin/suspend_action
5===================================================================
6--- .orig/usr/sbin/suspend_action
7+++ /usr/sbin/suspend_action
8@@ -1,9 +1,9 @@
9 #!/bin/sh
10
11-echo -e "powerd: System going to sleep now\n" | wall
12+# echo -e "powerd: System going to sleep now\n" | wall
13
14 # Initiate suspend
15 echo mem > /sys/power/state
16
17-echo -e "powerd: System woke up.\n" | wall
18+# echo -e "powerd: System woke up.\n" | wall
19
  
1show-actual-battery-percent
2
3Tested-On: 1.1
4
5//show actual battery percent in the system user interface.
6//note: battery @ 100% will only charge on a new charge event or if power is <94%
7Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
8===================================================================
9--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
10+++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
11@@ -1382,11 +1382,11 @@ handlePowerNotifications: function(paylo
12
13 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
14 // Is the battery level provided?
15- if (payload.percent_ui != undefined) {
16+ if (payload.percent != undefined) {
17 //Save the Battery Percentage
18- this.batteryLevel = payload.percent_ui;
19+ this.batteryLevel = payload.percent;
20 for (var i = 0; i < this.powerIndicator.length; i++) {
21- if (payload.percent_ui > this.powerIndicator[i])
22+ if (payload.percent > this.powerIndicator[i])
23 continue;
24 this.lastBatteryLevel = i;
25 this.lastBatteryLevelPayload = payload;
26@@ -1397,7 +1397,7 @@ handlePowerNotifications: function(paylo
27 $('power').className = 'battery-' + i;
28
29 //Show Banner Message if the Battery level is below 20%
30- var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
31+ var batteryalert = $L("#{percent}% battery remaining").interpolate(payload);
32 if(this.batteryLevel <= 5 && !this.batteryLevel5Shown) {
33 this.batteryLevel5Shown = true;
34 this.showLowBatteryAlert();
35@@ -1423,7 +1423,7 @@ handlePowerNotifications: function(paylo
36 }
37 else {
38 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
39- if(payload.percent_ui == 100)
40+ if(payload.percent == 100)
41 $('power').className = 'battery-charged';
42 else
43 $('power').className = 'battery-charging-' + i;
  
1// enable ondemand cpu powersaving option
2Index: /etc/event.d/powersave-cpu-scaling
3===================================================================
4--- /dev/null
5+++ /etc/event.d/powersave-cpu-scaling
6@@ -0,0 +1,13 @@
7+# Enables cpu scaling
8+
9+start on stopped finish
10+stop on runlevel [!2]
11+
12+console none
13+
14+script
15+ echo "600000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
16+ echo "250000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
17+ echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
18+ echo "30" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
19+end script
  
1// enable SmartReflex powersaving option
2Index: /etc/event.d/powersave-smartreflex
3===================================================================
4--- /dev/null
5+++ /etc/event.d/powersave-smartreflex
6@@ -0,0 +1,28 @@
7+# -*- mode: shell-script; -*-
8+description "Overclock to 600MHz + SmartReflex"
9+author "Alex Markson"
10+version 1.0
11+
12+start on stopped finish
13+stop on runlevel [!2]
14+
15+console none
16+
17+script
18+
19+# SmartReflex
20+# "SmartReflexâ„¢ driver allows for auto-compensation of VDD1 and
21+# VDD2 voltages (around the voltages specified by current OPP)
22+# by analyzing the silicon characteristics, temperature, voltage etc"
23+#
24+# Enable SmartReflex
25+echo -n 1 > /sys/power/sr_vdd1_autocomp
26+echo -n 1 > /sys/power/sr_vdd2_autocomp
27+
28+# according to the OEM shell script in /etc/init.d/bootmisc.sh
29+# this seems like it needs to be set twice to make sure ?
30+echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
31+echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
32+
33+end script
34+
  
1While ssh'd into a pre that's suspended, powerd spams all users with messages
2every second or so. This patch silences those.
3
4Index: /usr/sbin/suspend_action
5===================================================================
6--- .orig/usr/sbin/suspend_action
7+++ /usr/sbin/suspend_action
8@@ -1,9 +1,9 @@
9 #!/bin/sh
10
11-echo -e "powerd: System going to sleep now\n" | wall
12+# echo -e "powerd: System going to sleep now\n" | wall
13
14 # Initiate suspend
15 echo mem > /sys/power/state
16
17-echo -e "powerd: System woke up.\n" | wall
18+# echo -e "powerd: System woke up.\n" | wall
19
  
1// enable ondemand cpu powersaving option
2Index: /etc/event.d/powersave-cpu-scaling
3===================================================================
4--- /dev/null
5+++ /etc/event.d/powersave-cpu-scaling
6@@ -0,0 +1,13 @@
7+# Enables cpu scaling
8+
9+start on stopped finish
10+stop on runlevel [!2]
11+
12+console none
13+
14+script
15+ echo "600000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
16+ echo "250000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
17+ echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
18+ echo "30" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
19+end script
  
1// enable SmartReflex powersaving option
2Index: /etc/event.d/powersave-smartreflex
3===================================================================
4--- /dev/null
5+++ /etc/event.d/powersave-smartreflex
6@@ -0,0 +1,28 @@
7+# -*- mode: shell-script; -*-
8+description "Overclock to 600MHz + SmartReflex"
9+author "Alex Markson"
10+version 1.0
11+
12+start on stopped finish
13+stop on runlevel [!2]
14+
15+console none
16+
17+script
18+
19+# SmartReflex
20+# "SmartReflexâ„¢ driver allows for auto-compensation of VDD1 and
21+# VDD2 voltages (around the voltages specified by current OPP)
22+# by analyzing the silicon characteristics, temperature, voltage etc"
23+#
24+# Enable SmartReflex
25+echo -n 1 > /sys/power/sr_vdd1_autocomp
26+echo -n 1 > /sys/power/sr_vdd2_autocomp
27+
28+# according to the OEM shell script in /etc/init.d/bootmisc.sh
29+# this seems like it needs to be set twice to make sure ?
30+echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
31+echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
32+
33+end script
34+
  
1diff --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
2index ee479ac..115140c 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -2337,7 +2337,9 @@ updateClockEveryMinute: function() {
6 }
7 }
8 format = format.replace(/\s?a\s?/,"");
9- $('clock').innerHTML = Mojo.Format.formatDate(date, {time: format});
10+ var formatDate = Mojo.Format.formatDate(date, {date:'short'});
11+ formatDate = formatDate.substr(0, formatDate.lastIndexOf('/'));
12+ $('clock').innerHTML = formatDate+'&nbsp;&nbsp;&nbsp;'+Mojo.Format.formatDate(date, {time:format});
13 $('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
14 },
15
  
1diff --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
2index ee479ac..f02e1cd 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -2337,7 +2337,7 @@ updateClockEveryMinute: function() {
6 }
7 }
8 format = format.replace(/\s?a\s?/,"");
9- $('clock').innerHTML = Mojo.Format.formatDate(date, {time: format});
10+ $('clock').innerHTML = Mojo.Format.formatDate(date, {date:'short',time: format});
11 $('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
12 },
13
  
1diff --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
2index ee479ac..c2447db 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1430,10 +1430,49 @@ closePbapAlert: function() {
6 }
7 },
8
9+/* Format battery level percent
10+ * We use this function instead of just a variable because
11+ * sometimes this.batteryLevel is used, and sometimes
12+ * payload.percent_ui is
13+ */
14+getBatteryLevelPercent: function(percent, color, image, charging) {
15+ if (color) {
16+ if (charging == 1)
17+ bColor = '#33CCFF';
18+ else if (percent >= 70)
19+ bColor = '#33FF33';
20+ else if(percent <= 69 && percent >= 45)
21+ bColor = '#FFFF33';
22+ else if(percent <= 44 && percent >= 20)
23+ bColor = '#FFCC00';
24+ else if(percent <= 19)
25+ bColor = '#FF0000';
26+ else
27+ bColor = 'white';
28+
29+ // Use span to set color
30+ if (image != undefined)
31+ var fPercent = '<span style="color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
32+ else
33+ var fPercent = '<span style="position: relative; bottom: 2px; color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
34+ }
35+ else {
36+ var fPercent = percent + unescape('%');
37+ }
38+ return fPercent;
39+},
40+
41+
42 /*
43 * Handle power and charging notifications
44 */
45 handlePowerNotifications: function(payload) {
46+ // Replace this with a user definable setting
47+ var batteryLevelImage = 2; // 0 displays image (factory default)
48+ // 1 displays numerical percentage
49+ // 2 displays the image on left and numerical percentage on right (default)
50+
51+ var batteryLevelColor = 1; // Set to 0 for white, 1 for color
52
53 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
54 if(!this.powerdServiceUp) {
55@@ -1453,7 +1492,15 @@ handlePowerNotifications: function(payload) {
56 // Show the battery level if not charging
57 if (!this.isCharging) {
58 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i);
59+ if (batteryLevelImage == 0) {
60 $('power').className = 'battery-' + i;
61+ } else if(batteryLevelImage == 1) {
62+ $('power').className = 'battery-percent';
63+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0);
64+ } else if(batteryLevelImage == 2) {
65+ $('power').className = 'battery-percentimage';
66+ $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor);
67+ }
68
69 //Show Banner Message if the Battery level is below 20%
70 var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
71@@ -1482,10 +1529,23 @@ handlePowerNotifications: function(payload) {
72 }
73 else {
74 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
75- if(payload.percent_ui == 100)
76+ if (batteryLevelImage == 0) {
77+ if (payload.percent_ui == 100)
78 $('power').className = 'battery-charged';
79 else
80 $('power').className = 'battery-charging-' + i;
81+ } else if (batteryLevelImage == 1) {
82+ $('power').className = 'battery-percent';
83+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
84+ } else if(batteryLevelImage == 2) {
85+ if (payload.percent_ui == 100) {
86+ $('power').className = 'battery-percentimage-charged';
87+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
88+ } else {
89+ $('power').className = 'battery-percentimage';
90+ $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
91+ }
92+ }
93
94 }
95
96@@ -1522,10 +1582,23 @@ handlePowerNotifications: function(payload) {
97
98 if (this.isCharging) {
99 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
100- if(this.batteryLevel == 100)
101+ if (batteryLevelImage == 0) {
102+ if (this.batteryLevel == 100)
103 $('power').className = 'battery-charged';
104 else
105 $('power').className = 'battery-charging-' + this.lastBatteryLevel;
106+ } else if(batteryLevelImage == 1) {
107+ $('power').className = 'battery-percent';
108+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
109+ } else if(batteryLevelImage == 2) {
110+ if (this.batteryLevel == 100) {
111+ $('power').className = 'battery-percentimage-charged';
112+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
113+ } else {
114+ $('power').className = 'battery-percentimage';
115+ $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
116+ }
117+ }
118
119 var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert");
120 if (stageController) {
121@@ -1546,7 +1619,17 @@ handlePowerNotifications: function(payload) {
122 else {
123 this.chargingBannerShown = false;
124 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
125+ if (batteryLevelImage == 0) {
126 $('power').className = 'battery-' + this.lastBatteryLevel;
127+ }
128+ else if (batteryLevelImage == 1) {
129+ $('power').className = 'battery-percent';
130+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true);
131+ }
132+ else if(batteryLevelImage == 2) {
133+ $('power').className = 'battery-percentimage';
134+ $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor);
135+ }
136 Mojo.Controller.getAppController().removeBanner('chargingAlert');
137 }
138 }
139diff --git a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
140index 58b22e8..b23eab5 100644
141--- a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
142+++ b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
143@@ -136,6 +136,22 @@ body.palm-default {
144 margin-left: 2px;
145 width: 17px;
146 }
147+
148+/* Begin: Battery Percent / Image w/ Percent */
149+#power.battery-percent {
150+ width: 38px;
151+ background-color: black;
152+}
153+#power.battery-percentimage {
154+ width: 49px;
155+ background-color: black;
156+}
157+#power.battery-percentimage-charged {
158+ width: 49px;
159+ background-color: black;
160+}
161+/* End: Battery Percent / Image w/ Percent */
162+
163 #power.error {
164 background: url(../images/battery-error.png) center center no-repeat;
165 }
  
1diff --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
2index ee479ac..0618d89 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1430,10 +1430,49 @@ closePbapAlert: function() {
6 }
7 },
8
9+/* Format battery level percent
10+ * We use this function instead of just a variable because
11+ * sometimes this.batteryLevel is used, and sometimes
12+ * payload.percent_ui is
13+ */
14+getBatteryLevelPercent: function(percent, color, image, charging) {
15+ if (color) {
16+ if (charging == 1)
17+ bColor = '#33CCFF';
18+ else if (percent >= 70)
19+ bColor = '#33FF33';
20+ else if(percent <= 69 && percent >= 45)
21+ bColor = '#FFFF33';
22+ else if(percent <= 44 && percent >= 20)
23+ bColor = '#FFCC00';
24+ else if(percent <= 19)
25+ bColor = '#FF0000';
26+ else
27+ bColor = 'white';
28+
29+ // Use span to set color
30+ if (image != undefined)
31+ var fPercent = '<span style="color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
32+ else
33+ var fPercent = '<span style="position: relative; bottom: 2px; color: ' + bColor + ';">' + percent + unescape('%') + '</span>';
34+ }
35+ else {
36+ var fPercent = percent + unescape('%');
37+ }
38+ return fPercent;
39+},
40+
41+
42 /*
43 * Handle power and charging notifications
44 */
45 handlePowerNotifications: function(payload) {
46+ // Replace this with a user definable setting
47+ var batteryLevelImage = 1; // 0 displays image (factory default)
48+ // 1 displays numerical percentage
49+ // 2 displays the image on left and numerical percentage on right (default)
50+
51+ var batteryLevelColor = 1; // Set to 0 for white, 1 for color
52
53 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
54 if(!this.powerdServiceUp) {
55@@ -1453,7 +1492,15 @@ handlePowerNotifications: function(payload) {
56 // Show the battery level if not charging
57 if (!this.isCharging) {
58 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i);
59+ if (batteryLevelImage == 0) {
60 $('power').className = 'battery-' + i;
61+ } else if(batteryLevelImage == 1) {
62+ $('power').className = 'battery-percent';
63+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0);
64+ } else if(batteryLevelImage == 2) {
65+ $('power').className = 'battery-percentimage';
66+ $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor);
67+ }
68
69 //Show Banner Message if the Battery level is below 20%
70 var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
71@@ -1482,10 +1529,23 @@ handlePowerNotifications: function(payload) {
72 }
73 else {
74 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
75- if(payload.percent_ui == 100)
76+ if (batteryLevelImage == 0) {
77+ if (payload.percent_ui == 100)
78 $('power').className = 'battery-charged';
79 else
80 $('power').className = 'battery-charging-' + i;
81+ } else if (batteryLevelImage == 1) {
82+ $('power').className = 'battery-percent';
83+ $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
84+ } else if(batteryLevelImage == 2) {
85+ if (payload.percent_ui == 100) {
86+ $('power').className = 'battery-percentimage-charged';
87+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
88+ } else {
89+ $('power').className = 'battery-percentimage';
90+ $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1);
91+ }
92+ }
93
94 }
95
96@@ -1522,10 +1582,23 @@ handlePowerNotifications: function(payload) {
97
98 if (this.isCharging) {
99 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
100- if(this.batteryLevel == 100)
101+ if (batteryLevelImage == 0) {
102+ if (this.batteryLevel == 100)
103 $('power').className = 'battery-charged';
104 else
105 $('power').className = 'battery-charging-' + this.lastBatteryLevel;
106+ } else if(batteryLevelImage == 1) {
107+ $('power').className = 'battery-percent';
108+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
109+ } else if(batteryLevelImage == 2) {
110+ if (this.batteryLevel == 100) {
111+ $('power').className = 'battery-percentimage-charged';
112+ $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
113+ } else {
114+ $('power').className = 'battery-percentimage';
115+ $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1);
116+ }
117+ }
118
119 var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert");
120 if (stageController) {
121@@ -1546,7 +1619,17 @@ handlePowerNotifications: function(payload) {
122 else {
123 this.chargingBannerShown = false;
124 Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel);
125+ if (batteryLevelImage == 0) {
126 $('power').className = 'battery-' + this.lastBatteryLevel;
127+ }
128+ else if (batteryLevelImage == 1) {
129+ $('power').className = 'battery-percent';
130+ $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true);
131+ }
132+ else if(batteryLevelImage == 2) {
133+ $('power').className = 'battery-percentimage';
134+ $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor);
135+ }
136 Mojo.Controller.getAppController().removeBanner('chargingAlert');
137 }
138 }
139diff --git a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
140index 58b22e8..b23eab5 100644
141--- a/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
142+++ b/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
143@@ -136,6 +136,22 @@ body.palm-default {
144 margin-left: 2px;
145 width: 17px;
146 }
147+
148+/* Begin: Battery Percent / Image w/ Percent */
149+#power.battery-percent {
150+ width: 38px;
151+ background-color: black;
152+}
153+#power.battery-percentimage {
154+ width: 49px;
155+ background-color: black;
156+}
157+#power.battery-percentimage-charged {
158+ width: 49px;
159+ background-color: black;
160+}
161+/* End: Battery Percent / Image w/ Percent */
162+
163 #power.error {
164 background: url(../images/battery-error.png) center center no-repeat;
165 }
  
1Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2===================================================================
3--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -817,6 +817,8 @@ handletelephonyNotifications: function(p
6 this.callForwardNotificationSession = null;
7 }
8 }
9+ var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");
10+ stageController.delegateToSceneAssistant("updatePhone");
11 }
12 else if (payload.eventNetwork && this.phoneRadioState) {
13 var networkMsg = payload.eventNetwork;
14@@ -2647,6 +2649,10 @@ getCurrentWiFiState: function() {
15 return this.wifiState;
16 },
17
18+getCurrentPhoneState: function() {
19+ return this.phoneRadioState;
20+},
21+
22 setDeviceMenuAssistant: function(menuassistant) {
23 this.deviceMenuAssistant = menuassistant;
24 },
25Index: /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
26===================================================================
27--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
28+++ /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js
29@@ -1,6 +1,6 @@
30 /* Copyright 2009 Palm, Inc. All rights reserved. */
31
32-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});
33+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});
34
35 var DevicemenuAssistant = Class.create({
36
37@@ -39,6 +39,8 @@ var DevicemenuAssistant = Class.create({
38 this.drawerModel = {myOpenProperty:false};
39 this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
40 this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
41+ this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);
42+ this.phonedrawer = this.controller.get('phonedetails')
43 this.wifidrawer = this.controller.get('wifidetails');
44 this.btdrawer = this.controller.get('btdetails');
45
46@@ -95,6 +97,17 @@ var DevicemenuAssistant = Class.create({
47 else
48 this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML();
49 }
50+
51+ var phonestate = this.barAssistant.getCurrentPhoneState();
52+ if(phonestate === 'Off') {
53+ this.controller.get('phonemsg').innerHTML = $L('Off');
54+ RadioState.set('phone',false);
55+ }
56+ else {
57+ this.controller.get('phonemsg').innerHTML = $L('On');
58+ RadioState.set('phone',true);
59+ }
60+
61 this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));
62 this.isVisible = true;
63
64@@ -118,6 +131,8 @@ var DevicemenuAssistant = Class.create({
65 this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this));
66 this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));
67 this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));
68+ this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));
69+ this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));
70 this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));
71 this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));
72 this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));
73@@ -177,6 +192,49 @@ var DevicemenuAssistant = Class.create({
74 }
75 this.apModeInProgress = false;
76 },
77+
78+
79+ updatePhone: function() {
80+ if(this.barAssistant.getCurrentPhoneState()) {
81+ this.controller.get('phonemsg').innerHTML = $L('On');
82+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');
83+ RadioState.set('phone', true);
84+ }
85+ else {
86+ this.controller.get('phonemsg').innerHTML = $L('Off');
87+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');
88+ RadioState.set('phone', false);
89+ }
90+ },
91+
92+ togglePhoneRadio: function(event) {
93+ this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {
94+ method: 'vibrate', parameters: { 'period': 0,'duration': 250 }
95+ });
96+ if(RadioState.get('phone'))
97+ TelephonyService.tempPowerSet('off',false,null,null);
98+ else
99+ TelephonyService.tempPowerSet('on',false,null,null);
100+ this.toggleDeviceMenu();
101+ },
102+
103+ togglePhoneList: function(event) {
104+ if(this.apModeInProgress)
105+ return;
106+
107+ if (this.phonedrawer.mojo.getOpenState()) {
108+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));
109+ }
110+ else {
111+ if(RadioState.get('phone'))
112+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');
113+ else
114+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');
115+
116+ this.controller.showWidgetContainer(this.controller.get('phonedetails'));
117+ }
118+ this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState());
119+ },
120
121 toggleBTRadio: function(event) {
122 if(RadioState.get('bluetooth')) {
123@@ -891,6 +949,10 @@ var DevicemenuAssistant = Class.create({
124
125 close: function() {
126
127+ if(this.phonedrawer.mojo.getOpenState()) {
128+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));
129+ this.phonedrawer.mojo.setOpenState(false);
130+ }
131 if (this.btdrawer.mojo.getOpenState()) {
132 this.clearBTList();
133 this.controller.hideWidgetContainer(this.controller.get('btdetails'));
134Index: /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
135===================================================================
136--- .orig/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
137+++ /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html
138@@ -94,6 +94,22 @@
139
140 <div class="palm-section-divider"></div>
141
142+ <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
143+ <div class="title truncating-text">
144+ <div class="label right" id="phonemsg">&nbsp;</div>
145+ <span x-mojo-loc=''>Phone</span>
146+ </div>
147+ </div></div>
148+
149+ <div id='phonedetails' x-mojo-element="Drawer">
150+ <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
151+ <div id="phone_radio" class="title truncating-text">
152+ </div>
153+ </div></div>
154+ </div>
155+
156+ <div class="palm-section-divider"></div>
157+
158 <div id="dm_airplanemode" class="palm-row last menu-end" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper">
159 <div id="dm_airplanemode_status" class="title truncating-text">
160 </div>
  
1show-actual-battery-percent
2
3Tested-On: 1.1
4
5//show actual battery percent in the system user interface.
6//note: battery @ 100% will only charge on a new charge event or if power is <94%
7Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
8===================================================================
9--- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
10+++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
11@@ -1382,11 +1382,11 @@ handlePowerNotifications: function(paylo
12
13 Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload));
14 // Is the battery level provided?
15- if (payload.percent_ui != undefined) {
16+ if (payload.percent != undefined) {
17 //Save the Battery Percentage
18- this.batteryLevel = payload.percent_ui;
19+ this.batteryLevel = payload.percent;
20 for (var i = 0; i < this.powerIndicator.length; i++) {
21- if (payload.percent_ui > this.powerIndicator[i])
22+ if (payload.percent > this.powerIndicator[i])
23 continue;
24 this.lastBatteryLevel = i;
25 this.lastBatteryLevelPayload = payload;
26@@ -1397,7 +1397,7 @@ handlePowerNotifications: function(paylo
27 $('power').className = 'battery-' + i;
28
29 //Show Banner Message if the Battery level is below 20%
30- var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload);
31+ var batteryalert = $L("#{percent}% battery remaining").interpolate(payload);
32 if(this.batteryLevel <= 5 && !this.batteryLevel5Shown) {
33 this.batteryLevel5Shown = true;
34 this.showLowBatteryAlert();
35@@ -1423,7 +1423,7 @@ handlePowerNotifications: function(paylo
36 }
37 else {
38 Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging );
39- if(payload.percent_ui == 100)
40+ if(payload.percent == 100)
41 $('power').className = 'battery-charged';
42 else
43 $('power').className = 'battery-charging-' + i;
  
1diff --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
2index 7d94506..1c90d5e 100644
3--- a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
4+++ b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
5@@ -48,6 +48,7 @@ GlobalSearchAssistant = Class.create({
6 this.offset=0;
7 this.limit=40;
8 this.URLs = {
9+ 'keytoss':$L("http://pre.keytoss.com/parse.php5?term="),
10 'google':$L("www.google.com/m/search?client=ms-palm-webOS&channel=iss&q="),
11 'wikipedia':$L("http://en.m.wikipedia.org/wiki/Special:Search?search="),
12 'twitter': $L("http://search.twitter.com/search?q=")
13@@ -1656,6 +1657,7 @@ GlobalSearchAssistant = Class.create({
14 this.expandedSearchDrawer.showExpanded = false;
15 this.controller.modelChanged(this.expandedSearchDrawer);
16 this.searchApps.clear();
17+ $('keytoss').removeClassName('selected');
18 $('google').removeClassName('selected');
19 $('map').removeClassName('selected');
20 $('wikipedia').removeClassName('selected');
21@@ -1761,6 +1763,7 @@ GlobalSearchAssistant = Class.create({
22 }
23 //clear search':
24 $('google').removeClassName('palm-focus');
25+ $('keytoss').removeClassName('palm-focus');
26 $('web').removeClassName('palm-focus');
27 },
28 highlightSelection: function() {
29@@ -1819,19 +1822,23 @@ GlobalSearchAssistant = Class.create({
30 break;
31 case 'search':
32 if (this.webDrawer.showWeb == true) {
33- $('google').removeClassName('palm-focus');
34+ //$('google').removeClassName('palm-focus');
35+ $('keytoss').removeClassName('palm-focus');
36 $('web').addClassName('palm-focus');
37 this.highlightTarget = $('web');
38 }
39 else if(this.expandedSearchDrawer.showExpanded == true){
40- $('google').addClassName('palm-focus');
41+ //$('google').addClassName('palm-focus');
42+ $('keytoss').addClassName('palm-focus');
43 $('web').removeClassName('palm-focus');
44- this.highlightTarget = $('google');
45+ //this.highlightTarget = $('google');
46+ this.highlightTarget = $('keytoss');
47 }
48 break;
49 }
50 if (this.enterKeyActionItem != "search") {
51 $('google').removeClassName('palm-focus');
52+ $('keytoss').removeClassName('palm-focus');
53 $('web').removeClassName('palm-focus');
54 }
55 },
56@@ -1923,7 +1930,8 @@ GlobalSearchAssistant = Class.create({
57 if (this.webDrawer.showWeb == true)
58 this.launchBrowser(this.currentFilter);
59 else {
60- this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
61+ //this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
62+ this.launchBrowser(this.URLs['keytoss'] + encodeURIComponent(this.currentFilter));
63 }
64 break;
65 }
66diff --git a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
67index 7bfc200..00cc1cc 100644
68--- a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
69+++ b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
70@@ -9,6 +9,11 @@
71 </div>
72
73 <div id='expanded_searches_drawer' x-mojo-element="Drawer">
74+ <div class="palm-row" id="keytoss" name="search-identifier" x-mojo-tap-highlight="persistent">
75+ <div class="palm-row-wrapper">
76+ <div class="search-keytoss"></div>
77+ </div>
78+ </div>
79 <div class="palm-row" id="google" name="search-identifier" x-mojo-tap-highlight="persistent">
80 <div class="palm-row-wrapper">
81 <div class="search-google"></div>
82diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
83index 1f10209..5887f9c 100644
84--- a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
85+++ b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
86@@ -119,6 +119,12 @@ Copyright 2009 Palm, Inc. All rights reserved.
87 background: url(../images/search-add.png) center center no-repeat;
88 }
89
90+.palm-group.search .search-keytoss {
91+ width: 100%;
92+ height: 52px;
93+ background: url(../images/search-keytoss.png) center center no-repeat;
94+}
95+
96 .palm-group.search .search-google {
97 width: 100%;
98 height: 52px;
99diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
100index 986f0bb..61d4d0c 100644
101--- a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
102+++ b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
103@@ -58,6 +58,12 @@ function UrlSearchController(controller){
104
105 // Our search providers
106 UrlSearchController.SearchProviders = {
107+ keytoss: {
108+ searchTitle: $L('Search KeyToss'),
109+ searchTemplate: $L('KeyToss "#{search}"'),
110+ urlTemplate: $L('http://pre.keytoss.com/parse.php5?term=#{query}')
111+ },
112+
113 google: {
114 searchTitle: $L('Search Google'),
115 searchTemplate: $L('Google "#{search}"'),
116@@ -218,14 +224,18 @@ UrlSearchController.prototype._addStockSearchItems = function(searchText, withDi
117 this.urlSearchListModel.unshift(item);
118
119 // Google block....
120- url = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
121- title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
122+ //url = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
123+ //title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
124+ url = UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodedUriComponent});
125+ title = UrlSearchController.SearchProviders.keytoss.searchTemplate.interpolate({search: escapedSearchText});
126
127 item = new UrlReference(url, title);
128- item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
129+ //item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
130+ item.subTitle = UrlSearchController.SearchProviders.keytoss.searchTitle;
131 item.iconclass = 'search-image';
132 item.rowclass = 'search first';
133- item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
134+ //item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
135+ item.iconUrl = Mojo.appPath + 'images/list-icon-keytoss.png';
136
137 this.urlSearchListModel.unshift(item);
138
139@@ -382,7 +392,8 @@ UrlSearchController.prototype._handleSelection = function(event) {
140
141 UrlSearchController.formatDefaultSearchUrl = function(query) {
142
143- return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
144+ //return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
145+ return UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodeURIComponent(query)});
146 };
147
148 /**