Skip to content

Commit

Permalink
pushing thorugh some patches -cryptk
Browse files Browse the repository at this point in the history
  • Loading branch information
www-data committed Mar 21, 2011
1 parent eed8ef3 commit 44dc86f
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 0 deletions.
140 changes: 140 additions & 0 deletions email/email-save-attachments-to-downloads-folder.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
diff --git a/usr/palm/applications/com.palm.app.email/app/controllers/message-assistant.js b/usr/palm/applications/com.palm.app.email/app/controllers/message-assistant.js
index 95bb302..6116755 100644
--- a/usr/palm/applications/com.palm.app.email/app/controllers/message-assistant.js
+++ b/usr/palm/applications/com.palm.app.email/app/controllers/message-assistant.js
@@ -1655,8 +1655,37 @@ MessageAssistant.prototype._getAttachmentById = function(id) {

if (listDiv) {
var attachmentUri = listDiv.getAttribute('x-uri');
+ var filename = listDiv.getAttribute("x-fileName");
if (attachmentUri) {
- this.openAttachment(listDiv);
+ this.controller.serviceRequest("palm://ca.canucksoftware.filemgr", {
+ method: "exists",
+ parameters: {file:"/media/internal/downloads/" + filename},
+ onSuccess: function(response) {
+ if(response.exists) {
+ listDiv.setAttribute("x-uri", "/media/internal/downloads/" + filename);
+ this.openAttachment(listDiv);
+ } else {
+ this.controller.serviceRequest("palm://ca.canucksoftware.filemgr", {
+ method: "exists",
+ parameters: {file:attachmentUri},
+ onSuccess: function(response2) {
+ if(response2.exists) {
+ this.openAttachment(listDiv);
+ } else {
+ listDiv.removeAttribute("x-uri");
+ this.handleAttachmentTapped(event);
+ }
+ }.bind(this),
+ onFailure: function(err2) {
+ this.openAttachment(listDiv);
+ }.bind(this)
+ });
+ }
+ }.bind(this),
+ onFailure: function(err) {
+ this.openAttachment(listDiv);
+ }.bind(this)
+ });
} else if (event.target.className === "download-cancel") {
this.stopAttachmentDownload(listDiv.id);

@@ -1669,7 +1698,7 @@ MessageAssistant.prototype._getAttachmentById = function(id) {
window.clearTimeout(this.hideTimeout);
this.hideTimeout = null;
}
- this.startAttachmentDownload(listDiv.id);
+ this.startAttachmentDownload(listDiv.id, filename);

if (this.attachmentDownloadCount === undefined) {
this.attachmentDownloadCount = 1;
@@ -1680,11 +1709,11 @@ MessageAssistant.prototype._getAttachmentById = function(id) {
}
};

- MessageAssistant.prototype.startAttachmentDownload = function(attachmentId) {
+ MessageAssistant.prototype.startAttachmentDownload = function(attachmentId, filename) {
var accountId = this.targetAccountId;
var messageId = this.targetEmail._id;
var folderId = this.targetEmail.folderId;
- EmailApp.attachmentsUtil.startAttachmentDownload(this, accountId, folderId, messageId, attachmentId);
+ EmailApp.attachmentsUtil.startAttachmentDownload(this, accountId, folderId, messageId, attachmentId, filename);
};

MessageAssistant.prototype.stopAttachmentDownload = function(attachmentId) {
diff --git a/usr/palm/applications/com.palm.app.email/app/models/Attachments.js b/usr/palm/applications/com.palm.app.email/app/models/Attachments.js
index 8b3e591..5ec004e 100644
--- a/usr/palm/applications/com.palm.app.email/app/models/Attachments.js
+++ b/usr/palm/applications/com.palm.app.email/app/models/Attachments.js
@@ -39,13 +39,13 @@ Attachments.prototype.isDownloadInProgress = function(partId) {
return this.attachmentDLProgress.details[partId] !== undefined;
};

-Attachments.prototype.startAttachmentDownload = function(scene, accountId, folderId, messageId, partId) {
+Attachments.prototype.startAttachmentDownload = function(scene, accountId, folderId, messageId, partId, attachmentName) {
Mojo.Log.info("start attachment '%s' download", partId);

if (this.isDownloadInProgress(partId)) {
Mojo.Log.info("ignoring tap because attachment is already downloading");
} else {
- var successFunc = this.attachmentDownloadProgress.bind(this);
+ var successFunc = this.attachmentDownloadProgress.bind(this, attachmentName);
var errorFunc = function(error){
this.broadcast(Attachments.kDownloadProgressError, partId, error);
}.bind(this, partId);
@@ -115,7 +115,7 @@ Attachments.prototype.attachmentError = function(scene, id, err) {
});
};

-Attachments.prototype.attachmentDownloadProgress = function(info) {
+Attachments.prototype.attachmentDownloadProgress = function(attachmentName, info) {
if (!info.partId) {
// If the object doesn't contain a 'id' property, it isn't valid download progress
return;
@@ -125,12 +125,38 @@ Attachments.prototype.attachmentDownloadProgress = function(info) {
if (info.path) {
// Transport will return a path when attachment is downloaded
Mojo.Log.info("attachmentDownloadProgress complete for attachment: %s", info.partId);
- // Notifiy listeners about the downloaded progress
- this.broadcast(Attachments.kDownloadProgressUpdate, info.partId, 100);
- this.broadcast(Attachments.kDownloadProgressComplete, info);
-
- // remove download subscription
- this.attachmentDLProgress.clearSubscription(info.partId);
+ this.filemgrRequest1 = new Mojo.Service.Request("palm://ca.canucksoftware.filemgr", {
+ method: "createDir",
+ parameters: {path:"/media/internal/downloads/"},
+ onSuccess: function(response1) {
+ var newPath = undefined;
+ if(attachmentName) {
+ newPath = "/media/internal/downloads/" + attachmentName;
+ } else {
+ newPath = "/media/internal/downloads/" + info.path.substring(info.path.lastIndexOf("/")+1);
+ }
+ this.filemgrRequest2 = new Mojo.Service.Request("palm://ca.canucksoftware.filemgr", {
+ method: "move",
+ parameters: {from:info.path, to:newPath},
+ onSuccess: function(response2) {
+ info.path = newPath;
+ this.broadcast(Attachments.kDownloadProgressUpdate, info.partId, 100);
+ this.broadcast(Attachments.kDownloadProgressComplete, info);
+ this.attachmentDLProgress.clearSubscription(info.partId);
+ }.bind(this),
+ onFailure: function(err2) {
+ this.broadcast(Attachments.kDownloadProgressUpdate, info.partId, 100);
+ this.broadcast(Attachments.kDownloadProgressComplete, info);
+ this.attachmentDLProgress.clearSubscription(info.partId);
+ }.bind(this)
+ });
+ }.bind(this),
+ onFailure: function(err1) {
+ this.broadcast(Attachments.kDownloadProgressUpdate, info.partId, 100);
+ this.broadcast(Attachments.kDownloadProgressComplete, info);
+ this.attachmentDLProgress.clearSubscription(info.partId);
+ }.bind(this)
+ });
} else {
var progress = (info.bytesDownloaded / info.totalBytes) * 100;
var detailsObj = this.attachmentDLProgress.details;
13 changes: 13 additions & 0 deletions messaging/messaging-15px-font.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css b/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
index 59607ca..9772980 100644
--- a/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
+++ b/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
@@ -698,7 +698,7 @@
.my-chat .chat-balloon-wrapper,
.their-chat .chat-balloon-wrapper {
padding: 1px 0;
- font-size: 18px;
+ font-size: 15px;
word-wrap: break-word !important;
}

61 changes: 61 additions & 0 deletions video-player/video-player-remove-video-pause-on-minimize.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/usr/palm/frameworks/metascene.videos/submission/103/concatenated.js b/usr/palm/frameworks/metascene.videos/submission/103/concatenated.js
index 9f3bb1d..6ace45e 100755
--- a/usr/palm/frameworks/metascene.videos/submission/103/concatenated.js
+++ b/usr/palm/frameworks/metascene.videos/submission/103/concatenated.js
@@ -1369,7 +1369,7 @@ var NowplayingAssistant = Class.create(metascene.Base, {
this._blockDim(false);

if (this.mediaController.isStaticStream){
- this.pause();
+ //this.pause();
} else {
this.mediaController.stop();
}
@@ -1463,7 +1463,7 @@ var NowplayingAssistant = Class.create(metascene.Base, {
if (event.event === "displayOff"){
this.playEngine.setBlockPlayEvents(true);
Mojo.Log.info ("display is off, sending pause");
- this.pause();
+ //this.pause();
} else if (event.event === "displayOn" && this.controller.stageController.active){
//this tells the videoplayer to continue blocking play events if autoplay is set to false
this.playEngine.setBlockPlayEvents(!this.autoplay);
diff --git a/usr/palm/frameworks/metascene.videos/submission/103/javascript/assistants/nowplaying-assistant.js b/usr/palm/frameworks/metascene.videos/submission/103/javascript/assistants/nowplaying-assistant.js
index afd4524..8843f5e 100644
--- a/usr/palm/frameworks/metascene.videos/submission/103/javascript/assistants/nowplaying-assistant.js
+++ b/usr/palm/frameworks/metascene.videos/submission/103/javascript/assistants/nowplaying-assistant.js
@@ -282,7 +282,7 @@ var NowplayingAssistant = Class.create(metascene.Base, {
this._blockDim(false);

if (this.mediaController.isStaticStream){
- this.pause();
+ //this.pause();
} else {
this.mediaController.stop();
}
@@ -376,7 +376,7 @@ var NowplayingAssistant = Class.create(metascene.Base, {
if (event.event === "displayOff"){
this.playEngine.setBlockPlayEvents(true);
Mojo.Log.info ("display is off, sending pause");
- this.pause();
+ //this.pause();
} else if (event.event === "displayOn" && this.controller.stageController.active){
//this tells the videoplayer to continue blocking play events if autoplay is set to false
this.playEngine.setBlockPlayEvents(!this.autoplay);
diff --git a/usr/palm/frameworks/metascene.videos/submission/103metascene_videos.js b/usr/palm/frameworks/metascene.videos/submission/103metascene_videos.js
index 6773145..f71a73a 100644
--- a/usr/palm/frameworks/metascene.videos/submission/103metascene_videos.js
+++ b/usr/palm/frameworks/metascene.videos/submission/103metascene_videos.js
@@ -54,10 +54,10 @@ Mojo.Event.flick,this.onVideoFlick.bind(this),false)}else this.autoListen(this.v
"mouseup",this.onControllerDragEnd.bind(this),false);this.autoListen(videoControls,Mojo.Event.tap,this.onControllerTap.bind(this),false);this.autoListen(this.videoPlayer,"loadstart",this.onLoadStart.bind(this),false);this.autoListen(this.videoPlayer,"ended",this._ended.bind(this),false);this.autoListen(this.videoPlayer,"progress",this._progress.bind(this),false)},onVideoFlick:function(event){event.stop();if(!this.mediaController.isStaticStream||!this.enableControls)return;if(this.controller.getMenuVisible(Mojo.Menu.commandMenu)){Mojo.Log.info("controls are up");
this.showControls();this._doVideoFlick(event)}else{Mojo.Log.info("doing delayed show");this.showControls();this._doVideoFlick.bind(this).delay(this.FLICK_DELAY_SECS,event)}},_doVideoFlick:function(event){if(event.velocity.x>0){if(this.videoPlayer.currentTime+this.FLICK_FORWARD_SKIP_AMOUNT<this.videoPlayer.duration)this.videoPlayer.currentTime+=this.FLICK_FORWARD_SKIP_AMOUNT}else if(this.videoPlayer.currentTime-this.FLICK_BACK_SKIP_AMOUNT>0)this.videoPlayer.currentTime-=this.FLICK_BACK_SKIP_AMOUNT;
else this.videoPlayer.currentTime=0},_overridingMenuSetVisible:function(which,visible){var controlsDiv=this.controller.get("video-controls");if(visible){controlsDiv.removeClassName("faded");this.controller.sceneElement.removeClassName("faded")}else{controlsDiv.addClassName("faded");this.controller.sceneElement.addClassName("faded")}this._originalSetMenuVisible(which,visible);this.updateTime(this.videoPlayer.currentTime,true)},_onBlurHandle:function(){Mojo.Log.info("blur handler");this.playEngine.setBlockPlayEvents(true);
-this._blockDim(false);if(this.mediaController.isStaticStream)this.pause();else this.mediaController.stop();this.showControls();Util.markForeground(this.controller,false,Util.powerService)},_clearUnloadTimeout:function(){if(this.unloadTimeoutId!==0){this.controller.window.clearTimeout(this.unloadTimeoutId);this.unloadTimeoutId=0}},_onFocusHandle:function(){this._clearUnloadTimeout();this.playEngine.setBlockPlayEvents(!this.autoplay);Util.markForeground(this.controller,true,Util.powerService);var currentState=
+this._blockDim(false);if(!this.mediaController.isStaticStream)this.mediaController.stop();this.showControls();Util.markForeground(this.controller,false,Util.powerService)},_clearUnloadTimeout:function(){if(this.unloadTimeoutId!==0){this.controller.window.clearTimeout(this.unloadTimeoutId);this.unloadTimeoutId=0}},_onFocusHandle:function(){this._clearUnloadTimeout();this.playEngine.setBlockPlayEvents(!this.autoplay);Util.markForeground(this.controller,true,Util.powerService);var currentState=
this.playEngine.getCurrentState();if(this.shouldPreventDim(currentState))this._blockDim(true);if(currentState==this.playEngine.STATE_DISCONNECTED){Mojo.Log.info("was disconnected, reload the file");this.playEngine.load(this.getCurrentPos())}},getCurrentPos:function(){var pos=this.sliderModel.value;var secs=Math.round(pos/100*this.videoPlayer.duration);Mojo.Log.info("video player getCurrentPos returning "+secs);return secs},progressBarDragEnd:function(){this.sliderIsDragging=false;var pos=this.sliderModel.value;
var secs=Math.round(pos/100*this.videoPlayer.duration);this.videoPlayer.currentTime=secs;if(this.pausedFromDrag){this.videoPlayer.play();this.pausedFromDrag=false}},progressBarDragStart:function(){if(this.sliderIsDragging)return;this.sliderIsDragging=true;Mojo.Log.info("pausing on drag");if(!this.videoPlayer.paused){this.eatPause=true;this.videoPlayer.pause();this.pausedFromDrag=true}else this.pausedFromDrag=false},progressBarSeek:function(event){var pos=event.value;var secs=Math.round(pos/100*this.videoPlayer.duration);
-this.updateCounters(secs)},_registerForDisplayChanges:function(){this.powerService=Util.powerService.registerForEvents(this.controller,this._powerServiceCallback.bind(this))},_powerServiceCallback:function(event){if(!this.playEngine)return;if(event.event==="displayOff"){this.playEngine.setBlockPlayEvents(true);Mojo.Log.info("display is off, sending pause");this.pause()}else if(event.event==="displayOn"&&this.controller.stageController.active)this.playEngine.setBlockPlayEvents(!this.autoplay)},_isLocal:function(url){var localProtocol=
+this.updateCounters(secs)},_registerForDisplayChanges:function(){this.powerService=Util.powerService.registerForEvents(this.controller,this._powerServiceCallback.bind(this))},_powerServiceCallback:function(event){if(!this.playEngine)return;if(event.event==="displayOff"){this.playEngine.setBlockPlayEvents(true);Mojo.Log.info("display is off, sending pause")}else if(event.event==="displayOn"&&this.controller.stageController.active)this.playEngine.setBlockPlayEvents(!this.autoplay)},_isLocal:function(url){var localProtocol=
"file:";return url[0]=="/"||url.substring(0,localProtocol.length).toLowerCase()===localProtocol},aboutToActivate:function(callback){this.controller.stageController.setWindowProperties({suppressBannerMessages:true});this.controller.stageController.setWindowOrientation("left");if(this.video.path)callback.defer();else this.aboutToActivateCallback=callback},activate:function(){if(!Util.transcoding&&this.video.path)this.loadVideo();else this._transcodingInterval=this.controller.window.setInterval(function(){if(Util.transcoding&&
this.video.path);else{this.controller.window.clearInterval(this._transcodingInterval);this.loadVideo()}}.bind(this),1E3)},loadVideo:function(){if(!this.playEngine){this.showProgressInfo();this.playEngine=new StreamingPlayEngine(this.videoPlayer,this.videoExt,this,this.video.path,this.video.playbackPosition,!this.autoplay);this.mediaController=new MediaController(this.videoPlayer,this.playEngine,this);Util.markForeground(this.controller,true)}},savePlaybackProgress:function(){if(this.video._id!==undefined)if(this.videoPlayer.duration>
this.MIN_DURATION_FOR_SAVE&&Math.abs(this.videoPlayer.duration-this.videoPlayer.currentTime)>this.MIN_TIME_DELTA_FOR_SAVE)this._doWritePlaybackProgress(this.video._id,this.videoPlayer.currentTime);else if(this.video.playbackPosition!==undefined&&this.video.playbackPosition>0)this._doWritePlaybackProgress(this.video._id,0)},deactivate:function(){this._blockDim(false);this.controller.document.removeEventListener(Mojo.Event.stageActivate,this.focusHandler,false);this.controller.document.removeEventListener(Mojo.Event.stageDeactivate,

0 comments on commit 44dc86f

Please sign in to comment.