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/bluemoon/slider.reel/slider.js | 14 +- node_modules/montage/ui/button.reel/button.js | 95 +- node_modules/montage/ui/check-input.js | 4 +- node_modules/montage/ui/component.js | 23 +- .../montage/ui/composer/long-press-composer.js | 232 --- node_modules/montage/ui/composer/press-composer.js | 126 +- .../montage/ui/composer/translate-composer.js | 133 +- .../montage/ui/condition.reel/condition.js | 2 +- node_modules/montage/ui/flow-bezier-spline.js | 405 +++++ node_modules/montage/ui/flow-path-cubic.js | 115 -- node_modules/montage/ui/flow-path-lerp.js | 112 -- node_modules/montage/ui/flow-path-linear.js | 83 - node_modules/montage/ui/flow-path-sigmoid.js | 148 -- node_modules/montage/ui/flow-path.js | 215 --- node_modules/montage/ui/flow.reel/flow.html | 48 +- node_modules/montage/ui/flow.reel/flow.js | 1002 +++++++++--- node_modules/montage/ui/list.reel/list.html | 38 +- .../ui/loading-panel.reel/loading-panel.html | 32 +- node_modules/montage/ui/native-control.js | 14 +- .../ui/picasa-carousel.reel/image.reel/image.html | 3 +- .../ui/picasa-carousel.reel/picasa-carousel.css | 15 +- .../ui/picasa-carousel.reel/picasa-carousel.html | 242 +-- .../ui/picasa-carousel.reel/picasa-carousel.js | 210 ++- .../montage/ui/popup/alert.reel/alert.html | 32 +- .../montage/ui/popup/confirm.reel/confirm.html | 32 +- .../montage/ui/popup/notifier.reel/notifier.js | 4 +- node_modules/montage/ui/popup/popup.reel/popup.js | 135 +- .../montage/ui/range-input.reel/range-input.js | 6 +- .../montage/ui/repetition.reel/repetition.js | 18 +- .../rich-text-linkpopup.css | 31 + .../rich-text-linkpopup.html | 37 + .../rich-text-linkpopup.js | 274 ++++ .../rich-text-resizer.reel/rich-text-resizer.css | 141 ++ .../rich-text-resizer.reel/rich-text-resizer.html | 45 + .../rich-text-resizer.reel/rich-text-resizer.js | 568 +++++++ .../rich-text-editor.reel/rich-text-editor-base.js | 1706 ++++++++++++++++++++ .../rich-text-editor.reel/rich-text-editor.css | 30 + .../rich-text-editor.reel/rich-text-editor.html | 41 + .../rich-text-editor.reel/rich-text-editor.js | 614 +++++++ .../rich-text-editor.reel/rich-text-sanitizer.js | 132 ++ .../montage/ui/scroller.reel/scroller.html | 56 +- node_modules/montage/ui/scroller.reel/scroller.js | 49 +- .../montage/ui/select-input.reel/select-input.js | 7 +- .../ui/skeleton/range-input.reel/range-input.html | 19 +- node_modules/montage/ui/tabs.reel/tabs.html | 20 +- node_modules/montage/ui/template.js | 313 +++- node_modules/montage/ui/text-input.js | 24 +- node_modules/montage/ui/textarea.reel/textarea.js | 4 +- .../montage/ui/video-player.reel/video-player.html | 24 +- 49 files changed, 5797 insertions(+), 1876 deletions(-) delete mode 100644 node_modules/montage/ui/composer/long-press-composer.js create mode 100755 node_modules/montage/ui/flow-bezier-spline.js delete mode 100644 node_modules/montage/ui/flow-path-cubic.js delete mode 100644 node_modules/montage/ui/flow-path-lerp.js delete mode 100644 node_modules/montage/ui/flow-path-linear.js delete mode 100644 node_modules/montage/ui/flow-path-sigmoid.js delete mode 100644 node_modules/montage/ui/flow-path.js create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.css create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.html create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.css create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.html create mode 100644 node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js create mode 100644 node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js create mode 100644 node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.css create mode 100644 node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.html create mode 100644 node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js create mode 100644 node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-sanitizer.js (limited to 'node_modules/montage/ui') diff --git a/node_modules/montage/ui/bluemoon/slider.reel/slider.js b/node_modules/montage/ui/bluemoon/slider.reel/slider.js index 56c4faa8..1a0e3d6e 100644 --- a/node_modules/montage/ui/bluemoon/slider.reel/slider.js +++ b/node_modules/montage/ui/bluemoon/slider.reel/slider.js @@ -4,7 +4,7 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ /** - @module "montage/ui/bluemoon/slider.reel" + @module "montage/ui/bluemoon/slider.reel" @requires montage/core/core @requires montage/ui/component */ @@ -199,6 +199,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon }, set: function (value) { if (value !== this._minValue) { + if(String.isString(value)) { + value = parseFloat(value); + } this._minValue = value; this._valueRange = null; this.needsDraw = true; @@ -226,6 +229,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon }, set: function (value) { if (value !== this._maxValue) { + if(String.isString(value)) { + value = parseFloat(value); + } this._maxValue = value; this._valueRange = null; this.needsDraw = true; @@ -288,6 +294,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon }, set: function (value) { if (!isNaN(value)) { + if(String.isString(value)) { + value = parseFloat(value); + } if (value !== this._value) { this._value = parseFloat(value); this.needsDraw = true; @@ -450,7 +459,8 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon */ handleMousemove: { value: function (event) { - this.value = this._value + ((event.clientX - this._cursorPosition) * (this.valueRange)) / this._width; + this.value = this.value + ((event.clientX - this._cursorPosition) * (this.valueRange)) / this._width; + this._cursorPosition = event.clientX; event.preventDefault(); event.stopPropagation(); diff --git a/node_modules/montage/ui/button.reel/button.js b/node_modules/montage/ui/button.reel/button.js index 5da92482..315cf505 100644 --- a/node_modules/montage/ui/button.reel/button.js +++ b/node_modules/montage/ui/button.reel/button.js @@ -13,6 +13,24 @@ var Montage = require("montage").Montage, */ var Button = exports.Button = Montage.create(NativeControl, { + /** + @event + @name action + @param {Event} event + + Dispatched when the button is activated through a mouse click, finger tap, + or when focused and the spacebar is pressed. + */ + + /** + @event + @name hold + @param {Event} event + + Dispatched when the button is pressed for a period of time, set by + {@link holdTimeout}. + */ + /** Description TODO @private @@ -104,6 +122,23 @@ var Button = exports.Button = Montage.create(NativeControl, { } }, + /** + How long a press has to last for a hold event to be dispatched + */ + holdTimeout: { + get: function() { + return this._pressComposer.longPressTimeout; + }, + set: function(value) { + this._pressComposer.longPressTimeout = value; + } + }, + + _pressComposer: { + enumberable: false, + value: null + }, + /** True when the button is being interacted with, either through mouse click or touch event. @@ -129,13 +164,28 @@ var Button = exports.Button = Montage.create(NativeControl, { } }, + didCreate: { + value: function() { + this._pressComposer = PressComposer.create(); + this.addComposer(this._pressComposer); + } + }, + prepareForActivationEvents: { value: function() { - var pressComposer = PressComposer.create(); - this.addComposer(pressComposer); - pressComposer.addEventListener("pressstart", this, false); - pressComposer.addEventListener("press", this, false); - pressComposer.addEventListener("presscancel", this, false); + this._pressComposer.addEventListener("pressStart", this, false); + this._pressComposer.addEventListener("press", this, false); + this._pressComposer.addEventListener("pressCancel", this, false); + } + }, + + // Optimisation + addEventListener: { + value: function(type, listener, useCapture) { + NativeControl.addEventListener.call(this, type, listener, useCapture); + if (type === "hold") { + this._pressComposer.addEventListener("longPress", this, false); + } } }, @@ -144,7 +194,7 @@ var Button = exports.Button = Montage.create(NativeControl, { /** Called when the user starts interacting with the component. */ - handlePressstart: { + handlePressStart: { value: function(event) { this.active = true; @@ -166,10 +216,33 @@ var Button = exports.Button = Montage.create(NativeControl, { } }, + handleKeyup: { + value: function(event) { + console.log(event.keyCode); + // action event on spacebar + if (event.keyCode === 32) { + this.active = false; + this._dispatchActionEvent(); + } + } + }, + + handleLongPress: { + value: function(event) { + // When we fire the "hold" event we don't want to fire the + // "action" event as well. + this._pressComposer.cancelPress(); + + var holdEvent = document.createEvent("CustomEvent"); + holdEvent.initCustomEvent("hold", true, true, null); + this.dispatchEvent(holdEvent); + } + }, + /** Called when all interaction is over. */ - handlePresscancel: { + handlePressCancel: { value: function(event) { this.active = false; } @@ -186,10 +259,10 @@ var Button = exports.Button = Montage.create(NativeControl, { didSetElement: { value: function() { - var o = NativeControl.didSetElement.call(this); + NativeControl.didSetElement.call(this); this._element.classList.add("montage-button"); - this._element.setAttribute("aria-role", "button"); + this._element.setAttribute("role", "button"); this._isInputElement = (this._element.tagName === "INPUT"); // Only take the value from the element if it hasn't been set @@ -219,6 +292,8 @@ var Button = exports.Button = Montage.create(NativeControl, { } } + this._element.addEventListener("keyup", this, false); + this.needsDraw = true; } }, @@ -262,7 +337,7 @@ Button.addAttributes({ formaction: null, formenctype: null, formmethod: null, - formnovalidate: null, + formnovalidate: {dataType: 'boolean'}, formtarget: null, type: {value: 'button'}, name: null, diff --git a/node_modules/montage/ui/check-input.js b/node_modules/montage/ui/check-input.js index 1621eb45..58f1cbc7 100644 --- a/node_modules/montage/ui/check-input.js +++ b/node_modules/montage/ui/check-input.js @@ -29,7 +29,7 @@ var CheckInput = exports.CheckInput = Montage.create(NativeControl, { value: function() { var pressComposer = this._pressComposer = PressComposer.create(); this.addComposer(pressComposer); - pressComposer.addEventListener("pressstart", this, false); + pressComposer.addEventListener("pressStart", this, false); pressComposer.addEventListener("press", this, false); } }, @@ -82,7 +82,7 @@ var CheckInput = exports.CheckInput = Montage.create(NativeControl, { // Handlers - handlePressstart: { + handlePressStart: { value: function(event) { this._shouldFakeCheck = event.defaultPrevented; } diff --git a/node_modules/montage/ui/component.js b/node_modules/montage/ui/component.js index 69559fc1..17f87b62 100755 --- a/node_modules/montage/ui/component.js +++ b/node_modules/montage/ui/component.js @@ -136,23 +136,32 @@ var Component = exports.Component = Montage.create(Montage,/** @lends module:mon }, set: function(value) { if (value == null) { - console.log("Warning: Tried to set element of ", this, " as " + value + "."); + console.warn("Tried to set element of ", this, " to ", value); return; } - this.eventManager.registerEventHandlerForElement(this, value); - if (this.isDeserializing) { + this.eventManager.registerEventHandlerForElement(this, value); + // if this component has a template and has been already instantiated then assume the value is the template. if (this._isTemplateInstantiated) { - this._templateElement = value; + // this is important for component extension, we don't want to override template element + if (!this._templateElement) { + this._templateElement = value; + } } else { this._element = value; if (!this.blockDrawGate.value && this._element) { this.blockDrawGate.setField("element", true); } } + } else if (!this._firstDraw) { + // If a draw has happened then at some point the element has been set + console.error("Cannot change element of ", this, " after it has been set"); + return; } else { + this.eventManager.registerEventHandlerForElement(this, value); + this._element = value; if (!this.blockDrawGate.value && this._element) { this.blockDrawGate.setField("element", true); @@ -614,9 +623,9 @@ var Component = exports.Component = Montage.create(Montage,/** @lends module:mon } }, - serializeSelf: { - value: function(serializer, propertyNames) { - serializer.setProperties(propertyNames); + serializeProperties: { + value: function(serializer) { + serializer.setAll(); var childComponents = this.childComponents; for (var i = 0, l = childComponents.length; i < l; i++) { serializer.addObject(childComponents[i]); 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); - } - } - } - - -}); diff --git a/node_modules/montage/ui/composer/press-composer.js b/node_modules/montage/ui/composer/press-composer.js index 4a6b99b2..680c301d 100644 --- a/node_modules/montage/ui/composer/press-composer.js +++ b/node_modules/montage/ui/composer/press-composer.js @@ -20,11 +20,11 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m /** @event - @name pressstart + @name pressStart @param {Event} event Dispatched when a press begins. It is ended by either a {@link press} or - {@link presscancel} event. + {@link pressCancel} event. */ /** @@ -37,7 +37,15 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m /** @event - @name presscancel + @name longPress + @param {Event} event + + Dispatched when a press lasts for longer than (@link longPressTimeout} + */ + + /** + @event + @name pressCancel @param {Event} event Dispatched when a press is canceled. This could be because the pointer @@ -67,6 +75,35 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m } }, + /** + Cancel the current press. + + Can be used in a "longPress" event handler to prevent the "press" event + being fired. + @returns Boolean true if a press was canceled, false if the composer was + already in a unpressed or canceled state. + */ + cancelPress: { + value: function() { + if (this._state === PressComposer.PRESSED) { + this._dispatchPressCancel(); + this._endInteraction(); + return true; + } + return false; + } + }, + + // Optimisation so that we don't set a timeout if we do not need to + addEventListener: { + value: function(type, listener, useCapture) { + Composer.addEventListener.call(this, type, listener, useCapture); + if (type === "longPress") { + this._shouldDispatchLongPress = true; + } + } + }, + UNPRESSED: { value: 0 }, @@ -87,6 +124,34 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m } }, + _shouldDispatchLongPress: { + enumerable: false, + value: false + }, + + _longPressTimeout: { + enumerable: false, + value: 1000 + }, + /** + How long a press has to last for a longPress event to be dispatched + */ + longPressTimeout: { + get: function() { + return this._longPressTimeout; + }, + set: function(value) { + if (this._longPressTimeout !== value) { + this._longPressTimeout = value; + } + } + }, + + _longPressTimer: { + enumberable: false, + value: null + }, + // Magic /** @@ -140,7 +205,7 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m this.component.eventManager.claimPointer(this._observedPointer, this); - this._dispatchPressstart(event); + this._dispatchPressStart(event); } }, @@ -165,12 +230,12 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m while (target !== this._element && target && target.parentNode) { target = target.parentNode; } - isTarget = target === this.component.element; + isTarget = target === this._element; if (isSurrendered && event.type === "click") { // Pointer surrendered, so prevent the default action event.preventDefault(); - // No need to dispatch an event as presscancel was dispatched + // No need to dispatch an event as pressCancel was dispatched // in surrenderPointer, just end the interaction. this._endInteraction(event); return; @@ -183,7 +248,7 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m } if (!isSurrendered && !isTarget && event.type === "mouseup") { - this._dispatchPresscancel(event); + this._dispatchPressCancel(event); this._endInteraction(event); return; } @@ -247,7 +312,7 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m return false; } - this._dispatchPresscancel(); + this._dispatchPressCancel(); return true; } }, @@ -280,7 +345,7 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m value: function(event) { if (this._observedPointer === null || this._changedTouchisObserved(event.changedTouches) !== false) { if (this.component.eventManager.isPointerClaimedByComponent(this._observedPointer, this)) { - this._dispatchPresscancel(event); + this._dispatchPressCancel(event); } this._endInteraction(event); } @@ -331,14 +396,21 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m }, /** - Dispatch the pressstart event + Dispatch the pressStart event @private */ - _dispatchPressstart: { + _dispatchPressStart: { enumerable: false, value: function (event) { this._state = PressComposer.PRESSED; - this.dispatchEvent(this._createPressEvent("pressstart", event)); + this.dispatchEvent(this._createPressEvent("pressStart", event)); + + if (this._shouldDispatchLongPress) { + var self = this; + this._longPressTimer = setTimeout(function () { + self._dispatchLongPress(); + }, this._longPressTimeout); + } } }, @@ -349,20 +421,44 @@ var PressComposer = exports.PressComposer = Montage.create(Composer,/** @lends m _dispatchPress: { enumerable: false, value: function (event) { + if (this._shouldDispatchLongPress) { + clearTimeout(this._longPressTimer); + this._longPressTimer = null; + } + this.dispatchEvent(this._createPressEvent("press", event)); this._state = PressComposer.UNPRESSED; } }, /** - Dispatch the presscancel event + Dispatch the long press event + @private + */ + _dispatchLongPress: { + enumerable: false, + value: function (event) { + if (this._shouldDispatchLongPress) { + this.dispatchEvent(this._createPressEvent("longPress", event)); + this._longPressTimer = null; + } + } + }, + + /** + Dispatch the pressCancel event @private */ - _dispatchPresscancel: { + _dispatchPressCancel: { enumerable: false, value: function (event) { + if (this._shouldDispatchLongPress) { + clearTimeout(this._longPressTimer); + this._longPressTimer = null; + } + this._state = PressComposer.CANCELLED; - this.dispatchEvent(this._createPressEvent("presscancel", event)); + this.dispatchEvent(this._createPressEvent("pressCancel", event)); } } diff --git a/node_modules/montage/ui/composer/translate-composer.js b/node_modules/montage/ui/composer/translate-composer.js index 4ce165dc..6e762af9 100644 --- a/node_modules/montage/ui/composer/translate-composer.js +++ b/node_modules/montage/ui/composer/translate-composer.js @@ -4,7 +4,7 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ /** - @module montage/ui/composer/long-press-composer + @module montage/ui/composer/translate-composer @requires montage @requires montage/ui/composer/composer */ @@ -66,6 +66,11 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** value: null }, + _shouldDispatchTranslate: { + value: false, + enumerable: false + }, + _isSelfUpdate: { enumerable: false, value: false @@ -203,7 +208,19 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** } }, - invertAxis: {value: null}, + _invertAxis: { + value: false, + enumerable: false + }, + + invertAxis: { + get: function() { + return this._invertAxis; + }, + set: function(value) { + this._invertAxis=value?true:false; + } + }, _hasMomentum: { enumerable: false, @@ -233,33 +250,34 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** } }, - _momentumDuration: { + __momentumDuration: { enumerable: false, value: 650 }, - momentumDuration: { + _momentumDuration: { get: function () { - return this._momentumDuration; + return this.__momentumDuration; }, set: function (value) { - this._momentumDuration=isNaN(value)?1:value>>0; - if (this._momentumDuration<1) this._momentumDuration=1; - } + this.__momentumDuration=isNaN(value)?1:value>>0; + if (this.__momentumDuration<1) this.__momentumDuration=1; + }, + enumerable: false }, - _bouncingDuration: { + __bouncingDuration: { enumerable: false, value: 750 }, - bouncingDuration: { + _bouncingDuration: { get: function () { - return this._bouncingDuration; + return this.__bouncingDuration; }, set: function (value) { - this._bouncingDuration=isNaN(value)?1:value>>0; - if (this._bouncingDuration<1) this._bouncingDuration=1; + this.__bouncingDuration=isNaN(value)?1:value>>0; + if (this.__bouncingDuration<1) this.__bouncingDuration=1; } }, @@ -538,38 +556,44 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** value: function (event) { var self = this; + var oldTranslateY = this._translateY; this.translateY = this._translateY - (event.wheelDeltaY * 20) / 120; this._dispatchTranslateStart(); window.clearTimeout(this._translateEndTimeout); this._translateEndTimeout = window.setTimeout(function () { self._dispatchTranslateEnd(); }, 400); - event.preventDefault(); + + // If we're not at one of the extremes (i.e. the scroll actully + // changed the translate) then we want to preventDefault to stop + // the page scrolling. + if (oldTranslateY !== this._translateY) { + event.preventDefault(); + } } }, _move: { enumerable: false, value: function (x, y) { - + var pointerDelta; this._isSelfUpdate=true; - var delta; if (this._axis!="vertical") { - var delta = this.invertAxis ? (x-this._pointerX) : (this._pointerX-x); + pointerDelta = this._invertAxis ? (this._pointerX-x) : (x-this._pointerX); if ((this._translateX<0)||(this._translateX>this._maxTranslateX)) { - this.translateX+=(delta/2)*this._pointerSpeedMultiplier; + this.translateX+=((pointerDelta)/2)*this._pointerSpeedMultiplier; } else { - this.translateX+=(delta)*this._pointerSpeedMultiplier; + this.translateX+=(pointerDelta)*this._pointerSpeedMultiplier; } } if (this._axis!="horizontal") { + pointerDelta = this._invertAxis ? (this._pointerY-y) : (y-this._pointerY); if ((this._translateY<0)||(this._translateY>this._maxTranslateY)) { - this.translateY+=((this._pointerY-y)/2)*this._pointerSpeedMultiplier; + this.translateY+=((pointerDelta)/2)*this._pointerSpeedMultiplier; } else { - this.translateY+=(this._pointerY-y)*this._pointerSpeedMultiplier; + this.translateY+=(pointerDelta)*this._pointerSpeedMultiplier; } } - this._isSelfUpdate=false; this._pointerX=x; this._pointerY=y; @@ -577,6 +601,9 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** this._dispatchTranslateStart(); this._isFirstMove = false; } + if (this._shouldDispatchTranslate) { + this._dispatchTranslate(); + } } }, @@ -627,6 +654,17 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** } }, + _dispatchTranslate: { + enumerable: false, + value: function() { + var translateEvent = document.createEvent("CustomEvent"); + translateEvent.initCustomEvent("translate", true, true, null); + translateEvent.translateX = this._translateX; + translateEvent.translateY = this._translateY; + this.dispatchEvent(translateEvent); + } + }, + _end: { enumerable: false, @@ -662,8 +700,8 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** } else { momentumY=0; } - endX=startX-(momentumX*this._momentumDuration/2000); - endY=startY-(momentumY*this._momentumDuration/2000); + endX=startX-(momentumX*this.__momentumDuration/2000); + endY=startY-(momentumY*this.__momentumDuration/2000); animateMomentum=true; } @@ -672,9 +710,9 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** if (animateMomentum) { t=time-startTime; - if (tself._bouncingDuration) { - t=self._bouncingDuration; + if ((tself.__bouncingDuration) { + t=self.__bouncingDuration; } - tmpX=tmpX*(1-self._bezierTValue(t/self._bouncingDuration, .17, .93, .19, 1)); + tmpX=tmpX*(1-self._bezierTValue(t/self.__bouncingDuration, .17, .93, .19, 1)); } else { tmpX=0; animateBouncingX=false; @@ -712,11 +750,11 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** startTimeBounceY=time; } t=time-startTimeBounceY; - if ((tself._bouncingDuration) { - t=self._bouncingDuration; + if ((tself.__bouncingDuration) { + t=self.__bouncingDuration; } - tmpY=tmpY*(1-self._bezierTValue(t/self._bouncingDuration, .17, .93, .19, 1)); + tmpY=tmpY*(1-self._bezierTValue(t/self.__bouncingDuration, .17, .93, .19, 1)); } else { tmpY=0; animateBouncingY=false; @@ -733,11 +771,11 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** startTimeBounceX=time; } t=time-startTimeBounceX; - if ((tself._bouncingDuration) { - t=self._bouncingDuration; + if ((tself.__bouncingDuration) { + t=self.__bouncingDuration; } - tmpX=self._maxTranslateX+(tmpX-self._maxTranslateX)*(1-self._bezierTValue(t/self._bouncingDuration, .17, .93, .19, 1)); + tmpX=self._maxTranslateX+(tmpX-self._maxTranslateX)*(1-self._bezierTValue(t/self.__bouncingDuration, .17, .93, .19, 1)); } else { tmpX=self._maxTranslateX; animateBouncingX=false; @@ -754,11 +792,11 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** startTimeBounceY=time; } t=time-startTimeBounceY; - if ((tself._bouncingDuration) { - t=self._bouncingDuration; + if ((tself.__bouncingDuration) { + t=self.__bouncingDuration; } - tmpY=self._maxTranslateY+(tmpY-self._maxTranslateY)*(1-self._bezierTValue(t/self._bouncingDuration, .17, .93, .19, 1)); + tmpY=self._maxTranslateY+(tmpY-self._maxTranslateY)*(1-self._bezierTValue(t/self.__bouncingDuration, .17, .93, .19, 1)); } else { tmpY=self._maxTranslateY; animateBouncingY=false; @@ -809,6 +847,15 @@ var TranslateComposer = exports.TranslateComposer = Montage.create(Composer,/** this.eventManager.isStoringPointerEvents = true; } + }, + + addEventListener: { + value: function(type, listener, useCapture) { + Composer.addEventListener.call(this, type, listener, useCapture); + if (type === "translate") { + this._shouldDispatchTranslate = true; + } + } } }); diff --git a/node_modules/montage/ui/condition.reel/condition.js b/node_modules/montage/ui/condition.reel/condition.js index 064f51b7..bcb0e957 100755 --- a/node_modules/montage/ui/condition.reel/condition.js +++ b/node_modules/montage/ui/condition.reel/condition.js @@ -148,7 +148,7 @@ exports.Condition = Montage.create(Component, /** @lends module:"montage/ui/cond this.content = document.createElement("div"); childList = Array.prototype.slice.call(this._element.childNodes, 0); for (i = 0; (childElement = childList[i]); i++) { - childElement.parentElement.removeChild(childElement); + childElement.parentNode.removeChild(childElement); this.content.appendChild(childElement); } } diff --git a/node_modules/montage/ui/flow-bezier-spline.js b/node_modules/montage/ui/flow-bezier-spline.js new file mode 100755 index 00000000..5f2a9e76 --- /dev/null +++ b/node_modules/montage/ui/flow-bezier-spline.js @@ -0,0 +1,405 @@ +var Montage = require("montage").Montage, + FlowBezierSpline = exports.FlowBezierSpline = Montage.create(Montage, { + + knots: { + get: function () { + if (!this._knots) { + this._knots = []; + } + return this._knots; + }, + set: function (value) { + this._knots = value; + } + }, + + previousHandlers: { + get: function () { + if (!this._previousHandlers) { + this._previousHandlers = []; + } + return this._previousHandlers; + }, + set: function (value) { + this._previousHandlers = value; + } + }, + + nextHandlers: { + get: function () { + if (!this._nextHandlers) { + this._nextHandlers = []; + } + return this._nextHandlers; + }, + set: function (value) { + this._nextHandlers = value; + } + }, + + densities: { + get: function () { + if (!this._densities) { + this._densities = []; + } + return this._densities; + }, + set: function (value) { + this._densities = value; + this._densitiesLength = this._densities.length; + this._densitySummation = null; + } + }, + + _parameters: { + value: { + rotateX: { + data: [0], + units: "rad" + }, + rotateY: { + data: [0], + units: "rad" + }, + rotateZ: { + data: [0], + units: "rad" + }, + opacity: { + data: [1], + units: "" + } + } + }, + + parameters: { + get: function () { + if (!this._parameters) { + this._parameters = []; + } + return this._parameters; + }, + set: function (value) { + this._parameters = value; + this._parametersLength = this._parameters.length; + } + }, + + knotsLength: { + get: function () { + if (!this._knots) { + return 0; + } + return this._knots.length; + }, + set: function () {} + }, + + getKnot: { + value: function (index) { + return this._knots[index]; + } + }, + + getPreviousHandler: { + value: function (index) { + return this._previousHandlers[index]; + } + }, + + getNextHandler: { + value: function (index) { + return this._nextHandlers[index]; + } + }, + + removeKnot: { + value: function (index) { + this._knots.splice(index, 1); + this._nextHandlers.splice(index, 1); + this._previousHandlers.splice(index, 1); + this._densities.splice(index, 1); + } + }, + + maxTime: { + get: function () { + if (!this._densitySummation) { + this._computeDensitySummation(); + } + return this._densitySummation[this._densitySummation.length - 1]; + }, + set: function () {} + }, + + _computeDensitySummation: { + enumerable: false, + value: function () { + var length = this.densities.length - 1, + sum = 0, + i; + + this._densitySummation = []; + for (i = 0; i < length; i++) { + sum += (this._densities[i] + this._densities[i + 1]) / 2; + this._densitySummation[i] = sum; + } + } + }, + + getPositionAtTime: { + value: function (time) { + var p0, p1, p2, p3, + a, b, c, + t, y, + start, + parameters = {}, + i, j; + + if ((time >= 0) && (time < this.maxTime)) { + if (this._previousIndex && (time >= this._densitySummation[this._previousIndex - 1])) { + i = this._previousIndex; + } else { + i = 0; + } + while (time >= this._densitySummation[i]) { + i++; + } + this._previousIndex = i; + start = i ? this._densitySummation[i - 1] : 0; + p0 = this._knots[i], + p1 = this._nextHandlers[i], + p2 = this._previousHandlers[i + 1], + p3 = this._knots[i + 1], + a = this._densities[i], + b = this._densities[i + 1], + c = a - b; + if ((c < -1e-10) || (c > 1e-10)) { + t = (a - Math.sqrt(a * a + (b - a) * 2 * (time - start))) / c; + } else { + t = (time - start) / a; + } + y = 1 - t; + // TODO: Redo this and create getParametersAtTime or getPositionAndParametersAtTime + for (j in this._parameters) { + if (this._parameters.hasOwnProperty(j)) { + if ((typeof this._parameters[j].data[i] !== "undefined") && (typeof this._parameters[j].data[i + 1] !== "undefined")) { + parameters[j] = (this._parameters[j].data[i] * y + this._parameters[j].data[i + 1] * t) + this._parameters[j].units; + } else { + parameters[j] = this._parameters[j].data[this._parameters[j].data.length - 1] + this._parameters[j].units; + } + } + } + return [ + p0[0]*(y*y*y)+p1[0]*(y*y*t*3)+p2[0]*(y*t*t*3)+p3[0]*(t*t*t), + p0[1]*(y*y*y)+p1[1]*(y*y*t*3)+p2[1]*(y*t*t*3)+p3[1]*(t*t*t), + p0[2]*(y*y*y)+p1[2]*(y*y*t*3)+p2[2]*(y*t*t*3)+p3[2]*(t*t*t), + parameters + ]; + } else { + return null; + } + } + }, + + transformVectorArray: { + value: function (vectors, matrix) { + var length = vectors.length, + out = [], + iVector, + i; + + for (i = 0; i < length; i++) { + iVector = vectors[i]; + out[i] = [ + iVector[0] * matrix[0] + iVector[1] * matrix[4] + iVector[2] * matrix [8] + matrix[12], + iVector[0] * matrix[1] + iVector[1] * matrix[5] + iVector[2] * matrix [9] + matrix[13], + iVector[0] * matrix[2] + iVector[1] * matrix[6] + iVector[2] * matrix [10] + matrix[14] + ]; + } + return out; + } + }, + + transform: { + value: function (matrix) { + var spline = Montage.create(FlowBezierSpline); + + spline._densities = this._densities; + spline._knots = this.transformVectorArray(this.knots, matrix); + spline._previousHandlers = this.transformVectorArray(this.previousHandlers, matrix); + spline._nextHandlers = this.transformVectorArray(this.nextHandlers, matrix); + return spline; + } + }, + + deCasteljau: { + value: function (b0, b1, b2, b3, t) { + var t1 = 1 - t, + p1x = t1 * b0[0] + t * b1[0], p2x = t1 * b1[0] + t * b2[0], p3x = t1 * b2[0] + t * b3[0], + p4x = t1 * p1x + t * p2x, p5x = t1 * p2x + t * p3x, p6x = t1 * p4x + t * p5x, + p1y = t1 * b0[1] + t * b1[1], p2y = t1 * b1[1] + t * b2[1], p3y = t1 * b2[1] + t * b3[1], + p4y = t1 * p1y + t * p2y, p5y = t1 * p2y + t * p3y, p6y = t1 * p4y + t * p5y, + p1z = t1 * b0[2] + t * b1[2], p2z = t1 * b1[2] + t * b2[2], p3z = t1 * b2[2] + t * b3[2], + p4z = t1 * p1z + t * p2z, p5z = t1 * p2z + t * p3z, p6z = t1 * p4z + t * p5z; + + return [ + [b0, [p1x, p1y, p1z], [p4x, p4y, p4z], [p6x, p6y, p6z]], + [[p6x, p6y, p6z], [p5x, p5y, p5z], [p3x, p3y, p3z], b3] + ]; + } + }, + + cubic: { + enumerable: false, + value: function (a, b, c, d, x) { + return ((a * x + b) * x + c) * x + d; + } + }, + + cubeRoot: { + enumerable: false, + value: function (value) { + return (value > 0) ? Math.pow(value, 1/3) : -Math.pow(-value, 1/3); + } + }, + + cubicRealRoots: { + enumerable: false, + value: function (a, b, c, d) { + var epsilon = 1e-100; + + if ((a < -epsilon) || (a > epsilon)) { + var dv = 1 / a, + A = b * dv, + B = c * dv, + Q = (3 * B - A * A) * (1 / 9), + R = (4.5 * A * B - 13.5 * d * dv - A * A * A) * (1 / 27), + D = Q * Q * Q + R * R; + + if (D > epsilon) { + var sqD = Math.sqrt(D); + + return [this.cubeRoot(R + sqD) + this.cubeRoot(R - sqD) + A * (-1 / 3)]; + } else { + if (D > -epsilon) { + if ((R < -epsilon) || (R > epsilon)) { + var S = this.cubeRoot(R), + r1 = S * 2 + A * (-1 / 3), + r2 = A * (-1 / 3) - S; + + if (r1 < r2) { + return [r1, r2]; + } else { + return [r2, r1]; + } + } else { + return [A * (-1 / 3)]; + } + } else { + var O = Math.acos(R / Math.sqrt(-Q * Q * Q)) * (1 / 3), + tmp1 = Math.sqrt(-Q), + sinO = tmp1 * Math.sin(O) * 1.7320508075688772, + tmp2 = A * (-1 / 3); + + tmp1 *= Math.cos(O); + return [tmp2 - tmp1 - sinO, tmp2 - tmp1 + sinO, tmp2 + tmp1 * 2]; + } + } + } else { + if ((b < -epsilon) || (b > epsilon)) { + var sq = c * c - 4 * b * d; + + if (sq >= 0) { + sq = Math.sqrt(sq); + return [(-c - sq) / (2 * b), (sq - c) / (2 * b)]; + } else { + return []; + } + } else { + if ((c < -epsilon) || (c > epsilon)) { + return [-d / c]; + } else { + return []; + } + } + } + } + }, + + reflectionMatrix: { + enumerable: false, + value: function (planeNormal) { + var angleZ = Math.PI/2 - Math.atan2(planeNormal[1], planeNormal[0]), + p1 = planeNormal[0] * Math.sin(angleZ) + planeNormal[1] * Math.cos(angleZ), + p2 = planeNormal[2], + angleX = Math.PI/2 - Math.atan2(p2, p1); + + return [Math.sin(angleX) * Math.sin(angleZ), Math.cos(angleZ) * Math.sin(angleX), Math.cos(angleX)]; + } + }, + + reflectedY: { + enumerable: false, + value: function (x, y, z, matrix) { + return x * matrix[0] + y * matrix[1] + z * matrix[2]; + } + }, + + planeBezierIntersection: { + enumerable: false, + value: function (planeOrigin, planeNormal, b0, b1, b2, b3) { + var matrix = this.reflectionMatrix(planeNormal), // TODO: cache for matrix and cache for cubicRealRoots + d = this.reflectedY(b0[0] - planeOrigin[0], b0[1] - planeOrigin[1], b0[2] - planeOrigin[2], matrix), + r1 = this.reflectedY(b1[0] - planeOrigin[0], b1[1] - planeOrigin[1], b1[2] - planeOrigin[2], matrix), + r2 = this.reflectedY(b2[0] - planeOrigin[0], b2[1] - planeOrigin[1], b2[2] - planeOrigin[2], matrix), + r3 = this.reflectedY(b3[0] - planeOrigin[0], b3[1] - planeOrigin[1], b3[2] - planeOrigin[2], matrix); + + return this.cubicRealRoots( + (r1 - r2) * 3 + r3 - d, + (d + r2) * 3 - 6 * r1, + (r1 - d) * 3, + d + ); + } + }, + + directedPlaneBezierIntersection: { + enumerable: false, + value: function (planeOrigin, planeNormal, b0, b1, b2, b3) { + var matrix = this.reflectionMatrix(planeNormal), // TODO: cache for matrix and cache for cubicRealRoots + d = this.reflectedY(b0[0] - planeOrigin[0], b0[1] - planeOrigin[1], b0[2] - planeOrigin[2], matrix), + r1 = this.reflectedY(b1[0] - planeOrigin[0], b1[1] - planeOrigin[1], b1[2] - planeOrigin[2], matrix), + r2 = this.reflectedY(b2[0] - planeOrigin[0], b2[1] - planeOrigin[1], b2[2] - planeOrigin[2], matrix), + r3 = this.reflectedY(b3[0] - planeOrigin[0], b3[1] - planeOrigin[1], b3[2] - planeOrigin[2], matrix), + a = (r1 - r2) * 3 + r3 - d, + b = (d + r2) * 3 - 6 * r1, + c = (r1 - d) * 3, + r = this.cubicRealRoots(a, b, c, d), + min, + max = 0, + mid, + i = 0, + segments = []; + + while ((i < r.length) && (r[i] <= 0)) { + i++; + } + while ((i < r.length) && (r[i] < 1)) { + min = max; + max = r[i]; + mid = (min + max) * .5; + if (this.cubic(a, b, c, d, mid) >= 0) { + segments.push([min, max]); + } + i++; + } + mid = (max + 1) * .5; + if (this.cubic(a, b, c, d, mid) >= 0) { + segments.push([max, 1]); + } + + return segments; + } + } +}); \ No newline at end of file diff --git a/node_modules/montage/ui/flow-path-cubic.js b/node_modules/montage/ui/flow-path-cubic.js deleted file mode 100644 index ec4c6600..00000000 --- a/node_modules/montage/ui/flow-path-cubic.js +++ /dev/null @@ -1,115 +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. -
*/ - -var Montage = require("montage").Montage; - -var FlowPathCubic = exports.FlowPathCubic = Montage.create(Montage, { - - _variable: { - enumerable: false, - value: "time" - }, - - variable: { - get: function () { - return this._variable; - }, - set: function (value) { - switch (value) { - case "speed": - case "index": - this._variable = value; - break; - default: - this._variable = "time"; - } - this._updatePath(); - } - }, - - _a: { - enumerable: false, - value: 0 - }, - - a: { - get: function () { - return this._a; - }, - set: function (value) { - this._a = value; - this._updatePath(); - } - }, - - _b: { - enumerable: false, - value: 0 - }, - - b: { - get: function () { - return this._b; - }, - set: function (value) { - this._b = value; - this._updatePath(); - } - }, - - _c: { - enumerable: false, - value: 0 - }, - - c: { - get: function () { - return this._c; - }, - set: function (value) { - this._c = value; - this._updatePath(); - } - }, - - _d: { - enumerable: false, - value: 0 - }, - - d: { - get: function () { - return this._d; - }, - set: function (value) { - this._d = value; - this._updatePath(); - } - }, - - _path: { - enumerable: false, - value: "0" - }, - - path: { - get: function () { - return this._path; - }, - set: function (value) { - this._path = value; - } - }, - - _updatePath: { - enumerable: false, - value: function () { - var s = "slide."+this._variable; - - this.path = "("+this._a+")*"+s+"*"+s+"*"+s+"+("+this._b+")*"+s+"*"+s+"+("+this._c+")*"+s+"+("+this._d+")"; - } - } -}); diff --git a/node_modules/montage/ui/flow-path-lerp.js b/node_modules/montage/ui/flow-path-lerp.js deleted file mode 100644 index bc550500..00000000 --- a/node_modules/montage/ui/flow-path-lerp.js +++ /dev/null @@ -1,112 +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. -
*/ - -var Montage = require("montage").Montage; - -var FlowPathLerp = exports.FlowPathLerp = Montage.create(Montage, { - - _path1: { - enumerable: false, - value: null - }, - - _path2: { - enumerable: false, - value: null - }, - - _interpolant: { - enumerable: false, - value: 0 - }, - - path1: { - get: function () { - return this._path1; - }, - set: function (value) { - this._path1 = value; - this.resultPath = true; - } - }, - - path2: { - get: function () { - return this._path2; - }, - set: function (value) { - this._path2 = value; - this.resultPath = true; - } - }, - - interpolant: { - get: function () { - return this._interpolant; - }, - set: function (value) { - this._interpolant = value; - this.resultPath = true; - } - }, - - _resultPath: { - enumerable: false, - value: null - }, - - resultPath: { - get: function () { - return this._resultPath; - }, - set: function () { - var self = this; - - this._resultPath =