All pastes #1719529 Raw Edit

Hold Chat To Launch A New Card

public diff v1 · immutable
#1719529 ·published 2009-12-18 15:38 UTC
rendered paste body
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js@@ -150,6 +150,8 @@ 	this.filterImmediate = this.filterImmediate.bind(this); 	this.filter = this.filter.bind(this); 	this.handleHistoryListTap = this.handleHistoryListTap.bindAsEventListener(this);+	this.handleHistoryListHold = this.handleHistoryListHold.bindAsEventListener(this);+	this.handleBuddyListHold = this.handleBuddyListHold.bindAsEventListener(this); 	this.handleHistoryListDelete = this.handleHistoryListDelete.bindAsEventListener(this); 	this.handleBuddyListTap = this.handleBuddyListTap.bindAsEventListener(this); 	this.handleAvailabilityPickerTap = this.handleAvailabilityPickerTap.bindAsEventListener(this);@@ -281,6 +282,8 @@      // observe clicks on the buddy list & history list     this.historyListWidget.observe(Mojo.Event.tap, this.handleHistoryListTap);+	 this.historyListWidget.observe(Mojo.Event.hold, this.handleHistoryListHold);+    this.buddyListWidget.observe(Mojo.Event.hold, this.handleBuddyListHold);     // observe swipe to delete on the history list     this.historyListWidget.observe(Mojo.Event.listDelete, this.handleHistoryListDelete);     this.buddyListWidget.observe(Mojo.Event.tap, this.handleBuddyListTap);@@ -303,7 +305,12 @@ 	handleHistoryListTap: function(e) { 		MessagingUtils.simpleListClick(this.controller.get(e.target),"historyRow",this.launchChatView.bind(this),true); 	},-	+	handleHistoryListHold: function(e) {+	    MessagingUtils.simpleListClick(this.controller.get(e.target),"historyRow",this.launchChatInNewCard.bind(this),true);+	},+	handleBuddyListHold: function(e) {+		MessagingUtils.simpleListClick(this.controller.get(e.target),"buddyListRow",this.launchChatInNewCard.bind(this),true);+	}, 	handleHistoryListDelete: function(event) { 		var chatThreadId = event.item.id; 		Mojo.Controller.appController.notificationAssistant.clearNotificationsForChat(chatThreadId);@@ -1071,6 +1075,26 @@     }, {popScenesTo: CONSTANTS.SCENE_ID_ACCOUNT_SUMMARY});   },   +  launchChatInNewCard: function(chatThreadId) {+	var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);+		if (stageController) {+			stageController.activate();+			return;+		}++	var params = {name: 'messaging' + chatThreadId,+			lightweight: Mojo.Controller.appInfo.lwStages+	};++	var callback = function(controller) {+		controller.pushScene('chatview',chatThreadId,{+					focusWindow: true+				});		+	};++	Mojo.Controller.getAppController().createStageWithCallback(params, callback);+  },+     launchChatView: function(chatThreadId) {     this.controller.stageController.pushScene('chatview',chatThreadId,{clearListBadgeFn:this.clearListBadgeForChatThreadId.bind(this,chatThreadId)});		   },@@ -1097,6 +1121,8 @@ 	this.filterField.stopObserving(Mojo.Event.filterImmediate, this.filterImmediate); 	this.filterField.stopObserving(Mojo.Event.filter, this.filter); 	this.historyListWidget.stopObserving(Mojo.Event.tap, this.handleHistoryListTap);+	this.historyListWidget.stopObserving(Mojo.Event.hold, this.handleHistoryListHold);+   this.historyListWidget.stopObserving(Mojo.Event.hold, this.handleBuddyListHold); 	this.historyListWidget.stopObserving(Mojo.Event.listDelete, this.handleHistoryListDelete); 	this.buddyListWidget.stopObserving(Mojo.Event.tap, this.handleBuddyListTap);     	this.customMessageField.stopObserving('blur', this.customMessageUpdate);