From 8fe92b94ce5e1e2857d088752d94e19db7e3d8a8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Sun, 17 Jun 2012 22:31:44 -0700 Subject: montage v11 merge into ninja Signed-off-by: Valerio Virgillito --- node_modules/montage/ui/anchor.reel/anchor.js | 80 +- node_modules/montage/ui/application.js | 33 +- .../autocomplete.reel/autocomplete.html | 13 +- .../autocomplete/autocomplete.reel/autocomplete.js | 7 + .../results-list.reel/results-list.html | 16 +- .../bluemoon/button-group.reel/button-group.html | 14 +- .../montage/ui/bluemoon/button.reel/button.html | 8 +- .../ui/bluemoon/checkbox.reel/checkbox.html | 6 +- .../montage/ui/bluemoon/checkbox.reel/checkbox.js | 6 +- .../montage/ui/bluemoon/progress.reel/progress.css | 33 +- .../ui/bluemoon/progress.reel/progress.html | 9 +- .../montage/ui/bluemoon/slider.reel/slider.html | 7 +- .../montage/ui/bluemoon/tabs.reel/tabs.css | 126 +++ .../montage/ui/bluemoon/tabs.reel/tabs.html | 66 ++ node_modules/montage/ui/bluemoon/tabs.reel/tabs.js | 180 ++++ .../ui/bluemoon/textarea.reel/textarea.html | 7 +- .../ui/bluemoon/textfield.reel/textfield.html | 8 +- .../ui/bluemoon/textfield.reel/textfield.js | 6 +- .../montage/ui/bluemoon/toggle.reel/toggle.html | 8 +- node_modules/montage/ui/button.reel/button.css | 55 + node_modules/montage/ui/button.reel/button.html | 14 + node_modules/montage/ui/button.reel/button.js | 457 +------- node_modules/montage/ui/check-input.js | 4 +- node_modules/montage/ui/checkbox.reel/checkbox.js | 79 -- node_modules/montage/ui/component.js | 6 +- node_modules/montage/ui/composer/key-composer.js | 16 +- node_modules/montage/ui/composer/press-composer.js | 52 +- .../montage/ui/composer/translate-composer.js | 2 +- .../montage/ui/date-input.reel/date-input.js | 46 - .../ui/dynamic-element.reel/dynamic-element.js | 143 +++ node_modules/montage/ui/flow.reel/flow.css | 32 + node_modules/montage/ui/flow.reel/flow.html | 113 +- node_modules/montage/ui/image.reel/image.js | 54 +- .../montage/ui/input-checkbox.reel/checkbox.png | Bin 0 -> 1087 bytes .../ui/input-checkbox.reel/input-checkbox.css | 36 + .../ui/input-checkbox.reel/input-checkbox.html | 14 + .../ui/input-checkbox.reel/input-checkbox.js | 25 + .../montage/ui/input-date.reel/input-date.html | 14 + .../montage/ui/input-date.reel/input-date.js | 35 + .../montage/ui/input-number.reel/input-number.html | 14 + .../montage/ui/input-number.reel/input-number.js | 35 + .../montage/ui/input-radio.reel/input-radio.css | 36 + .../montage/ui/input-radio.reel/input-radio.html | 14 + .../montage/ui/input-radio.reel/input-radio.js | 25 + node_modules/montage/ui/input-radio.reel/radio.png | Bin 0 -> 1015 bytes .../montage/ui/input-range.reel/input-range.css | 42 + .../montage/ui/input-range.reel/input-range.html | 43 + .../montage/ui/input-range.reel/input-range.js | 343 ++++++ .../montage/ui/input-text.reel/input-text.css | 41 + .../montage/ui/input-text.reel/input-text.html | 14 + .../montage/ui/input-text.reel/input-text.js | 24 + node_modules/montage/ui/list.reel/list.html | 13 +- node_modules/montage/ui/loader.reel/loader.js | 1 + .../ui/loading-panel.reel/loading-panel.html | 93 +- node_modules/montage/ui/loading.reel/loading.html | 23 +- .../montage/ui/native/anchor.reel/anchor.js | 80 ++ .../montage/ui/native/button.reel/button.js | 465 +++++++++ node_modules/montage/ui/native/image.reel/image.js | 54 + .../native/input-checkbox.reel/input-checkbox.js | 77 ++ .../ui/native/input-date.reel/input-date.js | 46 + .../ui/native/input-number.reel/input-number.js | 48 + .../ui/native/input-radio.reel/input-radio.js | 174 ++++ .../ui/native/input-range.reel/input-range.js | 83 ++ .../ui/native/input-text.reel/input-text.js | 26 + .../montage/ui/native/progress.reel/progress.js | 49 + .../montage/ui/native/select.reel/select.js | 496 +++++++++ .../montage/ui/native/textarea.reel/textarea.js | 127 +++ .../ui/nearest-neighbor-component-search.js | 232 ----- .../montage/ui/number-input.reel/number-input.js | 48 - .../montage/ui/popup/alert.reel/alert.html | 56 +- .../montage/ui/popup/confirm.reel/confirm.html | 59 +- .../montage/ui/popup/notifier.reel/notifier.html | 24 +- .../montage/ui/popup/popup.reel/popup.html | 28 +- node_modules/montage/ui/progress.reel/progress.css | 29 + .../montage/ui/progress.reel/progress.html | 28 + node_modules/montage/ui/progress.reel/progress.js | 127 ++- .../montage/ui/radio-button.reel/radio-button.js | 5 +- .../montage/ui/range-input.reel/range-input.js | 83 -- .../rich-text-linkpopup.html | 34 +- .../rich-text-resizer.reel/rich-text-resizer.html | 32 +- .../rich-text-resizer.reel/rich-text-resizer.js | 2 +- .../rich-text-editor.reel/rich-text-editor-base.js | 201 ++-- .../rich-text-editor.reel/rich-text-editor.css | 6 + .../rich-text-editor.reel/rich-text-editor.html | 38 +- .../rich-text-editor.reel/rich-text-editor.js | 78 +- .../montage/ui/scroll-bars.reel/scroll-bars.css | 67 ++ .../montage/ui/scroll-bars.reel/scroll-bars.html | 120 +-- node_modules/montage/ui/scroller.reel/scroller.css | 15 + .../montage/ui/scroller.reel/scroller.html | 132 ++- .../montage/ui/scrollview.reel/scrollview.js | 1090 -------------------- .../montage/ui/select-input.reel/select-input.js | 496 --------- node_modules/montage/ui/select.reel/select.css | 46 + node_modules/montage/ui/select.reel/select.html | 14 + node_modules/montage/ui/select.reel/select.js | 26 + node_modules/montage/ui/select.reel/select.png | Bin 0 -> 978 bytes .../ui/skeleton/range-input.reel/range-input.css | 27 - .../ui/skeleton/range-input.reel/range-input.html | 45 - .../ui/skeleton/range-input.reel/range-input.js | 300 ------ node_modules/montage/ui/tabs.reel/tabs.css | 126 --- node_modules/montage/ui/tabs.reel/tabs.html | 69 -- node_modules/montage/ui/tabs.reel/tabs.js | 180 ---- node_modules/montage/ui/template.js | 21 +- node_modules/montage/ui/text-input.js | 8 +- .../montage/ui/text-slider.reel/text-slider.css | 15 + .../montage/ui/text-slider.reel/text-slider.html | 102 ++ .../montage/ui/text-slider.reel/text-slider.js | 473 +++++++++ node_modules/montage/ui/textarea.reel/textarea.css | 26 + .../montage/ui/textarea.reel/textarea.html | 14 + node_modules/montage/ui/textarea.reel/textarea.js | 125 +-- .../montage/ui/textfield.reel/textfield.js | 26 - .../ui/toggle-button.reel/toggle-button.css | 13 + .../ui/toggle-button.reel/toggle-button.html | 15 + .../montage/ui/toggle-button.reel/toggle-button.js | 9 +- .../ui/toggle-switch.reel/toggle-switch.html | 8 +- .../token-field/token-field.reel/token-field.css | 20 +- .../token-field/token-field.reel/token-field.html | 29 +- .../montage/ui/token-field/token.reel/token.html | 16 +- .../montage/ui/video-player.reel/video-player.html | 109 +- 118 files changed, 4856 insertions(+), 4352 deletions(-) create mode 100755 node_modules/montage/ui/bluemoon/tabs.reel/tabs.css create mode 100755 node_modules/montage/ui/bluemoon/tabs.reel/tabs.html create mode 100755 node_modules/montage/ui/bluemoon/tabs.reel/tabs.js create mode 100644 node_modules/montage/ui/button.reel/button.css create mode 100644 node_modules/montage/ui/button.reel/button.html delete mode 100644 node_modules/montage/ui/checkbox.reel/checkbox.js delete mode 100644 node_modules/montage/ui/date-input.reel/date-input.js create mode 100644 node_modules/montage/ui/flow.reel/flow.css create mode 100644 node_modules/montage/ui/input-checkbox.reel/checkbox.png create mode 100644 node_modules/montage/ui/input-checkbox.reel/input-checkbox.css create mode 100644 node_modules/montage/ui/input-checkbox.reel/input-checkbox.html create mode 100644 node_modules/montage/ui/input-checkbox.reel/input-checkbox.js create mode 100644 node_modules/montage/ui/input-date.reel/input-date.html create mode 100644 node_modules/montage/ui/input-date.reel/input-date.js create mode 100644 node_modules/montage/ui/input-number.reel/input-number.html create mode 100644 node_modules/montage/ui/input-number.reel/input-number.js create mode 100644 node_modules/montage/ui/input-radio.reel/input-radio.css create mode 100644 node_modules/montage/ui/input-radio.reel/input-radio.html create mode 100644 node_modules/montage/ui/input-radio.reel/input-radio.js create mode 100644 node_modules/montage/ui/input-radio.reel/radio.png create mode 100644 node_modules/montage/ui/input-range.reel/input-range.css create mode 100644 node_modules/montage/ui/input-range.reel/input-range.html create mode 100644 node_modules/montage/ui/input-range.reel/input-range.js create mode 100644 node_modules/montage/ui/input-text.reel/input-text.css create mode 100644 node_modules/montage/ui/input-text.reel/input-text.html create mode 100644 node_modules/montage/ui/input-text.reel/input-text.js create mode 100644 node_modules/montage/ui/native/anchor.reel/anchor.js create mode 100644 node_modules/montage/ui/native/button.reel/button.js create mode 100644 node_modules/montage/ui/native/image.reel/image.js create mode 100644 node_modules/montage/ui/native/input-checkbox.reel/input-checkbox.js create mode 100644 node_modules/montage/ui/native/input-date.reel/input-date.js create mode 100644 node_modules/montage/ui/native/input-number.reel/input-number.js create mode 100644 node_modules/montage/ui/native/input-radio.reel/input-radio.js create mode 100644 node_modules/montage/ui/native/input-range.reel/input-range.js create mode 100644 node_modules/montage/ui/native/input-text.reel/input-text.js create mode 100644 node_modules/montage/ui/native/progress.reel/progress.js create mode 100644 node_modules/montage/ui/native/select.reel/select.js create mode 100644 node_modules/montage/ui/native/textarea.reel/textarea.js delete mode 100644 node_modules/montage/ui/nearest-neighbor-component-search.js delete mode 100644 node_modules/montage/ui/number-input.reel/number-input.js create mode 100644 node_modules/montage/ui/progress.reel/progress.css create mode 100644 node_modules/montage/ui/progress.reel/progress.html delete mode 100644 node_modules/montage/ui/range-input.reel/range-input.js create mode 100644 node_modules/montage/ui/scroll-bars.reel/scroll-bars.css create mode 100644 node_modules/montage/ui/scroller.reel/scroller.css delete mode 100755 node_modules/montage/ui/scrollview.reel/scrollview.js delete mode 100644 node_modules/montage/ui/select-input.reel/select-input.js create mode 100644 node_modules/montage/ui/select.reel/select.css create mode 100644 node_modules/montage/ui/select.reel/select.html create mode 100644 node_modules/montage/ui/select.reel/select.js create mode 100644 node_modules/montage/ui/select.reel/select.png delete mode 100644 node_modules/montage/ui/skeleton/range-input.reel/range-input.css delete mode 100644 node_modules/montage/ui/skeleton/range-input.reel/range-input.html delete mode 100644 node_modules/montage/ui/skeleton/range-input.reel/range-input.js delete mode 100755 node_modules/montage/ui/tabs.reel/tabs.css delete mode 100755 node_modules/montage/ui/tabs.reel/tabs.html delete mode 100755 node_modules/montage/ui/tabs.reel/tabs.js create mode 100644 node_modules/montage/ui/text-slider.reel/text-slider.css create mode 100644 node_modules/montage/ui/text-slider.reel/text-slider.html create mode 100644 node_modules/montage/ui/text-slider.reel/text-slider.js create mode 100644 node_modules/montage/ui/textarea.reel/textarea.css create mode 100644 node_modules/montage/ui/textarea.reel/textarea.html delete mode 100644 node_modules/montage/ui/textfield.reel/textfield.js create mode 100644 node_modules/montage/ui/toggle-button.reel/toggle-button.css create mode 100644 node_modules/montage/ui/toggle-button.reel/toggle-button.html (limited to 'node_modules/montage/ui') diff --git a/node_modules/montage/ui/anchor.reel/anchor.js b/node_modules/montage/ui/anchor.reel/anchor.js index 2c12684b..62eefede 100644 --- a/node_modules/montage/ui/anchor.reel/anchor.js +++ b/node_modules/montage/ui/anchor.reel/anchor.js @@ -3,78 +3,22 @@ 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 -*/ +/*global require,exports */ var Montage = require("montage").Montage, Component = require("ui/component").Component, - NativeControl = require("ui/native-control").NativeControl; -/** - 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(); } } - -}); - -Anchor.addAttributes( /** @lends module:"montage/ui/anchor.reel".Anchor# */ { + NativeAnchor = require("ui/native/anchor.reel").Anchor; /** - The text displayed by the link. - @type string - @default null -*/ - textContent: null, + * Montage Anchor + */ +exports.Anchor = Montage.create(NativeAnchor, { -/** - The link target URL. - @type string - @default null -*/ - href: null, + hasTemplate: {value: false}, -/** - 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 + didSetElement: { + value: function() { + NativeAnchor.didSetElement.call(this); + this['class'] = (this['class'] || '') + ' montage-anchor'; + } + } }); diff --git a/node_modules/montage/ui/application.js b/node_modules/montage/ui/application.js index bbce6835..025ef950 100755 --- a/node_modules/montage/ui/application.js +++ b/node_modules/montage/ui/application.js @@ -137,28 +137,27 @@ var Application = exports.Application = Montage.create(Montage, /** @lends monta value: null }, - /** - Description TODO - @function - @param {Function} callback A function to invoke after the method has completed. - */ - load: { - value: function(callback) { - var template = Template.create().initWithDocument(window.document), - component, + _load: { + value: function(applicationRequire, callback) { + var template = Template.create().initWithDocument(window.document, applicationRequire), + rootComponent, self = this; - self = Application.isPrototypeOf(self) ? self : Application.create(); - // assign to the exports so that it is available in the deserialization of the template exports.application = self; - template.instantiateWithOwnerAndDocument(null, window.document, function() { - require("ui/component").__root__.needsDraw = true; - if (callback) { - callback(self); - } - }); + require.async("ui/component").then(function(exports) { + rootComponent = exports.__root__; + rootComponent.element = document; + template.instantiateWithOwnerAndDocument(null, window.document, function() { + self.callDelegateMethod("willFinishLoading", self); + rootComponent.needsDraw = true; + if (callback) { + callback(self); + } + + }); + }).end(); } }, diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html index 256804c7..404c49d9 100644 --- a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html +++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.html @@ -1,10 +1,15 @@ + - - Autocomplete Template - + + + - + \ No newline at end of file diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js index 4e2dd82e..b5431891 100644 --- a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js +++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js @@ -50,6 +50,13 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, { hasTemplate: {value: true}, + didSetElement: { + value: function() { + TextInput.didSetElement.call(this); + this['class'] = (this['class'] || '') + ' montage-inputText'; + } + }, + delegate: { value: null }, diff --git a/node_modules/montage/ui/autocomplete/results-list.reel/results-list.html b/node_modules/montage/ui/autocomplete/results-list.reel/results-list.html index c40d36ce..61539f6c 100644 --- a/node_modules/montage/ui/autocomplete/results-list.reel/results-list.html +++ b/node_modules/montage/ui/autocomplete/results-list.reel/results-list.html @@ -1,13 +1,15 @@ + - - Autocomplete Results Template - - + + -
@@ -57,6 +58,5 @@
  • - - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html index e56d0bab..e721f6b5 100644 --- a/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html +++ b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html @@ -5,21 +5,19 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. --> - - - - - - + - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/button.reel/button.html b/node_modules/montage/ui/bluemoon/button.reel/button.html index 4ec77f61..ef7f4d5c 100644 --- a/node_modules/montage/ui/bluemoon/button.reel/button.html +++ b/node_modules/montage/ui/bluemoon/button.reel/button.html @@ -6,20 +6,18 @@ --> - - + + - - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.html b/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.html index 9bbec1b7..9c54ec94 100644 --- a/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.html +++ b/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.html @@ -6,9 +6,9 @@ --> - - + + - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.js b/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.js index 58e5154d..eec8a476 100644 --- a/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.js +++ b/node_modules/montage/ui/bluemoon/checkbox.reel/checkbox.js @@ -4,17 +4,17 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ /** - @module "montage/ui/bluemoon/checkbox.reel" + @module "montage/ui/bluemoon/input-checkbox.reel" @requires montage/core/core @requires montage/ui/component */ var Montage = require("montage").Montage, Component = require("ui/component").Component; /** - @class module:"montage/ui/bluemoon/checkbox.reel".Checkbox + @class module:"montage/ui/bluemoon/input-checkbox.reel".Checkbox @extends module:montage/ui/component.Component */ -exports.Checkbox = Montage.create(Component,/** @lends "module:montage/ui/bluemoon/checkbox.reel".Checkbox# */ { +exports.Checkbox = Montage.create(Component,/** @lends "module:montage/ui/bluemoon/input-checkbox.reel".Checkbox# */ { // Configuration /** The distance (squared) beyond which a touch will be considered. diff --git a/node_modules/montage/ui/bluemoon/progress.reel/progress.css b/node_modules/montage/ui/bluemoon/progress.reel/progress.css index cf9e6543..3887fab3 100644 --- a/node_modules/montage/ui/bluemoon/progress.reel/progress.css +++ b/node_modules/montage/ui/bluemoon/progress.reel/progress.css @@ -10,18 +10,18 @@ overflow: hidden; background: #ccc url(rule.png); -webkit-box-shadow: inset rgba(0,0,0,.2) 0 0 0 1px, rgba(255,255,255,.5) 0 1px 1px, rgba(0,0,0,.1) 0 -1px 0px; + -moz-box-shadow: inset rgba(0,0,0,.2) 0 0 0 1px, rgba(255,255,255,.5) 0 1px 1px, rgba(0,0,0,.1) 0 -1px 0px; + box-shadow: inset rgba(0,0,0,.2) 0 0 0 1px, rgba(255,255,255,.5) 0 1px 1px, rgba(0,0,0,.1) 0 -1px 0px; } .montage-progress .bar { height: 7px; border-radius: inherit; - - background-repeat: no-repeat; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, - color-stop(12%, #35c9ff), color-stop(12%, #0cbeff), - color-stop(85%, #0aa5dd), color-stop(85%, #0996c9) ); + background: #0cbeff; -webkit-transition: width .3s cubic-bezier(0.25, 0.1, 0.3, 0.9); + -moz-transition: width .3s cubic-bezier(0.25, 0.1, 0.3, 0.9); + transition: width .3s cubic-bezier(0.25, 0.1, 0.3, 0.9); } .montage-progress.dark { @@ -29,23 +29,6 @@ color-stop(0%, #303030), color-stop(100%, #3f3f3f) ); -webkit-box-shadow: rgba(255,255,255,.1) 0 1px 0, rgba(0,0,0,.1) 0 -1px 0px; -} - -@-webkit-keyframes montage-progress-scroll { - from { - background-position: 0px top; - } - to { - background-position: -8px top; - } -} - -.montage-progress .bar.scrolling { - background-image: url("scroll.png"); - background-repeat: repeat-x; - background-position: 10px top; - -webkit-animation-name: montage-progress-scroll; - -webkit-animation-duration: 1s; - -webkit-animation-timing-function: linear; - -webkit-animation-iteration-count: infinite; -} + -moz-box-shadow: rgba(255,255,255,.1) 0 1px 0, rgba(0,0,0,.1) 0 -1px 0px; + box-shadow: rgba(255,255,255,.1) 0 1px 0, rgba(0,0,0,.1) 0 -1px 0px; +} \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/progress.reel/progress.html b/node_modules/montage/ui/bluemoon/progress.reel/progress.html index a3835fe6..81e82b1a 100644 --- a/node_modules/montage/ui/bluemoon/progress.reel/progress.html +++ b/node_modules/montage/ui/bluemoon/progress.reel/progress.html @@ -6,8 +6,8 @@ --> - - + + - -
    - - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/slider.reel/slider.html b/node_modules/montage/ui/bluemoon/slider.reel/slider.html index e80a520e..1671d0c2 100644 --- a/node_modules/montage/ui/bluemoon/slider.reel/slider.html +++ b/node_modules/montage/ui/bluemoon/slider.reel/slider.html @@ -6,8 +6,8 @@ --> - - + + -
    @@ -78,4 +77,4 @@
    - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/tabs.reel/tabs.css b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.css new file mode 100755 index 00000000..e3615a9b --- /dev/null +++ b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.css @@ -0,0 +1,126 @@ +/* + 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-tabs { + position: relative; + display: inline-block; + border-radius: 26px; + + background-color: #ccc; + -webkit-box-shadow: rgba(255, 255, 255, .7) 0 1px 0, inset rgba(0, 0, 0, .3) 0 1px 3px; +} + +.montage-tabs-indicator { + position: absolute; + left: 0; + top: 0; + height: 48px; + margin: 2px; + padding: 0px 10px; + border-radius: 24px; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #fff), color-stop(100%, #e6e6e6)); + -webkit-box-shadow: rgba(0, 0, 0, .3) 0 1px 3px; + +} + +.montage-tabs-list { + padding: 0; + margin: 0; + position: relative; +} + +.montage-tabs-list li { + display: inline-block; + line-height: 46px; + margin: 3px; + padding: 0 10px; + border-radius: 26px; + font-family: 'AGBuchBQRegular', Helvetica, sans-serif; + font-size: 18px; + color: #555; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + cursor: pointer; +} + +.montage-tabs-list li.selected { + color: #333; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #fff), color-stop(100%, #e6e6e6)); + padding: 0 10px; + -webkit-box-shadow: rgba(0, 0, 0, .3) 0 1px 3px; +} + +.montage-tabs-list li img { + margin-bottom: -2px; /* based on 16px icons */ + opacity: .5; +} + +.montage-tabs-list li.selected img { + opacity: 1; +} + +.montage-tabs-list li span { + margin: 0; + padding: 0; + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +/* states */ + +.montage-tabs-list li.pressed { + background-color: #aaa; + -webkit-box-shadow: rgba(255, 255, 255, .2) 0 1px 0, inset rgba(0, 0, 0, .1) 0 2px 5px; + -webkit-transition: background-color .15s ease-out; +} + +/* ----------------------- Small ----------------------- */ + +/* tab width: 70px */ + +.montage-tabs.small .montage-tabs-indicator { + height: 27px; +} + +.montage-tabs.small .montage-tabs-list li { + padding: 0 10px; + line-height: 25px; + + font-size: 12px; +} + +/* ----------------------- Dark theme ----------------------- */ + +.montage-tabs.dark { + background-color: #404040; + -webkit-box-shadow: rgba(255, 255, 255, .25) 0 1px 0, inset rgba(0, 0, 0, .3) 0 1px 3px; +} + +.montage-tabs.dark .montage-tabs-indicator { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #767676), color-stop(100%, #5c5c5c)); + +} + +.montage-tabs.dark .montage-tabs-list li { + color: #bbb; +} + +.montage-tabs.dark .montage-tabs-list li.selected { + color: #333; +} + +/* states */ + +.montage-tabs.dark .montage-tabs-list li.pressed { + background-color: #333; + -webkit-box-shadow: rgba(255, 255, 255, .05) 0 1px 0, inset rgba(0, 0, 0, .1) 0 2px 5px; +} diff --git a/node_modules/montage/ui/bluemoon/tabs.reel/tabs.html b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.html new file mode 100755 index 00000000..9beda2b0 --- /dev/null +++ b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.html @@ -0,0 +1,66 @@ + + + + + + + + + +
    + + +
    + + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/tabs.reel/tabs.js b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.js new file mode 100755 index 00000000..4836e455 --- /dev/null +++ b/node_modules/montage/ui/bluemoon/tabs.reel/tabs.js @@ -0,0 +1,180 @@ +/* + 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/tabs.reel" + @requires montage/core/core + @requires montage/ui/component + @requires "montage/ui/repetition.reel" + @requires "montage/ui/substitution.reel" + @requires "montage/ui/dynamic-text.reel" + @requires "montage/ui/image.reel" + @requires montage/core/uuid +*/ +var Montage = require("montage").Montage, + Component = require("ui/component").Component, + Repetition = require("ui/repetition.reel").Repetition, + Substitution = require("ui/substitution.reel").Substitution, + DynamicText = require("ui/dynamic-text.reel").DynamicText, + Image = require("ui/image.reel").Image, + Uuid = require("core/uuid").Uuid; + +/** + @class module:"montage/ui/tabs.reel".Tabs +*/ + +var Tabs = exports.Tabs = Montage.create(Component, /** @lends module:"montage/ui/tabs.reel".Tabs# */ { + + _repetition: { + value: null, + serializable: true + }, + + _indicator: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Array} [] + */ + tabs: { + distinct: true, + serializable: true, + value: [] + }, + + navController: { + value: null, + serializable: true + }, + // optional property. If provided, this will result in wiring tab clicks to switching components in content + /** + Description TODO + @type {Property} + @default null + */ + content: { + enumerable: false, + serializable: true, + value: null + }, + + // @private - + _selectedTabs: {value: null}, + selectedTabs: { + get: function() { + return this._selectedTabs; + }, + set: function(arr) { + if(arr && arr.length > 0) { + this._selectedTabs = arr; + this.selectedTab = arr[0]; + } + } + }, + + // selectedTabValue is the value of the Tab, selectedTab returns the object representing the tab + + _selectedTabValue: {value: null}, + selectedTabValue: { + get: function() { + return this._selectedTabValue; + }, + set: function(value) { + this._selectedTabValue = value; + if(this.navController) { + var index = this._indexOf(value); + this.navController.selectedIndexes = [index]; + } + }, + serializable: true + }, + + + _selectedTab: {value: null}, + selectedTab: { + enumerable: false, + get: function() { + return this._selectedTab; + }, + set: function(value) { + if(value && value !== this._selectedTab) { + this._selectedTab = value; + this.needsDraw = true; + } + } + }, + + _indexOf: { + value: function(value) { + var index = 0; + // get the index of the this value element in the tabs array + var i = 0, len = this.tabs.length; + for (; i < len; i++) { + if (this.tabs[i].value === value) { + index = i; + } + } + return index; + + } + }, + + propertyChangeBindingListener: { + value: function(type, listener, useCapture, atSignIndex, bindingOrigin, bindingPropertyPath, bindingDescriptor) { + // kishore: same as in list.js + if (bindingDescriptor.boundObjectPropertyPath.match(/objectAtCurrentIteration/)) { + if (this._repetition) { + bindingDescriptor.boundObject = this._repetition; + return this._repetition.propertyChangeBindingListener.apply(this._repetition, arguments); + } else { + return null; + } + } else { + return Object.prototype.propertyChangeBindingListener.apply(this, arguments); + } + } + }, + + deserializedFromTemplate: { + value: function() { + this._orphanedChildren = this.childComponents; + this.childComponents = null; + } + }, + + templateDidLoad: { + value: function() { + var orphanedFragment, + currentContentRange = this.element.ownerDocument.createRange(); + currentContentRange.selectNodeContents(this.element); + orphanedFragment = currentContentRange.extractContents(); + + this._repetition.element.querySelector('li').appendChild(orphanedFragment); + this._repetition.childComponents = this._orphanedChildren; + this._repetition.needsDraw = true; + + if(this.content) { + // substitution + Object.defineBinding(this.content, "switchValue", { + boundObject: this, + boundObjectPropertyPath: 'selectedTab.value' + }); + } + var index = (this.selectedTabValue ? this._indexOf(this.selectedTabValue) : 0); + this.navController.selectedIndexes = [index]; + + } + }, + + draw: { + value: function() { + //console.log("draw current tab = " + value); + } + } + +}); diff --git a/node_modules/montage/ui/bluemoon/textarea.reel/textarea.html b/node_modules/montage/ui/bluemoon/textarea.reel/textarea.html index 850fe533..d323bb53 100644 --- a/node_modules/montage/ui/bluemoon/textarea.reel/textarea.html +++ b/node_modules/montage/ui/bluemoon/textarea.reel/textarea.html @@ -6,10 +6,9 @@ --> - - + + - - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/textfield.reel/textfield.html b/node_modules/montage/ui/bluemoon/textfield.reel/textfield.html index 4175d1d3..25618843 100644 --- a/node_modules/montage/ui/bluemoon/textfield.reel/textfield.html +++ b/node_modules/montage/ui/bluemoon/textfield.reel/textfield.html @@ -6,11 +6,9 @@ --> - - - + + - - + \ No newline at end of file diff --git a/node_modules/montage/ui/bluemoon/textfield.reel/textfield.js b/node_modules/montage/ui/bluemoon/textfield.reel/textfield.js index 6de3d636..eb8e482f 100644 --- a/node_modules/montage/ui/bluemoon/textfield.reel/textfield.js +++ b/node_modules/montage/ui/bluemoon/textfield.reel/textfield.js @@ -4,17 +4,17 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ /** - @module "montage/ui/bluemoon/textfield.reel" + @module "montage/ui/bluemoon/input-text.reel" @requires montage/core/core @requires montage/ui/editable-text */ var Montage = require("montage").Montage, EditableText = require("ui/editable-text").EditableText; /** - @class module:"montage/ui/bluemoon/textfield.reel".Textfield + @class module:"montage/ui/bluemoon/input-text.reel".Textfield @extends module:montage/ui/editable-text.EditableText */ -var Textfield = exports.Textfield = Montage.create(EditableText,/** @lends module:"montage/ui/bluemoon/textfield.reel".Textfield# */ { +var Textfield = exports.Textfield = Montage.create(EditableText,/** @lends module:"montage/ui/bluemoon/input-text.reel".Textfield# */ { /** Description TODO @type {Property} diff --git a/node_modules/montage/ui/bluemoon/toggle.reel/toggle.html b/node_modules/montage/ui/bluemoon/toggle.reel/toggle.html index 33b847ef..30acaa10 100644 --- a/node_modules/montage/ui/bluemoon/toggle.reel/toggle.html +++ b/node_modules/montage/ui/bluemoon/toggle.reel/toggle.html @@ -6,11 +6,9 @@ --> - - - + + - - + \ No newline at end of file diff --git a/node_modules/montage/ui/button.reel/button.css b/node_modules/montage/ui/button.reel/button.css new file mode 100644 index 00000000..f0f3ad60 --- /dev/null +++ b/node_modules/montage/ui/button.reel/button.css @@ -0,0 +1,55 @@ +/* + 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-button { + outline: none; + box-sizing: border-box; + font-size: 12px; + height: 2.5em; + min-width: 2.5em; + margin: 0 2px; + padding: 0 1em; + vertical-align: middle; + border-radius: 3px; + border: 1px solid #b3b3b3; + background-color: #f2f2f2; + cursor: pointer; +} + +/* States */ +.montage-button:hover { + background-color: #fff; + color: #000; +} + +.montage-button:active { + background-color: #e5e5e5; +} + +.montage-button:focus { + border-color: #7f7f7f; +} + + +/* ButtonGroup ------------------------------- */ + +.montage-buttonGroup { + padding-left: 5px; /* Add the negative margin back */ +} + +.montage-buttonGroup > .montage-button { + margin: 0; + border-radius: 0; + margin-left: -5px; /* Remove the space inbetween */ +} + +.montage-buttonGroup > .montage-button:first-child { + border-radius: 3px 0 0 3px; +} + +.montage-buttonGroup > .montage-button:last-child { + border-radius: 0 3px 3px 0; +} \ No newline at end of file diff --git a/node_modules/montage/ui/button.reel/button.html b/node_modules/montage/ui/button.reel/button.html new file mode 100644 index 00000000..662481ad --- /dev/null +++ b/node_modules/montage/ui/button.reel/button.html @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/montage/ui/button.reel/button.js b/node_modules/montage/ui/button.reel/button.js index 91b6304d..46ffc3a2 100644 --- a/node_modules/montage/ui/button.reel/button.js +++ b/node_modules/montage/ui/button.reel/button.js @@ -3,463 +3,22 @@ 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. */ - /*global require, exports*/ - -/** - @module "montage/ui/button.reel" - @requires montage/core/core - @requires montage/ui/component - @requires montage/ui/native-control - @requires montage/ui/composer/press-composer -*/ +/*global require,exports */ var Montage = require("montage").Montage, Component = require("ui/component").Component, - NativeControl = require("ui/native-control").NativeControl, - PressComposer = require("ui/composer/press-composer").PressComposer; - -/** - Wraps a native <button> or <input[type="button"]> HTML element. The element's standard attributes are exposed as bindable properties. - @class module:"montage/ui/button.reel".Button - @extends module:montage/native-control.NativeControl - @example -JavaScript example -var b1 = Button.create(); -b1.element = document.querySelector("btnElement"); -b1.addEventListener("action", function(event) { - console.log("Got event 'action' event"); -}); - @example -Serialized example -{ - "aButton": { - "prototype": "ui/button.reel", - "properties": { - "element": {"#": "btnElement"} - }, - "listeners": [ - { - "type": "action", - "listener": {"@": "appListener"} - } - ] - }, - "listener": { - "prototype": "appListener" - } -} -<button data-montage-id="btnElement"> -*/ -var Button = exports.Button = Montage.create(NativeControl, /** @lends module:"montage/ui/button.reel".Button# */ { - - _preventFocus: { - enumerable: false, - value: false - }, + NativeButton = require("ui/native/button.reel/button").Button; /** - Specifies whether the button should receive focus or not. - @type {boolean} - @default false - @event longpress -*/ - preventFocus: { - get: function () { - return this._preventFocus; - }, - set: function (value) { - if (value === true) { - this._preventFocus = true; - } else { - this._preventFocus = false; - } - } - }, - - -/** - Enables or disables the Button from user input. When this property is set to false, the "disabled" CSS style is applied to the button's DOM element during the next draw cycle. When set to true the "disabled" CSS class is removed from the element's class list. -*/ - //TODO we should prefer positive properties like enabled vs disabled, get rid of disabled - enabled: { - dependencies: ["disabled"], - get: function () { - return !this._disabled; - }, - set: function (value) { - this.disabled = !value; - } - }, - - /** - A Montage converter object used to convert or format the label displayed by the Button instance. When a new value is assigned to label, the converter object's convert() method is invoked, passing it the newly assigned label value. - @type {Property} - @default null - */ - converter: { - value: null - }, - - /** - Stores the node that contains this button's value. Only used for - non-`` elements. - @private - */ - _labelNode: {value:undefined, enumerable: false}, - - _label: { value: undefined, enumerable: false }, - - /** - The label for the button. In an <input> element this is taken from the element's value attribute. On any other element (including <button>) this is the first child node which is a text node. If one isn't found then it will be created. - - If the button has a non-null converter property, the converter object's convert() method is called on the value before being assigned to the button instance. - - @type {string} - @default undefined - */ - label: { - get: function() { - return this._label; - }, - set: function(value) { - if (value && value.length > 0 && this.converter) { - try { - value = this.converter.convert(value); - if (this.error) { - this.error = null; - } - } catch(e) { - // unable to convert - maybe error - this.error = e; - } - } - - this._label = value; - if (this._isInputElement) { - this._value = value; - } - - this.needsDraw = true; - } - }, - - /** - The amount of time in milliseconds the user must press and hold the button a hold event is dispatched. The default is 1 second. - @type {number} - @default 1000 - */ - holdThreshold: { - get: function() { - return this._pressComposer.longPressThreshold; - }, - set: function(value) { - this._pressComposer.longPressThreshold = value; - } - }, - - _pressComposer: { - enumberable: false, - value: null - }, - - _active: { - enumerable: false, - value: false - }, - - /** - This property is true when the button is being interacted with, either through mouse click or touch event, otherwise false. - @type {boolean} - @default false - */ - active: { - get: function() { - return this._active; - }, - set: function(value) { - this._active = value; - this.needsDraw = true; - } - }, - - // HTMLInputElement/HTMLButtonElement methods - - blur: { value: function() { this._element.blur(); } }, - focus: { value: function() { this._element.focus(); } }, - // click() deliberately omitted (it isn't available on