Commit 9013b899244bbbd98b965dbadbb96eee1e85f812
- Diff rendering mode:
- inline
- side by side
|   | |||
| 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..08d56ac 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 | @@ -1101,10 +1101,13 @@ HistoryAssistant.prototype.setup = function() { | ||
| 6 | this.controller.setupWidget('historyList', { | ||
| 7 | itemTemplate:'history/history-entry', | ||
| 8 | listTemplate:'history/history-container', | ||
| 9 | - itemsCallback:this._itemsCallback.bind(this) | ||
| 10 | + itemsCallback:this._itemsCallback.bind(this), | ||
| 11 | + swipeToDelete:true, | ||
| 12 | + autoconfirmDelete:true | ||
| 13 | }); | ||
| 14 | |||
| 15 | this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this); | ||
| 16 | + this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this); | ||
| 17 | this._historyListWidget = this.controller.get('historyList'); | ||
| 18 | |||
| 19 | var appMenuModel = { | ||
| 20 | @@ -1130,6 +1133,7 @@ HistoryAssistant.prototype.cleanup = function() { | ||
| 21 | HistoryAssistant.prototype.activate = function() { | ||
| 22 | |||
| 23 | this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 24 | + this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 25 | |||
| 26 | // On an activation for a re-render of the contents. | ||
| 27 | var len = this._historyListWidget.mojo.getLength(); | ||
| 28 | @@ -1139,6 +1143,7 @@ HistoryAssistant.prototype.activate = function() { | ||
| 29 | HistoryAssistant.prototype.deactivate = function() { | ||
| 30 | |||
| 31 | Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 32 | + Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | @@ -1218,6 +1223,10 @@ HistoryAssistant.prototype._onListSelection = function(event) { | ||
| 37 | }); | ||
| 38 | }; | ||
| 39 | |||
| 40 | +HistoryAssistant.prototype._onListDelete = function(event) { | ||
| 41 | + this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {}); | ||
| 42 | +}; | ||
| 43 | + | ||
| 44 | /** | ||
| 45 | * handle a menu command. | ||
| 46 | */ | ||
| 47 | @@ -7349,6 +7358,15 @@ function HistoryStore(options, onSuccess, onFailure) { | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | +HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) { | ||
| 52 | + this._executeSql(transaction, onSuccess, onFailure, | ||
| 53 | + "DELETE FROM 'history' WHERE url = ?", [url] ); | ||
| 54 | +}; | ||
| 55 | + | ||
| 56 | +HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) { | ||
| 57 | + this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure)); | ||
| 58 | +}; | ||
| 59 | + | ||
| 60 | /** @private */ | ||
| 61 | HistoryStore.prototype._addHistoryEntry = function(url, title, date, onSuccess, onFailure, transaction) { | ||
| 62 |
|   | |||
| 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..133bc7a 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 | @@ -1101,10 +1101,13 @@ HistoryAssistant.prototype.setup = function() { | ||
| 6 | this.controller.setupWidget('historyList', { | ||
| 7 | itemTemplate:'history/history-entry', | ||
| 8 | listTemplate:'history/history-container', | ||
| 9 | - itemsCallback:this._itemsCallback.bind(this) | ||
| 10 | + itemsCallback:this._itemsCallback.bind(this), | ||
| 11 | + swipeToDelete:true, | ||
| 12 | + autoconfirmDelete:false | ||
| 13 | }); | ||
| 14 | |||
| 15 | this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this); | ||
| 16 | + this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this); | ||
| 17 | this._historyListWidget = this.controller.get('historyList'); | ||
| 18 | |||
| 19 | var appMenuModel = { | ||
| 20 | @@ -1130,6 +1133,7 @@ HistoryAssistant.prototype.cleanup = function() { | ||
| 21 | HistoryAssistant.prototype.activate = function() { | ||
| 22 | |||
| 23 | this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 24 | + this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 25 | |||
| 26 | // On an activation for a re-render of the contents. | ||
| 27 | var len = this._historyListWidget.mojo.getLength(); | ||
| 28 | @@ -1139,6 +1143,7 @@ HistoryAssistant.prototype.activate = function() { | ||
| 29 | HistoryAssistant.prototype.deactivate = function() { | ||
| 30 | |||
| 31 | Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 32 | + Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | @@ -1218,6 +1223,10 @@ HistoryAssistant.prototype._onListSelection = function(event) { | ||
| 37 | }); | ||
| 38 | }; | ||
| 39 | |||
| 40 | +HistoryAssistant.prototype._onListDelete = function(event) { | ||
| 41 | + this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {}); | ||
| 42 | +}; | ||
| 43 | + | ||
| 44 | /** | ||
| 45 | * handle a menu command. | ||
| 46 | */ | ||
| 47 | @@ -7349,6 +7358,15 @@ function HistoryStore(options, onSuccess, onFailure) { | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | +HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) { | ||
| 52 | + this._executeSql(transaction, onSuccess, onFailure, | ||
| 53 | + "DELETE FROM 'history' WHERE url = ?", [url] ); | ||
| 54 | +}; | ||
| 55 | + | ||
| 56 | +HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) { | ||
| 57 | + this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure)); | ||
| 58 | +}; | ||
| 59 | + | ||
| 60 | /** @private */ | ||
| 61 | HistoryStore.prototype._addHistoryEntry = function(url, title, date, onSuccess, onFailure, transaction) { | ||
| 62 |
|   | |||
| 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..08d56ac 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 | @@ -1101,10 +1101,13 @@ HistoryAssistant.prototype.setup = function() { | ||
| 6 | this.controller.setupWidget('historyList', { | ||
| 7 | itemTemplate:'history/history-entry', | ||
| 8 | listTemplate:'history/history-container', | ||
| 9 | - itemsCallback:this._itemsCallback.bind(this) | ||
| 10 | + itemsCallback:this._itemsCallback.bind(this), | ||
| 11 | + swipeToDelete:true, | ||
| 12 | + autoconfirmDelete:true | ||
| 13 | }); | ||
| 14 | |||
| 15 | this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this); | ||
| 16 | + this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this); | ||
| 17 | this._historyListWidget = this.controller.get('historyList'); | ||
| 18 | |||
| 19 | var appMenuModel = { | ||
| 20 | @@ -1130,6 +1133,7 @@ HistoryAssistant.prototype.cleanup = function() { | ||
| 21 | HistoryAssistant.prototype.activate = function() { | ||
| 22 | |||
| 23 | this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 24 | + this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 25 | |||
| 26 | // On an activation for a re-render of the contents. | ||
| 27 | var len = this._historyListWidget.mojo.getLength(); | ||
| 28 | @@ -1139,6 +1143,7 @@ HistoryAssistant.prototype.activate = function() { | ||
| 29 | HistoryAssistant.prototype.deactivate = function() { | ||
| 30 | |||
| 31 | Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 32 | + Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | @@ -1218,6 +1223,10 @@ HistoryAssistant.prototype._onListSelection = function(event) { | ||
| 37 | }); | ||
| 38 | }; | ||
| 39 | |||
| 40 | +HistoryAssistant.prototype._onListDelete = function(event) { | ||
| 41 | + this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {}); | ||
| 42 | +}; | ||
| 43 | + | ||
| 44 | /** | ||
| 45 | * handle a menu command. | ||
| 46 | */ | ||
| 47 | @@ -7349,6 +7358,15 @@ function HistoryStore(options, onSuccess, onFailure) { | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | +HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) { | ||
| 52 | + this._executeSql(transaction, onSuccess, onFailure, | ||
| 53 | + "DELETE FROM 'history' WHERE url = ?", [url] ); | ||
| 54 | +}; | ||
| 55 | + | ||
| 56 | +HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) { | ||
| 57 | + this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure)); | ||
| 58 | +}; | ||
| 59 | + | ||
| 60 | /** @private */ | ||
| 61 | HistoryStore.prototype._addHistoryEntry = function(url, title, date, onSuccess, onFailure, transaction) { | ||
| 62 |
|   | |||
| 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..133bc7a 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 | @@ -1101,10 +1101,13 @@ HistoryAssistant.prototype.setup = function() { | ||
| 6 | this.controller.setupWidget('historyList', { | ||
| 7 | itemTemplate:'history/history-entry', | ||
| 8 | listTemplate:'history/history-container', | ||
| 9 | - itemsCallback:this._itemsCallback.bind(this) | ||
| 10 | + itemsCallback:this._itemsCallback.bind(this), | ||
| 11 | + swipeToDelete:true, | ||
| 12 | + autoconfirmDelete:false | ||
| 13 | }); | ||
| 14 | |||
| 15 | this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this); | ||
| 16 | + this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this); | ||
| 17 | this._historyListWidget = this.controller.get('historyList'); | ||
| 18 | |||
| 19 | var appMenuModel = { | ||
| 20 | @@ -1130,6 +1133,7 @@ HistoryAssistant.prototype.cleanup = function() { | ||
| 21 | HistoryAssistant.prototype.activate = function() { | ||
| 22 | |||
| 23 | this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 24 | + this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 25 | |||
| 26 | // On an activation for a re-render of the contents. | ||
| 27 | var len = this._historyListWidget.mojo.getLength(); | ||
| 28 | @@ -1139,6 +1143,7 @@ HistoryAssistant.prototype.activate = function() { | ||
| 29 | HistoryAssistant.prototype.deactivate = function() { | ||
| 30 | |||
| 31 | Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler); | ||
| 32 | + Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler); | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | @@ -1218,6 +1223,10 @@ HistoryAssistant.prototype._onListSelection = function(event) { | ||
| 37 | }); | ||
| 38 | }; | ||
| 39 | |||
| 40 | +HistoryAssistant.prototype._onListDelete = function(event) { | ||
| 41 | + this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {}); | ||
| 42 | +}; | ||
| 43 | + | ||
| 44 | /** | ||
| 45 | * handle a menu command. | ||
| 46 | */ | ||
| 47 | @@ -7349,6 +7358,15 @@ function HistoryStore(options, onSuccess, onFailure) { | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | +HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) { | ||
| 52 | + this._executeSql(transaction, onSuccess, onFailure, | ||
| 53 | + "DELETE FROM 'history' WHERE url = ?", [url] ); | ||
| 54 | +}; | ||
| 55 | + | ||
| 56 | +HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) { | ||
| 57 | + this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure)); | ||
| 58 | +}; | ||
| 59 | + | ||
| 60 | /** @private */ | ||
| 61 | HistoryStore.prototype._addHistoryEntry = function(url, title, date, onSuccess, onFailure, transaction) { | ||
| 62 |
|   | |||
| 1 | diff --git a/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js b/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 2 | index 2952de4..f11abf1 100644 | ||
| 3 | --- a/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 4 | +++ b/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 5 | @@ -79,6 +79,10 @@ CaptureAssistant = Class.create({ | ||
| 6 | this._handleFlashButton(); | ||
| 7 | }.bind(this)); | ||
| 8 | |||
| 9 | + this.controller.get('shutterSoundButtonState').observe(Mojo.Event.tap, function(){ | ||
| 10 | + this._handleShutterSoundButton(); | ||
| 11 | + }.bind(this)); | ||
| 12 | + | ||
| 13 | this.onKeyPressHandler = this.onKeyPress.bindAsEventListener(this); | ||
| 14 | Mojo.listen(this.controller.sceneElement, Mojo.Event.keydown, this.onKeyPressHandler); | ||
| 15 | Mojo.listen(this.controller.sceneElement, Mojo.Event.keyup, this.onKeyPressHandler); | ||
| 16 | @@ -140,6 +144,11 @@ CaptureAssistant = Class.create({ | ||
| 17 | this.setFlashState(prefFlashState); | ||
| 18 | } | ||
| 19 | |||
| 20 | + if (undefined === this.shutterSoundState){ | ||
| 21 | + var prefShutterSoundState = this.cameraControl.prefs[CameraControl.PREFS.SOUNDS]; | ||
| 22 | + this.setShutterSoundState(prefShutterSoundState); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | try { | ||
| 26 | var initialOrientation = PalmSystem.screenOrientation; | ||
| 27 | this.orientationChanged(initialOrientation); | ||
| 28 | @@ -629,6 +638,45 @@ CaptureAssistant = Class.create({ | ||
| 29 | }, | ||
| 30 | |||
| 31 | /** | ||
| 32 | + * Click handler for the shutter sound button. | ||
| 33 | + * | ||
| 34 | + * @param {Event} event The click event | ||
| 35 | + */ | ||
| 36 | + _handleShutterSoundButton: function(event){ | ||
| 37 | + if (this.shutterSoundState == 'enabled'){ | ||
| 38 | + this.shutterSoundState = 'disabled'; | ||
| 39 | + } | ||
| 40 | + else { | ||
| 41 | + this.shutterSoundState = 'enabled'; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + this.setShutterSoundState(this.shutterSoundState); | ||
| 45 | + }, | ||
| 46 | + | ||
| 47 | + setShutterSoundState: function(state){ | ||
| 48 | + if ((state != 'disabled') && (state != 'enabled')) { | ||
| 49 | + /* | ||
| 50 | + var elemC = this.controller.get('sagar_console'); | ||
| 51 | + if (elemC) { | ||
| 52 | + elemC.innerHTML = state; | ||
| 53 | + } | ||
| 54 | + */ | ||
| 55 | + llog("Requested shutter sound state is out of range ("+state+")"); | ||
| 56 | + return; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + this.shutterSoundState = state; | ||
| 60 | + CameraPrefs.updatePref(this.cameraControl.prefs, CameraControl.PREFS.SOUNDS, state); | ||
| 61 | + | ||
| 62 | + if (this.shutterSoundState == 'enabled') { | ||
| 63 | + this.controller.get('shutterSoundButtonState').className = "shutter-sound-button shutter-sound-on"; | ||
| 64 | + } | ||
| 65 | + else if (this.shutterSoundState == 'disabled') { | ||
| 66 | + this.controller.get('shutterSoundButtonState').className = "shutter-sound-button shutter-sound-off"; | ||
| 67 | + } | ||
| 68 | + }, | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | * Handler for click of photoroll button. | ||
| 72 | * | ||
| 73 | * The photoroll scene will be pushed on. | ||
| 74 | diff --git a/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html b/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 75 | index a586aba..e8243d2 100644 | ||
| 76 | --- a/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 77 | +++ b/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 78 | @@ -14,6 +14,8 @@ | ||
| 79 | <div id="captureSpinner" class="capture-spinner" x-mojo-element="Spinner"></div> | ||
| 80 | <div class="capture-button" id="captureButton"> | ||
| 81 | </div> | ||
| 82 | + <div class="shutter-sound-button shutter-sound-off" id="shutterSoundButtonState"> | ||
| 83 | + </div> | ||
| 84 | <div class="flash-button flash-off" id="flashButtonState"> | ||
| 85 | </div> | ||
| 86 | </div> | ||
| 87 | @@ -23,7 +25,7 @@ | ||
| 88 | |||
| 89 | </div> | ||
| 90 | </div> | ||
| 91 | - <!-- <div id="sagar_console" style="z-index: 100; position: fixed; top: 10px; left: 10px; width: 90px; height: 20px; background-color: #000000; color: #8080ff; font-family: sans-serif; font-size: 12px; display: none;" >Hello!</div> --> | ||
| 92 | + <!--<div id="sagar_console" style="z-index: 100; position: fixed; top: 10px; left: 10px; width: 90px; height: 20px; background-color: #000000; color: #8080ff; font-family: sans-serif; font-size: 12px; display: none;" >Hello!</div> --> | ||
| 93 | <div id="gpsMeter" style="z-index: 100; position: fixed; top: 10px; right: 10px; width: 90px; height: 20px; background-color: #a0a0a0; display: none" ></div> --> | ||
| 94 | |||
| 95 | <div id="palmScrim" class="palm-scrim" style="z-index: 1001; display: none;"> | ||
| 96 | diff --git a/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css b/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 97 | index 9480ffa..f0e242d 100644 | ||
| 98 | --- a/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 99 | +++ b/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 100 | @@ -119,6 +119,28 @@ body.palm-default { | ||
| 101 | z-index: 20; | ||
| 102 | } | ||
| 103 | |||
| 104 | +.shutter-sound-button, | ||
| 105 | +.shutter-sound-button.shutter-sound-off { | ||
| 106 | + width: 50px; | ||
| 107 | + height: 50px; | ||
| 108 | + background: url(../images/menu-shutter-sound.png) 0 0 no-repeat; | ||
| 109 | + position: absolute; | ||
| 110 | + left: 188px; | ||
| 111 | + top: 15px; | ||
| 112 | +} | ||
| 113 | + | ||
| 114 | +.shutter-sound-button.shutter-sound-on:active { | ||
| 115 | + background-position: 0px -50px; | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +.shutter-sound-button.shutter-sound-on { | ||
| 119 | + background-position: 0px -100px; | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +.shutter-sound-button.shutter-sound-on:active { | ||
| 123 | + background-position: 0px -150px; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | /* Photo Roll */ | ||
| 127 | |||
| 128 | .photo-roll { |
camera/camera-sound-toggle.patch
(128 / 0)
|   | |||
| 1 | diff --git a/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js b/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 2 | index 2952de4..f11abf1 100644 | ||
| 3 | --- a/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 4 | +++ b/usr/palm/applications/com.palm.app.camera/app/controllers/capture-assistant.js | ||
| 5 | @@ -79,6 +79,10 @@ CaptureAssistant = Class.create({ | ||
| 6 | this._handleFlashButton(); | ||
| 7 | }.bind(this)); | ||
| 8 | |||
| 9 | + this.controller.get('shutterSoundButtonState').observe(Mojo.Event.tap, function(){ | ||
| 10 | + this._handleShutterSoundButton(); | ||
| 11 | + }.bind(this)); | ||
| 12 | + | ||
| 13 | this.onKeyPressHandler = this.onKeyPress.bindAsEventListener(this); | ||
| 14 | Mojo.listen(this.controller.sceneElement, Mojo.Event.keydown, this.onKeyPressHandler); | ||
| 15 | Mojo.listen(this.controller.sceneElement, Mojo.Event.keyup, this.onKeyPressHandler); | ||
| 16 | @@ -140,6 +144,11 @@ CaptureAssistant = Class.create({ | ||
| 17 | this.setFlashState(prefFlashState); | ||
| 18 | } | ||
| 19 | |||
| 20 | + if (undefined === this.shutterSoundState){ | ||
| 21 | + var prefShutterSoundState = this.cameraControl.prefs[CameraControl.PREFS.SOUNDS]; | ||
| 22 | + this.setShutterSoundState(prefShutterSoundState); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | try { | ||
| 26 | var initialOrientation = PalmSystem.screenOrientation; | ||
| 27 | this.orientationChanged(initialOrientation); | ||
| 28 | @@ -629,6 +638,45 @@ CaptureAssistant = Class.create({ | ||
| 29 | }, | ||
| 30 | |||
| 31 | /** | ||
| 32 | + * Click handler for the shutter sound button. | ||
| 33 | + * | ||
| 34 | + * @param {Event} event The click event | ||
| 35 | + */ | ||
| 36 | + _handleShutterSoundButton: function(event){ | ||
| 37 | + if (this.shutterSoundState == 'enabled'){ | ||
| 38 | + this.shutterSoundState = 'disabled'; | ||
| 39 | + } | ||
| 40 | + else { | ||
| 41 | + this.shutterSoundState = 'enabled'; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + this.setShutterSoundState(this.shutterSoundState); | ||
| 45 | + }, | ||
| 46 | + | ||
| 47 | + setShutterSoundState: function(state){ | ||
| 48 | + if ((state != 'disabled') && (state != 'enabled')) { | ||
| 49 | + /* | ||
| 50 | + var elemC = this.controller.get('sagar_console'); | ||
| 51 | + if (elemC) { | ||
| 52 | + elemC.innerHTML = state; | ||
| 53 | + } | ||
| 54 | + */ | ||
| 55 | + llog("Requested shutter sound state is out of range ("+state+")"); | ||
| 56 | + return; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + this.shutterSoundState = state; | ||
| 60 | + CameraPrefs.updatePref(this.cameraControl.prefs, CameraControl.PREFS.SOUNDS, state); | ||
| 61 | + | ||
| 62 | + if (this.shutterSoundState == 'enabled') { | ||
| 63 | + this.controller.get('shutterSoundButtonState').className = "shutter-sound-button shutter-sound-on"; | ||
| 64 | + } | ||
| 65 | + else if (this.shutterSoundState == 'disabled') { | ||
| 66 | + this.controller.get('shutterSoundButtonState').className = "shutter-sound-button shutter-sound-off"; | ||
| 67 | + } | ||
| 68 | + }, | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | * Handler for click of photoroll button. | ||
| 72 | * | ||
| 73 | * The photoroll scene will be pushed on. | ||
| 74 | diff --git a/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html b/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 75 | index a586aba..e8243d2 100644 | ||
| 76 | --- a/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 77 | +++ b/usr/palm/applications/com.palm.app.camera/app/views/capture/capture-scene.html | ||
| 78 | @@ -14,6 +14,8 @@ | ||
| 79 | <div id="captureSpinner" class="capture-spinner" x-mojo-element="Spinner"></div> | ||
| 80 | <div class="capture-button" id="captureButton"> | ||
| 81 | </div> | ||
| 82 | + <div class="shutter-sound-button shutter-sound-off" id="shutterSoundButtonState"> | ||
| 83 | + </div> | ||
| 84 | <div class="flash-button flash-off" id="flashButtonState"> | ||
| 85 | </div> | ||
| 86 | </div> | ||
| 87 | @@ -23,7 +25,7 @@ | ||
| 88 | |||
| 89 | </div> | ||
| 90 | </div> | ||
| 91 | - <!-- <div id="sagar_console" style="z-index: 100; position: fixed; top: 10px; left: 10px; width: 90px; height: 20px; background-color: #000000; color: #8080ff; font-family: sans-serif; font-size: 12px; display: none;" >Hello!</div> --> | ||
| 92 | + <!--<div id="sagar_console" style="z-index: 100; position: fixed; top: 10px; left: 10px; width: 90px; height: 20px; background-color: #000000; color: #8080ff; font-family: sans-serif; font-size: 12px; display: none;" >Hello!</div> --> | ||
| 93 | <div id="gpsMeter" style="z-index: 100; position: fixed; top: 10px; right: 10px; width: 90px; height: 20px; background-color: #a0a0a0; display: none" ></div> --> | ||
| 94 | |||
| 95 | <div id="palmScrim" class="palm-scrim" style="z-index: 1001; display: none;"> | ||
| 96 | diff --git a/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css b/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 97 | index 9480ffa..f0e242d 100644 | ||
| 98 | --- a/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 99 | +++ b/usr/palm/applications/com.palm.app.camera/stylesheets/camera.css | ||
| 100 | @@ -119,6 +119,28 @@ body.palm-default { | ||
| 101 | z-index: 20; | ||
| 102 | } | ||
| 103 | |||
| 104 | +.shutter-sound-button, | ||
| 105 | +.shutter-sound-button.shutter-sound-off { | ||
| 106 | + width: 50px; | ||
| 107 | + height: 50px; | ||
| 108 | + background: url(../images/menu-shutter-sound.png) 0 0 no-repeat; | ||
| 109 | + position: absolute; | ||
| 110 | + left: 188px; | ||
| 111 | + top: 15px; | ||
| 112 | +} | ||
| 113 | + | ||
| 114 | +.shutter-sound-button.shutter-sound-on:active { | ||
| 115 | + background-position: 0px -50px; | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +.shutter-sound-button.shutter-sound-on { | ||
| 119 | + background-position: 0px -100px; | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +.shutter-sound-button.shutter-sound-on:active { | ||
| 123 | + background-position: 0px -150px; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | /* Photo Roll */ | ||
| 127 | |||
| 128 | .photo-roll { |
|   | |||
| 1 | diff --git a/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js b/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 2 | index b2b1cd7..57a4157 100644 | ||
| 3 | --- a/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 4 | +++ b/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 5 | @@ -47,6 +47,7 @@ var EmailAppDepot = Class.create({ | ||
| 6 | if (accounts.list !== undefined && this.numAccounts !== accounts.list.length) { | ||
| 7 | // look for accounts that have been removed | ||
| 8 | var removedAccounts = []; | ||
| 9 | + if (this.accounts.list) { | ||
| 10 | this.accounts.list.each(function(existingAcct){ | ||
| 11 | var stillExists = false; | ||
| 12 | accounts.list.each(function(newAcct) { | ||
| 13 | @@ -59,6 +60,7 @@ var EmailAppDepot = Class.create({ | ||
| 14 | removedAccounts.push(existingAccnt); | ||
| 15 | } | ||
| 16 | }); | ||
| 17 | + } | ||
| 18 | if (removedAccounts.length > 0) { | ||
| 19 | // delete the security policy that are associated with the deleted | ||
| 20 | // accounts. |
email/email-update-bug-fix.patch
(0 / 20)
|   | |||
| 1 | diff --git a/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js b/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 2 | index b2b1cd7..57a4157 100644 | ||
| 3 | --- a/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 4 | +++ b/usr/palm/applications/com.palm.app.email/app/models/EmailAppDepot.js | ||
| 5 | @@ -47,6 +47,7 @@ var EmailAppDepot = Class.create({ | ||
| 6 | if (accounts.list !== undefined && this.numAccounts !== accounts.list.length) { | ||
| 7 | // look for accounts that have been removed | ||
| 8 | var removedAccounts = []; | ||
| 9 | + if (this.accounts.list) { | ||
| 10 | this.accounts.list.each(function(existingAcct){ | ||
| 11 | var stillExists = false; | ||
| 12 | accounts.list.each(function(newAcct) { | ||
| 13 | @@ -59,6 +60,7 @@ var EmailAppDepot = Class.create({ | ||
| 14 | removedAccounts.push(existingAccnt); | ||
| 15 | } | ||
| 16 | }); | ||
| 17 | + } | ||
| 18 | if (removedAccounts.length > 0) { | ||
| 19 | // delete the security policy that are associated with the deleted | ||
| 20 | // accounts. |

