From 24b483db367291b72170f969de78efcb1a9b95bd Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 3 May 2012 22:53:07 -0700 Subject: integrating the latest montage version Signed-off-by: Valerio Virgillito --- node_modules/montage/core/deserializer.js | 14 +- node_modules/montage/core/event/event-manager.js | 28 - node_modules/montage/core/logger.js | 2 +- node_modules/montage/core/serializer.js | 18 +- .../examples/feed-reader/images/07-map-marker.png | Bin 3131 -> 0 bytes .../examples/feed-reader/images/10-medical.png | Bin 2915 -> 0 bytes .../examples/feed-reader/images/100-coffee.png | Bin 2958 -> 0 bytes .../examples/feed-reader/images/107-widescreen.png | Bin 2986 -> 0 bytes .../examples/feed-reader/images/125-food.png | Bin 3038 -> 0 bytes .../feed-reader/images/142-wine-bottle.png | Bin 187 -> 0 bytes .../examples/feed-reader/images/34-coffee.png | Bin 3052 -> 0 bytes .../examples/feed-reader/images/35-shopping.png | Bin 2970 -> 0 bytes .../examples/feed-reader/images/38-airplane.png | Bin 3004 -> 0 bytes .../feed-reader/images/41-picture-frame.png | Bin 2928 -> 0 bytes .../examples/feed-reader/images/47-fuel.png | Bin 3091 -> 0 bytes .../feed-reader/images/48-fork-and-knife.png | Bin 2882 -> 0 bytes .../feed-reader/images/80-shopping-cart.png | Bin 2963 -> 0 bytes .../examples/feed-reader/images/87-wine-glass.png | Bin 2983 -> 0 bytes .../examples/feed-reader/images/88-beer-mug.png | Bin 3087 -> 0 bytes .../montage/examples/feed-reader/index.html | 81 --- .../examples/feed-reader/main.reel/main.html | 274 --------- .../montage/examples/feed-reader/main.reel/main.js | 55 -- .../examples/feed-reader/map-example.reel/main.css | 2 - .../feed-reader/map-example.reel/main.html | 58 -- .../examples/feed-reader/map-example.reel/main.js | 24 - .../montage/examples/feed-reader/package.json | 10 - .../examples/youtube-channel-example/index.html | 45 -- .../examples/youtube-channel-example/package.json | 7 - .../examples/youtube-channel-example/style.css | 47 -- .../youtube-channel-example.js | 8 - node_modules/montage/montage.js | 10 +- node_modules/montage/package.json | 2 +- node_modules/montage/ui/anchor.reel/anchor.js | 78 ++- node_modules/montage/ui/application.js | 4 +- .../autocomplete.reel/autocomplete.css | 12 + .../autocomplete.reel/autocomplete.html | 10 + .../autocomplete/autocomplete.reel/autocomplete.js | 498 ++++++++++++++++ .../ui/autocomplete/autocomplete.reel/loading.gif | Bin 0 -> 1456 bytes .../results-list.reel/results-list.css | 30 + .../results-list.reel/results-list.html | 62 ++ .../autocomplete/results-list.reel/results-list.js | 16 + .../bluemoon/button-group.reel/button-group.html | 3 +- .../montage/ui/bluemoon/button.reel/button.html | 3 +- .../ui/bluemoon/progress.reel/progress.html | 7 +- .../montage/ui/bluemoon/slider.reel/slider.html | 35 +- node_modules/montage/ui/button.reel/button.js | 214 +++++-- node_modules/montage/ui/check-input.js | 23 +- node_modules/montage/ui/checkbox.reel/checkbox.js | 63 +- node_modules/montage/ui/component.js | 201 ++++--- node_modules/montage/ui/composer/composer.js | 45 +- node_modules/montage/ui/composer/press-composer.js | 28 +- .../montage/ui/composer/translate-composer.js | 641 +++++++++++---------- .../montage/ui/controller/array-controller.js | 1 - .../montage/ui/date-input.reel/date-input.js | 33 +- .../ui/dynamic-element.reel/dynamic-element.js | 143 +++++ .../montage/ui/dynamic-text.reel/dynamic-text.js | 45 +- 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 | 38 +- node_modules/montage/ui/flow.reel/flow.js | 482 +++------------- node_modules/montage/ui/image.reel/image.js | 36 +- node_modules/montage/ui/list.reel/list.html | 13 +- node_modules/montage/ui/loader.reel/loader.js | 30 +- .../ui/loading-panel.reel/loading-panel.html | 24 +- node_modules/montage/ui/loading.reel/loading.html | 5 +- node_modules/montage/ui/native-control.js | 185 ++++-- .../montage/ui/number-input.reel/number-input.js | 32 +- .../montage/ui/popup/alert.reel/alert.html | 25 +- .../montage/ui/popup/confirm.reel/confirm.html | 24 +- .../montage/ui/popup/notifier.reel/notifier.html | 7 +- node_modules/montage/ui/popup/popup.reel/popup.css | 20 +- .../montage/ui/popup/popup.reel/popup.html | 12 +- node_modules/montage/ui/popup/popup.reel/popup.js | 16 +- node_modules/montage/ui/progress.reel/progress.js | 34 +- .../montage/ui/radio-button.reel/radio-button.js | 65 ++- .../montage/ui/range-input.reel/range-input.js | 31 +- .../rich-text-linkpopup.html | 10 +- .../rich-text-linkpopup.js | 1 + .../rich-text-resizer.reel/rich-text-resizer.css | 32 +- .../rich-text-resizer.reel/rich-text-resizer.html | 26 +- .../rich-text-resizer.reel/rich-text-resizer.js | 10 +- .../rich-text-editor.reel/rich-text-editor-base.js | 34 +- .../rich-text-editor.reel/rich-text-editor.html | 10 +- .../rich-text-editor.reel/rich-text-editor.js | 223 ++++--- .../montage/ui/scroll-bars.reel/scroll-bars.html | 17 +- .../montage/ui/scroller.reel/scroller.html | 26 +- node_modules/montage/ui/scroller.reel/scroller.js | 21 +- .../montage/ui/scrollview.reel/scrollview.js | 193 +------ .../montage/ui/select-input.reel/select-input.js | 86 ++- node_modules/montage/ui/tabs.reel/tabs.html | 12 +- node_modules/montage/ui/text-input.js | 148 ++--- node_modules/montage/ui/textarea.reel/textarea.js | 94 ++- .../montage/ui/textfield.reel/textfield.js | 14 +- .../montage/ui/toggle-button.reel/toggle-button.js | 74 +-- .../montage/ui/video-player.reel/video-player.html | 97 ++-- 98 files changed, 3461 insertions(+), 2299 deletions(-) delete mode 100644 node_modules/montage/examples/feed-reader/images/07-map-marker.png delete mode 100644 node_modules/montage/examples/feed-reader/images/10-medical.png delete mode 100644 node_modules/montage/examples/feed-reader/images/100-coffee.png delete mode 100644 node_modules/montage/examples/feed-reader/images/107-widescreen.png delete mode 100644 node_modules/montage/examples/feed-reader/images/125-food.png delete mode 100644 node_modules/montage/examples/feed-reader/images/142-wine-bottle.png delete mode 100644 node_modules/montage/examples/feed-reader/images/34-coffee.png delete mode 100644 node_modules/montage/examples/feed-reader/images/35-shopping.png delete mode 100644 node_modules/montage/examples/feed-reader/images/38-airplane.png delete mode 100644 node_modules/montage/examples/feed-reader/images/41-picture-frame.png delete mode 100644 node_modules/montage/examples/feed-reader/images/47-fuel.png delete mode 100644 node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png delete mode 100644 node_modules/montage/examples/feed-reader/images/80-shopping-cart.png delete mode 100644 node_modules/montage/examples/feed-reader/images/87-wine-glass.png delete mode 100644 node_modules/montage/examples/feed-reader/images/88-beer-mug.png delete mode 100644 node_modules/montage/examples/feed-reader/index.html delete mode 100644 node_modules/montage/examples/feed-reader/main.reel/main.html delete mode 100644 node_modules/montage/examples/feed-reader/main.reel/main.js delete mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.css delete mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.html delete mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.js delete mode 100644 node_modules/montage/examples/feed-reader/package.json delete mode 100755 node_modules/montage/examples/youtube-channel-example/index.html delete mode 100755 node_modules/montage/examples/youtube-channel-example/package.json delete mode 100755 node_modules/montage/examples/youtube-channel-example/style.css delete mode 100755 node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js create mode 100644 node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.css create mode 100644 node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html create mode 100644 node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js create mode 100644 node_modules/montage/ui/autocomplete/autocomplete.reel/loading.gif create mode 100644 node_modules/montage/ui/autocomplete/results-list.reel/results-list.css create mode 100644 node_modules/montage/ui/autocomplete/results-list.reel/results-list.html create mode 100644 node_modules/montage/ui/autocomplete/results-list.reel/results-list.js mode change 100755 => 100644 node_modules/montage/ui/controller/array-controller.js create mode 100644 node_modules/montage/ui/dynamic-element.reel/dynamic-element.js create mode 100644 node_modules/montage/ui/flow-path-cubic.js create mode 100644 node_modules/montage/ui/flow-path-lerp.js create mode 100644 node_modules/montage/ui/flow-path-linear.js create mode 100644 node_modules/montage/ui/flow-path-sigmoid.js create mode 100644 node_modules/montage/ui/flow-path.js (limited to 'node_modules/montage') diff --git a/node_modules/montage/core/deserializer.js b/node_modules/montage/core/deserializer.js index b8ed5618..c1c97b2b 100755 --- a/node_modules/montage/core/deserializer.js +++ b/node_modules/montage/core/deserializer.js @@ -332,11 +332,6 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri @param {Array} properties The property names to be deserialized. */ deserializePropertiesForObject: {value: function(object, properties) { - // TODO: ensure backward compatibility - if (properties && "childComponents" in properties) { - properties.childComponents = []; - console.log('Warning: "childComponents" isn\'t supported on components within the current serializaation format, this property will be reset to [].'); - } for (var key in properties) { object[key] = properties[key]; } @@ -846,8 +841,7 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri if (id) { return 'element.getElementById("' + id + '")'; } else { - // TODO: getElemenyById only here for backwards compatibility - return 'element.querySelector(\'*[' + Deserializer._MONTAGE_ID_ATTRIBUTE + '="' + value + '"]\') || element.getElementById("' + value + '")'; + return 'element.querySelector(\'*[' + Deserializer._MONTAGE_ID_ATTRIBUTE + '="' + value + '"]\')'; } break; @@ -859,7 +853,8 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri break; case "reference": - var object; + var object, + originalValue = value; if (value in exports) { object = exports[value]; @@ -874,6 +869,9 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri if (parent) { parent[key] = object; } + if (typeof object === "undefined") { + logger.error("Missing object in serialization: '" + originalValue + "'" + (self._origin ? " in " + self._origin : "")); + } return value; break; diff --git a/node_modules/montage/core/event/event-manager.js b/node_modules/montage/core/event/event-manager.js index 75272f85..d38b9755 100755 --- a/node_modules/montage/core/event/event-manager.js +++ b/node_modules/montage/core/event/event-manager.js @@ -332,29 +332,6 @@ var EventManager = exports.EventManager = Montage.create(Montage,/** @lends modu this._application = application; } }, -/** - @function - @param {String} composer Event composer. - @param {Array} eventType Event type array. - */ - registerComposer_forEventType_: { - enumerable: false, - value: function(composer, eventType) { - - if (!!this._registeredEventComposers[eventType]) { - throw "Cannot register composer for eventType:" + eventType + ". Already have one registered."; - } - - this._registeredEventComposers[eventType] = composer; - } - }, -/** - @private -*/ - _registeredEventComposers: { - value: {}, - enumerable: false - }, // Dictionary keyed by event types with the collection of handlers per event type // This dictates why the event manager observes events of a particular type @@ -718,12 +695,7 @@ var EventManager = exports.EventManager = Montage.create(Montage,/** @lends modu } - // Inform any composers about this request if we need to synthesize this eventType if (isNewTarget && typeof target.nativeAddEventListener === "function") { - if (this._registeredEventComposers[eventType]) { - this._registeredEventComposers[eventType].startObservingTarget_forEventType_(target, eventType); - } - this._observeTarget_forEventType_(target, eventType); } diff --git a/node_modules/montage/core/logger.js b/node_modules/montage/core/logger.js index 26094e76..434aa4dd 100755 --- a/node_modules/montage/core/logger.js +++ b/node_modules/montage/core/logger.js @@ -408,7 +408,7 @@ LoggerUI = Montage.create(Montage, /** @lends module:montage/core/logger.LoggerU //YUCK!! I wish I could use a reel!!! var styleTest = "#_montage_logger_inspector {"; styleTest += " border: 1px solid rgba(15,15,15,0.4);"; - styleTest += " position: absolute;"; + styleTest += " position: fixed;"; styleTest += " right: 25px;"; styleTest += " top: 25px;"; styleTest += " -webkit-border-radius: 5px;"; diff --git a/node_modules/montage/core/serializer.js b/node_modules/montage/core/serializer.js index 74080770..ba2fa04a 100755 --- a/node_modules/montage/core/serializer.js +++ b/node_modules/montage/core/serializer.js @@ -458,6 +458,10 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se serializedUnits = {}; objectInfo = Montage.getInfoForObject(object); + if (!this._require) { + throw new Error("Cannot serialize Montage objects without a require function to identify the corresponding package."); + } + moduleId = this._require.identify( objectInfo.moduleId, objectInfo.require @@ -491,15 +495,6 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se if (!properties) { properties = object; propertyNames = Montage.getSerializablePropertyNames(object); - // HACK: only to be able to live together with serialization v1, remover after - var ix; - if ((ix = propertyNames.indexOf("_bindingDescriptors")) > -1) { - propertyNames.splice(ix, 1); - } - if ((ix = propertyNames.indexOf("_eventListenerDescriptors")) > -1) { - propertyNames.splice(ix, 1); - } - // end HACK } serializedUnits.properties = this._serializeObjectLiteral(properties, propertyNames, 3); } @@ -572,14 +567,13 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se */ _serializeElement: {value: function(element) { var attribute = element.getAttribute(this._MONTAGE_ID_ATTRIBUTE), - // TODO: element.id only here for backwards compatibility - id = attribute || element.id; + id = attribute; if (id) { this._externalElements.push(element); return '{"#":"' + id + '"}'; } else { - logger.error("Error: Not possible to serialize a DOM element with no id assigned: " + element.outerHTML); + logger.error("Error: Not possible to serialize a DOM element with no " + this._MONTAGE_ID_ATTRIBUTE + " assigned: " + element.outerHTML); } }}, diff --git a/node_modules/montage/examples/feed-reader/images/07-map-marker.png b/node_modules/montage/examples/feed-reader/images/07-map-marker.png deleted file mode 100644 index a5d99d69..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/07-map-marker.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/10-medical.png b/node_modules/montage/examples/feed-reader/images/10-medical.png deleted file mode 100644 index ab78c783..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/10-medical.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/100-coffee.png b/node_modules/montage/examples/feed-reader/images/100-coffee.png deleted file mode 100644 index 4e9c517a..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/100-coffee.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/107-widescreen.png b/node_modules/montage/examples/feed-reader/images/107-widescreen.png deleted file mode 100644 index 2e5f1ba7..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/107-widescreen.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/125-food.png b/node_modules/montage/examples/feed-reader/images/125-food.png deleted file mode 100644 index 81afd74a..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/125-food.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png b/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png deleted file mode 100644 index a7df9e97..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/34-coffee.png b/node_modules/montage/examples/feed-reader/images/34-coffee.png deleted file mode 100644 index 4c4bedad..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/34-coffee.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/35-shopping.png b/node_modules/montage/examples/feed-reader/images/35-shopping.png deleted file mode 100644 index 03689f99..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/35-shopping.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/38-airplane.png b/node_modules/montage/examples/feed-reader/images/38-airplane.png deleted file mode 100644 index dfcbbc78..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/38-airplane.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/41-picture-frame.png b/node_modules/montage/examples/feed-reader/images/41-picture-frame.png deleted file mode 100644 index 6deee997..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/41-picture-frame.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/47-fuel.png b/node_modules/montage/examples/feed-reader/images/47-fuel.png deleted file mode 100644 index 617d7640..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/47-fuel.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png b/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png deleted file mode 100644 index 06d91088..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/80-shopping-cart.png b/node_modules/montage/examples/feed-reader/images/80-shopping-cart.png deleted file mode 100644 index 51a5f86f..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/80-shopping-cart.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/87-wine-glass.png b/node_modules/montage/examples/feed-reader/images/87-wine-glass.png deleted file mode 100644 index b4d34474..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/87-wine-glass.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/images/88-beer-mug.png b/node_modules/montage/examples/feed-reader/images/88-beer-mug.png deleted file mode 100644 index b0fdd99a..00000000 Binary files a/node_modules/montage/examples/feed-reader/images/88-beer-mug.png and /dev/null differ diff --git a/node_modules/montage/examples/feed-reader/index.html b/node_modules/montage/examples/feed-reader/index.html deleted file mode 100644 index 3b5529b9..00000000 --- a/node_modules/montage/examples/feed-reader/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - Montage Feed Reader - - - - - - - - - - -

-

- -
-

- -
-

This is the bootstrapper content which will now be shown for at least 1500ms.

-
-
-

This is the loader content which will now be shown for at least 2000ms.

-
- - - - diff --git a/node_modules/montage/examples/feed-reader/main.reel/main.html b/node_modules/montage/examples/feed-reader/main.reel/main.html deleted file mode 100644 index 1313219f..00000000 --- a/node_modules/montage/examples/feed-reader/main.reel/main.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - Feed Reader Example - - - - - - - - - - -
- - - -
-
-
-

Top Stories Around you

-
- Feed URL: - -
-
-
-
- -
-
-

Find your way

-
- Location: - -
- Show: - -
- Show Traffic -
-
-
Map
-
- -
- -
- - -
- - - diff --git a/node_modules/montage/examples/feed-reader/main.reel/main.js b/node_modules/montage/examples/feed-reader/main.reel/main.js deleted file mode 100644 index 06d8fdba..00000000 --- a/node_modules/montage/examples/feed-reader/main.reel/main.js +++ /dev/null @@ -1,55 +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/core/core").Montage, - Component = require("montage/ui/component").Component; - -exports.Main = Montage.create(Component, { - - feedURL: { - value: 'http://rss.cnn.com/rss/cnn_mostpopular.rss', - distinct: true - }, - - mapCategory: { - get: function() { - return this._mapCategory; - }, - set: function(value) { - this._mapCategory = value; - this.map.category = value; - } - }, - - feedReader: {value: null}, - - map: {value: null}, - - mapCenter: {value: null}, - - handleGoAction: { - value: function(event) { - event.preventDefault(); - this.feedReader.feedURL = this.feedURL; - - } - }, - - handleMapButtonAction: { - value: function(event) { - event.preventDefault(); - this.map.center = this.mapCenter; - } - }, - - draw: { - value: function() { - if(this.mapCenter != null) { - this.map.center = this.mapCenter; - } - } - } - -}); diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.css b/node_modules/montage/examples/feed-reader/map-example.reel/main.css deleted file mode 100644 index 139597f9..00000000 --- a/node_modules/montage/examples/feed-reader/map-example.reel/main.css +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.html b/node_modules/montage/examples/feed-reader/map-example.reel/main.html deleted file mode 100644 index 889ca8d6..00000000 --- a/node_modules/montage/examples/feed-reader/map-example.reel/main.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Main Component - - - - - - - - -
-

Main component of application

-
-
-
- -
- - - diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.js b/node_modules/montage/examples/feed-reader/map-example.reel/main.js deleted file mode 100644 index 54b84425..00000000 --- a/node_modules/montage/examples/feed-reader/map-example.reel/main.js +++ /dev/null @@ -1,24 +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/core/core").Montage, - Component = require("montage/ui/component").Component; - - -exports.Main = Montage.create(Component, { - - templateDidLoad: { - value: function() { - //console.log("main templateDidLoad") - } - }, - - prepareForDraw: { - value: function() { - //console.log("main prepareForDraw") - } - } - -}); diff --git a/node_modules/montage/examples/feed-reader/package.json b/node_modules/montage/examples/feed-reader/package.json deleted file mode 100644 index cbb9365f..00000000 --- a/node_modules/montage/examples/feed-reader/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "loader", - "version": "0.0.0", - "mappings": { - "montage": "../.." - }, - "directories": { - "lib": "" - } -} diff --git a/node_modules/montage/examples/youtube-channel-example/index.html b/node_modules/montage/examples/youtube-channel-example/index.html deleted file mode 100755 index 132d0d5a..00000000 --- a/node_modules/montage/examples/youtube-channel-example/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Youtube Channel - - - - - -
-
Youtube Channel
- -
-
- - diff --git a/node_modules/montage/examples/youtube-channel-example/package.json b/node_modules/montage/examples/youtube-channel-example/package.json deleted file mode 100755 index ecfbdd8a..00000000 --- a/node_modules/montage/examples/youtube-channel-example/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "youtube-channel-example", - "version": "0.0.0", - "mappings": { - "montage": "../../" - } -} \ No newline at end of file diff --git a/node_modules/montage/examples/youtube-channel-example/style.css b/node_modules/montage/examples/youtube-channel-example/style.css deleted file mode 100755 index c281cd65..00000000 --- a/node_modules/montage/examples/youtube-channel-example/style.css +++ /dev/null @@ -1,47 +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. -
*/ - - -/* Base ----------------------------- */ - -html { - background-color: hsl(0,0%,85%); - height: 100%; -} - -body { - margin: 0; - width: 100%; - height: 100%; - display: -webkit-box; - -webkit-box-align: center; - -webkit-box-pack: center; - - display: -moz-box; - -moz-box-align: center; - -moz-box-pack: center; -} - - -/* Converter ----------------------------- */ - -.youtube-channel-example { - padding: 10px; - text-shadow: #fff 0 1px 0; - border-radius: 8px; - background-color: hsl(0,0%,95%); - box-shadow: inset 0px 1px 2px 1px hsla(0,0%,100%,1), 0px 2px 5px hsla(0,0%,0%,.1); -} - -.youtube-channel-example #title { - margin: 0 0 5px 0; - text-align: center; - font: 24px/40px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; -} - -.youtube-channel-example-url { - width: 100%; -} diff --git a/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js b/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js deleted file mode 100755 index 4ca12757..00000000 --- a/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js +++ /dev/null @@ -1,8 +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; - -exports.YoutubeChannelExample = Montage.create(Converter, {}); diff --git a/node_modules/montage/montage.js b/node_modules/montage/montage.js index 05e1a52a..a174f50b 100755 --- a/node_modules/montage/montage.js +++ b/node_modules/montage/montage.js @@ -55,7 +55,7 @@ if (typeof window !== "undefined") { var platform = exports.getPlatform(); // Platform dependent - platform.bootstrap(function (Require, Promise, URL) { + platform.bootstrap(function (Require, Promise, URL, Clock) { var params = platform.getParams(); var config = platform.getConfig(); @@ -85,7 +85,8 @@ if (typeof window !== "undefined") { Require.loadPackage(montageLocation, config) .then(function (montageRequire) { montageRequire.inject("core/promise", Promise); - montageRequire.inject("core/shim/timers", {}); + montageRequire.inject("core/next-tick", Clock); + montageRequire.inject("core/mini-url", URL); // install the linter, which loads on the first error config.lint = function (module) { @@ -311,7 +312,7 @@ if (typeof window !== "undefined") { }, bootstrap: function (callback) { - var base, Require, DOM, Promise, URL; + var base, Require, DOM, Promise, URL, Clock; var params = this.getParams(); @@ -382,6 +383,7 @@ if (typeof window !== "undefined") { // execute bootstrap scripts function allModulesLoaded() { + Clock = bootRequire("core/next-tick"); Promise = bootRequire("core/promise"); URL = bootRequire("core/mini-url"); Require = bootRequire("require/require"); @@ -391,7 +393,7 @@ if (typeof window !== "undefined") { function callbackIfReady() { if (DOM && Require) { - callback(Require, Promise, URL); + callback(Require, Promise, URL, Clock); } } diff --git a/node_modules/montage/package.json b/node_modules/montage/package.json index 66501166..ce4b31d5 100755 --- a/node_modules/montage/package.json +++ b/node_modules/montage/package.json @@ -1,6 +1,6 @@ { "name": "montage", - "version": "0.7.0", + "version": "0.9.0", "description": "A UI Framework", "main": "montage", "overlay": { diff --git a/node_modules/montage/ui/anchor.reel/anchor.js b/node_modules/montage/ui/anchor.reel/anchor.js index d8ac1d8f..2c12684b 100644 --- a/node_modules/montage/ui/anchor.reel/anchor.js +++ b/node_modules/montage/ui/anchor.reel/anchor.js @@ -3,24 +3,78 @@ 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/anchor.reel" + @requires montage/core/core + @requires montage/ui/native-control +*/ var Montage = require("montage").Montage, Component = require("ui/component").Component, NativeControl = require("ui/native-control").NativeControl; - /** - * The native control with binding support for the standard attributes - */ + The Anchor component wraps a native <a> element and exposes its standard attributes as bindable properties. + @class module:"montage/ui/anchor.reel".Anchor + @extends module:montage/native-control.NativeControl + +*/ var Anchor = exports.Anchor = Montage.create(NativeControl, { + // HTMLAnchorElement methods + + blur: { value: function() { this._element.blur(); } }, + focus: { value: function() { this._element.focus(); } } + }); -http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element -Anchor.addAttributes({ - textContent: null, - href: null, - hreflang: null, - media: null, - rel: null, - target: null, - type: null +Anchor.addAttributes( /** @lends module:"montage/ui/anchor.reel".Anchor# */ { + +/** + The text displayed by the link. + @type string + @default null +*/ + textContent: null, + +/** + The link target URL. + @type string + @default null +*/ + href: null, + +/** + The language of the linked resource. + @type string + @default null +*/ + hreflang: null, + +/** + The media type for which the target document was designed. + @type string + @default null +*/ + media: null, + +/** + Controls what kinds of links the elements create. + @type string + @default null +*/ + rel: null, + +/** + The target window the link will open in. + @type string + @default null +*/ + target: null, + +/** + The MIME type of the linked resource. + @type string + @default null +*/ + type: null }); diff --git a/node_modules/montage/ui/application.js b/node_modules/montage/ui/application.js index 7cb4bd97..bbce6835 100755 --- a/node_modules/montage/ui/application.js +++ b/node_modules/montage/ui/application.js @@ -169,7 +169,7 @@ var Application = exports.Application = Montage.create(Montage, /** @lends monta _zIndex: {value: null}, _isSystemPopup: {value: function(type) { - return (type === 'alert' || type === 'confirm' || type === 'loading'); + return (type === 'alert' || type === 'confirm' || type === 'notify'); }}, _createPopupSlot: {value: function(zIndex) { @@ -201,7 +201,7 @@ var Application = exports.Application = Montage.create(Montage, /** @lends monta case "confirm": zIndex = 9003; break; - case "loading": + case "notify": zIndex = 9002; break; } diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.css b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.css new file mode 100644 index 00000000..972c41f5 --- /dev/null +++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.css @@ -0,0 +1,12 @@ +/* + 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. +
*/ + .montage-autocomplete { + padding-right: 20px; + } + .montage-autocomplete-loading { + background: url('loading.gif') no-repeat; + background-position: right; + } \ No newline at end of file diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html new file mode 100644 index 00000000..256804c7 --- /dev/null +++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html @@ -0,0 +1,10 @@ + + + + + Autocomplete Template + + + + + diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js new file mode 100644 index 00000000..0ce1ab85 --- /dev/null +++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js @@ -0,0 +1,498 @@ +/* + 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, + Component = require("ui/component").Component, + TextInput = require("ui/text-input").TextInput, + logger = require("core/logger").logger("autocomplete"), + ResultsList = require("ui/autocomplete/results-list.reel/results-list").ResultsList, + ArrayController = require("ui/controller/array-controller").ArrayController, + Popup = require("ui/popup/popup.reel").Popup, + PressComposer = require("ui/composer/press-composer").PressComposer; + +var KEY_UP = 38, + KEY_DOWN = 40, + KEY_RIGHT = 39, + KEY_ENTER = 13, + KEY_ESC = 27; + +var getElementPosition = function(obj) { + var curleft = 0, curtop = 0, curHt = 0, curWd = 0; + if (obj.offsetParent) { + do { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + curHt += obj.offsetHeight; + curWd += obj.offsetWidth; + } while ((obj = obj.offsetParent)); + } + return { + top: curtop, + left: curleft, + height: curHt, + width: curWd + }; +}; + +/** + * The Autocomplete input + */ +var Autocomplete = exports.Autocomplete = Montage.create(TextInput, { + + didCreate: { + value: function() { + this.delay = 500; + this.minLength = 2; + } + }, + + hasTemplate: {value: true}, + + delegate: { + value: null + }, + + separator: { + value: ',', + distinct: true + }, + + _delay: {value: null}, + delay: { + distinct: true, + get: function(){ + return this._delay; + }, + set: function(value) { + if(value !== this._delay) { + if(String.isString(value)) { + value = parseInt(value, 10); + } + this._delay = value; + } + } + }, + + /** + * Number of characters the user must type before the suggest query is fired + * Default = 2 + */ + minLength: { + value: null + }, + + _tokens: {value: null}, + tokens: { + get: function() { + return this._tokens; + }, + set: function(value) { + this._tokens = value; + this._valueSyncedWithInputField = false; + this.needsDraw = true; + }, + modify: function(v) { + this._tokens = v; + }, + distinct: true + }, + + // overridden here to get the substring/searchString + value: { + get: function() { + return this._value; + //var arr = this.tokens; + //return (arr ? arr.join(',') : this._value); + }, + set: function(newValue, fromInput) { + this._value = newValue ? newValue.trim() : ''; + + // get the entered text after the separator + var value = this._value; + + + if(fromInput) { + this._valueSyncedWithInputField = true; + if(value) { + var arr = value.split(this.separator).map(function(item) { + return item.trim(); + }); + this.activeTokenIndex = this._findActiveTokenIndex(this.tokens, arr); + this._tokens = value.split(this.separator).map(function(item) { + return item.trim(); + }); + if(this._tokens.length && this._tokens.length > 0) { + var searchTerm = this._tokens[this.activeTokenIndex]; + searchTerm = searchTerm ? searchTerm.trim() : ''; + if(searchTerm.length >= this.minLength) { + var self = this; + clearTimeout(this.delayTimer); + this.delayTimer = setTimeout(function() { + self.delayTimer = null; + if (logger.isDebug) { + logger.debug('SEARCH for ', searchTerm); + } + self.performSearch(searchTerm); + }, this.delay); + } else { + this.showPopup = false; + } + } else { + this.showPopup = false; + } + } + } else { + this.activeTokenIndex = 0; + this._tokens = []; + this.showPopup = false; + + this._valueSyncedWithInputField = false; + this.needsDraw = true; + } + } + }, + + + + //---- Private + + // width of the popup + overlayWidth: { + value: null, + enumerable: false + }, + + delayTimer: { + value: null, + enumerable: false + }, + + // valid values are 'loading', 'complete' and 'timeout' + // --> ResultList.loadingStatus + _loadingStatus: {value: false, enumerable: false}, + loadingStatus: { + enumerable: false, + get: function() { + return this._loadingStatus; + }, + set: function(value) { + this._loadingStatus = value; + if(this._loadingStatus === 'loading') { + this.showPopup = false; + } + this.needsDraw = true; + } + }, + + // the index of the token in the tokens Array that is being worked on + activeTokenIndex: {value: null}, + + /** @private */ + _findActiveTokenIndex: { + enumerable: false, + value: function(before, after) { + if(before == null || after == null) { + return 0; + } + var i=0, len = after.length; + for(i=0; i< len; i++) { + if(i < before.length) { + if(before[i] === after[i]) { + continue; + } else { + break; + } + } + } + return i; + + } + }, + + + // -> resultsController.activeIndexes + _activeIndexes: {value: null, enumerable: false}, + activeItemIndex: { + enumerable: false, + get: function() { + if(this._activeIndexes && this._activeIndexes.length > 0) { + return this._activeIndexes[0]; + } + return null; + }, + set: function(value) { + if(value == null) { + this._activeIndexes = []; + } else { + this._activeIndexes = [value]; + } + + } + }, + + _suggestedValue: {value: null}, + suggestedValue: { + distinct: true, + enumerable: false, + get: function() { + return this._suggestedValue; + }, + set: function(value) { + if(value) { + this._suggestedValue = value; + var arr = this.tokens; + arr[this.activeTokenIndex] = this._suggestedValue; + this.tokens = arr; + this.showPopup = false; + } + } + }, + + // private + + popup: { + enumerable: false, + value: null + }, + + _showPopup: {value: null}, + showPopup: { + enumerable: false, + get: function() { + return this._showPopup; + }, + set: function(value) { + if(value != this._showPopup) { + this._showPopup = value; + this.needsDraw = true; + } + } + }, + + // the delegate should set the suggestions. + // suggestions -> resultsController.objects + _suggestions: {value: null}, + suggestions: { + enumerable: false, + get: function() { + return this._suggestions; + }, + set: function(value) { + if (logger.isDebug) { + logger.debug('got suggestions: ', value); + } + this.loadingStatus = 'complete'; + this._suggestions = value; + this.showPopup = (value && value.length > 0); + } + }, + + // resultsController -> resultsList.contentController + resultsController: { + enumerable: false, + value: null + }, + + // repetition + resultsList: { + enumerable: false, + value: null + }, + + performSearch: { + enumerable: false, + value: function(searchTerm) { + if(this.delegate) { + // index on the popup + this.activeItemIndex = 0; + this.loadingStatus = 'loading'; + //this.showPopup = true; + // delegate must set the results on the AutoComplete + var fn = this.identifier + 'ShouldGetSuggestions'; + if(typeof this.delegate[fn] === 'function') { + this.delegate[fn](this, searchTerm); + } else if(typeof this.delegate.shouldGetSuggestions === 'function') { + this.delegate.shouldGetSuggestions(this, searchTerm); + } else { + // error - d + } + } + } + }, + + + _addEventListeners: { + enumerable: false, + value: function() { + this.element.addEventListener("keyup", this); + this.element.addEventListener("input", this); + } + }, + + _removeEventListeners: { + enumerable: false, + value: function() { + this.element.removeEventListener("keyup", this); + this.element.removeEventListener("input", this); + } + }, + + _getPopup: { + enumerable: false, + value: function() { + + var popup = this.popup; + + if(!popup) { + popup = Popup.create(); + popup.content = this.resultsList; + popup.anchor = this.element; + popup.delegate = this; + // dont let the popup take away the focus + // we need the focus on the textfield + popup.focusOnShow = false; + this.popup = popup; + } + return this.popup; + + } + }, + + // Delegate method to position the suggest popup + willPositionPopup: { + value: function(popup, defaultPosition) { + var anchor = popup.anchorElement, anchorPosition = getElementPosition(anchor); + return { + left: anchorPosition.left, + top: anchorPosition.top + 30 + }; + + } + }, + + prepareForDraw: { + value: function() { + this._addEventListeners(); + this.element.classList.add('montage-autocomplete'); + + // create the Repetition for the suggestions + this.resultsController = ArrayController.create(); + Object.defineBinding(this.resultsController, "content", { + boundObject: this, + boundObjectPropertyPath: "suggestions", + oneway: true + }); + + Object.defineBinding(this, "suggestedValue", { + boundObject: this.resultsController, + boundObjectPropertyPath: "selectedObjects.0", + oneway: true + }); + + this.resultsList = ResultsList.create(); + Object.defineBinding(this.resultsList, "contentController", { + boundObject: this, + boundObjectPropertyPath: "resultsController", + oneway: true + }); + + Object.defineBinding(this.resultsList, "activeIndexes", { + boundObject: this, + boundObjectPropertyPath: "_activeIndexes", + oneway: true + }); + + var popup = this._getPopup(); + } + }, + + prepareForActivationEvents: { + value: function() { + // add pressComposer to handle the claimPointer related work + var pressComposer = PressComposer.create(); + this.addComposer(pressComposer); + } + }, + + draw: { + value: function() { + var el = this.element; + + var fn = Object.getPrototypeOf(Autocomplete).draw; + fn.call(this); + + if (!this._valueSyncedWithInputField) { + this.value = this.tokens.join(this.separator); + this.element.value = this.value; + this._valueSyncedWithInputField = true; + } + + if(this.showPopup) { + this.popup.show(); + // reset active index + this.activeItemIndex = 0; + } else { + if(this.popup && this.popup.displayed) { + this.popup.hide(); + } + } + + var isLoading = (this.loadingStatus === 'loading'); + this.element.classList[isLoading ? 'add' : 'remove']('montage-autocomplete-loading'); + + + } + }, + + + handleKeyup: { + enumerable: false, + value: function(e) { + var code = e.keyCode, popup = this._getPopup(); + + switch(code) { + case KEY_DOWN: + if(popup.displayed == false) { + popup.show(); + this.activeItemIndex = 0; + } else { + var list = this.suggestions || []; + if(list.length > 0 && this.activeItemIndex < list.length-1) { + this.activeItemIndex++; + } else { + this.activeItemIndex = 0; + } + + } + + break; + + case KEY_UP: + if(popup.displayed == true) { + if(this.activeItemIndex > 0) { + this.activeItemIndex --; + } else { + this.activeItemIndex = 0; + } + } + + break; + + case KEY_ENTER: + if(popup.displayed == true) { + this.resultsController.selectedIndexes = [this.activeItemIndex]; + //this.selectSuggestedValue(); + // select the currently active item in the results list + } + + break; + + } + this.element.focus(); + } + } + +}); + diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/loading.gif b/node_modules/montage/ui/autocomplete/autocomplete.reel/loading.gif new file mode 100644 index 00000000..18abf9aa Binary files /dev/null and b/node_modules/montage/ui/autocomplete/autocomplete.reel/loading.gif differ diff --git a/node_modules/montage/ui/autocomplete/results-list.reel/results-list.css b/node_modules/montage/ui/autocomplete/results-list.reel/results-list.css new file mode 100644 index 00000000..cc8791bc --- /dev/null +++ b/node_modules/montage/ui/autocomplete/results-list.reel/results-list.css @@ -0,0 +1,30 @@ +/* + 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. +
*/ +div.results-list { + min-width: 300px; + } + div.results-list ul { + list-style: none; + margin: 0; + } + div.