Commit a6c72d74e4fab0954d7f03aa26384930d3bf2cb5
- Diff rendering mode:
- inline
- side by side
luna/battery-percent-and-icon.patch
(228 / 0)
|   | |||
| 1 | Battery percent and icon in top bar with default percent | ||
| 2 | |||
| 3 | Updated for 1.2 by StoneRyno | ||
| 4 | Credit for development of the modifications and who who updated it to | ||
| 5 | work with 1.2 go to forum members in this thread | ||
| 6 | http://forums.precentral.net/web-os-development/194029-battery-place-icon-working-1-1-0-color.html | ||
| 7 | |||
| 8 | Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | ||
| 9 | =================================================================== | ||
| 10 | --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | ||
| 11 | +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | ||
| 12 | @@ -132,6 +132,39 @@ getMSMWarningPref: function() { | ||
| 13 | }); | ||
| 14 | }, | ||
| 15 | |||
| 16 | +/* Format battery level percent | ||
| 17 | + * We use this function instead of just a variable because | ||
| 18 | + * sometimes this.batteryLevel is used, and sometimes | ||
| 19 | + * payload.percent_ui is | ||
| 20 | + */ | ||
| 21 | +getBatteryLevelPercent: function(percent, color, image) { | ||
| 22 | + | ||
| 23 | + // Special thanks to gordian for the color codes, and maouton for the ranges | ||
| 24 | + if (color) { | ||
| 25 | + // Green for 100%, yellow for 20%, red for 10%, norm for rest | ||
| 26 | + if (percent >= 70) | ||
| 27 | + bColor = '#33FF33'; | ||
| 28 | + else if(percent <= 69 && percent >= 45) | ||
| 29 | + bColor = '#FFFF33'; | ||
| 30 | + else if(percent <= 44 && percent >= 20) | ||
| 31 | + bColor = '#FFCC00'; | ||
| 32 | + else if(percent <= 19) | ||
| 33 | + bColor = '#FF0000'; | ||
| 34 | + else | ||
| 35 | + bColor = 'white'; | ||
| 36 | + | ||
| 37 | + // Use span to set color | ||
| 38 | + if (image != undefined) | ||
| 39 | + var fPercent = '<span style="color: ' + bColor + ';">' + percent + unescape('%') + '</span>'; | ||
| 40 | + else | ||
| 41 | + var fPercent = '<span style="position: relative; bottom: 2px; color: ' + bColor + ';">' + percent + unescape('%') + '</span>'; | ||
| 42 | + } | ||
| 43 | + else { | ||
| 44 | + var fPercent = percent + unescape('%'); | ||
| 45 | + } | ||
| 46 | + return fPercent; | ||
| 47 | +}, | ||
| 48 | + | ||
| 49 | getMSMWarningPrefDone: function(payload) { | ||
| 50 | |||
| 51 | if(payload && payload.showMSMWarning != undefined) { | ||
| 52 | @@ -1436,6 +1469,22 @@ closePbapAlert: function() { | ||
| 53 | handlePowerNotifications: function(payload) { | ||
| 54 | |||
| 55 | Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload)); | ||
| 56 | + | ||
| 57 | + // Replace this with a user definable setting | ||
| 58 | + var batteryLevelImage = 2; // 0 displays image (factory default) | ||
| 59 | + // 1 displays numerical percentage | ||
| 60 | + // 2 displays the image on left and numerical percentage on right (default) | ||
| 61 | + | ||
| 62 | + var batteryLevelColor = 1; // Set to 0 for white, 1 for color | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + // Format the percent and number | ||
| 66 | + var batteryLevelPercent = this.batteryLevel + escape('%'); | ||
| 67 | + | ||
| 68 | + // Set the background to blank if we are not using the image | ||
| 69 | + if (!batteryLevelImage) | ||
| 70 | + $('power').className = 'battery-blank'; | ||
| 71 | + | ||
| 72 | if(!this.powerdServiceUp) { | ||
| 73 | Mojo.Log.error("SystemUI PowerD down -- ignoring the notification"); | ||
| 74 | return; | ||
| 75 | @@ -1453,10 +1502,23 @@ handlePowerNotifications: function(paylo | ||
| 76 | // Show the battery level if not charging | ||
| 77 | if (!this.isCharging) { | ||
| 78 | Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i); | ||
| 79 | - $('power').className = 'battery-' + i; | ||
| 80 | + //$('power').className = 'battery-' + i; | ||
| 81 | + | ||
| 82 | + if (batteryLevelImage == 0) { | ||
| 83 | + $('power').className = 'battery-' + i; | ||
| 84 | + } | ||
| 85 | + else if(batteryLevelImage == 1) { | ||
| 86 | + $('power').className = 'battery-percent'; | ||
| 87 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true); | ||
| 88 | + } | ||
| 89 | + else if(batteryLevelImage == 2) { | ||
| 90 | + $('power').className = 'battery-percentimage'; | ||
| 91 | + $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 92 | + } | ||
| 93 | |||
| 94 | //Show Banner Message if the Battery level is below 20% | ||
| 95 | - var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 96 | + // var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 97 | + var batteryalert = $L("#{percent}% battery remaining").interpolate(payload); | ||
| 98 | if(this.batteryLevel <= 5 && !this.batteryLevel5Shown) { | ||
| 99 | this.batteryLevel5Shown = true; | ||
| 100 | this.showLowBatteryAlert(); | ||
| 101 | @@ -1482,11 +1544,32 @@ handlePowerNotifications: function(paylo | ||
| 102 | } | ||
| 103 | else { | ||
| 104 | Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging ); | ||
| 105 | - if(payload.percent_ui == 100) | ||
| 106 | - $('power').className = 'battery-charged'; | ||
| 107 | - else | ||
| 108 | - $('power').className = 'battery-charging-' + i; | ||
| 109 | - | ||
| 110 | + if (batteryLevelImage == 0) { | ||
| 111 | + if (payload.percent_ui == 100) | ||
| 112 | + $('power').className = 'battery-charged'; | ||
| 113 | + else | ||
| 114 | + $('power').className = 'battery-charging-' + i; | ||
| 115 | + } | ||
| 116 | + else if (batteryLevelImage == 1) { | ||
| 117 | + $('power').className = 'battery-percent'; | ||
| 118 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true); | ||
| 119 | + } | ||
| 120 | + else if(batteryLevelImage == 2) { | ||
| 121 | + if (payload.percent_ui == 100) { | ||
| 122 | + $('power').className = 'battery-percentimage-charged'; | ||
| 123 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 124 | + } | ||
| 125 | + else { | ||
| 126 | + $('power').className = 'battery-percentimage'; | ||
| 127 | + $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | + else { | ||
| 131 | + if(!batteryLevelImage) | ||
| 132 | + $('power').innerHTML = batteryLevelPercent; | ||
| 133 | + else | ||
| 134 | + $('power').className = 'battery-charging-' + i; | ||
| 135 | + } | ||
| 136 | } | ||
| 137 | |||
| 138 | if(this.batteryLevel > 5 && this.batteryLevel <= 10) { | ||
| 139 | @@ -1522,10 +1605,34 @@ handlePowerNotifications: function(paylo | ||
| 140 | |||
| 141 | if (this.isCharging) { | ||
| 142 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | ||
| 143 | - if(this.batteryLevel == 100) | ||
| 144 | - $('power').className = 'battery-charged'; | ||
| 145 | - else | ||
| 146 | - $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 147 | + | ||
| 148 | + if (batteryLevelImage == 0) { | ||
| 149 | + if (this.batteryLevel == 100) | ||
| 150 | + $('power').className = 'battery-charged'; | ||
| 151 | + else | ||
| 152 | + $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 153 | + } | ||
| 154 | + if (batteryLevelImage == 1) { | ||
| 155 | + $('power').className = 'battery-percent'; | ||
| 156 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true); | ||
| 157 | + } | ||
| 158 | + else if(batteryLevelImage == 2) { | ||
| 159 | + if (this.batteryLevel == 100) { | ||
| 160 | + $('power').className = 'battery-percentimage-charged'; | ||
| 161 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 162 | + } | ||
| 163 | + else { | ||
| 164 | + $('power').className = 'battery-percentimage'; | ||
| 165 | + $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + else { | ||
| 170 | + if(!batteryLevelImage) | ||
| 171 | + $('power').innerHTML = batteryLevelPercent; | ||
| 172 | + else | ||
| 173 | + $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 174 | + } | ||
| 175 | |||
| 176 | var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert"); | ||
| 177 | if (stageController) { | ||
| 178 | @@ -1546,7 +1653,17 @@ handlePowerNotifications: function(paylo | ||
| 179 | else { | ||
| 180 | this.chargingBannerShown = false; | ||
| 181 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | ||
| 182 | - $('power').className = 'battery-' + this.lastBatteryLevel; | ||
| 183 | + if (batteryLevelImage == 0) { | ||
| 184 | + $('power').className = 'battery-' + this.lastBatteryLevel; | ||
| 185 | + } | ||
| 186 | + else if (batteryLevelImage == 1) { | ||
| 187 | + $('power').className = 'battery-percent'; | ||
| 188 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true); | ||
| 189 | + } | ||
| 190 | + else if(batteryLevelImage == 2) { | ||
| 191 | + $('power').className = 'battery-percentimage'; | ||
| 192 | + $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 193 | + } | ||
| 194 | Mojo.Controller.getAppController().removeBanner('chargingAlert'); | ||
| 195 | } | ||
| 196 | } | ||
| 197 | Index: /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 198 | =================================================================== | ||
| 199 | --- .orig/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 200 | +++ /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 201 | @@ -134,8 +134,26 @@ body.palm-default { | ||
| 202 | |||
| 203 | #power { | ||
| 204 | margin-left: 2px; | ||
| 205 | - width: 17px; | ||
| 206 | + width: 17px; | ||
| 207 | } | ||
| 208 | +#power.battery-blank { | ||
| 209 | + width: 27px; | ||
| 210 | + background-color: black; | ||
| 211 | +} | ||
| 212 | +/* Begin: Battery Percent / Image w/ Percent */ | ||
| 213 | +#power.battery-percent { | ||
| 214 | + width: 38px; | ||
| 215 | + background-color: black; | ||
| 216 | +} | ||
| 217 | +#power.battery-percentimage { | ||
| 218 | + width: 49px; | ||
| 219 | + background-color: black; | ||
| 220 | +} | ||
| 221 | +#power.battery-percentimage-charged { | ||
| 222 | + width: 49px; | ||
| 223 | + background-color: black; | ||
| 224 | +} | ||
| 225 | +/* End: Battery Percent / Image w/ Percent */ | ||
| 226 | #power.error { | ||
| 227 | background: url(../images/battery-error.png) center center no-repeat; | ||
| 228 | } |
luna/keytoss-keyword-search.patch
(148 / 0)
|   | |||
| 1 | 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 | ||
| 2 | index 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 | } | ||
| 66 | diff --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 | ||
| 67 | index 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> | ||
| 82 | diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css | ||
| 83 | index 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; | ||
| 99 | diff --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 | ||
| 100 | index 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 | /** |
luna/more_icons_per_row.patch
(18 / 49)
|   | |||
| 1 | More icons per row with reduced margins and increase space between columns | ||
| 2 | |||
| 3 | Updated for 1.2 | ||
| 4 | |||
| 5 | Variation by StoneRyno of the original patch | ||
| 6 | |||
| 1 | 7 | Index: /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | |
| 2 | 8 | =================================================================== | |
| 3 | 9 | --- .orig/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | |
| 4 | 10 | +++ /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | |
| 5 | @@ -16,7 +16,7 @@ var LauncherAssistant = Class.create({ | ||
| 11 | @@ -10,7 +10,7 @@ var LauncherAssistant = Class.create({ | ||
| 6 | 12 | */ | |
| 7 | kBottomFadeHeight: 0, | ||
| 13 | kQuickLaunchHeight: 67, | ||
| 8 | 14 | ||
| 9 | 15 | - kPageIndicatorSpacing: 6, /* spacing between each page indicator */ | |
| 10 | 16 | + kPageIndicatorSpacing: 1, /* spacing between each page indicator */ | |
| 11 | 17 | kPageMargin: 10, /* 10 pixel margin on each side of a page */ | |
| 12 | kTopMargin: 12, | ||
| 13 | 18 | kPageWidthNoMargin: NaN, | |
| 14 | @@ -30,8 +30,8 @@ var LauncherAssistant = Class.create({ | ||
| 15 | visible: true, | ||
| 16 | label: $L('Launcher'), | ||
| 17 | items: [ | ||
| 18 | - /*{ label: $L('New page'), command: 'newpage' }, | ||
| 19 | - { label: $L('Delete page'), command: 'deletepage' },*/ | ||
| 20 | + { label: $L('New page'), command: 'newpage' }, | ||
| 21 | + { label: $L('Delete page'), command: 'deletepage' }, | ||
| 22 | Mojo.Menu.editItem, | ||
| 23 | { label: $L('List Apps...'), command: 'listapps' }, | ||
| 24 | Mojo.Menu.helpItem | ||
| 25 | @@ -125,7 +125,24 @@ var LauncherAssistant = Class.create({ | ||
| 26 | ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params); | ||
| 27 | break; | ||
| 28 | /* | ||
| 29 | - case 'newpage': | ||
| 30 | + START ENABLE PAGE ADD AND DELETE */ | ||
| 31 | + case 'newpage': | ||
| 32 | + if (this.pageDivs.length < 10) { | ||
| 33 | + this.insertPage(this.activePageIndex, true); | ||
| 34 | + } | ||
| 35 | + break; | ||
| 36 | + case 'deletepage': | ||
| 37 | + if (this.pageDivs.length > 1) { | ||
| 38 | + this.deletePage(this.activePageIndex); | ||
| 39 | + if (this.activePageIndex >= this.pageDivs.length) { | ||
| 40 | + this.activePageIndex = this.pageDivs.length - 1; | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + break; | ||
| 44 | + /* | ||
| 45 | + END ENABLE PAGE ADD AND DELETE | ||
| 46 | + | ||
| 47 | + case 'newpage': | ||
| 48 | if (this.pageDivs.length < 10) { | ||
| 49 | this.insertPage(this.activePageIndex, true); | ||
| 50 | } | ||
| 51 | @@ -382,9 +399,9 @@ var LauncherAssistant = Class.create({ | ||
| 19 | kPageWidth: NaN, | ||
| 20 | @@ -324,9 +324,9 @@ var LauncherAssistant = Class.create({ | ||
| 52 | 21 | var newAppDiv = $(newAppInfo.launchPointId); | |
| 53 | 22 | Mojo.assert(newAppDiv !== undefined, "Application (%d) was inserted into the DOM but unable to be retrieved!", newAppInfo.launchPointId); | |
| 54 | 23 | if (isNaN(this.kAppWidth) || isNaN(this.kAppHeight)) { | |
| 55 | 24 | - this.kAppWidth = newAppDiv.getWidth(); | |
| 56 | 25 | - this.kAppHeight = newAppDiv.getHeight(); | |
| 57 | 26 | - this.kAppsPerRow = Math.round(this.kPageWidthNoMargin / this.kAppWidth); | |
| 58 | + this.kAppWidth = 55; | ||
| 27 | + this.kAppWidth = 64; | ||
| 59 | 28 | + this.kAppHeight = 90; | |
| 60 | 29 | + this.kAppsPerRow = 5; | |
| 61 | 30 | } | |
| 62 | 31 | ||
| 63 | 32 | Mojo.listen(newAppDiv, Mojo.Event.tap, this.onAppTapped.bindAsEventListener(this)); | |
| 64 | @@ -498,7 +515,7 @@ var LauncherAssistant = Class.create({ | ||
| 33 | @@ -439,7 +439,7 @@ var LauncherAssistant = Class.create({ | ||
| 65 | 34 | /* determines the position of an app element at appIndex within a page */ | |
| 66 | 35 | calculateAppPosition: function(appIndex) { | |
| 67 | 36 | return { | |
| 68 | 37 | - left: (((appIndex % this.kAppsPerRow) * this.kAppWidth) + this.kPageMargin), | |
| 69 | + left: (((appIndex % this.kAppsPerRow) * this.kAppWidth)), | ||
| 70 | top: (Math.floor(appIndex/this.kAppsPerRow) * this.kAppHeight + this.kTopMargin) | ||
| 38 | + left: (((appIndex % this.kAppsPerRow) * this.kAppWidth) - 18), | ||
| 39 | top: (Math.floor(appIndex/this.kAppsPerRow) * this.kAppHeight) | ||
| 71 | 40 | }; | |
| 72 | 41 | }, | |
| 73 | 42 | Index: /usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | |
| 74 | 43 | =================================================================== | |
| 75 | 44 | --- .orig/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | |
| 76 | 45 | +++ /usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | |
| 77 | @@ -116,7 +116,7 @@ body.palm-default | ||
| 46 | @@ -121,7 +121,7 @@ body.palm-default | ||
| 78 | 47 | ||
| 79 | 48 | .launcher_page .name { | |
| 80 | 49 | position:absolute; | |
| … | … | ||
| 52 | 52 | width:100px; | |
| 53 | 53 | height: 34px; | |
| 54 | 54 | max-height: 34px; | |
| 55 | @@ -125,7 +125,7 @@ body.palm-default | ||
| 55 | @@ -130,7 +130,7 @@ body.palm-default | ||
| 56 | 56 | color:white; | |
| 57 | 57 | text-align:center; | |
| 58 | 58 | font-weight:bold; | |
| … | … | ||
| 61 | 61 | overflow: hidden; | |
| 62 | 62 | text-overflow: ellipsis; | |
| 63 | 63 | z-index:5; | |
| 64 | @@ -148,8 +148,8 @@ body.palm-default | ||
| 64 | @@ -164,8 +164,8 @@ body.palm-default | ||
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | 67 | .draggable { | |
| … | … | ||
| 72 | 72 | margin: 0 auto; | |
| 73 | 73 | -webkit-user-drag: any; | |
| 74 | 74 | -webkit-user-select: none; | |
| 75 | @@ -192,8 +192,8 @@ body.palm-default | ||
| 75 | @@ -213,8 +213,8 @@ body.palm-default | ||
| 76 | 76 | ||
| 77 | 77 | #app-icon { | |
| 78 | 78 | float:left; |
messaging/clean-timestamp.patch
(63 / 0)
|   | |||
| 1 | Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 2 | =================================================================== | ||
| 3 | --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 4 | +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 5 | @@ -1245,6 +1245,11 @@ var ChatviewAssistant = Class.create({ | ||
| 6 | var d = new Date(); | ||
| 7 | d.setTime(msg.deviceTimeStamp); | ||
| 8 | msg.niceDate = BucketDateFormatter.getDateBucket(d,true,true); // this used to use msg.timeStamp - changed 2008-11-05 | ||
| 9 | + | ||
| 10 | + // timestamp hack - enables timestamps on all messages | ||
| 11 | + var ts = new Date(); | ||
| 12 | + ts.setTime(msg.deviceTimeStamp); | ||
| 13 | + msg.timeStampText = Mojo.Format.formatDate(ts,'short'); | ||
| 14 | |||
| 15 | // divider hack - round to the nearest 5 minutes | ||
| 16 | // we have to do this because the list divider implementation does not allow a divider | ||
| 17 | @@ -1252,11 +1257,11 @@ var ChatviewAssistant = Class.create({ | ||
| 18 | var deviceTimeStampMinutes = d.getMinutes(); | ||
| 19 | d.setMinutes((deviceTimeStampMinutes - (deviceTimeStampMinutes % 5))); | ||
| 20 | d.setSeconds(0); | ||
| 21 | - msg.dividerText = msg.transportClass + BucketDateFormatter.getDateBucket(d,true,true); | ||
| 22 | + msg.dividerText = msg.transportClass; // + BucketDateFormatter.getDateBucket(d,true,true); | ||
| 23 | |||
| 24 | // if the INCOMING message was sent longer than 10 minutes before it arrived on device, | ||
| 25 | // add sent date to indicate that this delay happened | ||
| 26 | - if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) { | ||
| 27 | + // if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) { // timestamp fix var d = new Date(); | ||
| 28 | var d = new Date(); | ||
| 29 | var today = d.getTime(); | ||
| 30 | d.setTime(msg.timeStamp); | ||
| 31 | @@ -1264,10 +1269,10 @@ var ChatviewAssistant = Class.create({ | ||
| 32 | |||
| 33 | // Only show the message sent time if it is less than two days old | ||
| 34 | // from when it arrived on device | ||
| 35 | - if(today-msg.timeStamp <= (1000*60*60*24*2)) { | ||
| 36 | - msg.timeStampDeltaMsg = new Template($L("Message Sent: #{dateTime}")).evaluate({dateTime:Mojo.Format.formatDate(sentTimeStamp,'short')}); | ||
| 37 | - } | ||
| 38 | - } | ||
| 39 | + // if(today-msg.timeStamp <= (1000*60*60*24*2)) { // timestamp fix | ||
| 40 | + msg.timeStampDeltaMsg = new Template($L("#{dateTime}")).evaluate({dateTime:Mojo.Format.formatDate(sentTimeStamp,'short')}); | ||
| 41 | + // } // timestamp fix | ||
| 42 | + // } // timestamp fix | ||
| 43 | |||
| 44 | if (msg.callbackNumber) { | ||
| 45 | msg.callbackNumber = PalmSystem.runTextIndexer(msg.callbackNumber); | ||
| 46 | Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 47 | =================================================================== | ||
| 48 | --- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 49 | +++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 50 | @@ -681,7 +681,12 @@ img.avatar-overlay { | ||
| 51 | width: 40px; | ||
| 52 | height: 40px; | ||
| 53 | } | ||
| 54 | - | ||
| 55 | +/* timestamp formatting */ | ||
| 56 | +.timeStamp { | ||
| 57 | + font-size: 12px; | ||
| 58 | + font-style: italic; | ||
| 59 | + color: #1111ff; | ||
| 60 | + } | ||
| 61 | .message.status-success { | ||
| 62 | color: #000000; | ||
| 63 | } |
messaging/timestamp-all-messages-builtin-method.patch
(31 / 0)
|   | |||
| 1 | Timestamps all messages with the method used to timestamp messages that show up late | ||
| 2 | |||
| 3 | Modified for 1.2 by StoneRyno | ||
| 4 | |||
| 5 | Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 6 | =================================================================== | ||
| 7 | --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 8 | +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js | ||
| 9 | @@ -1303,7 +1303,7 @@ var ChatviewAssistant = Class.create({ | ||
| 10 | |||
| 11 | // if the INCOMING message was sent longer than 10 minutes before it arrived on device, | ||
| 12 | // add sent date to indicate that this delay happened | ||
| 13 | - if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) { | ||
| 14 | +// if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) { | ||
| 15 | var d = new Date(); | ||
| 16 | var today = d.getTime(); | ||
| 17 | d.setTime(msg.timeStamp); | ||
| 18 | @@ -1311,10 +1311,10 @@ var ChatviewAssistant = Class.create({ | ||
| 19 | |||
| 20 | // Only show the message sent time if it is less than two days old | ||
| 21 | // from when it arrived on device | ||
| 22 | - if(today-msg.timeStamp <= (1000*60*60*24*2)) { | ||
| 23 | +// if(today-msg.timeStamp <= (1000*60*60*24*2)) { | ||
| 24 | msg.timeStampDeltaMsg = new Template($L("Message Sent: #{dateTime}")).evaluate({dateTime:Mojo.Format.formatDate(sentTimeStamp,'short')}); | ||
| 25 | - } | ||
| 26 | - } | ||
| 27 | +// } | ||
| 28 | +// } | ||
| 29 | |||
| 30 | if (msg.callbackNumber) { | ||
| 31 | msg.callbackNumber = PalmSystem.runTextIndexer(msg.callbackNumber); |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

