Commit bea12514b137ee83564e285edb7b57a50c81e756
- Diff rendering mode:
- inline
- side by side
browser/enable-browser-downloads.patch
(262 / 258)
|   | |||
| 1 | diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/global_code.js b/usr/palm/applications/com.palm.app.browser/app/controllers/global_code.js | ||
| 2 | index b2c8848..d541ea7 100644 | ||
| 3 | --- a/usr/palm/applications/com.palm.app.browser/app/controllers/global_code.js | ||
| 4 | +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/global_code.js | ||
| 5 | @@ -1449,6 +1449,8 @@ PageAssistant.prototype.setup = function() { | ||
| 6 | this._webView.addEventListener(Mojo.Event.webViewUrlRedirect, this._onUrlRedirect.bind(this), false); | ||
| 7 | this._webView.addEventListener(Mojo.Event.webViewModifierTap, this._onModifierTapHandler, false); | ||
| 8 | this._webView.addEventListener(Mojo.Event.webViewUpdateHistory, this._onUpdateHistoryHandler, false); | ||
| 9 | + this._downloadController = new DownloadController(this.controller); | ||
| 10 | + this._downloadController.setup(); | ||
| 11 | } | ||
| 12 | catch (e) { | ||
| 13 | Mojo.Log.logException(e, 'PageAssistant#setup'); | ||
| 14 | @@ -2287,28 +2289,116 @@ PageAssistant.prototype._newBrowserPage = function(url, pageIdentifier){ | ||
| 15 | */ | ||
| 1 | Index: /usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js | ||
| 2 | =================================================================== | ||
| 3 | --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js | ||
| 4 | +++ /usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js | ||
| 5 | @@ -1198,27 +1198,116 @@ | ||
| 16 | 6 | PageAssistant.prototype._streamResource = function(uri, appid, mimeType){ | |
| 17 | 7 | ||
| 18 | - Mojo.Log.info("Streaming: '%s' with '%s' (%s)", uri, appid, mimeType); | ||
| 8 | Mojo.Log.info("Streaming: '%s' with '%s' (%s)", uri, appid, mimeType); | ||
| 19 | 9 | - | |
| 20 | + Mojo.Log.error("Streaming: '%s' with '%s' (%s)", uri, appid, mimeType); | ||
| 21 | + if(appid === 'com.palm.app.email') | ||
| 22 | +{ | ||
| 23 | + //an email was clicked, so we bypass the download dialog and open the email app. | ||
| 24 | + var params = {target: uri, mimeType: mimeType}; | ||
| 25 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 26 | + method: 'open', | ||
| 27 | + parameters: { | ||
| 28 | + 'id': appid, | ||
| 29 | + 'params': params | ||
| 30 | + }} | ||
| 31 | + ); | ||
| 32 | + return; | ||
| 33 | +} | ||
| 34 | + if(appid === 'com.palm.app.docviwer') | ||
| 35 | +{ | ||
| 36 | + //a doc was clicked, so we bypass the download dialog and open the docviewer app. | ||
| 37 | + var params = {target: uri, mimeType: mimeType}; | ||
| 38 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 39 | + method: 'open', | ||
| 40 | + parameters: { | ||
| 41 | + 'id': appid, | ||
| 42 | + 'params': params | ||
| 43 | + }} | ||
| 44 | + ); | ||
| 45 | + return; | ||
| 46 | +} | ||
| 47 | + if(appid === 'com.palm.app.pdfviewer') | ||
| 48 | +{ | ||
| 49 | + //a pdf was clicked, so we bypass the download dialog and open the pdfviewer app. | ||
| 50 | + var params = {target: uri, mimeType: mimeType}; | ||
| 51 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 52 | + method: 'open', | ||
| 53 | + parameters: { | ||
| 54 | + 'id': appid, | ||
| 55 | + 'params': params | ||
| 56 | + }} | ||
| 57 | + ); | ||
| 58 | + return; | ||
| 59 | +} | ||
| 60 | + if(appid === 'com.palm.app.maps') | ||
| 61 | +{ | ||
| 62 | + //a map was clicked, so we bypass the download dialog and open the maps app. | ||
| 63 | + var params = {target: uri, mimeType: mimeType}; | ||
| 64 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 65 | + method: 'open', | ||
| 66 | + parameters: { | ||
| 67 | + 'id': appid, | ||
| 68 | + 'params': params | ||
| 69 | + }} | ||
| 70 | + ); | ||
| 71 | + return; | ||
| 72 | +} | ||
| 73 | + if(appid === 'com.palm.app.youtube') | ||
| 74 | + { | ||
| 75 | + //a youtube video was clicked, so we bypass the download dialog and open the youtube app. | ||
| 76 | + var params = {target: uri, mimeType: mimeType}; | ||
| 77 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 78 | + method: 'open', | ||
| 79 | + parameters: { | ||
| 80 | + 'id': appid, | ||
| 81 | + 'params': params | ||
| 82 | + }} | ||
| 83 | + ); | ||
| 84 | + return; | ||
| 85 | +} | ||
| 86 | + if(appid === 'com.palm.app.phone') | ||
| 87 | +{ | ||
| 88 | + //a phone # was clicked, so we bypass the download dialog and open the phone app. | ||
| 89 | + var params = {target: uri, mimeType: mimeType}; | ||
| 90 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 91 | + method: 'open', | ||
| 92 | + parameters: { | ||
| 93 | + 'id': appid, | ||
| 94 | + 'params': params | ||
| 95 | + }} | ||
| 96 | + ); | ||
| 97 | + return; | ||
| 98 | +} | ||
| 99 | + this._downloadWidgetElement = this.controller.showDialog({ | ||
| 100 | + uri: uri, | ||
| 101 | + mimeType: mimeType, | ||
| 102 | + appid: appid, | ||
| 103 | + template: 'download/download-stream-popup', | ||
| 104 | + assistant: new DownloadDialogAssistant({ | ||
| 105 | + sceneAssistant: this, | ||
| 106 | + onDismiss: function(cParams) { // DOWNLOAD | ||
| 107 | + //this._onPopupHandler('close'); | ||
| 108 | + this._downloadController.downloadResource(uri); | ||
| 109 | + }.bind(this), | ||
| 110 | + onAccept: function(cParams) { // STREAM | ||
| 111 | + var params = {target: uri, mimeType: mimeType, appid: appid}; | ||
| 112 | // Only a few select applications can be | ||
| 10 | - // Only a few select applications can be | ||
| 113 | 11 | - crossAppScene = { | |
| 114 | + var crossAppScene = { | ||
| 115 | 'com.palm.app.videoplayer': 'nowplaying', | ||
| 116 | 'com.palm.app.streamingmusicplayer': 'nowplaying' | ||
| 117 | }; | ||
| 12 | - 'com.palm.app.videoplayer': 'nowplaying', | ||
| 13 | - 'com.palm.app.streamingmusicplayer': 'nowplaying' | ||
| 14 | - }; | ||
| 118 | 15 | - var params = {target: uri, mimeType: mimeType}; | |
| 119 | + //this._onPopupHandler('close'); | ||
| 120 | if (crossAppScene[appid]) { | ||
| 16 | - if (crossAppScene[appid]) { | ||
| 121 | 17 | - | |
| 122 | var args = { appId: appid, name: crossAppScene[appid] }; | ||
| 123 | this.controller.stageController.pushScene(args, params); | ||
| 124 | } | ||
| 125 | else { | ||
| 18 | - var args = { appId: appid, name: crossAppScene[appid] }; | ||
| 19 | - this.controller.stageController.pushScene(args, params); | ||
| 20 | - } | ||
| 21 | - else { | ||
| 126 | 22 | - this.controller.serviceRequest('palm://com.palm.applicationManager', { | |
| 127 | 23 | - method: 'open', | |
| 128 | 24 | - parameters: { | |
| 129 | 25 | - 'id': appid, | |
| 130 | 26 | - 'params': params | |
| 131 | + this._downloadController.downloadResource(uri); | ||
| 27 | + if(appid === 'com.palm.app.email') | ||
| 28 | + { | ||
| 29 | + //an email was clicked, so we bypass the download dialog and open the email app. | ||
| 30 | + var params = {target: uri, mimeType: mimeType}; | ||
| 31 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 32 | + method: 'open', | ||
| 33 | + parameters: { | ||
| 34 | + 'id': appid, | ||
| 35 | + 'params': params | ||
| 36 | + }} | ||
| 37 | + ); | ||
| 38 | + return; | ||
| 39 | + } | ||
| 40 | + if(appid === 'com.palm.app.docviwer') | ||
| 41 | + { | ||
| 42 | + //a doc was clicked, so we bypass the download dialog and open the docviewer app. | ||
| 43 | + var params = {target: uri, mimeType: mimeType}; | ||
| 44 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 45 | + method: 'open', | ||
| 46 | + parameters: { | ||
| 47 | + 'id': appid, | ||
| 48 | + 'params': params | ||
| 49 | + }} | ||
| 50 | + ); | ||
| 51 | + return; | ||
| 52 | + } | ||
| 53 | + if(appid === 'com.palm.app.pdfviewer') | ||
| 54 | + { | ||
| 55 | + //a pdf was clicked, so we bypass the download dialog and open the pdfviewer app. | ||
| 56 | + var params = {target: uri, mimeType: mimeType}; | ||
| 57 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 58 | + method: 'open', | ||
| 59 | + parameters: { | ||
| 60 | + 'id': appid, | ||
| 61 | + 'params': params | ||
| 62 | + }} | ||
| 63 | + ); | ||
| 64 | + return; | ||
| 65 | + } | ||
| 66 | + if(appid === 'com.palm.app.maps') | ||
| 67 | + { | ||
| 68 | + //a map was clicked, so we bypass the download dialog and open the maps app. | ||
| 69 | + var params = {target: uri, mimeType: mimeType}; | ||
| 70 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 71 | + method: 'open', | ||
| 72 | + parameters: { | ||
| 73 | + 'id': appid, | ||
| 74 | + 'params': params | ||
| 75 | + }} | ||
| 76 | + ); | ||
| 77 | + return; | ||
| 78 | + } | ||
| 79 | + if(appid === 'com.palm.app.youtube') | ||
| 80 | + { | ||
| 81 | + //a youtube video was clicked, so we bypass the download dialog and open the youtube app. | ||
| 82 | + var params = {target: uri, mimeType: mimeType}; | ||
| 83 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 84 | + method: 'open', | ||
| 85 | + parameters: { | ||
| 86 | + 'id': appid, | ||
| 87 | + 'params': params | ||
| 88 | + }} | ||
| 89 | + ); | ||
| 90 | + return; | ||
| 91 | + } | ||
| 92 | + if(appid === 'com.palm.app.phone') | ||
| 93 | + { | ||
| 94 | + //a phone # was clicked, so we bypass the download dialog and open the phone app. | ||
| 95 | + var params = {target: uri, mimeType: mimeType}; | ||
| 96 | + this.controller.serviceRequest('palm://com.palm.applicationManager',{ | ||
| 97 | + method: 'open', | ||
| 98 | + parameters: { | ||
| 99 | + 'id': appid, | ||
| 100 | + 'params': params | ||
| 101 | + }} | ||
| 102 | + ); | ||
| 103 | + return; | ||
| 104 | + } | ||
| 105 | + this._downloadWidgetElement = this.controller.showDialog({ | ||
| 106 | + uri: uri, | ||
| 107 | + mimeType: mimeType, | ||
| 108 | + appid: appid, | ||
| 109 | + template: 'download/download-stream-popup', | ||
| 110 | + assistant: new DownloadDialogAssistant({ | ||
| 111 | + sceneAssistant: this, | ||
| 112 | + onDismiss: function(cParams) { // DOWNLOAD | ||
| 113 | + this._downloadResource(uri); | ||
| 114 | + }.bind(this), | ||
| 115 | + onAccept: function(cParams) { // STREAM | ||
| 116 | + // Only a few select applications can be | ||
| 117 | + crossAppScene = { | ||
| 118 | + 'com.palm.app.videoplayer': 'nowplaying', | ||
| 119 | + 'com.palm.app.streamingmusicplayer': 'nowplaying' | ||
| 120 | + }; | ||
| 121 | + var params = {target: uri, mimeType: mimeType}; | ||
| 122 | + if (crossAppScene[appid]) { | ||
| 123 | + var args = { appId: appid, name: crossAppScene[appid] }; | ||
| 124 | + this.controller.stageController.pushScene(args, params); | ||
| 125 | + } else { | ||
| 126 | + this.controller.serviceRequest('palm://com.palm.applicationManager', { | ||
| 127 | + method: 'open', | ||
| 128 | + parameters: { | ||
| 129 | + 'id': appid, | ||
| 130 | + 'params': params | ||
| 131 | + } | ||
| 132 | + }); | ||
| 132 | 133 | } | |
| 133 | + }.bind(this)}) | ||
| 134 | }); | ||
| 134 | - }); | ||
| 135 | 135 | - } | |
| 136 | + // Record we have a popup | ||
| 137 | + //this._onPopupHandler('open'); | ||
| 136 | + }.bind(this)}) | ||
| 137 | + }); | ||
| 138 | 138 | + | |
| 139 | 139 | }; | |
| 140 | 140 | ||
| 141 | 141 | /** | |
| 142 | @@ -2323,11 +2413,24 @@ PageAssistant.prototype._downloadResource = function(uri) { | ||
| 143 | try { | ||
| 144 | // We should no longer download a resource but inform the user | ||
| 145 | // we are unable to perform the download. | ||
| 146 | - this.controller.showAlertDialog({ | ||
| 147 | - onChoose: function(value) { /* Do Nothing */}, | ||
| 148 | - message: $L('Cannot find an application which can open this file.'), | ||
| 149 | - choices:[{label:$L('OK'), value:'1', type:'dismiss'}] | ||
| 150 | + if (!this._downloadWidgetElement) { | ||
| 151 | + this._downloadWidgetElement = this.controller.showDialog({ | ||
| 152 | + template: 'download/download-popup', | ||
| 153 | + assistant: new DownloadDialogAssistant({ | ||
| 154 | + sceneAssistant: this, | ||
| 155 | + onDismiss: function() { | ||
| 156 | + //this._onPopupHandler('close'); | ||
| 157 | + delete this._downloadWidgetElement; | ||
| 158 | + }.bind(this), | ||
| 159 | + onAccept: function() { | ||
| 160 | + //this._onPopupHandler('close'); | ||
| 161 | + this._downloadController.downloadResource(uri); | ||
| 162 | + }.bind(this)}) | ||
| 163 | }); | ||
| 164 | + | ||
| 165 | + // Record we have a popup | ||
| 166 | + //this._onPopupHandler('open'); | ||
| 167 | + } | ||
| 168 | } catch (e) { | ||
| 169 | Mojo.Log.logException(e, "#_downloadResource"); | ||
| 170 | } | ||
| 171 | @@ -3167,6 +3270,31 @@ PageAssistant.prototype._onKeyDownEvent = function(event) { | ||
| 142 | @@ -2237,7 +2326,32 @@ | ||
| 172 | 143 | // allowed to trigger the bar. | |
| 173 | 144 | if (this._addressBar.isAGotoAddressBarEvent(event.originalEvent)) { | |
| 174 | 145 | this._gotoUrlBar(); | |
| 175 | + } else { | ||
| 176 | + var key = event.originalEvent.keyCode; | ||
| 177 | + var scroller = this.controller.getSceneScroller(); | ||
| 178 | + var pageHeight = scroller.mojo.scrollerSize().height; | ||
| 179 | + if (pageHeight > 50) pageHeight = pageHeight - 50; | ||
| 180 | + if (key == 32) { | ||
| 181 | + // alternate method for scrolling, gives visual feedback, but slower | ||
| 182 | + //var currentTop = scroller.mojo.getScrollPosition().top; | ||
| 183 | + //currentTop += scroller.mojo.scrollerSize().height - 50; | ||
| 184 | + //scroller.mojo.scrollTo(undefined, currentTop, true); | ||
| 185 | + scroller.mojo.adjustBy(0, -1*pageHeight); | ||
| 186 | + this._addressBar.hide(); | ||
| 187 | + } else if (key == 0) { | ||
| 188 | + scroller.mojo.adjustBy(0, pageHeight); | ||
| 189 | + } else if (key == 190) { | ||
| 190 | + scroller.mojo.adjustBy(0, -25); | ||
| 191 | + this._addressBar.hide(); | ||
| 192 | + } else if (key == 8) { | ||
| 193 | + scroller.mojo.revealTop(0); | ||
| 194 | + } else if (key == 13) { | ||
| 195 | + scroller.mojo.revealBottom(0); | ||
| 196 | + this._addressBar.hide(); | ||
| 197 | + } else { | ||
| 198 | + Mojo.Log.error("Ignoring keyCode", key); | ||
| 199 | + } | ||
| 200 | } | ||
| 146 | - } | ||
| 147 | + } else { | ||
| 148 | + var key = event.originalEvent.keyCode; | ||
| 149 | + var scroller = this.controller.getSceneScroller(); | ||
| 150 | + var pageHeight = scroller.mojo.scrollerSize().height; | ||
| 151 | + if (pageHeight > 50) pageHeight = pageHeight - 50; | ||
| 152 | + if (key == 32) { | ||
| 153 | + // alternate method for scrolling, gives visual feedback, but slower | ||
| 154 | + //var currentTop = scroller.mojo.getScrollPosition().top; | ||
| 155 | + //currentTop += scroller.mojo.scrollerSize().height - 50; | ||
| 156 | + //scroller.mojo.scrollTo(undefined, currentTop, true); | ||
| 157 | + scroller.mojo.adjustBy(0, -1*pageHeight); | ||
| 158 | + this._addressBar.hide(); | ||
| 159 | + } else if (key == 0) { | ||
| 160 | + scroller.mojo.adjustBy(0, pageHeight); | ||
| 161 | + } else if (key == 190) { | ||
| 162 | + scroller.mojo.adjustBy(0, -25); | ||
| 163 | + this._addressBar.hide(); | ||
| 164 | + } else if (key == 8) { | ||
| 165 | + scroller.mojo.revealTop(0); | ||
| 166 | + } else if (key == 13) { | ||
| 167 | + scroller.mojo.revealBottom(0); | ||
| 168 | + this._addressBar.hide(); | ||
| 169 | + } else { | ||
| 170 | + Mojo.Log.error("Ignoring keyCode", key); | ||
| 171 | + } | ||
| 172 | + } | ||
| 201 | 173 | } | |
| 202 | 174 | }; | |
| 203 | @@ -4956,8 +5084,10 @@ UrlBar.prototype.isAGotoUrlBarKey = function(keycode) { | ||
| 204 | UrlBar.prototype.setOrientation = function(orientation) { | ||
| 205 | 175 | ||
| 176 | Index: /usr/palm/applications/com.palm.app.browser/app/controllers/urlbar.js | ||
| 177 | =================================================================== | ||
| 178 | --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/urlbar.js | ||
| 179 | +++ /usr/palm/applications/com.palm.app.browser/app/controllers/urlbar.js | ||
| 180 | @@ -47,6 +47,10 @@ | ||
| 206 | 181 | if (orientation !== 'up') { | |
| 207 | - // In landscape and down we ALWAYS hide the BAR so we make sure it's | ||
| 208 | - // already hidden by calling' 'hide'. | ||
| 182 | // In landscape and down we ALWAYS hide the BAR so we make sure it's | ||
| 183 | // already hidden by calling' 'hide'. | ||
| 209 | 184 | + this.show = this._showNoOp; | |
| 210 | 185 | + this.hide = this._hideNoOp; | |
| 211 | 186 | + } else { | |
| … | … | ||
| 188 | 188 | this._hidePortrait(); | |
| 189 | 189 | } | |
| 190 | 190 | ||
| 191 | @@ -4984,6 +5114,12 @@ UrlBar.prototype.setup = function(properties) { | ||
| 191 | @@ -73,6 +77,12 @@ | ||
| 192 | 192 | this._onPropertyChange = properties.onPropertyChange || function(){}; | |
| 193 | 193 | this._configOrientation(properties.orientation || 'up'); | |
| 194 | 194 | ||
| 195 | + if (properties.orientation === 'up') { | ||
| 196 | + owidth = 271; | ||
| 197 | + } else { | ||
| 198 | + owidth = 430; | ||
| 199 | + } | ||
| 200 | + | ||
| 195 | + if (properties.orientation === 'up') { | ||
| 196 | + this.owidth = 271; | ||
| 197 | + } else { | ||
| 198 | + this.owidth = 430; | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | 201 | this.models = { | |
| 202 | 202 | urlInput: { | |
| 203 | 203 | template: 'page/url-field', | |
| 204 | @@ -5001,7 +5137,7 @@ UrlBar.prototype.setup = function(properties) { | ||
| 204 | @@ -90,7 +100,7 @@ | ||
| 205 | 205 | url: '' | |
| 206 | 206 | }, | |
| 207 | 207 | ||
| 208 | 208 | - width: 271 | |
| 209 | + width: owidth | ||
| 209 | + width: this.owidth | ||
| 210 | 210 | }, | |
| 211 | 211 | ||
| 212 | 212 | // Beware: These are shallow copies. | |
| 213 | @@ -5327,12 +5463,25 @@ UrlBar.prototype._hidePortrait = function() { | ||
| 213 | @@ -416,12 +426,25 @@ | ||
| 214 | 214 | this.controller.setMenuVisible(Mojo.Menu.viewMenu, false); | |
| 215 | 215 | }; | |
| 216 | 216 | ||
| … | … | ||
| 218 | 218 | +UrlBar.prototype.hide = UrlBar.prototype._hideNoOp; | |
| 219 | 219 | + | |
| 220 | 220 | UrlBar.prototype._showNoOp = function() { | |
| 221 | - // DO NOTHING - We don't show anything in landscape. | ||
| 222 | + | ||
| 221 | // DO NOTHING - We don't show anything in landscape. | ||
| 223 | 222 | + var menuAssistant = this.controller._menu.assistant; | |
| 224 | 223 | + var spacerHeight = menuAssistant.viewSpacerHeight; | |
| 225 | + | ||
| 224 | + | ||
| 226 | 225 | + menuAssistant.viewSpacerHeight = 0; | |
| 227 | 226 | + this.controller.setMenuVisible(Mojo.Menu.viewMenu, true); | |
| 228 | 227 | }; | |
| 229 | 228 | ||
| 230 | 229 | UrlBar.prototype._hideNoOp = function() { | |
| 231 | - // DO NOTHING - We should not be displayed in landscape. | ||
| 232 | + | ||
| 230 | // DO NOTHING - We should not be displayed in landscape. | ||
| 233 | 231 | + var menuAssistant = this.controller._menu.assistant; | |
| 234 | 232 | + var spacerHeight = menuAssistant.viewSpacerHeight; | |
| 235 | + | ||
| 233 | + | ||
| 236 | 234 | + menuAssistant.viewSpacerHeight = 0; | |
| 237 | 235 | + this.controller.setMenuVisible(Mojo.Menu.viewMenu, false); | |
| 238 | 236 | }; | |
| 239 | 237 | ||
| 240 | 238 | UrlBar.prototype.isVisible = function() { | |
| 241 | @@ -5738,12 +5887,43 @@ Chrome.prototype._hidePortrait = function() { | ||
| 239 | Index: /usr/palm/applications/com.palm.app.browser/app/controllers/chrome.js | ||
| 240 | =================================================================== | ||
| 241 | --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/chrome.js | ||
| 242 | +++ /usr/palm/applications/com.palm.app.browser/app/controllers/chrome.js | ||
| 243 | @@ -102,12 +102,39 @@ | ||
| 242 | 244 | } | |
| 243 | 245 | }; | |
| 244 | 246 | ||
| … | … | ||
| 249 | 249 | + | |
| 250 | 250 | Chrome.prototype._showNoOp = function() { | |
| 251 | 251 | - // DO NOTHING - We don't show anything in landscape. | |
| 252 | + | ||
| 252 | + // DO NOTHING - We don't show anything in landscape. | ||
| 253 | 253 | + var animator; | |
| 254 | 254 | + var element = this.controller.get(this._elementName); | |
| 255 | 255 | + | |
| … | … | ||
| 261 | 261 | + duration: 0.15, | |
| 262 | 262 | + reverse: false | |
| 263 | 263 | + }); | |
| 264 | + | ||
| 265 | 264 | + this._currentHeight = this._maxHeight; | |
| 266 | 265 | + } | |
| 267 | 266 | }; | |
| 268 | 267 | ||
| 269 | 268 | Chrome.prototype._hideNoOp = function() { | |
| 270 | - // DO NOTHING - We should not be displayed in landscape. | ||
| 271 | + | ||
| 269 | // DO NOTHING - We should not be displayed in landscape. | ||
| 272 | 270 | + var animator; | |
| 273 | 271 | + var element = this.controller.get(this._elementName); | |
| 274 | + | ||
| 275 | 272 | + if (element && (this._currentHeight > 0)) { | |
| 276 | 273 | + animator = Mojo.Animation.animateStyle(element, 'height', 'linear', { | |
| 277 | 274 | + from: 0, | |
| … | … | ||
| 276 | 276 | + duration: 0.15, | |
| 277 | 277 | + reverse: true | |
| 278 | 278 | + }); | |
| 279 | + | ||
| 280 | + | ||
| 281 | 279 | + this._currentHeight = 0; | |
| 282 | 280 | + } | |
| 283 | 281 | }; | |
| 284 | 282 | ||
| 285 | 283 | Chrome.prototype.isVisible = function() { | |
| 286 | diff --git a/usr/palm/applications/com.palm.app.browser/app/views/download/download-container.html b/usr/palm/applications/com.palm.app.browser/app/views/download/download-container.html | ||
| 287 | index b5f171f..a838cda 100644 | ||
| 288 | --- a/usr/palm/applications/com.palm.app.browser/app/views/download/download-container.html | ||
| 289 | +++ b/usr/palm/applications/com.palm.app.browser/app/views/download/download-container.html | ||
| 290 | @@ -1,3 +1,3 @@ | ||
| 291 | <div x-mojo-elements="List" class="palm-list no-lines"> | ||
| 292 | - #{listElements} | ||
| 293 | + #{-listElements} | ||
| 294 | </div> | ||
| 295 | \ No newline at end of file | ||
| 296 | diff --git a/usr/palm/applications/com.palm.app.browser/app/views/page/page-scene.html b/usr/palm/applications/com.palm.app.browser/app/views/page/page-scene.html | ||
| 297 | index a8fc62d..68bad1b 100644 | ||
| 298 | --- a/usr/palm/applications/com.palm.app.browser/app/views/page/page-scene.html | ||
| 299 | +++ b/usr/palm/applications/com.palm.app.browser/app/views/page/page-scene.html | ||
| 300 | @@ -16,5 +16,9 @@ | ||
| 301 | <div id="server-disconnected" class="palm-scrim"> | ||
| 302 | <div id="server-disconnected-spinner" x-mojo-element="Spinner"></div> | ||
| 303 | </div> | ||
| 304 | +<div id="downloadListScroller" class="browser-download" x-mojo-element="Scroller"> | ||
| 305 | + <div id="downloadList" class="palm-list" x-mojo-element="List"></div> | ||
| 284 | Index: /usr/palm/applications/com.palm.app.browser/app/controllers/downloaddialog-assistant.js | ||
| 285 | =================================================================== | ||
| 286 | --- /dev/null | ||
| 287 | +++ /usr/palm/applications/com.palm.app.browser/app/controllers/downloaddialog-assistant.js | ||
| 288 | @@ -0,0 +1,46 @@ | ||
| 289 | +/** | ||
| 290 | + * A dialog assistant for display of yes/no box. | ||
| 291 | + */ | ||
| 292 | +DownloadDialogAssistant = Class.create({ | ||
| 293 | + | ||
| 294 | + initialize: function(params) { | ||
| 295 | + this.onDismiss = params.onDismiss; | ||
| 296 | + this.onAccept = params.onAccept; | ||
| 297 | + this.controller= params.sceneAssistant.controller; | ||
| 298 | + | ||
| 299 | + // Button handlers. | ||
| 300 | + this.onDismissHandler = this.handleDismiss.bindAsEventListener(this); | ||
| 301 | + this.onAcceptHandler = this.handleAccept.bindAsEventListener(this); | ||
| 302 | + }, | ||
| 303 | + | ||
| 304 | + setup: function(widget) { | ||
| 305 | + this.widget = widget; | ||
| 306 | + this.controller.get('acceptButton').addEventListener(Mojo.Event.tap, this.onAcceptHandler); | ||
| 307 | + this.controller.get('acceptButton').focus(); | ||
| 308 | + this.controller.get('dismissButton').addEventListener(Mojo.Event.tap, this.onDismissHandler); | ||
| 309 | + this.controller.get('dismissButton').focus(); | ||
| 310 | + }, | ||
| 311 | + | ||
| 312 | + handleDismiss: function() { | ||
| 313 | + this.onDismiss(); | ||
| 314 | + delete this.onDismiss; | ||
| 315 | + this.widget.mojo.close(); | ||
| 316 | + }, | ||
| 317 | + handleAccept: function() { | ||
| 318 | + this.onAccept(); | ||
| 319 | + delete this.onAccept; | ||
| 320 | + delete this.onDismiss; | ||
| 321 | + this.widget.mojo.close(); | ||
| 322 | + }, | ||
| 323 | + | ||
| 324 | + cleanup: function() { | ||
| 325 | + Mojo.Log.info("NetworkDialogAssistant#cleanup()"); | ||
| 326 | + Mojo.Event.stopListening(this.controller.get('dismissButton'), Mojo.Event.tap, this.onDismissHandler); | ||
| 327 | + Mojo.Event.stopListening(this.controller.get('acceptButton'), Mojo.Event.tap, this.onAcceptHandler); | ||
| 328 | + | ||
| 329 | + // Send a dismiss if NOT already sent a response | ||
| 330 | + if (this.onDismiss) { | ||
| 331 | + this.onDismiss(); | ||
| 332 | + } | ||
| 333 | + } | ||
| 334 | +}); | ||
| 335 | Index: /usr/palm/applications/com.palm.app.browser/app/views/download/download-stream-popup.html | ||
| 336 | =================================================================== | ||
| 337 | --- /dev/null | ||
| 338 | +++ /usr/palm/applications/com.palm.app.browser/app/views/download/download-stream-popup.html | ||
| 339 | @@ -0,0 +1,8 @@ | ||
| 340 | +<div id="palm-dialog-content" class="palm-dialog-content"> | ||
| 341 | + <div class="dialog-message" x-mojo-loc="">This file type has been registered as a streaming media file. Would you like to download it to /media/internal/downloads instead?</div> | ||
| 306 | 342 | +</div> | |
| 307 | 343 | + | |
| 308 | |||
| 309 | |||
| 310 | diff --git a/usr/palm/applications/com.palm.app.browser/sources.json b/usr/palm/applications/com.palm.app.browser/sources.json | ||
| 311 | index bc485bf..74fb77a 100644 | ||
| 312 | --- a/usr/palm/applications/com.palm.app.browser/sources.json | ||
| 313 | +++ b/usr/palm/applications/com.palm.app.browser/sources.json | ||
| 314 | @@ -1,5 +1,17 @@ | ||
| 315 | [ | ||
| 316 | { | ||
| 317 | + "source":"app\/models\/download-model.js" | ||
| 318 | + }, | ||
| 319 | + { | ||
| 320 | + "source":"app\/controllers\/download-request.js" | ||
| 321 | + }, | ||
| 322 | + { | ||
| 323 | + "source":"app\/controllers\/download-controller.js" | ||
| 324 | + }, | ||
| 325 | + { | ||
| 326 | + "source":"app\/controllers\/downloaddialog-assistant.js" | ||
| 327 | + }, | ||
| 328 | + { | ||
| 329 | "source": "app\/controllers\/global_code.js" | ||
| 330 | } | ||
| 331 | ] | ||
| 332 | diff --git a/usr/palm/applications/com.palm.app.browser/stylesheets/browser.css b/usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 333 | index 4be566b..5a0f544 100644 | ||
| 334 | --- a/usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 335 | +++ b/usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 336 | @@ -753,7 +753,7 @@ div#historyScroller { | ||
| 344 | +<div class="palm-dialog-buttons"> | ||
| 345 | + <div class="dismiss palm-button" id="acceptButton" x-mojo-loc="" x-mojo-tap-highlight="momentary">Stream</div> | ||
| 346 | + <div class="dismiss palm-button" id="dismissButton" x-mojo-loc="" x-mojo-tap-highlight="momentary">Download</div> | ||
| 347 | +</div> | ||
| 348 | Index: /usr/palm/applications/com.palm.app.browser/sources.json | ||
| 349 | =================================================================== | ||
| 350 | --- .orig/usr/palm/applications/com.palm.app.browser/sources.json | ||
| 351 | +++ /usr/palm/applications/com.palm.app.browser/sources.json | ||
| 352 | @@ -47,6 +47,9 @@ | ||
| 353 | { | ||
| 354 | "source": "app\/controllers\/download-controller.js", | ||
| 355 | }, | ||
| 356 | + { | ||
| 357 | + "source":"app\/controllers\/downloaddialog-assistant.js" | ||
| 358 | + }, | ||
| 359 | { | ||
| 360 | "source": "app\/controllers\/preferences-assistant.js", | ||
| 361 | }, | ||
| 362 | Index: /usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 363 | =================================================================== | ||
| 364 | --- .orig/usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 365 | +++ /usr/palm/applications/com.palm.app.browser/stylesheets/browser.css | ||
| 366 | @@ -753,7 +753,7 @@ | ||
| 337 | 367 | } | |
| 338 | 368 | ||
| 339 | 369 | .search-results-container .palm-list { | |
| 340 | 370 | - width: 304px; | |
| 341 | + width=100%; | ||
| 371 | + width: 95%; | ||
| 342 | 372 | } | |
| 343 | 373 | ||
| 344 | 374 | .search-results-container .search.first { |
luna/battery-percent-and-icon.patch
(44 / 99)
|   | |||
| 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 | 1 | Index: /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | |
| 9 | 2 | =================================================================== | |
| 10 | 3 | --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | |
| 11 | 4 | +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js | |
| 12 | @@ -132,6 +132,39 @@ getMSMWarningPref: function() { | ||
| 13 | }); | ||
| 5 | @@ -1430,10 +1430,49 @@ | ||
| 6 | } | ||
| 14 | 7 | }, | |
| 15 | 8 | ||
| 16 | 9 | +/* Format battery level percent | |
| … | … | ||
| 11 | 11 | + * sometimes this.batteryLevel is used, and sometimes | |
| 12 | 12 | + * payload.percent_ui is | |
| 13 | 13 | + */ | |
| 14 | +getBatteryLevelPercent: function(percent, color, image) { | ||
| 15 | + | ||
| 16 | + // Special thanks to gordian for the color codes, and maouton for the ranges | ||
| 14 | +getBatteryLevelPercent: function(percent, color, image, charging) { | ||
| 17 | 15 | + if (color) { | |
| 18 | + // Green for 100%, yellow for 20%, red for 10%, norm for rest | ||
| 19 | + if (percent >= 70) | ||
| 16 | + if (charging == 1) | ||
| 17 | + bColor = '#33CCFF'; | ||
| 18 | + else if (percent >= 70) | ||
| 20 | 19 | + bColor = '#33FF33'; | |
| 21 | 20 | + else if(percent <= 69 && percent >= 45) | |
| 22 | 21 | + bColor = '#FFFF33'; | |
| … | … | ||
| 38 | 38 | + return fPercent; | |
| 39 | 39 | +}, | |
| 40 | 40 | + | |
| 41 | getMSMWarningPrefDone: function(payload) { | ||
| 42 | |||
| 43 | if(payload && payload.showMSMWarning != undefined) { | ||
| 44 | @@ -1436,6 +1469,22 @@ closePbapAlert: function() { | ||
| 41 | + | ||
| 42 | /* | ||
| 43 | * Handle power and charging notifications | ||
| 44 | */ | ||
| 45 | 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 | ||
| 46 | 52 | ||
| 47 | 53 | Mojo.Log.info("SystemUI Power Payload "+ Object.toJSON(payload)); | |
| 48 | + | ||
| 49 | + // Replace this with a user definable setting | ||
| 50 | + var batteryLevelImage = 2; // 0 displays image (factory default) | ||
| 51 | + // 1 displays numerical percentage | ||
| 52 | + // 2 displays the image on left and numerical percentage on right (default) | ||
| 53 | + | ||
| 54 | + var batteryLevelColor = 1; // Set to 0 for white, 1 for color | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + // Format the percent and number | ||
| 58 | + var batteryLevelPercent = this.batteryLevel + escape('%'); | ||
| 59 | + | ||
| 60 | + // Set the background to blank if we are not using the image | ||
| 61 | + if (!batteryLevelImage) | ||
| 62 | + $('power').className = 'battery-blank'; | ||
| 63 | + | ||
| 64 | 54 | if(!this.powerdServiceUp) { | |
| 65 | Mojo.Log.error("SystemUI PowerD down -- ignoring the notification"); | ||
| 66 | return; | ||
| 67 | @@ -1453,10 +1502,23 @@ handlePowerNotifications: function(paylo | ||
| 55 | @@ -1453,7 +1492,15 @@ | ||
| 68 | 56 | // Show the battery level if not charging | |
| 69 | 57 | if (!this.isCharging) { | |
| 70 | 58 | Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging + " Battery level "+ i); | |
| 71 | 59 | - $('power').className = 'battery-' + i; | |
| 72 | + //$('power').className = 'battery-' + i; | ||
| 73 | + | ||
| 74 | 60 | + if (batteryLevelImage == 0) { | |
| 75 | 61 | + $('power').className = 'battery-' + i; | |
| 76 | + } | ||
| 77 | + else if(batteryLevelImage == 1) { | ||
| 62 | + } else if(batteryLevelImage == 1) { | ||
| 78 | 63 | + $('power').className = 'battery-percent'; | |
| 79 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true); | ||
| 80 | + } | ||
| 81 | + else if(batteryLevelImage == 2) { | ||
| 64 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0); | ||
| 65 | + } else if(batteryLevelImage == 2) { | ||
| 82 | 66 | + $('power').className = 'battery-percentimage'; | |
| 83 | 67 | + $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | |
| 84 | + } | ||
| 68 | + } | ||
| 85 | 69 | ||
| 86 | 70 | //Show Banner Message if the Battery level is below 20% | |
| 87 | - var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 88 | + // var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 89 | + var batteryalert = $L("#{percent}% battery remaining").interpolate(payload); | ||
| 90 | if(this.batteryLevel <= 5 && !this.batteryLevel5Shown) { | ||
| 91 | this.batteryLevel5Shown = true; | ||
| 92 | this.showLowBatteryAlert(); | ||
| 93 | @@ -1482,11 +1544,32 @@ handlePowerNotifications: function(paylo | ||
| 71 | var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 72 | @@ -1482,10 +1529,23 @@ | ||
| 94 | 73 | } | |
| 95 | 74 | else { | |
| 96 | 75 | Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging ); | |
| … | … | ||
| 77 | 77 | - $('power').className = 'battery-charged'; | |
| 78 | 78 | - else | |
| 79 | 79 | - $('power').className = 'battery-charging-' + i; | |
| 80 | - | ||
| 81 | 80 | + if (batteryLevelImage == 0) { | |
| 82 | 81 | + if (payload.percent_ui == 100) | |
| 83 | 82 | + $('power').className = 'battery-charged'; | |
| 84 | 83 | + else | |
| 85 | 84 | + $('power').className = 'battery-charging-' + i; | |
| 86 | + } | ||
| 87 | + else if (batteryLevelImage == 1) { | ||
| 85 | + } else if (batteryLevelImage == 1) { | ||
| 88 | 86 | + $('power').className = 'battery-percent'; | |
| 89 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true); | ||
| 90 | + } | ||
| 91 | + else if(batteryLevelImage == 2) { | ||
| 87 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 88 | + } else if(batteryLevelImage == 2) { | ||
| 92 | 89 | + if (payload.percent_ui == 100) { | |
| 93 | 90 | + $('power').className = 'battery-percentimage-charged'; | |
| 94 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 95 | + } | ||
| 96 | + else { | ||
| 91 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 92 | + } else { | ||
| 97 | 93 | + $('power').className = 'battery-percentimage'; | |
| 98 | + $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 99 | + } | ||
| 94 | + $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 95 | + } | ||
| 100 | 96 | + } | |
| 101 | + else { | ||
| 102 | + if(!batteryLevelImage) | ||
| 103 | + $('power').innerHTML = batteryLevelPercent; | ||
| 104 | + else | ||
| 105 | + $('power').className = 'battery-charging-' + i; | ||
| 106 | + } | ||
| 97 | |||
| 107 | 98 | } | |
| 108 | 99 | ||
| 109 | if(this.batteryLevel > 5 && this.batteryLevel <= 10) { | ||
| 110 | @@ -1522,10 +1605,34 @@ handlePowerNotifications: function(paylo | ||
| 100 | @@ -1522,10 +1582,23 @@ | ||
| 111 | 101 | ||
| 112 | 102 | if (this.isCharging) { | |
| 113 | 103 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | |
| … | … | ||
| 105 | 105 | - $('power').className = 'battery-charged'; | |
| 106 | 106 | - else | |
| 107 | 107 | - $('power').className = 'battery-charging-' + this.lastBatteryLevel; | |
| 108 | + | ||
| 109 | 108 | + if (batteryLevelImage == 0) { | |
| 110 | 109 | + if (this.batteryLevel == 100) | |
| 111 | 110 | + $('power').className = 'battery-charged'; | |
| 112 | 111 | + else | |
| 113 | 112 | + $('power').className = 'battery-charging-' + this.lastBatteryLevel; | |
| 114 | + } | ||
| 115 | + if (batteryLevelImage == 1) { | ||
| 113 | + } else if(batteryLevelImage == 1) { | ||
| 116 | 114 | + $('power').className = 'battery-percent'; | |
| 117 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true); | ||
| 118 | + } | ||
| 119 | + else if(batteryLevelImage == 2) { | ||
| 115 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 116 | + } else if(batteryLevelImage == 2) { | ||
| 120 | 117 | + if (this.batteryLevel == 100) { | |
| 121 | 118 | + $('power').className = 'battery-percentimage-charged'; | |
| 122 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 123 | + } | ||
| 124 | + else { | ||
| 119 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 120 | + } else { | ||
| 125 | 121 | + $('power').className = 'battery-percentimage'; | |
| 126 | + $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 122 | + $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 127 | 123 | + } | |
| 128 | + } | ||
| 129 | + | ||
| 130 | + else { | ||
| 131 | + if(!batteryLevelImage) | ||
| 132 | + $('power').innerHTML = batteryLevelPercent; | ||
| 133 | + else | ||
| 134 | + $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 135 | 124 | + } | |
| 136 | 125 | ||
| 137 | 126 | var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert"); | |
| 138 | 127 | if (stageController) { | |
| 139 | @@ -1546,7 +1653,17 @@ handlePowerNotifications: function(paylo | ||
| 128 | @@ -1546,7 +1619,17 @@ | ||
| 140 | 129 | else { | |
| 141 | 130 | this.chargingBannerShown = false; | |
| 142 | 131 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | |
| … | … | ||
| 140 | 140 | + else if(batteryLevelImage == 2) { | |
| 141 | 141 | + $('power').className = 'battery-percentimage'; | |
| 142 | 142 | + $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | |
| 143 | + } | ||
| 143 | + } | ||
| 144 | 144 | Mojo.Controller.getAppController().removeBanner('chargingAlert'); | |
| 145 | 145 | } | |
| 146 | 146 | } | |
| … | … | ||
| 148 | 148 | =================================================================== | |
| 149 | 149 | --- .orig/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | |
| 150 | 150 | +++ /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | |
| 151 | @@ -134,8 +134,26 @@ body.palm-default { | ||
| 152 | |||
| 153 | #power { | ||
| 151 | @@ -136,6 +136,22 @@ | ||
| 154 | 152 | margin-left: 2px; | |
| 155 | - width: 17px; | ||
| 156 | + width: 17px; | ||
| 153 | width: 17px; | ||
| 157 | 154 | } | |
| 158 | +#power.battery-blank { | ||
| 159 | + width: 27px; | ||
| 160 | + background-color: black; | ||
| 161 | +} | ||
| 155 | + | ||
| 162 | 156 | +/* Begin: Battery Percent / Image w/ Percent */ | |
| 163 | 157 | +#power.battery-percent { | |
| 164 | 158 | + width: 38px; | |
| … | … | ||
| 167 | 167 | + background-color: black; | |
| 168 | 168 | +} | |
| 169 | 169 | +/* End: Battery Percent / Image w/ Percent */ | |
| 170 | + | ||
| 170 | 171 | #power.error { | |
| 171 | 172 | background: url(../images/battery-error.png) center center no-repeat; | |
| 172 | 173 | } |
luna/battery-percent.patch
(173 / 0)
|   | |||
| 1 | Index: /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 | @@ -1430,10 +1430,49 @@ | ||
| 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 @@ | ||
| 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 | - $('power').className = 'battery-' + i; | ||
| 60 | + if (batteryLevelImage == 0) { | ||
| 61 | + $('power').className = 'battery-' + i; | ||
| 62 | + } else if(batteryLevelImage == 1) { | ||
| 63 | + $('power').className = 'battery-percent'; | ||
| 64 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 0); | ||
| 65 | + } else if(batteryLevelImage == 2) { | ||
| 66 | + $('power').className = 'battery-percentimage'; | ||
| 67 | + $('power').innerHTML = '<img src="images/battery-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor); | ||
| 68 | + } | ||
| 69 | |||
| 70 | //Show Banner Message if the Battery level is below 20% | ||
| 71 | var batteryalert = $L("#{percent_ui}% battery remaining").interpolate(payload); | ||
| 72 | @@ -1482,10 +1529,23 @@ | ||
| 73 | } | ||
| 74 | else { | ||
| 75 | Mojo.Log.info("SystemUI- Is Charging "+ this.isCharging ); | ||
| 76 | - if(payload.percent_ui == 100) | ||
| 77 | - $('power').className = 'battery-charged'; | ||
| 78 | - else | ||
| 79 | - $('power').className = 'battery-charging-' + i; | ||
| 80 | + if (batteryLevelImage == 0) { | ||
| 81 | + if (payload.percent_ui == 100) | ||
| 82 | + $('power').className = 'battery-charged'; | ||
| 83 | + else | ||
| 84 | + $('power').className = 'battery-charging-' + i; | ||
| 85 | + } else if (batteryLevelImage == 1) { | ||
| 86 | + $('power').className = 'battery-percent'; | ||
| 87 | + $('power').innerHTML = this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 88 | + } else if(batteryLevelImage == 2) { | ||
| 89 | + if (payload.percent_ui == 100) { | ||
| 90 | + $('power').className = 'battery-percentimage-charged'; | ||
| 91 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 92 | + } else { | ||
| 93 | + $('power').className = 'battery-percentimage'; | ||
| 94 | + $('power').innerHTML = '<img src="images/battery-charging-' + i + '.png" />' + this.getBatteryLevelPercent(payload.percent_ui, batteryLevelColor, true, 1); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | |||
| 98 | } | ||
| 99 | |||
| 100 | @@ -1522,10 +1582,23 @@ | ||
| 101 | |||
| 102 | if (this.isCharging) { | ||
| 103 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | ||
| 104 | - if(this.batteryLevel == 100) | ||
| 105 | - $('power').className = 'battery-charged'; | ||
| 106 | - else | ||
| 107 | - $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 108 | + if (batteryLevelImage == 0) { | ||
| 109 | + if (this.batteryLevel == 100) | ||
| 110 | + $('power').className = 'battery-charged'; | ||
| 111 | + else | ||
| 112 | + $('power').className = 'battery-charging-' + this.lastBatteryLevel; | ||
| 113 | + } else if(batteryLevelImage == 1) { | ||
| 114 | + $('power').className = 'battery-percent'; | ||
| 115 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 116 | + } else if(batteryLevelImage == 2) { | ||
| 117 | + if (this.batteryLevel == 100) { | ||
| 118 | + $('power').className = 'battery-percentimage-charged'; | ||
| 119 | + $('power').innerHTML = '<img src="images/battery-charged.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 120 | + } else { | ||
| 121 | + $('power').className = 'battery-percentimage'; | ||
| 122 | + $('power').innerHTML = '<img src="images/battery-charging-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true, 1); | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | |||
| 126 | var stageController = Mojo.Controller.getAppController().getStageProxy("LowBatteryAlert"); | ||
| 127 | if (stageController) { | ||
| 128 | @@ -1546,7 +1619,17 @@ | ||
| 129 | else { | ||
| 130 | this.chargingBannerShown = false; | ||
| 131 | Mojo.Log.info("SystemUI- Charger Notification "+ this.isCharging + " Last battery level "+ this.lastBatteryLevel); | ||
| 132 | - $('power').className = 'battery-' + this.lastBatteryLevel; | ||
| 133 | + if (batteryLevelImage == 0) { | ||
| 134 | + $('power').className = 'battery-' + this.lastBatteryLevel; | ||
| 135 | + } | ||
| 136 | + else if (batteryLevelImage == 1) { | ||
| 137 | + $('power').className = 'battery-percent'; | ||
| 138 | + $('power').innerHTML = this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor, true); | ||
| 139 | + } | ||
| 140 | + else if(batteryLevelImage == 2) { | ||
| 141 | + $('power').className = 'battery-percentimage'; | ||
| 142 | + $('power').innerHTML = '<img src="images/battery-' + this.lastBatteryLevel + '.png" />' + this.getBatteryLevelPercent(this.batteryLevel, batteryLevelColor); | ||
| 143 | + } | ||
| 144 | Mojo.Controller.getAppController().removeBanner('chargingAlert'); | ||
| 145 | } | ||
| 146 | } | ||
| 147 | Index: /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 148 | =================================================================== | ||
| 149 | --- .orig/usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 150 | +++ /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css | ||
| 151 | @@ -136,6 +136,22 @@ | ||
| 152 | margin-left: 2px; | ||
| 153 | width: 17px; | ||
| 154 | } | ||
| 155 | + | ||
| 156 | +/* Begin: Battery Percent / Image w/ Percent */ | ||
| 157 | +#power.battery-percent { | ||
| 158 | + width: 38px; | ||
| 159 | + background-color: black; | ||
| 160 | +} | ||
| 161 | +#power.battery-percentimage { | ||
| 162 | + width: 49px; | ||
| 163 | + background-color: black; | ||
| 164 | +} | ||
| 165 | +#power.battery-percentimage-charged { | ||
| 166 | + width: 49px; | ||
| 167 | + background-color: black; | ||
| 168 | +} | ||
| 169 | +/* End: Battery Percent / Image w/ Percent */ | ||
| 170 | + | ||
| 171 | #power.error { | ||
| 172 | background: url(../images/battery-error.png) center center no-repeat; | ||
| 173 | } |
|   | |||
| 1 | Index: /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | ||
| 2 | =================================================================== | ||
| 3 | --- .orig/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | ||
| 4 | +++ /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js | ||
| 5 | @@ -10,7 +10,7 @@ | ||
| 6 | */ | ||
| 7 | kQuickLaunchHeight: 67, | ||
| 8 | |||
| 9 | - kPageIndicatorSpacing: 6, /* spacing between each page indicator */ | ||
| 10 | + kPageIndicatorSpacing: 1, /* spacing between each page indicator */ | ||
| 11 | kPageMargin: 10, /* 10 pixel margin on each side of a page */ | ||
| 12 | kPageWidthNoMargin: NaN, | ||
| 13 | kPageWidth: NaN, | ||
| 14 | @@ -324,9 +324,9 @@ | ||
| 15 | var newAppDiv = $(newAppInfo.launchPointId); | ||
| 16 | Mojo.assert(newAppDiv !== undefined, "Application (%d) was inserted into the DOM but unable to be retrieved!", newAppInfo.launchPointId); | ||
| 17 | if (isNaN(this.kAppWidth) || isNaN(this.kAppHeight)) { | ||
| 18 | - this.kAppWidth = newAppDiv.getWidth(); | ||
| 19 | - this.kAppHeight = newAppDiv.getHeight(); | ||
| 20 | - this.kAppsPerRow = Math.round(this.kPageWidthNoMargin / this.kAppWidth); | ||
| 21 | + this.kAppWidth = 75; | ||
| 22 | + this.kAppHeight = 90; | ||
| 23 | + this.kAppsPerRow = 4; | ||
| 24 | } | ||
| 25 | |||
| 26 | Mojo.listen(newAppDiv, Mojo.Event.tap, this.onAppTapped.bindAsEventListener(this)); | ||
| 27 | @@ -439,7 +439,7 @@ | ||
| 28 | /* determines the position of an app element at appIndex within a page */ | ||
| 29 | calculateAppPosition: function(appIndex) { | ||
| 30 | return { | ||
| 31 | - left: (((appIndex % this.kAppsPerRow) * this.kAppWidth) + this.kPageMargin), | ||
| 32 | + left: (((appIndex % this.kAppsPerRow) * this.kAppWidth)), | ||
| 33 | top: (Math.floor(appIndex/this.kAppsPerRow) * this.kAppHeight) | ||
| 34 | }; | ||
| 35 | }, | ||
| 36 | Index: /usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | ||
| 37 | =================================================================== | ||
| 38 | --- .orig/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | ||
| 39 | +++ /usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css | ||
| 40 | @@ -121,8 +121,8 @@ | ||
| 41 | |||
| 42 | .launcher_page .name { | ||
| 43 | position:absolute; | ||
| 44 | - top: 68px; | ||
| 45 | - width:100px; | ||
| 46 | + top: 48px; | ||
| 47 | + width:80px; | ||
| 48 | height: 34px; | ||
| 49 | max-height: 34px; | ||
| 50 | clear:both; | ||
| 51 | @@ -130,7 +130,8 @@ | ||
| 52 | color:white; | ||
| 53 | text-align:center; | ||
| 54 | font-weight:bold; | ||
| 55 | - font-size: 14px; | ||
| 56 | + font-size: 11px; | ||
| 57 | + left: 10px; | ||
| 58 | overflow: hidden; | ||
| 59 | text-overflow: ellipsis; | ||
| 60 | z-index:5; | ||
| 61 | @@ -164,8 +165,8 @@ | ||
| 62 | } | ||
| 63 | |||
| 64 | .draggable { | ||
| 65 | - width:64px; | ||
| 66 | - height:64px; | ||
| 67 | + width:48px; | ||
| 68 | + height:48px; | ||
| 69 | margin: 0 auto; | ||
| 70 | -webkit-user-drag: any; | ||
| 71 | -webkit-user-select: none; | ||
| 72 | @@ -213,8 +214,8 @@ | ||
| 73 | |||
| 74 | #app-icon { | ||
| 75 | float:left; | ||
| 76 | - width:64px; | ||
| 77 | - height:64px; | ||
| 78 | + width:32px; | ||
| 79 | + height:32px; | ||
| 80 | background: center center no-repeat; | ||
| 81 | } | ||
| 82 |
messaging/msg-avatar.patch
(56 / 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 | @@ -1347,7 +1347,7 @@ | ||
| 6 | if (ChatFlags.isOutgoing(msg.flags)) { | ||
| 7 | tmpClass.push("my-chat"); | ||
| 8 | // Disabling MY avatar because we are not doing this for 1.0 2008-11-05 | ||
| 9 | - //msg.avatar = this.myAvatar || 'images/my-avatar.png'; | ||
| 10 | + msg.avatar = this.myAvatar || 'images/my-avatar.png'; | ||
| 11 | } else { | ||
| 12 | tmpClass.push("their-chat"); | ||
| 13 | msg.avatar = this.avatarHash[msg.fromAddress] || this.contactAvatar || "images/list-view-default-avatar.png"; | ||
| 14 | Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 15 | =================================================================== | ||
| 16 | --- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 17 | +++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css | ||
| 18 | @@ -137,16 +137,11 @@ | ||
| 19 | } | ||
| 20 | |||
| 21 | .chatRow img.avatar-location { | ||
| 22 | - margin-top: -18px; | ||
| 23 | + margin-top: -39px; | ||
| 24 | } | ||
| 25 | |||
| 26 | .chatRow img.avatar-overlay { | ||
| 27 | - margin-top: -21px; | ||
| 28 | -} | ||
| 29 | - | ||
| 30 | -.chatRow .avatar-container { | ||
| 31 | - vertical-align: middle; | ||
| 32 | - display: inline-block; | ||
| 33 | + margin-top: -42.5px; | ||
| 34 | } | ||
| 35 | |||
| 36 | .login-animation-available, | ||
| 37 | @@ -664,9 +659,7 @@ | ||
| 38 | padding: 1px 0; | ||
| 39 | font-size: 18px; | ||
| 40 | word-wrap: break-word !important; | ||
| 41 | -} | ||
| 42 | -.their-chat .chat-balloon-wrapper { | ||
| 43 | - padding-right: 8px; | ||
| 44 | + padding-right: 40px; | ||
| 45 | } | ||
| 46 | .their-chat .avatar { | ||
| 47 | width: 40px; | ||
| 48 | @@ -675,8 +668,6 @@ | ||
| 49 | |||
| 50 | /* Disabling MY avatar because we are not doing this for 1.0 2008-11-05*/ | ||
| 51 | .my-chat .avatar-location, | ||
| 52 | -.my-chat .avatar-overlay, | ||
| 53 | -.my-chat .avatar-container { | ||
| 54 | display: none; | ||
| 55 | width: 40px; | ||
| 56 | height: 40px; |
phone/call-duration.patch
(13 / 0)
|   | |||
| 1 | Index: /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js | ||
| 2 | =================================================================== | ||
| 3 | --- .orig/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js | ||
| 4 | +++ /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js | ||
| 5 | @@ -10,7 +10,7 @@ | ||
| 6 | this.stageController = Mojo.Controller.getAppController().getStageController("PhoneApp"); | ||
| 7 | this.telListener = this.appAssistant.telephonyEventListener; | ||
| 8 | // if it's true, then we hide call length | ||
| 9 | - this.hideduration = this.appAssistant.hideCallLogCallDuration; | ||
| 10 | + this.hideduration = false; | ||
| 11 | this.zeroOffset = new Date(0, 0, 0, 0, 0, 0, 0).getTime(); | ||
| 12 | |||
| 13 | if (contactId !== undefined && contactId !== "") |
screenlock/min-brightness.patch
(13 / 0)
|   | |||
| 1 | Index: /usr/palm/applications/com.palm.app.screenlock/app/controllers/securityconfig-assistant.js | ||
| 2 | =================================================================== | ||
| 3 | --- .orig/usr/palm/applications/com.palm.app.screenlock/app/controllers/securityconfig-assistant.js | ||
| 4 | +++ /usr/palm/applications/com.palm.app.screenlock/app/controllers/securityconfig-assistant.js | ||
| 5 | @@ -35,7 +35,7 @@ | ||
| 6 | sliderattributes: { | ||
| 7 | modelProperty: 'value', | ||
| 8 | maxValue: 100, | ||
| 9 | - minValue: 10, | ||
| 10 | + minValue: 0, | ||
| 11 | round: false, | ||
| 12 | updateInterval: 0.1 | ||
| 13 | }, |

