From 2e04af953463643791f6362bd8ef4c6ba190abfa Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Apr 2012 13:48:51 -0700 Subject: Squashed commit of the following: commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito Date: Tue Apr 10 14:33:00 2012 -0700 fixed the text area case issue Text area was renamed from TextArea to Textarea Signed-off-by: Valerio Virgillito commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito Signed-off-by: Valerio Virgillito --- .../montage/ui/composer/long-press-composer.js | 232 --------------------- 1 file changed, 232 deletions(-) delete mode 100644 node_modules/montage/ui/composer/long-press-composer.js (limited to 'node_modules/montage/ui/composer/long-press-composer.js') diff --git a/node_modules/montage/ui/composer/long-press-composer.js b/node_modules/montage/ui/composer/long-press-composer.js deleted file mode 100644 index 717bb42e..00000000 --- a/node_modules/montage/ui/composer/long-press-composer.js +++ /dev/null @@ -1,232 +0,0 @@ -/* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ -/** - @module montage/ui/composer/long-press-composer - @requires montage - @requires montage/ui/composer/composer -*/ -var Montage = require("montage").Montage, - Composer = require("ui/composer/composer").Composer; -/** - @class module:montage/ui/composer/long-press-composer.LongPressComposer - @extends module:montage/ui/composer/composer.Composer -*/ -exports.LongPressComposer = Montage.create(Composer,/** @lends module:montage/ui/event/composer/long-press-composer.LongPressComposer# */ { - -/** - Description TODO - @private -*/ - _motionThreshold: { - value: 10 - }, -/** - Description TODO - @private -*/ - _longpressTimeOut: { - value: 1500 - }, - - _longPressTimer: { - value: null - }, - - _fingerId: { - value: null - }, - - _X: { - value: null - }, - - _Y: { - value: null - }, - - /** - Description TODO - @function - */ - load: { - value: function () { - if (window.Touch) { - this._element.addEventListener("touchstart", this); - this._element.addEventListener("touchmove", this); - this._element.addEventListener("touchend", this); - } else { - this._element.addEventListener("mousedown", this); - } - } - }, - /** - Description TODO - @function - */ - unload: { - value: function () { - if (window.Touch) { - this._element.removeEventListener("touchstart", this); - this._element.removeEventListener("touchmove", this); - this._element.removeEventListener("touchend", this); - } - else { - this._element.removeEventListener("mousedown", this); - } - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleTouchstart: { - value: function (event) { - var self = this; - /* If two longpress on same target then the first one will be cleared*/ - if (this._longpressTimer) { - clearTimeout(this._longpressTimer); - this._longpressTimer = null; - } - this._fingerId = event.changedTouches[0].identifier; - this._X = event.changedTouches[0].clientX; - this._Y = event.changedTouches[0].clientY; - this._longpressTimer = null; - this._longpressTimer = setTimeout(function () { - // FIXME should be dispatched against something else - self._dispatchLongPress(self._element); - }, this._longpressTimeOut); - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleTouchmove: { - value: function (event) { - var i, deltaX, deltaY, len; - /* the longpresstimer is checked so that the flushing of the timer occurs only once even though touchmoves are received */ - if (this._longpressTimer) { - len = event.changedTouches.length; - for (i = 0; i < len; i++) { - /*Checked if two fingers on same target and both are moved */ - if (this._fingerId === event.changedTouches[i].identifier) { - deltaX = Math.abs(event.changedTouches[i].clientX - this._X); - deltaY = Math.abs(event.changedTouches[i].clientY - this._Y); - /* Clearing timer only on some considerable motion */ - if (deltaX > this._motionThreshold || deltaY > this._motionThreshold) { - this._clearLongpress(event.currentTarget); - break; - } - } - } - } - } - }, - /** - Description TODO - @function - @param {Event} event This event. - */ - handleTouchend: { - value: function (event) { - var target = event.currentTarget; - /* longpresstimer checked because end occurs after its move then timer is already cleared. */ - if (this._longpressTimer && this._fingerId === event.changedTouches[0].identifier) { - this._clearLongpress(target); - } - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleMousedown: { - value: function (event) { - var target = event.currentTarget; - var self = this; - target.addEventListener("mousemove", this); - target.addEventListener("mouseup", this); - target.addEventListener("mouseout", this); - this._fingerId = 0; - this._X = event.clientX; - this._Y = event.clientY; - this._longpressTimer = setTimeout(function () { - self._dispatchLongPress(target); - }, this._longpressTimeOut); - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleMouseup: { - value: function (event) { - this._clearLongpress(event.currentTarget); - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleMouseout: { - value: function (event) { - this._clearLongpress(event.currentTarget); - } - }, -/** - Description TODO - @function - @param {Event} event This event. - */ - handleMousemove: { - value: function (event) { - this._clearLongpress(event.currentTarget); - } - }, - /** - Description TODO - @private -*/ - _dispatchLongPress: { - value: function (target) { - longPressEvent = document.createEvent("CustomEvent"); - longPressEvent.clientX = this._X; - longPressEvent.clientY = this._Y; - longPressEvent.identifier = this._fingerId; - longPressEvent.initCustomEvent("longpress", true, true, null); - this.dispatchEvent(longPressEvent); - this._clearLongpress(target); - } - }, -/** - Description TODO - @private -*/ - _clearLongpress: { - value: function (target) { - if (this._longpressTimer) { - clearTimeout(this._longpressTimer); - this._longpressTimer = null; - this._X = null; - this._Y = null; - } - if (window.Touch) { - this._fingerId = null; - } else { - target.removeEventListener("mouseup", this); - target.removeEventListener("mousemove", this); - target.removeEventListener("mouseout", this); - } - } - } - - -}); -- cgit v1.2.3