From 18a9075edd78e84bcf296b65a1cac343235e1c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Frisch?= Date: Wed, 16 Apr 2014 12:16:50 -0700 Subject: [PATCH] Remove matte dependency. --- node_modules/matte/.npmignore | 7 - node_modules/matte/CHANGES.md | 12 - node_modules/matte/LICENSE.md | 55 - node_modules/matte/README.md | 33 - .../matte/node_modules/native/.npmignore | 7 - .../matte/node_modules/native/CHANGES.md | 3 - .../matte/node_modules/native/LICENSE.md | 55 - .../matte/node_modules/native/README.md | 33 - .../matte/node_modules/native/overview.html | 21 - .../matte/node_modules/native/package.json | 29 - .../native/ui/anchor.reel/anchor.js | 70 - .../native/ui/button.reel/button.js | 509 ----- .../native/ui/button.reel/button.meta | 312 --- .../node_modules/native/ui/check-input.js | 117 -- .../native/ui/image.reel/image.js | 46 - .../ui/input-checkbox.reel/input-checkbox.js | 72 - .../native/ui/input-date.reel/input-date.js | 40 - .../ui/input-number.reel/input-number.js | 40 - .../native/ui/input-radio.reel/input-radio.js | 171 -- .../native/ui/input-range.reel/input-range.js | 73 - .../native/ui/input-text.reel/input-text.js | 20 - .../node_modules/native/ui/native-control.js | 122 -- .../native/ui/native-control.meta | 314 --- .../native/ui/progress.reel/progress.js | 39 - .../native/ui/select.reel/select.js | 545 ----- .../node_modules/native/ui/text-input.js | 303 --- .../native/ui/textarea.reel/textarea.js | 131 -- node_modules/matte/package.json | 30 - node_modules/matte/run-tests.html | 16 - node_modules/matte/ui/anchor.reel/anchor.js | 24 - .../autocomplete.reel/autocomplete.css | 7 - .../autocomplete.reel/autocomplete.html | 10 - .../autocomplete.reel/autocomplete.js | 538 ----- .../autocomplete.reel/loading.gif | Bin 1456 -> 0 bytes .../result-item.reel/result-item.js | 35 - .../results-list.reel/results-list.css | 25 - .../results-list.reel/results-list.html | 57 - .../results-list.reel/results-list.js | 11 - node_modules/matte/ui/button.reel/button.css | 65 - node_modules/matte/ui/button.reel/button.html | 9 - node_modules/matte/ui/button.reel/button.js | 22 - node_modules/matte/ui/button.reel/button.meta | 34 - .../component-group.reel/component-group.js | 25 - .../dynamic-element.reel/dynamic-element.js | 175 -- .../ui/image.reel/image-description.json | 87 - node_modules/matte/ui/image.reel/image.js | 25 - .../matte/ui/input-checkbox.reel/checkbox.png | Bin 1087 -> 0 bytes .../ui/input-checkbox.reel/input-checkbox.css | 37 - .../input-checkbox.reel/input-checkbox.html | 9 - .../ui/input-checkbox.reel/input-checkbox.js | 23 - .../matte/ui/input-date.reel/input-date.html | 9 - .../matte/ui/input-date.reel/input-date.js | 27 - .../ui/input-number.reel/input-number.html | 9 - .../ui/input-number.reel/input-number.js | 27 - .../matte/ui/input-range.reel/input-range.css | 46 - .../ui/input-range.reel/input-range.html | 33 - .../matte/ui/input-range.reel/input-range.js | 326 --- .../matte/ui/input-text.reel/input-text.css | 39 - .../matte/ui/input-text.reel/input-text.html | 9 - .../matte/ui/input-text.reel/input-text.js | 22 - node_modules/matte/ui/list.reel/list.css | 4 - node_modules/matte/ui/list.reel/list.html | 57 - node_modules/matte/ui/list.reel/list.js | 119 -- node_modules/matte/ui/list.reel/list.meta | 101 - .../ui/loading-panel.reel/loading-panel.css | 40 - .../ui/loading-panel.reel/loading-panel.html | 58 - .../ui/loading-panel.reel/loading-panel.js | 32 - .../matte/ui/loading.reel/loading-0.svg | 3 - .../matte/ui/loading.reel/loading-1.svg | 3 - .../matte/ui/loading.reel/loading-2.svg | 3 - .../matte/ui/loading.reel/loading-3.svg | 3 - .../matte/ui/loading.reel/loading-4.svg | 3 - .../matte/ui/loading.reel/loading-5.svg | 3 - .../matte/ui/loading.reel/loading-bg.svg | 31 - .../matte/ui/loading.reel/loading.css | 73 - .../matte/ui/loading.reel/loading.html | 29 - node_modules/matte/ui/loading.reel/loading.js | 53 - .../matte/ui/popup/alert.reel/alert.css | 62 - .../matte/ui/popup/alert.reel/alert.html | 86 - .../matte/ui/popup/alert.reel/alert.js | 127 -- .../matte/ui/popup/confirm.reel/confirm.css | 12 - .../matte/ui/popup/confirm.reel/confirm.html | 88 - .../matte/ui/popup/confirm.reel/confirm.js | 179 -- .../matte/ui/popup/notifier.reel/notifier.css | 10 - .../ui/popup/notifier.reel/notifier.html | 27 - .../matte/ui/popup/notifier.reel/notifier.js | 111 -- .../matte/ui/popup/popup.reel/popup.css | 69 - .../matte/ui/popup/popup.reel/popup.html | 43 - .../matte/ui/popup/popup.reel/popup.js | 561 ------ .../matte/ui/progress.reel/progress.css | 24 - .../matte/ui/progress.reel/progress.html | 23 - .../matte/ui/progress.reel/progress.js | 101 - .../ui/radio-button.reel/radio-button.css | 37 - .../ui/radio-button.reel/radio-button.html | 9 - .../ui/radio-button.reel/radio-button.js | 23 - .../matte/ui/radio-button.reel/radio.png | Bin 1015 -> 0 bytes .../rich-text-linkpopup.css | 26 - .../rich-text-linkpopup.html | 30 - .../rich-text-linkpopup.js | 268 --- .../rich-text-resizer.css | 136 -- .../rich-text-resizer.html | 38 - .../rich-text-resizer.js | 560 ------ .../rich-text-editor-base.js | 1750 ----------------- .../rich-text-editor.css | 26 - .../rich-text-editor.html | 32 - .../rich-text-editor.reel/rich-text-editor.js | 683 ------- .../rich-text-sanitizer.js | 126 -- .../matte/ui/scroll-bars.reel/scroll-bars.css | 62 - .../ui/scroll-bars.reel/scroll-bars.html | 48 - .../matte/ui/scroll-bars.reel/scroll-bars.js | 274 --- .../matte/ui/scroller.reel/scroller.css | 10 - .../matte/ui/scroller.reel/scroller.html | 69 - .../matte/ui/scroller.reel/scroller.js | 250 --- node_modules/matte/ui/select.reel/select.css | 46 - node_modules/matte/ui/select.reel/select.html | 9 - node_modules/matte/ui/select.reel/select.js | 24 - node_modules/matte/ui/select.reel/select.png | Bin 978 -> 0 bytes node_modules/matte/ui/text-input.js | 337 ---- .../matte/ui/text-slider.reel/text-slider.css | 16 - .../ui/text-slider.reel/text-slider.html | 97 - .../matte/ui/text-slider.reel/text-slider.js | 466 ----- .../matte/ui/textarea.reel/textarea.css | 27 - .../matte/ui/textarea.reel/textarea.html | 9 - .../matte/ui/textarea.reel/textarea.js | 22 - .../ui/toggle-button.reel/toggle-button.css | 8 - .../ui/toggle-button.reel/toggle-button.html | 10 - .../ui/toggle-button.reel/toggle-button.js | 176 -- .../ui/toggle-switch.reel/toggle-switch.css | 157 -- .../ui/toggle-switch.reel/toggle-switch.html | 9 - .../ui/toggle-switch.reel/toggle-switch.js | 419 ---- .../token-field.reel/token-field.css | 29 - .../token-field.reel/token-field.html | 80 - .../token-field.reel/token-field.js | 226 --- .../matte/ui/token-field/token.reel/token.css | 49 - .../ui/token-field/token.reel/token.html | 40 - .../matte/ui/token-field/token.reel/token.js | 111 -- .../matte/ui/video-player.reel/README.md | 105 - .../images/fullscreen-enter.png | Bin 1178 -> 0 bytes .../images/fullscreen-exit.png | Bin 1214 -> 0 bytes .../ui/video-player.reel/images/pause.png | Bin 2928 -> 0 bytes .../ui/video-player.reel/images/play.png | Bin 3223 -> 0 bytes .../video-player.reel/images/volume-down.png | Bin 991 -> 0 bytes .../ui/video-player.reel/images/volume-up.png | Bin 1094 -> 0 bytes .../ui/video-player.reel/video-player.css | 315 --- .../ui/video-player.reel/video-player.html | 268 --- .../ui/video-player.reel/video-player.js | 369 ---- package.json | 1 - 147 files changed, 15010 deletions(-) delete mode 100644 node_modules/matte/.npmignore delete mode 100644 node_modules/matte/CHANGES.md delete mode 100644 node_modules/matte/LICENSE.md delete mode 100644 node_modules/matte/README.md delete mode 100644 node_modules/matte/node_modules/native/.npmignore delete mode 100644 node_modules/matte/node_modules/native/CHANGES.md delete mode 100644 node_modules/matte/node_modules/native/LICENSE.md delete mode 100644 node_modules/matte/node_modules/native/README.md delete mode 100644 node_modules/matte/node_modules/native/overview.html delete mode 100644 node_modules/matte/node_modules/native/package.json delete mode 100644 node_modules/matte/node_modules/native/ui/anchor.reel/anchor.js delete mode 100644 node_modules/matte/node_modules/native/ui/button.reel/button.js delete mode 100644 node_modules/matte/node_modules/native/ui/button.reel/button.meta delete mode 100644 node_modules/matte/node_modules/native/ui/check-input.js delete mode 100644 node_modules/matte/node_modules/native/ui/image.reel/image.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-checkbox.reel/input-checkbox.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-date.reel/input-date.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-number.reel/input-number.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-radio.reel/input-radio.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-range.reel/input-range.js delete mode 100644 node_modules/matte/node_modules/native/ui/input-text.reel/input-text.js delete mode 100644 node_modules/matte/node_modules/native/ui/native-control.js delete mode 100644 node_modules/matte/node_modules/native/ui/native-control.meta delete mode 100644 node_modules/matte/node_modules/native/ui/progress.reel/progress.js delete mode 100644 node_modules/matte/node_modules/native/ui/select.reel/select.js delete mode 100644 node_modules/matte/node_modules/native/ui/text-input.js delete mode 100644 node_modules/matte/node_modules/native/ui/textarea.reel/textarea.js delete mode 100644 node_modules/matte/package.json delete mode 100644 node_modules/matte/run-tests.html delete mode 100644 node_modules/matte/ui/anchor.reel/anchor.js delete mode 100644 node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.css delete mode 100644 node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.html delete mode 100644 node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.js delete mode 100644 node_modules/matte/ui/autocomplete/autocomplete.reel/loading.gif delete mode 100644 node_modules/matte/ui/autocomplete/result-item.reel/result-item.js delete mode 100644 node_modules/matte/ui/autocomplete/results-list.reel/results-list.css delete mode 100644 node_modules/matte/ui/autocomplete/results-list.reel/results-list.html delete mode 100644 node_modules/matte/ui/autocomplete/results-list.reel/results-list.js delete mode 100644 node_modules/matte/ui/button.reel/button.css delete mode 100644 node_modules/matte/ui/button.reel/button.html delete mode 100644 node_modules/matte/ui/button.reel/button.js delete mode 100644 node_modules/matte/ui/button.reel/button.meta delete mode 100644 node_modules/matte/ui/component-group.reel/component-group.js delete mode 100644 node_modules/matte/ui/dynamic-element.reel/dynamic-element.js delete mode 100644 node_modules/matte/ui/image.reel/image-description.json delete mode 100644 node_modules/matte/ui/image.reel/image.js delete mode 100644 node_modules/matte/ui/input-checkbox.reel/checkbox.png delete mode 100644 node_modules/matte/ui/input-checkbox.reel/input-checkbox.css delete mode 100644 node_modules/matte/ui/input-checkbox.reel/input-checkbox.html delete mode 100644 node_modules/matte/ui/input-checkbox.reel/input-checkbox.js delete mode 100644 node_modules/matte/ui/input-date.reel/input-date.html delete mode 100644 node_modules/matte/ui/input-date.reel/input-date.js delete mode 100644 node_modules/matte/ui/input-number.reel/input-number.html delete mode 100644 node_modules/matte/ui/input-number.reel/input-number.js delete mode 100644 node_modules/matte/ui/input-range.reel/input-range.css delete mode 100644 node_modules/matte/ui/input-range.reel/input-range.html delete mode 100644 node_modules/matte/ui/input-range.reel/input-range.js delete mode 100644 node_modules/matte/ui/input-text.reel/input-text.css delete mode 100644 node_modules/matte/ui/input-text.reel/input-text.html delete mode 100644 node_modules/matte/ui/input-text.reel/input-text.js delete mode 100644 node_modules/matte/ui/list.reel/list.css delete mode 100644 node_modules/matte/ui/list.reel/list.html delete mode 100644 node_modules/matte/ui/list.reel/list.js delete mode 100644 node_modules/matte/ui/list.reel/list.meta delete mode 100644 node_modules/matte/ui/loading-panel.reel/loading-panel.css delete mode 100644 node_modules/matte/ui/loading-panel.reel/loading-panel.html delete mode 100644 node_modules/matte/ui/loading-panel.reel/loading-panel.js delete mode 100644 node_modules/matte/ui/loading.reel/loading-0.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-1.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-2.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-3.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-4.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-5.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading-bg.svg delete mode 100644 node_modules/matte/ui/loading.reel/loading.css delete mode 100644 node_modules/matte/ui/loading.reel/loading.html delete mode 100644 node_modules/matte/ui/loading.reel/loading.js delete mode 100644 node_modules/matte/ui/popup/alert.reel/alert.css delete mode 100644 node_modules/matte/ui/popup/alert.reel/alert.html delete mode 100644 node_modules/matte/ui/popup/alert.reel/alert.js delete mode 100644 node_modules/matte/ui/popup/confirm.reel/confirm.css delete mode 100644 node_modules/matte/ui/popup/confirm.reel/confirm.html delete mode 100644 node_modules/matte/ui/popup/confirm.reel/confirm.js delete mode 100644 node_modules/matte/ui/popup/notifier.reel/notifier.css delete mode 100644 node_modules/matte/ui/popup/notifier.reel/notifier.html delete mode 100644 node_modules/matte/ui/popup/notifier.reel/notifier.js delete mode 100644 node_modules/matte/ui/popup/popup.reel/popup.css delete mode 100644 node_modules/matte/ui/popup/popup.reel/popup.html delete mode 100644 node_modules/matte/ui/popup/popup.reel/popup.js delete mode 100644 node_modules/matte/ui/progress.reel/progress.css delete mode 100644 node_modules/matte/ui/progress.reel/progress.html delete mode 100644 node_modules/matte/ui/progress.reel/progress.js delete mode 100644 node_modules/matte/ui/radio-button.reel/radio-button.css delete mode 100644 node_modules/matte/ui/radio-button.reel/radio-button.html delete mode 100644 node_modules/matte/ui/radio-button.reel/radio-button.js delete mode 100644 node_modules/matte/ui/radio-button.reel/radio.png delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.css delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.html delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.css delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.html delete mode 100644 node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js delete mode 100644 node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js delete mode 100644 node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.css delete mode 100644 node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.html delete mode 100644 node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js delete mode 100644 node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-sanitizer.js delete mode 100644 node_modules/matte/ui/scroll-bars.reel/scroll-bars.css delete mode 100644 node_modules/matte/ui/scroll-bars.reel/scroll-bars.html delete mode 100644 node_modules/matte/ui/scroll-bars.reel/scroll-bars.js delete mode 100644 node_modules/matte/ui/scroller.reel/scroller.css delete mode 100644 node_modules/matte/ui/scroller.reel/scroller.html delete mode 100644 node_modules/matte/ui/scroller.reel/scroller.js delete mode 100644 node_modules/matte/ui/select.reel/select.css delete mode 100644 node_modules/matte/ui/select.reel/select.html delete mode 100644 node_modules/matte/ui/select.reel/select.js delete mode 100644 node_modules/matte/ui/select.reel/select.png delete mode 100644 node_modules/matte/ui/text-input.js delete mode 100644 node_modules/matte/ui/text-slider.reel/text-slider.css delete mode 100644 node_modules/matte/ui/text-slider.reel/text-slider.html delete mode 100644 node_modules/matte/ui/text-slider.reel/text-slider.js delete mode 100644 node_modules/matte/ui/textarea.reel/textarea.css delete mode 100644 node_modules/matte/ui/textarea.reel/textarea.html delete mode 100644 node_modules/matte/ui/textarea.reel/textarea.js delete mode 100644 node_modules/matte/ui/toggle-button.reel/toggle-button.css delete mode 100644 node_modules/matte/ui/toggle-button.reel/toggle-button.html delete mode 100644 node_modules/matte/ui/toggle-button.reel/toggle-button.js delete mode 100644 node_modules/matte/ui/toggle-switch.reel/toggle-switch.css delete mode 100644 node_modules/matte/ui/toggle-switch.reel/toggle-switch.html delete mode 100644 node_modules/matte/ui/toggle-switch.reel/toggle-switch.js delete mode 100644 node_modules/matte/ui/token-field/token-field.reel/token-field.css delete mode 100644 node_modules/matte/ui/token-field/token-field.reel/token-field.html delete mode 100644 node_modules/matte/ui/token-field/token-field.reel/token-field.js delete mode 100644 node_modules/matte/ui/token-field/token.reel/token.css delete mode 100644 node_modules/matte/ui/token-field/token.reel/token.html delete mode 100644 node_modules/matte/ui/token-field/token.reel/token.js delete mode 100644 node_modules/matte/ui/video-player.reel/README.md delete mode 100644 node_modules/matte/ui/video-player.reel/images/fullscreen-enter.png delete mode 100644 node_modules/matte/ui/video-player.reel/images/fullscreen-exit.png delete mode 100644 node_modules/matte/ui/video-player.reel/images/pause.png delete mode 100644 node_modules/matte/ui/video-player.reel/images/play.png delete mode 100644 node_modules/matte/ui/video-player.reel/images/volume-down.png delete mode 100644 node_modules/matte/ui/video-player.reel/images/volume-up.png delete mode 100644 node_modules/matte/ui/video-player.reel/video-player.css delete mode 100644 node_modules/matte/ui/video-player.reel/video-player.html delete mode 100644 node_modules/matte/ui/video-player.reel/video-player.js diff --git a/node_modules/matte/.npmignore b/node_modules/matte/.npmignore deleted file mode 100644 index 72f8f5a3..00000000 --- a/node_modules/matte/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.idea -node_modules -overview -run-test.html -test -testacular.conf.js diff --git a/node_modules/matte/CHANGES.md b/node_modules/matte/CHANGES.md deleted file mode 100644 index b464c156..00000000 --- a/node_modules/matte/CHANGES.md +++ /dev/null @@ -1,12 +0,0 @@ -### 0.1.4 - - - Update native dependency to v0.1.3 - - Updated blueprints - - Dispatch an action event when the select.reel is changed by the user - - Fix confirm.reel buttons taking given values - - Add video-player.reel - -### 0.1.3 - - - Stop re-establishing bindings in list so `contentController` or `content` - can be set multiple times diff --git a/node_modules/matte/LICENSE.md b/node_modules/matte/LICENSE.md deleted file mode 100644 index 2681f5ca..00000000 --- a/node_modules/matte/LICENSE.md +++ /dev/null @@ -1,55 +0,0 @@ -============================================================================ -Copyright (c) 2013, François Frisch -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -========================================== -Copyright (c) 2012, Motorola Mobility LLC. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Motorola Mobility LLC nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/matte/README.md b/node_modules/matte/README.md deleted file mode 100644 index 83d31489..00000000 --- a/node_modules/matte/README.md +++ /dev/null @@ -1,33 +0,0 @@ -matte -============== - -This is the Montage package template. - -Note: Before working on your package you will need to add montage to it. - -``` -npm install . -``` - -Layout ------- - -The template contains the following files and directories: - -* `ui/` – Directory containing all the UI .reel directories. -* `package.json` – Describes your app and its dependencies -* `README.md` – This readme. Replace the current content with a description of your app -* `overview.html` -* `overview/` – Directory that contains the files for the overview page. This is a different package so you will need to require the component using matte/*. - * `main.reel` – The main interface component where you can add the components to show. -* `node_modules/` – Directory containing all npm packages needed, including Montage. Any packages here must be included as `dependencies` in `package.json` for the Montage require to find them. -* `test/` – Directory containing tests for your package. - * `all.js` – Module that point the test runner to all your jasmine specs. -* `run-tests.html` – Page to run jasmine tests manually in your browser -* `testacular.conf.js` – This is the testacular configuration file. You can start testacular by running `node_modules/testacular/bin/testacular start` - -Create the following directories if you need them: - -* `locale/` – Directory containing localized content. -* `scripts/` – Directory containing other JS libraries. If a library doesn’t support the CommonJS "exports" object it will need to be loaded through a ` - - - -
Loading
- - diff --git a/node_modules/matte/node_modules/native/package.json b/node_modules/matte/node_modules/native/package.json deleted file mode 100644 index f6eab1af..00000000 --- a/node_modules/matte/node_modules/native/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "native", - "version": "0.2.0", - "repository": { - "type": "git", - "url": "https://github.com/montagejs/native.git" - }, - "dependencies": { - "montage": "~0.14.0" - }, - "devDependencies": { - "montage-testing": "~0.4.0" - }, - "exclude": [ - "overview.html", - "overview", - "run-tests.html", - "test" - ], - "readme": "montage-native\n==============\n\nThis is the Montage package template.\n\nNote: Before working on your package you will need to add montage to it.\n\n```\nnpm install .\n```\n\nLayout\n------\n\nThe template contains the following files and directories:\n\n* `ui/` – Directory containing all the UI .reel directories.\n* `package.json` – Describes your app and its dependencies\n* `README.md` – This readme. Replace the current content with a description of your app\n* `overview.html`\n* `overview/` – Directory that contains the files for the overview page. This is a different package so you will need to require the component using montage-native/*.\n * `main.reel` – The main interface component where you can add the components to show.\n* `node_modules/` – Directory containing all npm packages needed, including Montage. Any packages here must be included as `dependencies` in `package.json` for the Montage require to find them.\n* `test/` – Directory containing tests for your package.\n * `all.js` – Module that point the test runner to all your jasmine specs.\n* `run-tests.html` – Page to run jasmine tests manually in your browser\n* `testacular.conf.js` – This is the testacular configuration file. You can start testacular by running `node_modules/testacular/bin/testacular start`\n\nCreate the following directories if you need them:\n\n* `locale/` – Directory containing localized content.\n* `scripts/` – Directory containing other JS libraries. If a library doesn’t support the CommonJS \"exports\" object it will need to be loaded through a ` - - - - - - - - diff --git a/node_modules/matte/ui/anchor.reel/anchor.js b/node_modules/matte/ui/anchor.reel/anchor.js deleted file mode 100644 index 1a48b5ca..00000000 --- a/node_modules/matte/ui/anchor.reel/anchor.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - module:"matte/ui/anchor.reel" -*/ - -/*global require,exports */ -var Component = require("montage/ui/component").Component, - NativeAnchor = require("native/ui/anchor.reel").Anchor; - -/** - * Montage Anchor - * @class module:"matte/ui/anchor.reel".Anchor - * @extends module:"native/ui/anchor.reel".Anchor - */ -exports.Anchor = NativeAnchor.specialize(/** @lends module:"matte/ui/anchor.reel".Anchor# */{ - - hasTemplate: {value: false}, - - constructor: { - value: function Anchor() { - this.super(); - this.classList.add("matte-Anchor"); - } - } -}); diff --git a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.css b/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.css deleted file mode 100644 index 41f7c084..00000000 --- a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.css +++ /dev/null @@ -1,7 +0,0 @@ - .matte-Autocomplete { - padding-right: 20px; - } - .matte-Autocomplete--loading { - background: url('loading.gif') no-repeat; - background-position: right; - } diff --git a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.html b/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.html deleted file mode 100644 index 61e88f5f..00000000 --- a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.js b/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.js deleted file mode 100644 index 6274db18..00000000 --- a/node_modules/matte/ui/autocomplete/autocomplete.reel/autocomplete.js +++ /dev/null @@ -1,538 +0,0 @@ - -/** - @module "matte/ui/autocomplete/autocomplete.reel" -*/ - -var Component = require("montage/ui/component").Component, - TextInput = require("ui/text-input").TextInput, - logger = require("montage/core/logger").logger("autocomplete"), - ResultsList = require("ui/autocomplete/results-list.reel/results-list").ResultsList, - Popup = require("ui/popup/popup.reel").Popup, - PressComposer = require("montage/composer/press-composer").PressComposer, - RangeController = require("montage/core/range-controller").RangeController; - -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 component - @class module:"matte/ui/autocomplete/autocomplete.reel".Autocomplete - @extends module:matte/ui/text-input.TextInput -*/ -var Autocomplete = exports.Autocomplete = TextInput.specialize(/** @lends module:"matte/ui/autocomplete/autocomplete.reel".Autocomplete# */ { - - constructor: { - value: function Autocomplete() { - this.super(); - this.delay = 500; - this.minLength = 2; - - this.classList.add("matte-InputText"); - } - }, - - hasTemplate: {value: true}, - -/** - The AutoComplete instance's delegate object. - @type {Object} -*/ - delegate: { - value: null - }, - - /** - * If the delegate returns Objects, this property can be used to derive the - * display string for an object. If this property is not provided, the results - * provided by the delegate are assumed to be String. - @type {String} - */ - textPropertyPath: { - value: null - }, - -/** - The string separator to use between tokens in the AutoComplete. - @type {String} - @default {Boolean} "," -*/ - separator: { - value: ',', - distinct: true - }, - - _delay: {value: null}, - -/** - The delay in milliseconds between when the user modifies the input field and when the query to retrieve suggestions is executed. - @type {Number} - @defaultvalue 500 -*/ - delay: { - get: function(){ - return this._delay; - }, - set: function(value) { - if(value !== this._delay) { - if(typeof value === "string") { - value = parseInt(value, 10); - } - this._delay = value; - } - } - }, - - /** - * The number of characters the user must type before the query for suggeseted tokens executes. - * @type {Number} - */ - minLength: { - value: null - }, - - _tokens: {value: null}, -/** - Gets and sets the tokens being displayed by the AutoComplete component. - @type {Array} -*/ - tokens: { - get: function() { - return this._tokens; - }, - set: function(value) { - this._tokens = value; - this._valueSyncedWithInputField = false; - this.needsDraw = true; - }, - modify: function(v) { - this._tokens = v; - } - }, - - // 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(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(); - }); - } else { - this.activeTokenIndex = 0; - this._tokens = []; - } - - if(fromInput) { - this._valueSyncedWithInputField = true; - this.showPopup = false; - 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; - 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: { - enumerable: false, - get: function() { - return this._suggestedValue; - }, - set: function(aValue) { - this._suggestedValue = aValue; - if(aValue) { - - var arr = this.tokens || []; - var token; - - if(typeof aValue === "string") { - token = aValue; - } else { - if(this.textPropertyPath) { - token = aValue[this.textPropertyPath]; - } else { - token = ''; - } - } - - arr[this.activeTokenIndex] = token; - 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.content - _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) { - this.resultsController.selectedIndexes = []; - // index on the popup - this.activeItemIndex = 0; - this.loadingStatus = 'loading'; - var delegateFn = this.callDelegateMethod('ShouldGetSuggestions', this, searchTerm); - - } - } - }, - - - _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 = new Popup(); - 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 - }; - - } - }, - - enterDocument: { - value: function(firstTime) { - if (firstTime) { - this._addEventListeners(); - this.element.classList.add('matte-Autocomplete'); - - // create the Repetition for the suggestions - this.resultsController = new RangeController(); - this.resultsController.selection = []; - - this.defineBinding("resultsController.content", { - "<-": "suggestions" - }); - this.defineBinding("suggestedValue", { - "<-": "resultsController.selection[0]" - }); - - this.resultsList = new ResultsList(); - this.defineBinding("resultsList.contentController", { - "<-": "resultsController" - }); - this.defineBinding("resultsList.activeIndexes", { - "<-": "_activeIndexes" - }); - this.defineBinding("resultsList.textPropertyPath", { - "<-": "textPropertyPath" - }); - - this._getPopup(); - } - } - }, - - prepareForActivationEvents: { - value: function() { - // add pressComposer to handle the claimPointer related work - var pressComposer = new PressComposer(); - this.addComposer(pressComposer); - } - }, - - draw: { - value: function() { - this.super(); - - if (!this._valueSyncedWithInputField) { - if(this.tokens) { - this.value = this.tokens.join(this.separator); - } - if(this.value && this.value.charAt(this.value.length-1) != this.separator) { - this.value += this.separator; - } - this.element.value = this.value; - this._valueSyncedWithInputField = true; - } - var showPopup = this.showPopup; - if(this.value === '') { - showPopup = false; - } - - if(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']('matte-Autocomplete--loading'); - - - } - }, - - - handleKeyup: { - enumerable: false, - value: function(e) { - var code = e.keyCode, popup = this._getPopup(); - - switch(code) { - case KEY_DOWN: - if(!popup.displayed) { - 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.selection = [this.suggestions[this.activeItemIndex]]; - e.preventDefault(); - // select the currently active item in the results list - } else { - this.suggestedValue = this.tokens[this.tokens.length-1]; - } - - break; - - } - this.element.focus(); - } - } - -}); - diff --git a/node_modules/matte/ui/autocomplete/autocomplete.reel/loading.gif b/node_modules/matte/ui/autocomplete/autocomplete.reel/loading.gif deleted file mode 100644 index 18abf9aa158a600ffac56d5354393c90cd113090..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1456 zcmb`GYfM{J9Kg?@JT7#DGU?iiqs3d~CGELI@#*5F|vr7dO)AClk-d^W}Gbzw`e` zU6u%gq>jK5>;Z6ebOZo6I5;RTFIOlOTU%SBqoWH83wphtxYug6BO@aMfgmX)V4 zv9VF7)9vi+KnPu2Tsk{D8yXs_tE+c+clY=Ao12>_Cnv>XF_lWq&dy$1T3TOU@9XRH z^70A{43tPDb8~aU!^0sVA#rhWB9SOMI(lkqYHVyQJw3gvt7~Ipqp+~Bt*x!QySuly zH!CYEBO@axCr2)qFE1~bl$0DE9@f{_GZ+jXAD`6JR0@TXkdQDjF(DKR)6&vdEY|k+ z_Wb;OO-;?p%F5c>T4-pf(P%_bl+9+hx3?D+6~)BF`1|`86co(N%nS?+xVyU-7Z-bgZtf#>U3(?d_RNro6no{QUgI#YKa`;N;}w=H^B;`F{`RPgX?H z4e9M0x$Mtw-p*%B3#6Zaa!Z=)d-K!0TY&Qi1=tcm&XIjwWJ+>GSVE-0mv4EBxbh+2 zL4G2z$^QaCjP2&m#gxF_i3KQ=T29u`x?Z@Zv_hIh%?C2}L zg*pFNp3uM)N??f~&VcLWrKCZMh8`M*xJP0%Cga#iDAGt2^~&?%5&lssLSEd}MJ6jl zdjLn{@obQ)@f^g6NDsz)zERCW!wbk@Rwxz$Ixs)Z?Vmo8w={=;M9Rx>IplInF&c)V zKx`kEBqNx(!(}89ufn5a;*-_5E8nUSCnEuFnVPKh-IG$DN!SXBEXGzzfqA4iZ%qW$M49 zG?r3Y=!WAG24a@*TFg5&Ewv9ms30r6FKUs z;KM2)&A94!#%&(SbLbbeF;ZrRsX2NL#i{}_O+&j~V6YKG - - - - - - - -
-
    -
  • -
-
- - diff --git a/node_modules/matte/ui/autocomplete/results-list.reel/results-list.js b/node_modules/matte/ui/autocomplete/results-list.reel/results-list.js deleted file mode 100644 index fa19ec94..00000000 --- a/node_modules/matte/ui/autocomplete/results-list.reel/results-list.js +++ /dev/null @@ -1,11 +0,0 @@ -var Component = require("montage/ui/component").Component; - -exports.ResultsList = Component.specialize({ - - textPropertyPath: {value: null}, - - // contentController -> this.repetition.contentController - contentController: {value: null}, - - activeIndexes: {value: null} -}); diff --git a/node_modules/matte/ui/button.reel/button.css b/node_modules/matte/ui/button.reel/button.css deleted file mode 100644 index 1e8208da..00000000 --- a/node_modules/matte/ui/button.reel/button.css +++ /dev/null @@ -1,65 +0,0 @@ - -.matte-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 */ -.matte-Button:hover { - background-color: #fff; - color: #000; -} - -.matte-Button:active { - background-color: #e5e5e5; -} - -.matte-Button:focus { - border-color: #7f7f7f; -} - - -/* Variations ------------------------------------ */ - -.matte-Button--glass { - margin: 0; - border-radius: 0; - border: none; -} - -.matte-Button--glass, -.matte-Button--glass:hover, -.matte-Button--glass:active { - background-color: transparent; -} - - -/* ButtonGroup ------------------------------- */ - -.matte-ButtonGroup { - padding-left: 5px; /* Add the negative margin back */ -} - -.matte-ButtonGroup > .matte-Button { - margin: 0; - border-radius: 0; - margin-left: -5px; /* Remove the space inbetween */ -} - -.matte-ButtonGroup > .matte-Button:first-child { - border-radius: 3px 0 0 3px; -} - -.matte-ButtonGroup > .matte-Button:last-child { - border-radius: 0 3px 3px 0; -} diff --git a/node_modules/matte/ui/button.reel/button.html b/node_modules/matte/ui/button.reel/button.html deleted file mode 100644 index 2d937dbb..00000000 --- a/node_modules/matte/ui/button.reel/button.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/matte/ui/button.reel/button.js b/node_modules/matte/ui/button.reel/button.js deleted file mode 100644 index e64c9d40..00000000 --- a/node_modules/matte/ui/button.reel/button.js +++ /dev/null @@ -1,22 +0,0 @@ -/*global require,exports */ -/** - module:"matte/ui/button.reel" -*/ -var NativeButton = require("native/ui/button.reel").Button; - -/** - * Montage Button - @class module:"matte/ui/button.reel".Button - @extends module:"native/ui/button.reel".Button -*/ -exports.Button = NativeButton.specialize(/** @lends module:"matte/ui/button.reel".Button# */ { - - hasTemplate: {value: true}, - - constructor: { - value: function Button() { - this.super(); - this.classList.add("matte-Button"); - } - } -}); diff --git a/node_modules/matte/ui/button.reel/button.meta b/node_modules/matte/ui/button.reel/button.meta deleted file mode 100644 index 9ce02464..00000000 --- a/node_modules/matte/ui/button.reel/button.meta +++ /dev/null @@ -1,34 +0,0 @@ -{ - "blueprint_nativebutton_reference": { - "prototype": "montage/core/meta/blueprint-reference", - "properties": { - "valueReference": { - "blueprintName": "NativeButton", - "prototypeName": "NativeButton", - "blueprintModule": { - "%": "native/ui/button.reel/button.meta" - } - } - } - }, - "root": { - "prototype": "montage/core/meta/module-blueprint", - "properties": { - "name": "Button", - "customPrototype": false, - "parent": { - "@": "blueprint_nativebutton_reference" - }, - "propertyBlueprints": [], - "propertyBlueprintGroups": {}, - "propertyValidationRules": {}, - "blueprintModule": { - "%": "matte/ui/button.reel/button.meta" - }, - "exportName": "Button", - "module": { - "%": "ui/button.reel" - } - } - } -} diff --git a/node_modules/matte/ui/component-group.reel/component-group.js b/node_modules/matte/ui/component-group.reel/component-group.js deleted file mode 100644 index dcda2242..00000000 --- a/node_modules/matte/ui/component-group.reel/component-group.js +++ /dev/null @@ -1,25 +0,0 @@ -// TODO: ComponentList instead? ComponentContainer? -/** - module:"matte/ui/component-group.reel" -*/ -var Component = require("montage/ui/component").Component; - -/** - @class module:"matte/ui/component-group.reel".ComponentGroup - @extends module:montage/ui/component.Component - */ -exports.ComponentGroup = Component.specialize(/** @lends module:"matte/ui/component-group.reel".ComponentGroup# */ { - - hasTemplate: {value: false}, - -/** - Initializes the ComponentGroup instance's childComponents array with the specified array of components. - @function - @param {Component} components Components to be initialized. - @returns itself -*/ - initWithComponents: {value: function(components) { - this.childComponents = components; - return this; - }} -}); diff --git a/node_modules/matte/ui/dynamic-element.reel/dynamic-element.js b/node_modules/matte/ui/dynamic-element.reel/dynamic-element.js deleted file mode 100644 index b543e46b..00000000 --- a/node_modules/matte/ui/dynamic-element.reel/dynamic-element.js +++ /dev/null @@ -1,175 +0,0 @@ -/* -Copyright (c) 2012, Motorola Mobility LLC. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Motorola Mobility LLC nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - */ -/** - module:"matte/ui/dynamic-element.reel" -*/ -var Component = require("montage/ui/component").Component; - - -/** - The DynamicElement is a general purpose component that aims to expose all the properties of the element as a component. - @class module:"matte/ui/dynamic-element.reel".DynamicElement - @extends module:montage/ui/component.Component -*/ -exports.DynamicElement = Component.specialize(/** @lends module:"matte/ui/dynamic-element.reel".DynamicElement# */ { - - hasTemplate: { - value: false - }, - - _innerHTML: { - value: null - }, - - _usingInnerHTML: { - value: null - }, - - /** - The innerHTML displayed as the content of the DynamicElement - @type {Property} - @default null - */ - innerHTML: { - get: function() { - return this._innerHTML; - }, - set: function(value) { - this._usingInnerHTML = true; - if (this._innerHTML !== value) { - this._innerHTML = value; - this.needsDraw = true; - } - } - }, - - /** - The default html displayed if innerHTML is falsy. - @type {Property} - @default {String} "" - */ - defaultHTML: { - value: "" - }, - - _allowedTagNames: { - value: null - }, - - /** - White list of allowed tags in the innerHTML - @type {Property} - @default null - */ - allowedTagNames: { - get: function() { - return this._allowedTagNames; - }, - set: function(value) { - if (this._allowedTagNames !== value) { - this._allowedTagNames = value; - this.needsDraw = true; - } - } - }, - - - - _range: { - value: null - }, - - enterDocument: { - value: function(firstTime) { - if (firstTime) { - var range = document.createRange(), - className = this.element.className; - range.selectNodeContents(this.element); - this._range = range; - } - } - }, - - _contentNode: { - value: null - }, - - draw: { - value: function() { - // get correct value - var displayValue = (this.innerHTML || 0 === this.innerHTML ) ? this.innerHTML : this.defaultHTML, - content, allowedTagNames = this.allowedTagNames, range = this._range, elements; - - //push to DOM - if(this._usingInnerHTML) { - if (allowedTagNames !== null) { - //cleanup - this._contentNode = null; - range.deleteContents(); - //test for tag white list - content = range.createContextualFragment( displayValue ); - if(allowedTagNames.length !== 0) { - elements = content.querySelectorAll("*:not(" + allowedTagNames.join("):not(") + ")"); - } else { - elements = content.childNodes; - } - if (elements.length === 0) { - range.insertNode(content); - if(range.endOffset === 0) { - // according to https://bugzilla.mozilla.org/show_bug.cgi?id=253609 Firefox keeps a collapsed - // range collapsed after insertNode - range.selectNodeContents(this.element); - } - - } else { - console.warn("Some Elements Not Allowed " , elements); - } - } else { - content = this._contentNode; - if(content === null) { - //cleanup - range.deleteContents(); - this._contentNode = content = document.createTextNode(displayValue); - range.insertNode(content); - if(range.endOffset === 0) { - // according to https://bugzilla.mozilla.org/show_bug.cgi?id=253609 Firefox keeps a collapsed - // range collapsed after insert - range.selectNodeContents(this.element); - } - - } else { - content.data = displayValue; - } - } - } - } - } -}); diff --git a/node_modules/matte/ui/image.reel/image-description.json b/node_modules/matte/ui/image.reel/image-description.json deleted file mode 100644 index 43c97257..00000000 --- a/node_modules/matte/ui/image.reel/image-description.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "image_description_alt":{ - "prototype":"ui/component-description[ComponentPropertyDescription]", - "properties":{ - "_componentDescription":{ - "@":"root" - }, - "_name":"alt", - "_valueType":"string", - "helpString":"Alternative text to be displayed if the image is not available to the user" - } - }, - - "image_description_src":{ - "prototype":"ui/component-description[ComponentPropertyDescription]", - "properties":{ - "_componentDescription":{ - "@":"root" - }, - "_name":"src", - "_valueType":"file", - "helpString":"The image resource to display" - } - }, - - "image_description_width":{ - "prototype":"ui/component-description[ComponentPropertyDescription]", - "properties":{ - "_componentDescription":{ - "@":"root" - }, - "_name":"width", - "_valueType":"number", - "helpString":"The rendered width of the image in CSS pixels" - } - }, - - "image_description_height":{ - "prototype":"ui/component-description[ComponentPropertyDescription]", - "properties":{ - "_componentDescription":{ - "@":"root" - }, - "_name":"height", - "_valueType":"number", - "helpString":"The rendered height of the image in CSS pixels" - } - }, - - "root":{ - "prototype":"ui/component-description", - "properties":{ - "_componentPropertyDescriptions":{ - "alt":{ - "@":"image_description_alt" - }, - "src":{ - "@":"image_description_src" - }, - "width":{ - "@":"image_description_width" - }, - "height":{ - "@":"image_description_height" - } - }, - "_componentPropertyDescriptionGroups":{ - "base":[ - { - "@":"image_description_alt" - }, - { - "@":"image_description_src" - }, - { - "@":"image_description_width" - }, - { - "@":"image_description_height" - } - ] - }, - "_componentPropertyValidationRules":{ - } - } - } -} diff --git a/node_modules/matte/ui/image.reel/image.js b/node_modules/matte/ui/image.reel/image.js deleted file mode 100644 index 4a70e60e..00000000 --- a/node_modules/matte/ui/image.reel/image.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - @module "matte/ui/image.reel" - */ - -/*global require,exports */ -var AbstractImage = require("montage/ui/base/abstract-image").AbstractImage; - -/** - * Image - * @class module:"matte/ui/image.reel".Image - * @extends module:"montage/ui/base/abstract-image.reel".AbstractImage - */ -exports.Image = AbstractImage.specialize(/** @lends module:"matte/ui/image.reel".Image */ { - hasTemplate: { - value: false - }, - - constructor: { - value: function Image() { - this.super(); - this.classList.add("matte-image"); - } - } - -}); diff --git a/node_modules/matte/ui/input-checkbox.reel/checkbox.png b/node_modules/matte/ui/input-checkbox.reel/checkbox.png deleted file mode 100644 index 8c0e36475d49107bebae5cb6e235f6946e015968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1087 zcmaJ=OK1~87+w?m@KLlB4;GZ^wmy(1`$*Gtm!@TtZJLN%LK?9r$!2%jF6}Ydr?ugAt9({9)grE_rVO5)!{== zVJkuSNiExhdZc~4V(LNJ!vtO3!fb+QZFenM8Gs1nVV`D1$uBbxNT8`v@<3RkB`Xg5 zwd9BmyGOdR%E*AisbqT_XmxokphF}BS06MS-i?wAx;$Qc+Y|{FAZQ>;E}H6*(jacy z5QKwtK%tvy(98sxP*WrlX#_0I&=k#53>#n~e2C>~8Z3Pz&StBv>_^Dr zDXLg328*GfY4=eK$8nwp%LXta;0zl`b_0e}Us4dEqu82-G}8c{qMSDiC`w|dizVpR zvaI1O9TPq<%9SmO3DRCkC7>kzAFAuiXa{BBU%x8~JK13iQW@x&1zW)v*IVzUviP_S zWn|h}(;O_FV!Gc%rqgd)Al@AYlB{Tk7cbx?iBB00k_`o>#3+dsf|{oCajq#WFd-o< zbi^2@gAw9vQ%izNGzn~kZ5F~Mu4pO+9U7>_RWUcx5)OqU42!w(6}et3=oZc_LR%Yx zYQi>kuuw9ut?s2|buWutbpT*nXmH)b-c+kIin{U+Js4 zFn7L|xbB;Ly{_~77w+Nlc-@ofpXtvP6NiP3J152V&GQxSd=1~eC139HNo86tH$7w> zJf&W#Kl^smjR>)&{PDirns+fUG3bM7e+WO!c0MiaD$N z{ - - - - - - - - diff --git a/node_modules/matte/ui/input-checkbox.reel/input-checkbox.js b/node_modules/matte/ui/input-checkbox.reel/input-checkbox.js deleted file mode 100644 index 60cb13ea..00000000 --- a/node_modules/matte/ui/input-checkbox.reel/input-checkbox.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - @module "matte/ui/input-checkbox.reel" -*/ -/*global require,exports */ -var NativeInputCheckbox = require("native/ui/input-checkbox.reel").InputCheckbox; - -/** - * Input Checkbox - * @class module:"matte/ui/input-checkbox.reel".InputCheckbox - * @extends module:"native/ui/input-checkbox.reel".InputCheckbox - */ -exports.InputCheckbox = NativeInputCheckbox.specialize(/** module:"matte/ui/input-checkbox.reel".InputCheckbox */ { - - hasTemplate: {value: true}, - - constructor: { - value: function() { - this.super(); - this.classList.add("matte-InputCheckbox"); - } - } - -}); diff --git a/node_modules/matte/ui/input-date.reel/input-date.html b/node_modules/matte/ui/input-date.reel/input-date.html deleted file mode 100644 index ac18a01d..00000000 --- a/node_modules/matte/ui/input-date.reel/input-date.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/matte/ui/input-date.reel/input-date.js b/node_modules/matte/ui/input-date.reel/input-date.js deleted file mode 100644 index b4962e0f..00000000 --- a/node_modules/matte/ui/input-date.reel/input-date.js +++ /dev/null @@ -1,27 +0,0 @@ - -/** - @module "matte/ui/input-date.reel" -*/ - -var NativeInputDate = require("native/ui/input-date.reel").InputDate; - -/** - * Wraps the a <input type="date"> element with binding support for the element's standard attributes. - @class module:"matte/ui/input-date.reel".InputDate - @extends module:"native/ui/input-date.reel".InputDate - */ -exports.InputDate = NativeInputDate.specialize({ - - hasTemplate: { - value: true - }, - - constructor: { - value: function InputDate() { - this.super(); - this.classList.add("matte-InputDate"); - this.classList.add("matte-InputText"); - } - } - -}); diff --git a/node_modules/matte/ui/input-number.reel/input-number.html b/node_modules/matte/ui/input-number.reel/input-number.html deleted file mode 100644 index b3650ba8..00000000 --- a/node_modules/matte/ui/input-number.reel/input-number.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/matte/ui/input-number.reel/input-number.js b/node_modules/matte/ui/input-number.reel/input-number.js deleted file mode 100644 index 0bffb09a..00000000 --- a/node_modules/matte/ui/input-number.reel/input-number.js +++ /dev/null @@ -1,27 +0,0 @@ - -/** - @module "matte/ui/input-number.reel" -*/ - -var NativeInputNumber = require("native/ui/input-number.reel").InputNumber; - -/** - * Wraps the a <input type="date"> element with binding support for the element's standard attributes. - @class module:"matte/ui/input-number.reel".InputNumber - @extends module:"native/ui/input-number.reel".InputNumber - */ -exports.InputNumber = NativeInputNumber.specialize(/** @lends module:"matte/ui/input-number.reel".InputNumber */{ - - hasTemplate: { - value: true - }, - - constructor: { - value: function InputNumber() { - this.super(); - this.classList.add("matte-InputNumber"); - this.classList.add("matte-InputText"); - } - } - -}); diff --git a/node_modules/matte/ui/input-range.reel/input-range.css b/node_modules/matte/ui/input-range.reel/input-range.css deleted file mode 100644 index 51e748d1..00000000 --- a/node_modules/matte/ui/input-range.reel/input-range.css +++ /dev/null @@ -1,46 +0,0 @@ - -.matte-InputRange { - position: relative; - display: inline-block; - box-sizing: border-box; - width: 150px; - height: 10px; - border-radius: 3px; - border: 1px solid #b3b3b3; - background-color: #d9d9d9; -} - -.matte-InputRange-thumb { - position: absolute; - font-size: inherit; - box-sizing: border-box; - margin: -14px 0 0 -1px; - border-radius: 14px; - width: 28px; - height: 28px; - left: 0; - top: 50%; - border: 1px solid #b3b3b3; - background-color: #f2f2f2; - cursor: pointer; -} - -/* States */ -.matte-InputRange-thumb:hover { - background-color: #fff; -} -.matte-InputRange-thumb:active { - background-color: #e5e5e5; -} -.matte-InputRange-thumb:focus { - border-color: #7f7f7f; -} -.matte-InputRange-thumb:before { - content: ""; - position: absolute; - top: -7px; - left: -7px; - right: -7px; - bottom: -7px; - border-radius: 50%; -} diff --git a/node_modules/matte/ui/input-range.reel/input-range.html b/node_modules/matte/ui/input-range.reel/input-range.html deleted file mode 100644 index d8da4e62..00000000 --- a/node_modules/matte/ui/input-range.reel/input-range.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - -
-
-
- - diff --git a/node_modules/matte/ui/input-range.reel/input-range.js b/node_modules/matte/ui/input-range.reel/input-range.js deleted file mode 100644 index cf185435..00000000 --- a/node_modules/matte/ui/input-range.reel/input-range.js +++ /dev/null @@ -1,326 +0,0 @@ -/** - module:"matte/ui/input-range.reel" -*/ -/*global require,exports */ -var Component = require("montage/ui/component").Component, - dom = require("montage/core/dom"); - -/** - * The input type="range" field - * @class module:"matte/ui/input-range.reel".InputRange - * @extends module:"montage/ui/component".Component - */ -exports.InputRange = Component.specialize(/** @lends module:"matte/ui/input-range.reel".InputRange */ { - - // public API - _min: { - value: null - }, - - min: { - get: function() { - return this._min; - }, - set: function(value) { - this._min = typeof value === "string" ? parseFloat(value) : value; - this.needsDraw = true; - } - }, - - _max: { - value: null - }, - - max: { - get: function() { - return this._max; - }, - set: function(value) { - this._max = typeof value === "string" ? parseFloat(value) : value; - this.needsDraw = true; - } - }, - - _step: { - value: null - }, - - step: { - get: function() { - return this._step; - }, - set: function(value) { - this._step = typeof value === "string" ? parseFloat(value) : value; - this.needsDraw = true; - } - }, - - /** Width of the slider in px. Default = 300 */ - _width: { - value: null - }, - - width: { - get: function() { - return this._width; - }, - set: function(value) { - this._width = typeof value === "string" ? parseFloat(value) : value; - this.needsDraw = true; - } - }, - - percent: { - value: null - }, - - _valueSyncedWithPosition: { - value: null - }, - - _value: { - value: null - }, - - value: { - get: function() { - return this._value; - }, - set: function(value, fromInput) { - this._value = typeof value === "string" ? parseFloat(value) : value; - //console.log('value set', this._value); - if(fromInput) { - this._valueSyncedWithPosition = true; - } else { - this._valueSyncedWithPosition = false; - this.needsDraw = true; - } - } - }, - - // private - _handleEl: { - value: null - }, - - _translateComposer: { - value: null - }, - - _sliderWidth: { - value: null - }, - - __positionX: { - value: null - }, - - _positionX: { - get: function() { - return this.__positionX; - }, - set: function(value, fromValue) { - //console.log('positionX', value); - if(value !== null && !isNaN(value)) { - this.__positionX = value; - if(!fromValue) { - this._calculateValueFromPosition(); - } - this.needsDraw = true; - } - } - }, - - _touchOnHandle: {value: null}, - - __clickTarget: {value: null}, - _clickTarget: { - get: function() { - return this.__clickTarget; - }, - set: function(value) { - this.__clickTarget = value; - this.needsDraw = true; - } - }, - - _handleWidth: {value: null}, - - _calculateValueFromPosition: { - value: function() { - if(this._sliderWidth > 0) { - var percent = this.percent = (this._positionX / this._sliderWidth) * 100; - var value = (this.min + ((percent/100) * (this.max - this.min))); - Object.getPropertyDescriptor(this, "value").set.call(this, value, true); - this._valueSyncedWithPosition = true; - } - - } - }, - - _calculatePositionFromValue: { - value: function() { - // unless the element is ready, we cannot position the handle - if(this._sliderWidth) { - var percent, value = this.value; - var range = (this.max - this.min); - percent = ((this.value-this.min)/range) * 100; - var positionX = (percent/100)*this._sliderWidth; - Object.getPropertyDescriptor(this, "_positionX").set.call(this, positionX, true); - - this.percent = percent; - this._valueSyncedWithPosition = true; - } else { - this._valueSyncedWithPosition = false; - } - } - }, - - enterDocument: { - value: function(firstTime) { - if (firstTime) { - // read initial values from the input type=range - this.min = this.min || this.element.getAttribute('min') || 0; - this.max = this.max || this.element.getAttribute('max') || 100; - this.step = this.step || this.element.getAttribute('step') || 1; - this.value = this.value || this.element.getAttribute('value') || 0; - } - } - }, - - // @todo: Without prepareForActivationEvents, the _translateComposer does not work - prepareForActivationEvents: { - value: function() { - this._translateComposer.addEventListener('translateStart', this, false); - this._translateComposer.addEventListener('translate', this, false); - this._translateComposer.addEventListener('translateEnd', this, false); - this._addEventListeners(); - } - }, - - _addEventListeners: { - value: function() { - // support touching the scale to select only in Desktop - if(window.Touch) { - this.element.addEventListener('touchstart', this, false); - } else { - this.element.addEventListener('mousedown', this, false); - } - this._touchOnHandle = false; - - } - }, - - _removeEventListeners: { - value: function() { - // support touching the scale to select only in Desktop - if(window.Touch) { - this.element.removeEventListener('touchstart', this, false); - } else { - this.element.removeEventListener('mousedown', this, false); - } - } - }, - - _startTranslateX: { - enumerable: false, - value: null - }, - - _startPositionX: { - enumerable: false, - value: null - }, - - handleTranslateStart: { - value: function(e) { - this._startTranslateX = e.translateX; - this._startPositionX = this.__positionX; - this._removeEventListeners(); - this._valueSyncedWithPosition = false; - } - }, - - handleTranslate: { - value: function (event) { - // handle translate on Touch devices only if initial touch was on the knob/handle - if(!window.Touch || (window.Touch && this._touchOnHandle)) { - var x = this._startPositionX + event.translateX - this._startTranslateX; - if (x < 0) { - x = 0; - } else { - if (x > this._sliderWidth) { - x = this._sliderWidth; - } - } - this._positionX = x; - } - } - }, - - handleTranslateEnd: { - value: function(e) { - this._addEventListeners(); - } - }, - - handleMousedown: { - value: function(e) { - this._clickTarget = {x: e.pageX, y: e.pageY}; - } - }, - - handleTouchstart: { - value: function(e) { - var target = e.targetTouches[0]; - // handle the translate only if touch target is the knob - this._touchOnHandle = (target.target === this._handleEl); - } - }, - - surrenderPointer: { - value: function(pointer, composer) { - // If the user is sliding us then we do not want anyone using - // the pointer - return false; - } - }, - - willDraw: { - value: function() { - this._handleWidth = this._handleEl.offsetWidth; - this._sliderWidth = this.element.offsetWidth - this._handleWidth; - if(this._clickTarget) { - // the slider scale was clicked - var x = dom.convertPointFromNodeToPage(this.element).x; - var positionX = (this._clickTarget.x - (x + (this._handleWidth/2))); - if(positionX < 0) { - positionX = 0; - } - this._positionX = positionX; - this._clickTarget = null; - } - if(!this._valueSyncedWithPosition) { - this._calculatePositionFromValue(); - } - } - }, - - draw: { - value: function() { - var el = this._handleEl; - if(el.style.webkitTransform != null) { - // detection for webkitTransform to use Hardware acceleration where available - el.style.webkitTransform = 'translate3d(' + this._positionX + 'px,0,0)'; - } else if(el.style.MozTransform != null) { - el.style.MozTransform = 'translate3d(' + this._positionX + 'px,0,0)'; - } else if(el.style.transform != null) { - el.style.transform = 'translate3d(' + this._positionX + 'px,0,0)'; - } else { - // fallback - el.style['left'] = this._positionX + 'px'; - } - - } - } -}); diff --git a/node_modules/matte/ui/input-text.reel/input-text.css b/node_modules/matte/ui/input-text.reel/input-text.css deleted file mode 100644 index 88fc9cc1..00000000 --- a/node_modules/matte/ui/input-text.reel/input-text.css +++ /dev/null @@ -1,39 +0,0 @@ - -.matte-InputText { - outline: none; - box-sizing: border-box; - font-size: 12px; - width: 150px; - height: 2.5em; - padding: 0.5em; - vertical-align: middle; - border: 1px solid #b3b3b3; - border-radius: 3px; - background-color: #fff; -} - -.matte-InputText:hover { - border-color: #ccc; -} - -.matte-InputText:focus { - border-color: #7f7f7f; -} - -.matte-InputText:invalid { - border: 1px dashed #E73525; -} - -.matte-InputText:disabled { - opacity: .5; - border-style: dashed; - pointer-events: none; -} - -.matte-InputText[readonly] { - background-color: #e5e5e5; -} - -.matte-InputText[readonly]:hover { - border-color: #b3b3b3; -} diff --git a/node_modules/matte/ui/input-text.reel/input-text.html b/node_modules/matte/ui/input-text.reel/input-text.html deleted file mode 100644 index cac5bef4..00000000 --- a/node_modules/matte/ui/input-text.reel/input-text.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/matte/ui/input-text.reel/input-text.js b/node_modules/matte/ui/input-text.reel/input-text.js deleted file mode 100644 index 7eb6bd1c..00000000 --- a/node_modules/matte/ui/input-text.reel/input-text.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - @module "matte/ui/input-text.reel" - -/*global require,exports */ -var AbstractTextField = require("montage/ui/base/abstract-text-field").AbstractTextField; - -/** - * Input Text - * @class module:"matte/ui/input-text.reel".InputText - * @extends module:"native/ui/input-text.reel".InputText - */ -exports.InputText = AbstractTextField.specialize(/** @lends module:"matte/ui/input-text.reel".InputText# */ { - - hasTemplate: {value: true}, - - constructor: { - value: function InputText() { - this.super(); - this.classList.add("matte-InputText"); - } - } -}); diff --git a/node_modules/matte/ui/list.reel/list.css b/node_modules/matte/ui/list.reel/list.css deleted file mode 100644 index 7d37cc11..00000000 --- a/node_modules/matte/ui/list.reel/list.css +++ /dev/null @@ -1,4 +0,0 @@ -.matte-List-scroller { - width: 100%; - height: 100%; -} \ No newline at end of file diff --git a/node_modules/matte/ui/list.reel/list.html b/node_modules/matte/ui/list.reel/list.html deleted file mode 100644 index f19afe25..00000000 --- a/node_modules/matte/ui/list.reel/list.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -
-
-
-
-
- - diff --git a/node_modules/matte/ui/list.reel/list.js b/node_modules/matte/ui/list.reel/list.js deleted file mode 100644 index f4dd718e..00000000 --- a/node_modules/matte/ui/list.reel/list.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - @module "matte/ui/list.reel" -*/ -var Component = require("montage/ui/component").Component, - observeProperty = require("montage/frb/observers").observeProperty; - -var deprecationWarning = require("montage/core/deprecate").deprecationWarning; - -/** - @class module:"matte/ui/list.reel".List - @extends module:montage/ui/component.Component - */ -exports.List = Component.specialize(/** @lends module:"matte/ui/list.reel".List# */ { - - constructor: { - value: function List () { - this.super(); - - this.defineBinding("_repetition.content", {"<-": "content"}); - - // Only use a contentController if content is not defined - this.defineBinding("content.defined() ? null : _repetition.contentController", { - "<-": "contentController" - }); - - } - }, - - templateDidLoad: { - value: function() { - this._scroller.addOwnPropertyChangeListener("scrollY", this); - this._scroller.addOwnPropertyChangeListener("_maxTranslateY", this); - } - }, - - - /** - Description TODO - @private - */ - _repetition: { - value: null - }, - - _scroller: { - value: null - }, - - /** - Description TODO - @type {Property} - @default null - */ - delegate: { - value: null - }, - - content: {value: null}, - - contentController: {value: null}, - - axis: { - value: null - }, - -/** - Description TODO - @private -*/ - isSelectionEnabled: { - value: null - }, - - /** - * Threshold at which the list will fire a "listEnd" event. This is the ratio of - */ - listEndEventThreshold: { - value: 1 - }, - - // Initialization - - // TODO we should probably support the programmatic initialization of a list; forwarding the childComponents - // along to the repetition - // I want to say that if somebody knows enough to do that they know enough to append the child components' elements - // into the repetition, not the list - - observeProperty: { - value: function (key, emit, source, parameters, beforeChange) { - if (key === "objectAtCurrentIteration" || key === "currentIteration") { - deprecationWarning(key,":iteration.object"); - if (this._repetition) { - return this._repetition.observeProperty(key, emit, source, parameters, beforeChange); - } - } else { - return observeProperty(this, key, emit, source, parameters, beforeChange); - } - } - }, - - _fireEndEvent: { - value: function() { - this.dispatchEventNamed("listEnd"); - } - }, - - handlePropertyChange: { - value: function(changeValue, key, object) { - if (key === "scrollY" || key === "_maxTranslateY") { - if (this._scroller && object === this._scroller) { - if (this._scroller.scrollY >= (this._scroller._maxTranslateY * this.listEndEventThreshold) && this._scroller._maxTranslateY > 0) { - this._fireEndEvent(); - } - } - } - } - } - -}); diff --git a/node_modules/matte/ui/list.reel/list.meta b/node_modules/matte/ui/list.reel/list.meta deleted file mode 100644 index 2113a543..00000000 --- a/node_modules/matte/ui/list.reel/list.meta +++ /dev/null @@ -1,101 +0,0 @@ -{ - "blueprint_component_reference": { - "prototype": "montage/core/meta/blueprint-reference", - "properties": { - "valueReference": { - "blueprintName": "Component", - "prototypeName": "Component", - "blueprintModule": { - "%": "montage/ui/component.meta" - } - } - } - }, - "blueprint_list_delegate": { - "prototype": "montage/core/meta/property-blueprint", - "properties": { - "name": "delegate", - "blueprint": { - "@": "root" - }, - "valueType": "object" - } - }, - "blueprint_list_content": { - "prototype": "montage/core/meta/property-blueprint", - "properties": { - "name": "content", - "blueprint": { - "@": "root" - }, - "cardinality": -1, - "valueType": "object" - } - }, - "blueprint_list_contentController": { - "prototype": "montage/core/meta/property-blueprint", - "properties": { - "name": "contentController", - "blueprint": { - "@": "root" - }, - "valueType": "object" - } - }, - "blueprint_list_isSelectionEnabled": { - "prototype": "montage/core/meta/property-blueprint", - "properties": { - "name": "isSelectionEnabled", - "blueprint": { - "@": "root" - }, - "valueType": "boolean" - } - }, - "root": { - "prototype": "montage/core/meta/module-blueprint", - "properties": { - "name": "List", - "parent": { - "@": "blueprint_component_reference" - }, - "propertyBlueprints": [ - { - "@": "blueprint_list_delegate" - }, - { - "@": "blueprint_list_content" - }, - { - "@": "blueprint_list_contentController" - }, - { - "@": "blueprint_list_isSelectionEnabled" - } - ], - "propertyBlueprintGroups": { - "List": [ - { - "@": "blueprint_list_delegate" - }, - { - "@": "blueprint_list_content" - }, - { - "@": "blueprint_list_contentController" - }, - { - "@": "blueprint_list_isSelectionEnabled" - } - ] - }, - "blueprintModule": { - "%": "ui/list.reel/list.meta" - }, - "exportName": "List", - "module": { - "%": "ui/list.reel" - } - } - } -} diff --git a/node_modules/matte/ui/loading-panel.reel/loading-panel.css b/node_modules/matte/ui/loading-panel.reel/loading-panel.css deleted file mode 100644 index 1ed7d0f3..00000000 --- a/node_modules/matte/ui/loading-panel.reel/loading-panel.css +++ /dev/null @@ -1,40 +0,0 @@ - -.matte-LoadingPanel { - position: absolute; - z-index: 999; - top: 0; - right: 0; - bottom: 0; - left: 0; -} - -.matte-LoadingPanel > .matte-LoadingPanel-loadingIndicator { - width: 200px; - margin: 20px; - display: none; /* disabled for now, because the loading doesn't really look continuos enough. */ -} - - -.matte-LoadingPanel > .matte-LoadingPanel-loadingCount { - position: absolute; - width: 160px; - height: 160px; - top: 50%; - left: 50%; - margin: -90px; - padding: 10px; - border-radius: 50%; - color: #fff; - font: 30px/160px "Helvetica Neue", Helvetica, Geneva, sans-serif; - text-align: center; - background: hsla(0,0%,0%,.6); - background: -webkit-radial-gradient( center 33% , hsla(0,0%,0%,.6) 10%, hsla(0,0%,0%,.8) ); - background: -moz-radial-gradient( center 33% , hsla(0,0%,0%,.65) 10%, hsla(0,0%,0%,.8) ); - -webkit-box-shadow: inset 0 0 0 3px hsla(0,0%,0%,.3), 0 0 0 3px hsla(0,0%,100%,.3); - box-shadow: inset 0 0 0 3px hsla(0,0%,0%,.3), 0 0 0 3px hsla(0,0%,100%,.3); - overflow: hidden; -} - -.matte-LoadingPanel > .matte-LoadingPanel-loadingCount > .matte-LoadingPanel-divider { - color: hsl(200,100%,50%); -} diff --git a/node_modules/matte/ui/loading-panel.reel/loading-panel.html b/node_modules/matte/ui/loading-panel.reel/loading-panel.html deleted file mode 100644 index f40a45a5..00000000 --- a/node_modules/matte/ui/loading-panel.reel/loading-panel.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -
-
-
- 0 - / - 0 -
-
- - diff --git a/node_modules/matte/ui/loading-panel.reel/loading-panel.js b/node_modules/matte/ui/loading-panel.reel/loading-panel.js deleted file mode 100644 index 806d5827..00000000 --- a/node_modules/matte/ui/loading-panel.reel/loading-panel.js +++ /dev/null @@ -1,32 +0,0 @@ - -/** - module:"matte/ui/loading-panel.reel" -*/ - -var Component = require("montage/ui/component").Component; - -/** - @class module:matte/ui/loading-panel.LoadingPanel - @extends module:montage/ui/component.Component - */ - -exports.LoadingPanel = Component.specialize(/** @lends module:matte/ui/loading-panel.LoadingPanel# */ { - -/** - The number of modules that are required to load. -*/ - requiredModuleCount: { - enumerable: false, - value: 0 - }, - -/** - The number of modules that have been initialized. -*/ - initializedModuleCount: { - enumerable: false, - value: 0 - } - - -}); diff --git a/node_modules/matte/ui/loading.reel/loading-0.svg b/node_modules/matte/ui/loading.reel/loading-0.svg deleted file mode 100644 index 87244e79..00000000 --- a/node_modules/matte/ui/loading.reel/loading-0.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-1.svg b/node_modules/matte/ui/loading.reel/loading-1.svg deleted file mode 100644 index 60ad8eaf..00000000 --- a/node_modules/matte/ui/loading.reel/loading-1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-2.svg b/node_modules/matte/ui/loading.reel/loading-2.svg deleted file mode 100644 index dfa84864..00000000 --- a/node_modules/matte/ui/loading.reel/loading-2.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-3.svg b/node_modules/matte/ui/loading.reel/loading-3.svg deleted file mode 100644 index af74427d..00000000 --- a/node_modules/matte/ui/loading.reel/loading-3.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-4.svg b/node_modules/matte/ui/loading.reel/loading-4.svg deleted file mode 100644 index 402340ca..00000000 --- a/node_modules/matte/ui/loading.reel/loading-4.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-5.svg b/node_modules/matte/ui/loading.reel/loading-5.svg deleted file mode 100644 index 1a473f16..00000000 --- a/node_modules/matte/ui/loading.reel/loading-5.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading-bg.svg b/node_modules/matte/ui/loading.reel/loading-bg.svg deleted file mode 100644 index 2ad50a91..00000000 --- a/node_modules/matte/ui/loading.reel/loading-bg.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/matte/ui/loading.reel/loading.css b/node_modules/matte/ui/loading.reel/loading.css deleted file mode 100644 index 88fe82cf..00000000 --- a/node_modules/matte/ui/loading.reel/loading.css +++ /dev/null @@ -1,73 +0,0 @@ -@-webkit-keyframes montage-loading { - 0% { - opacity: 0; - } - 20% { - opacity: .9; - } - 40% { - opacity: .27; - } - 100% { - opacity: 0; - } -} -.matte-Loading { - position: relative; - width: 30px; - height: 35px; - background-position: center center; - background-repeat: no-repeat; -} - -.matte-Loading.animate { - background-image: url(loading-bg.svg); -} - -.matte-Loading .matte-Loading-section { - display: none; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-position: center center; - background-repeat: no-repeat; -} - -.matte-Loading.animate .matte-Loading-section { - display: block; - -webkit-transform: translateZ(0); - -webkit-animation-name: montage-loading; - -webkit-animation-duration: 1200ms; - -webkit-animation-iteration-count: infinite; -} - -.matte-Loading .matte-Loading-l0 { - background-image: url(loading-0.svg); - -webkit-animation-delay: -1000ms; -} - -.matte-Loading .matte-Loading-l1 { - background-image: url(loading-1.svg); - -webkit-animation-delay: -800ms; -} - -.matte-Loading .matte-Loading-l2 { - background-image: url(loading-2.svg); - -webkit-animation-delay: -600ms; -} - -.matte-Loading .matte-Loading-l3 { - background-image: url(loading-3.svg); - -webkit-animation-delay: -400ms; -} - -.matte-Loading .matte-Loading-l4 { - background-image: url(loading-4.svg); - -webkit-animation-delay: -200ms; -} - -.matte-Loading .matte-Loading-l5 { - background-image: url(loading-5.svg); -} diff --git a/node_modules/matte/ui/loading.reel/loading.html b/node_modules/matte/ui/loading.reel/loading.html deleted file mode 100644 index f3c697cc..00000000 --- a/node_modules/matte/ui/loading.reel/loading.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - -
-
-
-
-
-
-
-
- - diff --git a/node_modules/matte/ui/loading.reel/loading.js b/node_modules/matte/ui/loading.reel/loading.js deleted file mode 100644 index 77a9a130..00000000 --- a/node_modules/matte/ui/loading.reel/loading.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - module:"matte/ui/loading.reel" -*/ -var Component = require("montage/ui/component").Component; -/** - @class module:matte/ui/loading.Loading - @extends module:montage/ui/component.Component - */ - -exports.Loading = Component.specialize(/** @lends module:"matte/ui/loading.reel".Loading# */ { -/** - Description TODO - @private -*/ - _loading: { - value: null - }, -/** - Description TODO - @type {Function} - @default null - */ - loading: { - get: function() { - return this._loading; - }, - set: function(isloading) { - if (this._loading !== isloading) { - this._loading = isloading; - this.needsDraw = true; - } - } - }, -/** - Description TODO - @function - */ - draw: { - value: function() { - var classList = this.element.classList, exists = classList.contains("animate"); - if (this.loading) { - if (!exists) { - classList.add("animate"); - } - } else { - if (exists) { - classList.remove("animate"); - } - - } - } - } -}); diff --git a/node_modules/matte/ui/popup/alert.reel/alert.css b/node_modules/matte/ui/popup/alert.reel/alert.css deleted file mode 100644 index 26ae174c..00000000 --- a/node_modules/matte/ui/popup/alert.reel/alert.css +++ /dev/null @@ -1,62 +0,0 @@ - -.matte-Alert-dialog { - min-width: 300px; -} -.matte-Alert-dialog Alert-content { - font-size: 1.3em; - padding: 15px; - -} -.matte-Alert-dialog Alert-actions { - float: right; -} - -/* - -.matte-Alert-dialog { - font-family: "AG Buch BQ Regular", "AG Buch BQ", Helvetica, Arial, sans-serif; - background-color: #333; - border: 1px solid #333; - border-radius: 5px; - margin: 0; - padding: 0px 3px; -} - -.matte-Alert-dialog .header { - height: 25px; - color: #fff; -} - -.matte-Alert-dialog .header h4 { - margin: 10px 0; - font-weight: normal; -} - -.matte-Alert-dialog .content { - text-align: center; - margin: 5px 0; - background-color: #e6e6e6; - padding: 10px; -} - -.matte-Alert-dialog .msg-container { - padding: 10px 0; - border-bottom: 1px solid #ccc; -} - -.matte-Alert-dialog .msg { - font-size: 18pt; - font-weight: normal; -} - -.matte-Alert-dialog .msg-detail { - font-size: 12pt; - font-weight: normal; - color: #cccccc; -} - -.matte-Alert-dialog .action-container { - padding: 10px 0; -} -*/ - diff --git a/node_modules/matte/ui/popup/alert.reel/alert.html b/node_modules/matte/ui/popup/alert.reel/alert.html deleted file mode 100644 index fc3d92eb..00000000 --- a/node_modules/matte/ui/popup/alert.reel/alert.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - -
-
-

-
-
-
-
-
- -
- - diff --git a/node_modules/matte/ui/popup/alert.reel/alert.js b/node_modules/matte/ui/popup/alert.reel/alert.js deleted file mode 100644 index 1f552022..00000000 --- a/node_modules/matte/ui/popup/alert.reel/alert.js +++ /dev/null @@ -1,127 +0,0 @@ - -/** - @module "matte/ui/popup/alert.reel" -*/ - -var Component = require("montage/ui/component").Component, - Popup = require("ui/popup/popup.reel").Popup; - -/** - @class module:"matte/ui/popup/alert.reel".Alert - @extends module:montage/ui/component.Component - */ - -var Alert = exports.Alert = Component.specialize({ - title: { - value: 'Alert' - }, -/** - Description TODO - @type {Property} - @default {String} '' - */ - msg: { - value: '' - }, -/** - Description TODO - @type {Property} - @default {String} '' - */ - details: { - value: '' - }, -/** - Description TODO - @private -*/ - _popup: { - value: null - }, -/** - Description TODO - @type {Function} - @default null - */ - popup: { - set: function(value) { - this._popup = value; - }, - get: function() { - return this._popup; - } - }, - - okCallback: {value: null}, - - enterDocument: { - value: function(firstTime) { - if (firstTime) { - this.element.addEventListener("keyup", this, false); - } - } - }, -/** - Description TODO - @function - @param {Event} evt The event keyCode. - */ - handleKeyup: { - value: function(evt) { - if (evt.keyCode == 13 /*Enter*/ || - evt.keyCode == 27 /*Escape*/) { - - this.handleOkAction(evt); - } - } - }, -/** - Description TODO - @function - @param {Event} evt The event keyCode. - */ - handleOkAction: { - value: function(evt) { - if(this.okCallback) { - this.okCallback.call(this, evt); - } - var anEvent = document.createEvent("CustomEvent"); - anEvent.initCustomEvent("montage_alert_ok", true, true, null); - - this.dispatchEvent(anEvent); - this.popup.hide(); - } - }, - - // Static method to show an Alert dialog - /** - Displays an Alert dialog with a OK button. - @function - @param {String} msg A message to display in the dialog. - @param {Function} okCallback Function that's invoked when the user clicks OK - @example - ... - */ - show: { - value: function(msg, okCallback) { - var popup = this.application._alertPopup, alert; - if(!popup) { - popup = new Popup(); - this.popup = popup; - - popup.type = 'alert'; - popup.title = 'Message'; - popup.modal = true; - this.application._alertPopup = popup; - - alert = new Alert(); - popup.content = alert; - } - alert = popup.content; - alert.msg = msg; - alert.okCallback = okCallback || null; - popup.show(); - } - } -}); - diff --git a/node_modules/matte/ui/popup/confirm.reel/confirm.css b/node_modules/matte/ui/popup/confirm.reel/confirm.css deleted file mode 100644 index fa18861c..00000000 --- a/node_modules/matte/ui/popup/confirm.reel/confirm.css +++ /dev/null @@ -1,12 +0,0 @@ - -.matte-Confirm-dialog { - min-width: 300px; - } -.matte-Confirm-dialog Confirm-content { - font-size: 1.3em; - padding: 15px; - } -.matte-Confirm-dialog Confirm-actions { - float: right; - } - diff --git a/node_modules/matte/ui/popup/confirm.reel/confirm.html b/node_modules/matte/ui/popup/confirm.reel/confirm.html deleted file mode 100644 index eb3d22a9..00000000 --- a/node_modules/matte/ui/popup/confirm.reel/confirm.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - -
-
-

Confirmation

-
-
-
-
-
- -
- - diff --git a/node_modules/matte/ui/popup/confirm.reel/confirm.js b/node_modules/matte/ui/popup/confirm.reel/confirm.js deleted file mode 100644 index 25e21c68..00000000 --- a/node_modules/matte/ui/popup/confirm.reel/confirm.js +++ /dev/null @@ -1,179 +0,0 @@ - -/** - @module "matte/ui/popup/confirm.reel" -*/ - -var Component = require("montage/ui/component").Component, - Popup = require("ui/popup/popup.reel").Popup; - -/** - @class module:"matte/ui/popup/confirm.reel".Confirm - @extends module:montage/ui/component.Component - */ - -var Confirm = exports.Confirm = Component.specialize(/** @lends module:"matte/ui/popup/confirm.reel".Confirm# */ { - hasTemplate: {value: true}, - - title: { - value: 'Confirm' - }, - /** - Text of message to display on the confirm popup - @type {Property} - @default {String} 'Are you sure?' - */ - msg: { - value: 'Are you sure?' - }, - - /** - Text to display on the OK button - @type {Property} - @default {String} 'OK' - */ - okLabel: { - value: 'OK' - }, - - /** - Text to display on the Cancel button - @type {Property} - @default {String} 'Cancel' - */ - cancelLabel: { - value: 'Cancel' - }, - -/** - Description TODO - @private -*/ - _popup: { - value: null - }, -/** - Description TODO - @type {Function} - @default null - */ - popup: { - set: function(value) { - this._popup = value; - }, - get: function() { - return this._popup; - } - }, - - okCallback: {value: null}, - cancelCallback: {value: null}, - - enterDocument: { - value: function(firstTime) { - if (firstTime) { - this.element.addEventListener("keyup", this, false); - } - } - }, -/** - Description TODO - @function - */ - draw: { - value: function() { - } - }, -/** - Description TODO - @function - @param {Event} evt The event keyCode. - */ - handleKeyup: { - value: function(evt) { - if (evt.keyCode == 13 /*Enter*/) { - this.handleOkAction(evt); - } else if (evt.keyCode == 27 /*Escape*/) { - this.handleCancelAction(evt); - } - } - }, -/** - Description TODO - @function - @param {Event} evt The event keyCode. - */ - handleOkAction: { - value: function(evt) { - if(this.okCallback) { - this.okCallback.call(this, evt); - } - var anEvent = document.createEvent("CustomEvent"); - anEvent.initCustomEvent("montage_confirm_ok", true, true, null); - this.dispatchEvent(anEvent); - - this.popup.hide(); - } - }, - /** - Description TODO - @function - @param {Event} evt The event keyCode. - */ - handleCancelAction: { - value: function(evt) { - if(this.cancelCallback) { - this.cancelCallback.call(this, evt); - } - var anEvent = document.createEvent("CustomEvent"); - anEvent.initCustomEvent("montage_confirm_cancel", true, true, null); - this.dispatchEvent(anEvent); - - this.popup.hide(); - } - }, - - // Static method to show a Confirmation dialog - /** - Displays a confirm dialog with OK and Cancel buttons. - @function - @param {String} msg A message to display in the dialog. - @param {Function} okCallback Function that's invoked when the user clicks OK - @param {Function} cancelCallback Function that's invoked if the user clicks Cancel. - @example - ... - */ - show: { - value: function(options, okCallback, cancelCallback) { - var popup = this.application._confirmPopup, confirm; - if(!popup) { - popup = new Popup(); - this.popup = popup; - - popup.type = 'confirm'; - popup.title = 'Confirmation'; - popup.modal = true; - this.application._confirmPopup = popup; - - confirm = new Confirm(); - popup.content = confirm; - } - - confirm = popup.content; - - if (typeof(options) === "string") { - confirm.msg = options; - confirm.okLabel = "OK"; - confirm.cancelLabel = "Cancel"; - } else { - confirm.msg = options.message; - confirm.okLabel = options.okLabel || "OK"; - confirm.cancelLabel = options.cancelLabel || "Cancel"; - } - - confirm.okCallback = okCallback || null; - confirm.cancelCallback = cancelCallback || null; - - popup.show(); - } - } -}); diff --git a/node_modules/matte/ui/popup/notifier.reel/notifier.css b/node_modules/matte/ui/popup/notifier.reel/notifier.css deleted file mode 100644 index 27a4555d..00000000 --- a/node_modules/matte/ui/popup/notifier.reel/notifier.css +++ /dev/null @@ -1,10 +0,0 @@ - -.matte-Notifier { - background-color: #333; /*#FFF1A8*/; - color: #fff; -} - -.matte-Notifier Notifier-message { - padding: 10px 20px; - text-overflow: ellipsis; -} diff --git a/node_modules/matte/ui/popup/notifier.reel/notifier.html b/node_modules/matte/ui/popup/notifier.reel/notifier.html deleted file mode 100644 index 6f001b19..00000000 --- a/node_modules/matte/ui/popup/notifier.reel/notifier.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -
-
-
- - diff --git a/node_modules/matte/ui/popup/notifier.reel/notifier.js b/node_modules/matte/ui/popup/notifier.reel/notifier.js deleted file mode 100644 index 9df1dab4..00000000 --- a/node_modules/matte/ui/popup/notifier.reel/notifier.js +++ /dev/null @@ -1,111 +0,0 @@ - -/** - @module "matte/ui/popup/notifier.reel" -*/ -var Component = require("montage/ui/component").Component; -var Popup = require("ui/popup/popup.reel").Popup; - -/** - @class module:"matte/ui/popup/notifier.reel".Notifier - @extends module:montage/ui/component.Component - */ - -var Notifier = exports.Notifier = Component.specialize(/** @lends module:"matte/ui/popup/notifier.reel".Notifier# */ { - - _msgEl: { - value: null - }, -/** - Description TODO - @private -*/ - _msg: {value: null}, -/** - Description TODO - @type {Function} - @default null - */ - msg: { - get: function() { - return this._msg; - }, - set: function(value) { - if (this._msg !== value) { - this._msg = value; - this.needsDraw = true; - } - } - }, -/** - Description TODO - @type {Property} - @default {String} null - */ - details: { - value: null - }, -/** - Description TODO - @function - */ - draw: { - value: function() { - this._msgEl.textContent = this.msg; - } - }, - - // Static method to show a Notify dialog - /** - Displays a small Growl-like notification in a pop-up dialog. The notification can have a timeout that determines how long it appears before being hidden automatically. - You can also specify the location of the notification in the browser window (top-left corner, by default). - @function - @param {String} msg A message to display in the notification. - @param {Number} timeout The number of milliseconds to display the notification before it is hidden. - @param {Object} Contains two properties named top and left that specify top and left coordinates of the notifiction. By default, notifications are positioned at the top-left corner of the window. - */ - show: { - value: function(msg, timeout, position) { - var popup = this.application._notifyPopup, notifier; - if(!popup) { - popup = new Popup(); - this.popup = popup; - popup.type = 'notify'; - this.application._notifyPopup = popup; - - notifier = new Notifier(); - popup.content = notifier; - } - notifier = popup.content; - notifier.msg = msg; - - if (!position) { - // position at the top by default - var viewportWidth = window.innerWidth; - position = { - top: 1, - right: 10 - }; - } - popup.position = position; - - if(timeout) { - timeout = parseInt(timeout, 10) || 3000; - popup.autoHide = timeout; - } - - popup.show(); - - - } - }, - - hide: { - value: function() { - var popup = this.application._notifyPopup; - if(popup) { - popup.hide(); - } - } - } - -}); diff --git a/node_modules/matte/ui/popup/popup.reel/popup.css b/node_modules/matte/ui/popup/popup.reel/popup.css deleted file mode 100644 index 5b1be434..00000000 --- a/node_modules/matte/ui/popup/popup.reel/popup.css +++ /dev/null @@ -1,69 +0,0 @@ -/* these need to be moved to montage.css when that is created */ -.matte-invisible { - display: none; -} -.clearfix:after { - visibility: hidden; - display: block; - font-size: 0; - content: " "; - clear: both; - height: 0; -} - -.matte-Popup-modal-mask { - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: #000; - opacity: 0.8; -} - -.matte-Popup-container { - border: 1px solid #eee; - -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - -webkit-transition: opacity .25s; - -moz-transition: opacity .25s; - -ms-transition: opacity .25s; - -o-transition: opacity .25s; - transition: opacity .25s; - background: white; - border: 1px solid rgba(0, 0, 0, .2); - cursor: default; - margin: 0; - outline: none; - width: auto; - border-radius: 3px; -} - -.matte-Popup-noborder { - border: 0px; -} - -.matte-Popup--modal { - border: 3px solid #ccc; -} - -.matte-Popup-container *:focus { - outline: none; -} - -.matte-Popup-wrapper { - -} - -.matte-Popup-header { - background-color: whitesmoke; - border-bottom: 1px solid #eee; - padding: 5px 15px; -} -.matte-Popup-footer { - background-color: whitesmoke; - padding: 10px 15px; - border-top: 1px solid #ddd; - -} diff --git a/node_modules/matte/ui/popup/popup.reel/popup.html b/node_modules/matte/ui/popup/popup.reel/popup.html deleted file mode 100644 index 4b9eb5dd..00000000 --- a/node_modules/matte/ui/popup/popup.reel/popup.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -
-
-
-
-
- - diff --git a/node_modules/matte/ui/popup/popup.reel/popup.js b/node_modules/matte/ui/popup/popup.reel/popup.js deleted file mode 100644 index 3cad5d51..00000000 --- a/node_modules/matte/ui/popup/popup.reel/popup.js +++ /dev/null @@ -1,561 +0,0 @@ - -/** - @module "matte/ui/popup/popup.reel" -*/ -var Component = require("montage/ui/component").Component; - -/** - @class module:"matte/ui/popup.reel".Popup - @extends module:montage/ui/component.Component -*/ - -var Popup = exports.Popup = Component.specialize({ /** @lends module:"matte/ui/popup/popup.reel".Popup */ - - hasTemplate: {value: true}, - - // the HTML Element to which the popup must be anchored to - anchorElement: { - value: null - }, - - _anchor: { - value: null - }, - - /** - * The HTMLElement or Montage Component that the popup must be anchored to - */ - anchor: { - get: function() { - return this._anchor; - }, - set: function(value) { - if(value) { - this._anchor = value; - if(value.nodeName) { - // HTMLElement - this.anchorElement = value; - } else { - this.anchorElement = value.element; - } - } - } - }, - - // A Delegate to control positioning (and other features, in future) of the popup in a custom manner - delegate: {value: null}, - - /** - Internal property. - @private - */ - contentEl: { - value: null - }, -/** - Description TODO - @type {Property} - @default {Container} null - @private - */ - containerEl: { - value: null - }, - - -/** - Description TODO - @private -*/ - _slot: {value: null}, -/** - - Description TODO - @type {Function} - @default null - @private - */ - slot: { - get: function() { - return this._slot; - }, - set: function(val) { - this._slot = val; - if (this.content) { - this._slot.content = this.content; - } - } - }, -/** - Description TODO - @private -*/ - _content: {value: null}, -/** - The Montage component that will be shown in this popup. - - @type {Function} - @default null - */ - content: { - get: function() { - return this._content; - }, - set: function(value) { - if (this._content !== value && this.slot) { - this.slot.content = value; - } - this._content = value; - // set the popup property of the content. - this._content.popup = this; - this.needsDraw = true; - } - }, -/** - Description TODO - @private -*/ - _modal: { value: false }, -/** - If true, the Popup will be rendered as a Modal. - - @type {Function} - @default {Boolean} false - */ - modal: { - get: function() { - return this._modal; - }, - set: function(value) { - // force this to be a boolean - value = !!value; - - if (this._modal !== value) { - this._modal = value; - this.needsDraw = true; - } - } - }, - - /** - An Object wtih values {top, left}. Set it only if the popup should display at a - given location always. - */ - _position: {value: null}, - position: { - get: function() { - return this._position; - }, - set: function(pos) { - this._position = pos; - //this.needsDraw = true; - } - }, - - /** - * Number of milliseconds after which the Popup must be dismissed. Default is 0. - */ - autoHide: { value: 0 }, - - /** @private */ - _displayed: { value: false }, - displayed: { - get: function() { - return this._displayed; - }, - set: function(value) { - if (this._displayed !== value) { - this.needsDraw = true; - } - this._displayed = value; - } - }, - - focusOnShow: { - value: true - }, - -/** - Description TODO - @function - */ - enterDocument: { - value: function(firstTime) { - if (firstTime) { - this.type = this.type || 'custom'; - } - } - }, - - _popupSlot: { - value: null - }, - - _modalDialogMask: { - value: null - }, - - - /** - Internal method. - @private - */ - _getElementPosition: { - value: 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 - }; - //return [curleft,curtop, curHt, curWd]; - - } - }, - - _getCSSValue: { - value: function(value) { - if(value != null) { - if(typeof value === 'number') { - value = value + 'px'; - } - return value; - } - return ''; - } - }, - - _positionPopup: { - value: function() { - var defaultPosition, position, delegate = this.delegate, anchor = this.anchorElement, type = this.type; - - if(this.position !== null) { - // If a position has been specified but no delegate has been provided - // we assume that the position is static and hence use that - defaultPosition = this.position; - } else { - // @todo - advanced positioning support - var $el = this.contentEl || this.content.element; - var elHeight = parseFloat($el.style.height || 0) || $el.offsetHeight || 0; - var elWidth = parseFloat($el.style.width || 0) || $el.offsetWidth || 0; - - // @todo - to get the window from application - var viewportHeight = window.innerHeight; - var viewportWidth = window.innerWidth; - - if (anchor) { - // if an anchor is provided, we position the popup relative to the anchor - var elPosition = this._getElementPosition(anchor); - var tgtHeight = parseFloat(anchor.style.height || 0) || anchor.offsetHeight || 0; - var tgtWidth = parseFloat(anchor.style.width || 0) || anchor.offsetWidth || 0; - - defaultPosition = { - top: elPosition.top + tgtHeight, - left: elPosition.left + (tgtWidth / 2) - (elWidth / 2) - }; - - if (defaultPosition.left < 0) { - defaultPosition.left = elPosition.left; - this._showHidePointer(false); - // dont show the pointer - @todo - support pointer arrow at different parts of the popup - } - - } else { - // No positioning hints provided. POsition it at the center of the viewport by default - defaultPosition = { - top: (viewportHeight / 2 - (elHeight / 2)), - left: (viewportWidth / 2 - (elWidth / 2)) - }; - } - } - - - // if a delegate is provided, use that to get the position - if(delegate && (typeof delegate.willPositionPopup === 'function')) { - position = delegate.willPositionPopup(this, defaultPosition); - } else { - position = defaultPosition; - } - - //this.position = position; - var popupSlot = this._popupSlot; - - if(position) { - popupSlot.element.style.top = this._getCSSValue(position.top); - popupSlot.element.style.left = this._getCSSValue(position.left); - popupSlot.element.style.right = this._getCSSValue(position.right); - popupSlot.element.style.bottom = this._getCSSValue(position.bottom); - } - - } - }, - - - _createModalMask: { - value: function() { - var el = document.createElement('div'); - el.classList.add('montage-Popup-modal-mask'); - el.style.zIndex = 6999; - el.classList.add('montage-invisible'); - - document.body.appendChild(el); - return el; - } - }, - - _showHidePointer: { - value: function(showTip) { - } - }, - - _addEventListeners: { - value: function() { - if (window.Touch) { - this.element.ownerDocument.addEventListener('touchstart', this, false); - } else { - this.element.ownerDocument.addEventListener('mousedown', this, false); - this.element.ownerDocument.addEventListener('keyup', this, false); - } - window.addEventListener('resize', this); - } - }, - - _removeEventListeners: { - value: function() { - if (window.Touch) { - this.element.ownerDocument.removeEventListener('touchstart', this, false); - } else { - this.element.ownerDocument.removeEventListener('mousedown', this, false); - this.element.ownerDocument.removeEventListener('keyup', this, false); - } - window.removeEventListener('resize', this); - } - }, - - /** - * Show the Popup. The Popup is displayed at a position determined by the following conditions: - * 1) If a delegate is provided and the willPositionPopup function is implemented, the position is always determined by the delegate - * 2) If Popup.position has been set, the Popup is always displayed at this location - * 3) If an anchor has been set, the popup is displayed below the anchor - * 4) If no positional hints are provided, the Popup is displayed at the center of the screen - */ - show: { - value: function() { - //console.log("popup show", this.element); - var type = this.type, - self = this; - this.application.getPopupSlot(type, this, function(slot) { - self._popupSlot = slot; - self.displayed = true; - self._addEventListeners(); - }); - } - }, - - /** - * Hide the popup - */ - hide: { - value: function() { - //console.log('popup hide', this.element); - var type = this.type, - self = this; - - this.application.getPopupSlot(type, this, function(slot) { - self._removeEventListeners(); - //self.application.returnPopupSlot(type); - self.displayed = false; - }); - } - }, - - _showModalMask: { - value: function() { - this._modalDialogMask = document.querySelector('Popup-modal-mask'); - this._modalDialogMask = this._modalDialogMask || this._createModalMask(); - this._modalDialogMask.classList.remove('montage-invisible'); - } - }, - - _hideModalMask: { - value: function() { - // check to see if there is at least one modal dialog in the DOM - // See https://github.com/Motorola-Mobility/montage/issues/32 - var activePopups = this.application._getActivePopupSlots(); - var count = 0; - if(activePopups && activePopups.length > 0) { - // look to see if any content is a modal - var i, len = activePopups.length; - for(i=0; i< len; i++) { - if(activePopups[i].content && activePopups[i].content.modal === true && activePopups[i].content.displayed === true) { - count++; - } - } - } - if(count <= 0) { - this._modalDialogMask.classList.add('montage-invisible'); - } - } - }, - - - draw: { - value: function() { - if (this.displayed) { - - if(this.modal === true) { - this.element.classList.add('montage-Popup--modal'); - } else { - this.element.classList.remove('montage-Popup--modal'); - - if (this.autoHide) { - var self = this; - setTimeout(function() { - self.hide(); - }, this.autoHide); - } - - } - - // @todo - positioning should happen inside the draw. Looks like this is only possible - // with a double draw where we calculate the position on didDraw and position it in draw(). - // For the first release, we position inside the didDraw - //this._positionPopup(); - - this.element.classList.remove('montage-invisible'); - this.content.element.style.display = 'block'; - this.content.element.classList.remove('montage-invisible'); - // TODO do we want the panel to be focusable? - this.content.element.setAttribute("tabindex", "0"); // Make the popup content focusable - - } else { - if (!this.element.classList.contains('montage-invisible')) { - this.element.classList.add('montage-invisible'); - } - this.content.element.classList.add('montage-invisible'); - if(this._popupSlot) { - this._popupSlot.content = null; - } - } - } - }, -/** - Description TODO - @function - */ - didDraw: { - value: function() { - if (this._displayed) { - - if(this.modal === true) { - this._showModalMask(); - } - - this._positionPopup(); - // focus the content to enable key events such as ENTER/ESC - if(this.focusOnShow === true) { - this.content.element.focus(); - } - - } else { - if(this.modal === true) { - this._hideModalMask(); - } - } - // kishore: invoking this event in didDraw as we need the dimensions of the content. - // Inside the draw(), the display is set to none at the top level and hence - // offsetWidth and Height are always 0 - var evt = document.createEvent("CustomEvent"); - evt.initCustomEvent((this._displayed === true ? 'show' : 'hide'), true, true, this); - this.dispatchEvent(evt); - - } - }, - - getZIndex: { - value: function(elem) { - - var position, value, zIndex; - while (elem && elem !== document) { - position = elem.style.position; - if (position === "absolute" || position === "relative" || position === "fixed") { - // webkit returns a string for zindex value and "" if zindex is not available - zIndex = elem.style['z-index']; - value = parseInt(zIndex, 10); - if (!isNaN(value) && value !== 0) { - return value; - } - } - elem = elem.parentNode; - } - return 0; - } - }, -/** - Description TODO - @private -*/ - _handleTouchMouseup: { - value: function(event) { - var targetzIndex = this.getZIndex(event.target), - zIndex = this.getZIndex(this.element); - - if (this.displayed === true && targetzIndex < zIndex) { - if (this.modal === true) { - - } else { - // hide the dialog when user clicks outside it - this.displayed = false; - } - } - } - }, - - _timeoutId: {value: null}, - handleResize: { - value: function(e) { - //console.log('window resize'); - var self = this; - if(this.displayed === true) { - // an optimization to call positionPopup fewer times - window.clearTimeout(this._timeoutId); - this._timeoutId = setTimeout(function() { - self.needsDraw = true; - }, 100); - } - } - }, - handleMousedown: { - value: function(event) { - this._handleTouchMouseup(event); - } - }, -/** - Description TODO - @function - @param {Event} event The event. - */ - handleTouchstart: { - value: function(event) { - this._handleTouchMouseup(event); - } - }, - handleKeyup: { - value: function(e) { - // default handling of the keyup event. Content inside the popup could - // handle the event optionally for custom behavior - if(this.displayed === true && !this.modal && e.keyCode === 27 /* ESC key */) { - this.hide(); - } - } - } -}); diff --git a/node_modules/matte/ui/progress.reel/progress.css b/node_modules/matte/ui/progress.reel/progress.css deleted file mode 100644 index ac0fa643..00000000 --- a/node_modules/matte/ui/progress.reel/progress.css +++ /dev/null @@ -1,24 +0,0 @@ - -.matte-Progress { - display: inline-block; - position: relative; - width: 150px; - height: 10px; - border-radius: 3px; - border: 1px solid #b3b3b3; - background-color: #d9d9d9; -} - -.matte-Progress > .matte-Progress-bar { - position: absolute; - height: inherit; - border-radius: 2px; - top: 0; - left: 0; - background-color: #f2f2f2; - -webkit-transition: width .3s cubic-bezier(.25,.1,.3,.9); - -moz-transition: width .3s cubic-bezier(.25,.1,.3,.9); - -ms-transition: width .3s cubic-bezier(.25,.1,.3,.9); - -o-transition: width .3s cubic-bezier(.25,.1,.3,.9); - transition: width .3s cubic-bezier(.25,.1,.3,.9); -} diff --git a/node_modules/matte/ui/progress.reel/progress.html b/node_modules/matte/ui/progress.reel/progress.html deleted file mode 100644 index ed2a97d7..00000000 --- a/node_modules/matte/ui/progress.reel/progress.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - -
-
-
- - diff --git a/node_modules/matte/ui/progress.reel/progress.js b/node_modules/matte/ui/progress.reel/progress.js deleted file mode 100644 index 43a6c888..00000000 --- a/node_modules/matte/ui/progress.reel/progress.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - module:"matte/ui/progress.reel" -*/ -var NativeProgress = require("native/ui/progress.reel").Progress; -/** - @class module:matte/ui/progress.Progress - @extends module:native/ui/progress.NativeProgress -*/ -exports.Progress = NativeProgress.specialize(/** @lends module:"matte/ui/progress.reel".Progress# */ { - - hasTemplate: {value: true}, - -/** - Description TODO - @private -*/ - _barElement: { - enumerable: false, - value: null - }, -/** - Description TODO - @private -*/ - _value: { - enumerable: false, - value: 0 - }, -/** - Description TODO - @type {Function} - @default {Number} 0 - */ - value: { - get: function() { - return this._value; - }, - set: function(val) { - if(val !== this._value) { - this._value = typeof val === "string" ? parseInt(val, 10) : val; - - if(this._max && (this._value > this._max)) { - this._value = this._max; - } - if(this._value < 0) { - this._value = 0; - } - this.needsDraw = true; - } - } - }, -/** - Description TODO - @private -*/ - _max: { - enumerable: false, - value: 100 - }, -/** - Description TODO - @type {Function} - @default {Number} 100 - */ - max: { - get: function() { - return this._max; - }, - set: function(val) { - if(val !== this._max) { - this._max = typeof val === "string" ? parseInt(val, 10) : val; - if(this._max <= 0) { - this._max = 1; // Prevent divide by zero errors - } - this.needsDraw = true; - } - } - }, - - constructor: { - value: function Progress() { - this.super(); - } - }, - -/** - Description TODO - @function - */ - draw: { - enumerable: false, - value: function() { - var ratio = this._value / this._max; - // constrain to interval [0, 1] - ratio = Math.min(Math.max(ratio, 0), 1); - // map into [0, 100] - var percentage = ratio * 100; - this._barElement.style.width = percentage + '%'; - } - } -}); diff --git a/node_modules/matte/ui/radio-button.reel/radio-button.css b/node_modules/matte/ui/radio-button.reel/radio-button.css deleted file mode 100644 index 6a3a5172..00000000 --- a/node_modules/matte/ui/radio-button.reel/radio-button.css +++ /dev/null @@ -1,37 +0,0 @@ - -.matte-RadioButton { - -webkit-appearance: none; - -moz-appearance: none; - outline: none; - box-sizing: border-box; - vertical-align: middle; - font-size: 12px; - width: 1.5em; - height: 1.5em; - border-radius: 1em; - border: 1px solid #b3b3b3; - background: #f2f2f2; - cursor: pointer; -} - -.matte-RadioButton:hover { - background-color: #fff; -} - -.matte-RadioButton.montage--active { - background-color: #e5e5e5; -} - -.matte-RadioButton:focus { - border-color: #7f7f7f; -} - -.matte-RadioButton.montage-RadioButton--checked { - background: #f2f2f2 url(radio.png) no-repeat center; -} - -.matte-RadioButton.montage--disabled { - opacity: .5; - border-style: dashed; - pointer-events: none; -} diff --git a/node_modules/matte/ui/radio-button.reel/radio-button.html b/node_modules/matte/ui/radio-button.reel/radio-button.html deleted file mode 100644 index c7d35e47..00000000 --- a/node_modules/matte/ui/radio-button.reel/radio-button.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/matte/ui/radio-button.reel/radio-button.js b/node_modules/matte/ui/radio-button.reel/radio-button.js deleted file mode 100644 index ce8c49ad..00000000 --- a/node_modules/matte/ui/radio-button.reel/radio-button.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - @module "matte/ui/radio-button.reel" -*/ -/*global require,exports */ -var AbstractRadioButton = require("montage/ui/base/abstract-radio-button").AbstractRadioButton; - -/** - * Input Radio - * @class module:"matte/ui/radio-button.reel".RadioButton - * @extends module:"montage/ui/abstract-radio-button.reel".AbstractRadioButton - */ -exports.RadioButton = AbstractRadioButton.specialize(/** @lends RadioButton# */ { - hasTemplate: { - value: true - }, - - constructor: { - value: function RadioButton() { - this.super(); - this.classList.add("matte-RadioButton"); - } - } -}); diff --git a/node_modules/matte/ui/radio-button.reel/radio.png b/node_modules/matte/ui/radio-button.reel/radio.png deleted file mode 100644 index 30975c5492836528c91abe0f6e14ee75cdfdd667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1015 zcmaJ=&ui0A9M4u;$6yFU{I$y?Q*mJPt4-5})vY$|S}>z@6$?AeGM(W2%Dm2=X^)gTM&a9Y?yYMK6?F@2Bwjw?}#d=I$78>3!5%n+FY#Y zn=L(M&~rDytS=J*3t|oU)~fBvewyy;%H$kevoz>Ja4St82US%|Ad6fGM23s%T!I4$ zp5bG0Ns_Juf#W%r6Ifn|@{$}AWR3&9k0#z+qb`?~e9srL(sUDJM`qb}yUny?400PR zpGu_y4MB(!MAYlpSo5Q{H{DlIpr^a0gH2?EKvAoqb)2S2q{k^(&Op}odSxO7V|~qG zd4>y8>H}5v|4_>spgmlMC-MGM*sF9L$d;jp)?J-6u09>Oa^$QFHH_Q}LaY5MmYN77 zuZbLxT@rz+>82gnUA(HwMcc!gt;3>{rilV$nuaVT#h57ZqL|5Lc|ONyvO+wWPvzqo zK@t)fvCmbIzHUJq_qoOiH!+kOjDqD5&kA(S4QS+DWPxtVvN=4K*igM5*BBm4d?=SC z!LUJN|7vvqicC*%9E>e727?c6GVLxI>wCXG+$K+=Ra7z+|8wodhEu0TP4F#Tn~IDj zM-Sf5|9%`U6sYeVa1PFIJ76PRTfPeT5p^AT$#$qCQ=+*{aRd9?GzKl?Q@ z^X&BD`Re7B(At&4{ucNYIt-V7Y+YNPdT>OYx - - - - - - - - - - diff --git a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js b/node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js deleted file mode 100644 index 35c227a3..00000000 --- a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel/rich-text-linkpopup.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - @module "matte/ui/rich-text-editor/overlays/rich-text-resizer.reel" -*/ -var Component = require("montage/ui/component").Component; - -/** - @class module:"matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel".RichTextLinkPopup - @extends module:montage/ui/component.Component -*/ -exports.RichTextLinkPopup = Component.specialize(/** @lends module:"matte/ui/rich-text-editor/overlays/rich-text-linkpopup.reel".RichTextLinkPopup# */ { - - /** - Description TODO - @private - */ - _isActive: { - enumerable: false, - value: false - }, - /** - Description TODO - @private - */ - _editor: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - target: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _needsReset: { - enumerable: false, - value: false - }, - - /** - Description TODO - @type {Function} - */ - initWithEditor: { - value: function(editor) { - this._editor = editor; - } - }, - - /** - Description TODO - @type {Function} - */ - editorMouseUp: { - value: function(event) { - var element; - - if (this._editor.activeOverlay != this) { - // Check if the caret is inside an image within an anchor element - if (event.target.nodeName == "IMG") { - element = event.target; - while (element && element != this._element) { - if (element.nodeName == "A") { - if (element != this.target) { - this.target = element; - this._needsReset = true; - if (this._isActive) { - this.needsDraw = true; - } else { - this._editor.showOverlay(this); - } - } - return true; - } - element = element.parentElement; - } - } - } - } - }, - - /** - Description TODO - @type {Function} - */ - editorTouchEnd: { - value: function(event) { - this.editorMouseUp(event); - } - }, - - /** - Description TODO - @type {Function} - */ - editorSelectionDidChange: { - value: function(range) { - var element; - - // Check if the caret is inside an anchor element - if (range && range.collapsed) { - element = range.commonAncestorContainer; - while (element && element != this._element) { - if (element.nodeName == "A") { - if (element != this.target) { - this.target = element; - this._needsReset = true; - if (this._isActive) { - this.needsDraw = true; - } else { - this._editor.showOverlay(this); - } - } - return true; - } - element = element.parentElement; - } - } - - if (this._editor.activeOverlay == this) { - this._editor.hideOverlay(); - } - this.target = null; - - return false; - } - }, - - /** - Description TODO - @function - */ - didBecomeActive: { - value: function() { - this._isActive = true; - window.addEventListener("resize", this, false); - } - }, - - /** - Description TODO - @function - */ - didBecomeInactive: { - value: function() { - this._isActive = false; - window.removeEventListener("resize", this, false); - - //Reset the resizer internal - this.target = null; - this._needsReset = false; - } - }, - - /** - Description TODO - @function - */ - enterDocument: { - value: function(firstTime) { - if (firstTime) { - this._popupExtraWidth = this.element.offsetWidth; - } - } - }, - - /** - Description TODO - @function - */ - draw: { - enumerable: false, - value: function() { - var element = this.element, - target = this.target, - editorElement = this._editor.innerElement; - - if (this._needsReset) { - var offsetLeft, - offsetTop, - oh = editorElement.offsetHeight, - ow = editorElement.offsetWidth, - st = editorElement.scrollTop, - sl = editorElement.scrollLeft, - w = target.offsetWidth, - h = target.offsetHeight, - l, t, - left, leftWidth, right, rightWidth, - style = ""; - - var _findOffset = function(node) { - offsetTop = node.offsetTop; - offsetLeft = node.offsetLeft; - - while ((node = node.offsetParent) && node != editorElement) { - offsetTop += node.offsetTop; - offsetLeft += node.offsetLeft; - } - }; - _findOffset(target); - - l = offsetLeft; - t = offsetTop; - - // Should we display the popup on top or below the element? - if (t > 60 && t - st + h + 50 > oh) { - style = "bottom: " + (oh - t + 5) + "px;"; - } else { - style = "top: " + (t + h + 5 ) + "px;"; - } - - // Should we display the popup aligned on the left or right of the element? - left = sl; - right = sl + ow; - leftWidth = right - l; - rightWidth = l + w - left; - - if (leftWidth > rightWidth) { - //Let's align the popup to the left of the element or to the far left - if (leftWidth < 150) { - style += " left: " + (left + 5) + "px;"; - style += " max-width: " + (ow - 10 - this._popupExtraWidth) + "px;"; - } else { - style += " left: " + (left + l) + "px;"; - style += " max-width: " + (leftWidth - 5 - this._popupExtraWidth) + "px;"; - } - } else { - if (rightWidth < 150) { - style += " right: " + (left + 5) + "px;"; - style += " max-width: " + (ow - 10 - this._popupExtraWidth) + "px;"; - } else { - style += " right: " + (right - (left + l + w + 1)) + "px;"; - style += " max-width: " + (rightWidth - this._popupExtraWidth) + "px;"; - } - } - - // Position and size the popup - element.setAttribute("style", style); - - // Setup the anchor - this.link.href = target.href; - this.link.textContent = target.href; - - this._needsReset = false; - } - } - }, - - /** - Description TODO - @function - */ - handleResize: { - enumerable: false, - value: function() { - this._needsReset = true; - this.needsDraw = true; - } - } - -}); diff --git a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.css b/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.css deleted file mode 100644 index fe3c5b06..00000000 --- a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.css +++ /dev/null @@ -1,136 +0,0 @@ - -.matte-Resizer { - display: inline-block; -} - -.matte-Resizer-container { - position: absolute; - border: 1px solid black; -} - -.matte-Resizer-handle { - position: absolute; - width: 7px; - height: 7px; - border: 1px solid black; - -moz-border-radius: 4px; - border-radius: 4px; - background: white; -} - -.matte-Resizer-handle:hover { - width: 9px; - height: 9px; - -moz-border-radius: 5px; - border-radius: 5px; -} - -.matte-Resizer-handle.n { - top: -4px; - left: 50%; - margin-left: -4px; - cursor: n-resize; -} - -.matte-Resizer-handle.n:hover { - top: -5px; - margin-left: -5px; -} - -.matte-Resizer-handle.ne { - top: -4px; - right: -4px; - cursor: ne-resize; -} - -.matte-Resizer-handle.ne:hover { - top: -5px; - right: -5px; -} - -.matte-Resizer-handle.e { - right: -4px; - top: 50%; - margin-top: -4px; - cursor: e-resize; -} - -.matte-Resizer-handle.e:hover { - right: -5px; - margin-top: -5px; -} - -.matte-Resizer-handle.se { - bottom: -4px; - right: -4px; - cursor: se-resize; -} - -.matte-Resizer-handle.se:hover { - bottom: -5px; - right: -5px; -} - -.matte-Resizer-handle.s { - bottom: -4px; - left: 50%; - margin-left: -4px; - cursor: s-resize; -} - -.matte-Resizer-handle.s:hover { - bottom: -5px; - margin-left: -5px; -} - -.matte-Resizer-handle.sw { - bottom: -4px; - left: -4px; - cursor: sw-resize; -} - -.matte-Resizer-handle.sw:hover { - bottom: -5px; - left: -5px; -} - -.matte-Resizer-handle.w { - left: -4px; - top: 50%; - margin-top: -4px; - cursor: w-resize; -} - -.matte-Resizer-handle.w:hover { - left: -5px; - margin-top: -5px; -} - -.matte-Resizer-handle.nw { - top: -4px; - left: -4px; - cursor: nw-resize; -} - -.matte-Resizer-handle.nw:hover { - top: -5px; - left: -5px; -} - -.matte-Resizer-image { - position: absolute; - display: none; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: 0.5; -} - -.matte-Editor--resizing Resizer-image { - display: block; -} - -.matte-Resizer-element::selection { - background: rgba(0,0,0,0); -} diff --git a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.html b/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.html deleted file mode 100644 index e9477d99..00000000 --- a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - -
- -
-
-
-
-
-
-
-
-
- - diff --git a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js b/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js deleted file mode 100644 index 9435a67b..00000000 --- a/node_modules/matte/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js +++ /dev/null @@ -1,560 +0,0 @@ -/** - module:"matte/ui/rich-text-editor/overlays/rich-text-resizer.reel" -*/ -var Component = require("montage/ui/component").Component, - dom = require("montage/core/dom"), - Point = require("montage/core/geometry/point").Point; - -/** - @class module:"matte/ui/rich-text-editor/overlays/rich-text-resizer.reel".RichTextResizer - @extends module:montage/ui/component.Component -*/ -exports.RichTextResizer = Component.specialize(/** @lends module:"matte/ui/rich-text-editor/overlays/rich-text-resizer.reel".RichTextResizer# */ { - - /** - Description TODO - @private - */ - _isActive: { - enumerable: false, - value: false - }, - /** - Description TODO - @private - */ - _editor: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - target: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _draggedElement: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _needsReset: { - enumerable: false, - value: false - }, - - /** - Description TODO - @type {Function} - */ - initWithEditor: { - value: function(editor) { - this._editor = editor; - } - }, - - /** - Description TODO - @type {Function} - */ - editorMouseDown: { - value: function(event) { - var target = event.target; - - if (this._isActive && target === this.element) { - event.preventDefault(); - event.stopPropagation(); - return true; - } - } - }, - - /** - Description TODO - @type {Function} - */ - editorTouchStart: { - value: function(event) { - this.editorMouseDown(event); - } - }, - - /** - Description TODO - @type {Function} - */ - editorMouseUp: { - value: function(event) { - var target = event.target, - previousTarget = this.target; - - // Ignore this call if we are curently capturing the pointer - if (this._observedPointer) { - return true; - } else { - if (target === this.element && this._editor.activeOverlay == this) { - this._editor.hideOverlay(); - // We need to stop the event propagation to prevent the selection to be reset - event.target = this.target; // Retarget the event - event.preventDefault(); - event.stopPropagation(); - } else if (target.tagName === "IMG") { - if (target !== previousTarget) { - if (previousTarget) { - previousTarget.classList.remove("matte-Resizer-element"); - if (previousTarget.classList.length == 0) { - previousTarget.removeAttribute("class"); - } - } - this.target = target; - this._needsReset = true; - if (this._isActive) { - this.needsDraw = true; - } else { - this._ignoreNextSelectionchanged = true; - this._editor.showOverlay(this); - } - } - event.preventDefault(); - event.stopPropagation(); - return true; - } else if (this._editor.activeOverlay == this) { - this._editor.hideOverlay(); - } - } - - return false; - } - }, - - /** - Description TODO - @type {Function} - */ - editorTouchEnd: { - value: function(event) { - this.editorMouseUp(event); - } - }, - - /** - Description TODO - @type {Function} - */ - editorSelectionDidChange: { - value: function(range) { - if (this._ignoreNextSelectionchanged || this._finalizeDrag) { - this._ignoreNextSelectionchanged = false; - } else { - if (this._editor.activeOverlay == this) { - this._editor.hideOverlay(); - } - this.target = null; - } - - return false; - } - }, - - /** - Description TODO - @function - */ - draw: { - enumerable: false, - value: function() { - var element = this.element, - target = this.target, - editorElement = this._editor.innerElement, - style; - - if (this._needsReset) { - var offsetLeft, - offsetTop, - _findOffset = function(node) { - offsetTop = node.offsetTop; - offsetLeft = node.offsetLeft; - - while ((node = node.offsetParent) && node != editorElement) { - offsetTop += node.offsetTop; - offsetLeft += node.offsetLeft; - } - }; - _findOffset(target); - - // Initialize the resizer - style = element.style; - - style.width = target.offsetWidth + "px"; - style.height = target.offsetHeight + "px"; - style.top = offsetTop + "px";; - style.left = offsetLeft + "px"; - - this._editor.innerElement.classList.remove("matte-Editor--resizing"); - target.classList.add("matte-Resizer-element"); - - // Setup the image - this.image.src = target.src; - this.image.title = target.title; - this.image.alt = target.alt; - - // Select the resizedElement - this._selectElement(target); - - this._needsReset = false; - } - - if (this._draggedElement) { - // Resize the resizer - var zero = new Point().init(0, 0), - framePosition = dom.convertPointFromNodeToPage(element, zero), - cursor = this._cursorPosition, - direction = this._draggedElement.getAttribute("data-montage-id").substring("matte-resizer-handle-".length), - info = this._resizerFrameInfo, - ratio = info.ratio, - height = parseFloat(element.style.height, 10), - width = parseFloat(element.style.width, 10), - top = parseFloat(element.style.top, 10), - left = parseFloat(element.style.left, 10), - minSize = 15; - - this._editor.innerElement.classList.add("matte-Editor--resizing"); - - if (direction == "n") { - height += framePosition.y - cursor.y; - top = info.top - (height - info.height); - } else if (direction == "ne") { - height += framePosition.y - cursor.y; - width = Math.round(height * ratio); - if (cursor.x > (framePosition.x + width)) { - width = cursor.x - framePosition.x; - height = Math.round(width / ratio); - } - top = info.top - (height - info.height); - } else if (direction == "e") { - width = cursor.x - framePosition.x; - } else if (direction == "se") { - height = cursor.y - framePosition.y; - width = Math.round(height * ratio); - if (cursor.x > (framePosition.x + width)) { - width = cursor.x - framePosition.x; - height = Math.round(width / ratio); - } - } else if (direction == "s") { - height = cursor.y - framePosition.y; - } else if (direction == "sw") { - height = cursor.y - framePosition.y; - width = Math.round(height * ratio); - if (cursor.x <= framePosition.x - width + element.clientWidth) { - width = element.clientWidth + framePosition.x - cursor.x; - height = Math.round(width / ratio); - } - left = info.left - (width - info.width); - } else if (direction == "w") { - width += framePosition.x - cursor.x; - left = info.left - (width - info.width); - } else if (direction == "nw") { - height += framePosition.y - cursor.y; - width = Math.round(height * ratio); - if (cursor.x <= framePosition.x - width + element.clientWidth) { - width = element.clientWidth + framePosition.x - cursor.x; - height = Math.round(width / ratio); - } - top = info.top - (height - info.height); - left = info.left - (width - info.width); - } - - //set the frame's new height and width - if (height > minSize && width > minSize) { - element.style.height = height + "px"; - element.style.width = width + "px"; - element.style.top = top + "px"; - element.style.left = left + "px"; - } - } - - if (this._finalizeDrag) { - width = element.clientWidth; - height = element.clientHeight; - - this._editor.innerElement.classList.remove("matte-Editor--resizing"); - target.classList.remove("matte-Resizer-element"); - if (target.classList.length == 0) { - target.removeAttribute("class"); - } - - // Select the resizedElement (just in case) - this._selectElement(target); - - // Take the element offline to modify it - var div = document.createElement("div"), - offlineElement, - savedID; - div.appendChild(target.cloneNode(true)); - offlineElement = div.firstChild; - - // Resize the element now that it's offline - offlineElement.width = width; - offlineElement.height = height; - offlineElement.style.removeProperty("width"); - offlineElement.style.removeProperty("height"); - - savedID = offlineElement.id; - offlineElement.id = "matte-editor-resized-image"; - - // Inject the resized element into the contentEditable using execCommand in order to be in the browser undo queue - this._editor.execCommand("inserthtml", false, div.innerHTML, "Resizing Image"); - target = document.getElementById(offlineElement.id); - if (target) { - if (savedID !== undefined && savedID !== "") { - target.id = savedID; - } else { - target.removeAttribute("id"); - } - - // Add back the resizer - this.target = target; - this._needsReset = true; - this.needsDraw = true; - } - - this._finalizeDrag = false; - } - } - }, - - /** - Description TODO - @function - */ - didBecomeActive: { - value: function() { - this._isActive = true; - this.element.addEventListener(window.Touch ? "touchstart" : "mousedown", this, false); - window.addEventListener("resize", this, false); - } - }, - - /** - Description TODO - @function - */ - didBecomeInactive: { - value: function() { - var target = this.target; - - this._isActive = false; - - this.element.removeEventListener(window.Touch ? "touchstart" : "mousedown", this, false); - window.removeEventListener("resize", this, false); - - if (this._draggedElement) { - if (window.Touch) { - document.removeEventListener("touchmove", this); - document.removeEventListener("touchend", this); - } else { - document.removeEventListener("mousemove", this); - document.removeEventListener("mouseup", this); - } - this._releaseInterest(); - } - - if (target) { - // Let's do some extra cleanup - target.classList.remove("matte-Resizer-element"); - if (target.classList.length == 0) { - target.removeAttribute("class"); - } - this._editor.markDirty(); - } - - //Reset the resizer internal - this.target = null; - this._needsReset = false; - this._draggedElement = null; - this._finalizeDrag = false; - } - }, - - /** - Description TODO - @function - */ - handleResize: { - enumerable: false, - value: function() { - this._needsReset = true; - this.needsDraw = true; - } - }, - - /** - Description TODO - @function - */ - handleMousedown: { - value: function(event) { - var target = event.target, - element = this.element; - - if (target.classList.contains("matte-Resizer-handle")) { - if (window.Touch) { - this._observePointer(target.id); - document.addEventListener("touchmove", this); - document.addEventListener("touchend", this); - } else { - this._observePointer("mouse"); - document.addEventListener("mousemove", this); - document.addEventListener("mouseup", this); - } - - this._resizerFrameInfo = { - width: element.clientWidth, - height: element.clientHeight, - left: parseInt(element.style.left, 10), - top: parseInt(element.style.top, 10), - ratio: element.clientWidth / element.clientHeight - }; - this._cursorPosition = {x:event.pageX, y:event.pageY}; - this._draggedElement = target; - - event.preventDefault(); - event.stopPropagation(); - } - } - }, - - /** - Description TODO - @function - */ - handleTouchstart: { - value: function(event) { - this.handleMousedown(event); - } - }, - - /** - Description TODO - @function - */ - handleMousemove: { - value: function(event) { - - this._cursorPosition = {x:event.pageX, y:event.pageY}; - this.needsDraw = true; - - event.preventDefault(); - event.stopPropagation(); - } - }, - - /** - Description TODO - @function - */ - handleTouchmove: { - value: function(event) { - this.handleMousemove(event); - } - }, - - /** - Description TODO - @function - */ - handleMouseup: { - value: function(event) { - if (this._draggedElement) { - if (window.Touch) { - document.removeEventListener("touchmove", this); - document.removeEventListener("touchend", this); - } else { - document.removeEventListener("mousemove", this); - document.removeEventListener("mouseup", this); - } - - this._draggedElement = null; - - this._finalizeDrag = true; - this.needsDraw = true; - - this._releaseInterest(); - - event.preventDefault(); - event.stopPropagation(); - } - } - }, - - /** - Description TODO - @function - */ - handleTouchend: { - value: function(event) { - this.handleMouseup(event); - } - }, - - /** - Description TODO - @function - @param {String} pointer TODO - @param {Component} demandingComponent TODO - @returns {Boolean} false - */ - surrenderPointer: { - value: function(pointer, demandingComponent) { - return false; - } - }, - - /** - Description TODO - @private - */ - _observePointer: { - value: function(pointer) { - this.eventManager.claimPointer(pointer, this); - this._observedPointer = pointer; - } - }, - - /** - Description TODO - @private - */ - _releaseInterest: { - value: function() { - this.eventManager.forfeitPointer(this._observedPointer, this); - this._observedPointer = null; - } - }, - - /** - Description TODO - @private - */ - _selectElement: { - value: function(element) { - var offset, - range; - - this._ignoreNextSelectionchanged = true; - this._editor.selectElement(element); - } - } -}); diff --git a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js b/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js deleted file mode 100644 index 0988edd8..00000000 --- a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js +++ /dev/null @@ -1,1750 +0,0 @@ -/*global Element */ -/** - module:"matte/ui/rich-text-editor.reel" -*/ -var Component = require("montage/ui/component").Component, - Sanitizer = require("./rich-text-sanitizer").Sanitizer, - RichTextLinkPopup = require("../overlays/rich-text-linkpopup.reel").RichTextLinkPopup, - RichTextResizer = require("../overlays/rich-text-resizer.reel").RichTextResizer, - Promise = require("montage/core/promise").Promise, - defaultUndoManager = require("montage/core/undo-manager").defaultUndoManager; - -/** - @class module:"matte/ui/rich-text-editor.reel".RichTextEditorBase - @extends module:montage/ui/component.Component -*/ -exports.RichTextEditorBase = Component.specialize(/** @lends module:"matte/ui/rich-text-editor.reel".RichTextEditor# */ { - /** - Description TODO - @private - */ - _COMMANDS: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - COMMANDS: { - enumerable: false, - get: function() { - if (!this._COMMANDS) { - this._COMMANDS = [ - {property: "bold"}, - {property: "underline"}, - {property: "italic"}, - {property: "strikeThrough"}, - {property: "baselineShift", method: this._baselineShiftGetState}, - {property: "justify", method: this._justifyGetState}, - {property: "listStyle", method: this._listStyleGetState}, - {property: "fontName", method: this._fontNameGetState}, - {property: "fontSize"}, - {property: "backColor"}, - {property: "foreColor"} - ]; - } - return this._COMMANDS; - } - }, - - /** - Description TODO - @private - */ - _overlays: { - enumerable: false, - value: undefined - }, - - /** - Description TODO - @private - */ - _overlaySlot: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _activeOverlay: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _innerElement: { - enumerable: false, - value: null - }, - - _originalDomContent: { - value: null - }, - - /** - Description TODO - @private - */ - _undoManager: { - enumerable: false, - value: undefined - }, - - /** - Description TODO - @private - */ - _isTyping: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _startTyping: { - enumerable: false, - value: function() { - if (this._doingUndoRedo) { - this._isTyping = false; - return; - } else if (!this._isTyping) { - this._isTyping = true; - if (this.undoManager) { - this.undoManager.register("Typing", Promise.resolve([this._undo, this, "Typing", this._innerElement])); - } - } - } - }, - - /** - Description TODO - @private - */ - _stopTyping: { - enumerable: false, - value: function() { - if (this._isTyping) { - this._isTyping = false; - } - } - }, - - /** - Description TODO - @private - */ - _hasSelectionChangeEvent: { - enumerable: false, - value: null // Need to be preset to null, will be set to true or false later on - }, - - /** - Description TODO - @private - */ - _uniqueId: { - enumerable: false, - value: Math.floor(Math.random() * 1000) + "-" + Math.floor(Math.random() * 1000) - }, - - /** - Description TODO - @private - */ - _contentInitialized: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _needsAssignOriginalContent: { - enumerable: false, - value: true - }, - - /** - Description TODO - @private - */ - _needsAssingValue: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _setCaretAtEndOfContent: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _selectionChangeTimer: { - enumerable: false, - value: null - }, - - /** - Description TODO - @private - */ - _hasFocus: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _needsFocus: { - value: false - }, - - /** - Description TODO - @private - */ - _isActiveElement: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _readOnly: { - enumerable: false, - value: false - }, - - /** - Description TODO - @private - */ - _value: { - enumerable: false, - value: "" - }, - - /** - Description TODO - @private - */ - _textValue: { - enumerable: false, - value: "" - }, - - /** - Description TODO - @type {} - */ - delegate: { - enumerable: true, - value: null - }, - - /** - Description TODO - @private - */ - _sanitizer: { - enumerable: false, - value: undefined - }, - - /** - Description TODO - @private - */ - _allowDrop: { - enumerable: false, - value: true - }, - - // Commands Helpers - _getState: { - value: function(property, command) { - var state, - savedActiveElement = document.activeElement, - editorElement = this._innerElement; - - if (editorElement && !this["_" + property + "_locked"]) { - - // Make sure we are the active element before calling execCommand - if (editorElement && editorElement != savedActiveElement) { - editorElement.focus(); - } - - state = document.queryCommandValue(command); - // Convert string to boolean - if (state == "true") { - state = true; - } if (state == "false") { - state = false; - } - - // Reset the focus - if (editorElement && editorElement != savedActiveElement) { - savedActiveElement.focus(); - } - - return state; - } else { - return this["_" + property]; - } - } - }, - - _genericCommandGetter : { - value: function(property, command) { - var propertyName = "_" + property; - this[propertyName] = this._getState(property, command); - return this[propertyName]; - } - }, - - _genericCommandSetter : { - value: function(property, command, value) { - var state = this._getState(property, command); // Make sure the state is up-to-date - if (state !== value) { - this.doAction(command, typeof value == "boolean" ? false : value); - } - } - }, - - // Edit Actions & Properties - /** - Description TODO - @private - */ - _bold: { value: false }, - - /** - Description TODO - @private - */ - _underline: { value: false }, - - /** - Description TODO - @private - */ - _italic: { value: false }, - - /** - Description TODO - @private - */ - _strikeThrough: { value: false }, - - /** - Description TODO - @private - */ - _baselineShiftGetState: { - enumerable: false, - value: function() { - var savedActiveElement = document.activeElement, - editorElement = this._innerElement; - - if (editorElement && !this._baselineShift_locked) { - // Make sure we are the active element before calling execCommand - if (editorElement != savedActiveElement) { - editorElement.focus(); - } - - if (this._getState("baselineShift", "subscript")) { - return "subscript" - } else if (this._getState("baselineShift", "superscript")) { - return "superscript" - } else { - return "baseline"; // default - } - - // Reset the focus - if (editorElement != savedActiveElement) { - savedActiveElement.focus(); - } - } else { - return this._baselineShift; - } - } - }, - - /** - Description TODO - @private - */ - _baselineShift: { value: "baseline" }, - - /** - Description TODO - @private - */ - _listStyleGetState: { - enumerable: false, - value: function() { - var savedActiveElement = document.activeElement, - editorElement = this._innerElement; - - if (editorElement && !this._listStyle_locked) { - // Make sure we are the active element before calling execCommand - if (editorElement != savedActiveElement) { - editorElement.focus(); - } - - if (this._getState("listStyle", "insertorderedlist")) { - return "ordered" - } else if (this._getState("listStyle", "insertunorderedlist")) { - return "unordered" - } else { - return "none"; // default - } - - // Reset the focus - if (editorElement != savedActiveElement) { - savedActiveElement.focus(); - } - } else { - return this._listStyle; - } - } - }, - /** - Description TODO - @private - */ - _listStyle: { value: "none" }, - - /** - Description TODO - @private - */ - _justifyGetState: { - enumerable: false, - value: function() { - var savedActiveElement = document.activeElement, - editorElement = this._innerElement; - - if (editorElement && !this._justify_locked) { - // Make sure we are the active element before calling execCommand - if (editorElement != savedActiveElement) { - editorElement.focus(); - } - - if (this._getState("justify", "justifyleft")) { - return "left" - } else if (this._getState("justify", "justifycenter")) { - return "center" - } else if (this._getState("justify", "justifyright")) { - return "right" - } else if (this._getState("justify", "justifyfull")) { - return "full" - } else { - return "left"; // default - } - - // Reset the focus - if (editorElement != savedActiveElement) { - savedActiveElement.focus(); - } - } else { - return this._justify; - } - } - }, - - /** - Description TODO - @private - */ - _justify: { value: "left" }, - - /** - Description TODO - @private - */ - _fontNameGetState: { - enumerable: false, - value: function() { - var fontName = this._getState("fontName", "fontname"); - if (fontName) { - fontName = fontName.replace(/\"|\'/g, ""); - } - - return fontName; - } - }, - /** - Description TODO - @private - */ - _fontName: { value: "" }, - - /** - Description TODO - @private - */ - _fontSize: { value: 0 }, - - /** - Description TODO - @private - */ - _backColor: { value: "" }, - - /** - Description TODO - @private - */ - _foreColor: { value: "" }, - - /** - Description TODO - @type {Function} - */ - _updateStates: { - enumerable: true, - value: function() { - var thisRef = this, - command, - commandName, - propertyName, - state, - prevState, - method, - descriptor, - i; - - var COMMANDS = this.COMMANDS; - var numCommands = COMMANDS.length; - for (i = 0; i < numCommands; i ++) { - command = COMMANDS[i]; - - if (typeof command == "object") { - propertyName = command.property; - commandName = command.name || propertyName.toLowerCase(); - method = command.method || this._getState; - } else { - continue; - } - - descriptor = this.getOwnPropertyChangeDescriptor(propertyName); - - if (descriptor) { - prevState = this["_" + propertyName]; - state = method.call(this, propertyName, commandName); - if (state !== prevState) { - this["_" + propertyName + "_locked"] = true; - this.dispatchBeforeOwnPropertyChange(propertyName, prevState); - this["_" + propertyName] = state; - this.dispatchOwnPropertyChange(propertyName, state); - thisRef["_" + propertyName + "_locked"] = false; - } - } - } - } - }, - - // Component Callbacks - - /** - Description TODO - @function - */ - enterDocument: { - value: function(firstTime) { - var el; - - if (firstTime) { - el = this.element; - - el.classList.add('montage-Editor-container'); - - el.addEventListener("focus", this, true); - el.addEventListener("dragstart", this, false); - el.addEventListener("dragenter", this, false); - el.addEventListener("dragover", this, false); - el.addEventListener("drop", this, false); - el.addEventListener("dragend", this, false); - - // Setup the sanitizer if not specified - if (this._sanitizer === undefined) { - this._sanitizer = new Sanitizer(); - } - - // Setup the undoManager if not specified - if (this._undoManager === undefined) { - this._undoManager = defaultUndoManager; - } - - // Initialize the overlays - if (this._overlays === undefined) { - // Install the default overlays - this._overlays = [new RichTextResizer(), new RichTextLinkPopup()]; - } - this._callOverlays("initWithEditor", this, true); - } - } - }, - - /** - Description TODO - @function - */ - draw: { - enumerable: false, - value: function() { - var editorElement = this.element, - editorInnerElement, - contents, - content, - contentChanged, - prevValue, - descriptor, - i; - - if (this._needsAssingValue || this._needsAssignOriginalContent) { - editorInnerElement = this._innerElement = editorElement.querySelector(".matte-Editor"); - - if (this._contentInitialized) { - // if the content has been already initialized, we need replace it by a clone of itself - // in order to reset the browser undo stack - editorElement.replaceChild(editorInnerElement.cloneNode(true), editorInnerElement); - editorInnerElement = this._innerElement = editorElement.querySelector(".matte-Editor"); - - //JFD TODO: Need to clear entries in the Montage undoManager queue - } - - editorInnerElement.setAttribute("contenteditable", (this._readOnly ? "false" : "true")); - editorInnerElement.classList.add("editor-" + this._uniqueId); - editorInnerElement.innerHTML = ""; - - if (this._needsAssingValue) { - // Set the contentEditable value - if (this._value && !this._dirtyValue) { - editorInnerElement.innerHTML = this._value; - } else if (this._textValue && !this._dirtyTextValue) { - if (editorInnerElement.innerText) { - editorInnerElement.innerText = this._textValue; - } else { - editorInnerElement.textContent = this._textValue; - } - } - } else if (this._needsAssignOriginalContent) { - contents = this._originalDomContent; - contentChanged = false; - if (contents instanceof Element) { - editorInnerElement.appendChild(contents); - contentChanged = true; - } else { - for (i = 0; contents && (content = contents[i]); i++) { - editorInnerElement.appendChild(content); - contentChanged = true; - } - } - if (contentChanged) { - // Clear the cached value in order to force an editorChange event - this._dirtyValue = true; - this._dirtyTextValue = true; - } - } - - this._adjustPadding(); - this.markDirty(); - - this._needsAssingValue = false; - this._needsAssignOriginalContent = false; - this._contentInitialized = true; - - this._setCaretAtEndOfContent = true; - if (this.hasFocus) { - // Call focus to move caret to end of document - this.focus(); - } - - } else { - editorInnerElement = this._innerElement; - } - - if (this._readOnly) { - editorInnerElement.setAttribute("contentEditable", "false"); - editorElement.classList.add("readonly") - } else { - editorInnerElement.setAttribute("contentEditable", "true"); - editorElement.classList.remove("readonly") - } - } - }, - - /** - Description TODO - @function - */ - didDraw: { - value: function() { - if (this._needsFocus) { - this._innerElement.focus(); - if(document.activeElement == this._innerElement) { - this._needsFocus = false; - } else { - // Make sure the element is visible before trying again to set the focus - var style = window.getComputedStyle(this.element); - if (style.getPropertyValue("visibility") == "hidden" || style.getPropertyValue("display") == "none") { - this._needsFocus = false; - } else { - this.needsDraw = true; - } - } - } - } - }, - - /** - Description TODO - @function - */ - slotDidSwitchContent: { - enumerable: false, - value: function(substitution, nodeShown, componentShown, nodeHidden, componentHidden) { - if(componentHidden && typeof componentHidden.didBecomeInactive === 'function') { - componentHidden.didBecomeInactive(); - } - if(componentShown && typeof componentShown.didBecomeActive === 'function') { - componentShown.didBecomeActive(); - } - } - }, - - /** - Description TODO - @function - */ - _adjustPadding: { - enumerable: false, - value: function() { - var el = this._innerElement, - minLeft = 0, - minTop = 0; - - var walkTree = function(node, parentLeft, parentTop) { - var nodes = node ? node.childNodes : [], - nbrNodes = nodes.length, - i, - offsetLeft = node.offsetLeft, - offsetTop = node.offsetTop; - - if (node.offsetParent) { - offsetLeft += parentLeft; - offsetTop += parentTop; - } - if (minLeft > offsetLeft) { - minLeft = offsetLeft; - } - if (minTop > offsetTop) { - minTop = offsetTop; - } - - for (i = 0; i < nbrNodes; i ++) { - walkTree(nodes[i], offsetLeft, offsetTop) - } - }; - walkTree(el, el.offsetLeft, el.offsetTop); - - var computedStyle = document.defaultView.getComputedStyle(el), - paddingLeft = computedStyle.paddingLeft, - paddingTop = computedStyle.paddingTop; - - if (paddingLeft.match(/%$/)) { - paddingLeft = parseInt(paddingLeft, 10) * el.clientWidth; - } else { - paddingLeft = parseInt(paddingLeft, 10); - } - if (paddingTop.match(/%$/)) { - paddingTop = parseInt(paddingTop, 10) * el.clientHeight; - } else { - paddingTop = parseInt(paddingTop, 10); - } - - if (minLeft < 0) { - el.style.paddingLeft = (-minLeft - paddingLeft) + "px"; - } - if (minTop < 0) { - el.style.paddingTop = (-minTop - paddingTop) + "px"; - } - } - }, - - // Event handlers - // Event handlers - /** - Description TODO - @function - */ - captureFocus: { - enumerable: false, - value: function() { - var thisRef = this, - el = this.element, - content = this._innerElement, - isActive, - savedRange, - timer; - - this.dispatchBeforeOwnPropertyChange("hasFocus", thisRef._hasFocus); - thisRef._hasFocus = true; - this.dispatchOwnPropertyChange("hasFocus", thisRef._hasFocus); - isActive = (content && content === document.activeElement); - if (isActive != this._isActiveElement) { - this.dispatchBeforeOwnPropertyChange("isActiveElement", this._isActiveElement); - thisRef._isActiveElement = isActive; - this.dispatchOwnPropertyChange("isActiveElement", this._isActiveElement); - } - - if (this._setCaretAtEndOfContent) { - var node = this._lastInnerNode(), - range, - length, - leafNodes = ["#text", "BR", "IMG"]; - - // Select the last inner node - if (node) { - if (leafNodes.indexOf(node.nodeName) !== -1) { - node = node.parentNode; - } - range = document.createRange(); - length = node.childNodes ? node.childNodes.length : 0; - range.setStart(node, length); - range.setEnd(node, length); - this._selectedRange = range; - } - - // Scroll the content to make sure the caret is visible, but only only if the focus wasn't the result of a user click/touch - savedRange = this._selectedRange; - timer = setInterval(function() { - if (thisRef._equalRange(thisRef._selectedRange, savedRange) && - content.scrollTop + content.offsetHeight != content.scrollHeight) { - content.scrollTop = content.scrollHeight - content.offsetHeight; - } - }, 10); - - setTimeout(function(){clearInterval(timer)}, 1000); - - this._setCaretAtEndOfContent = false; - } - - el.addEventListener("blur", this, true); - el.addEventListener("input", this); - el.addEventListener("keydown", this); - el.addEventListener("keypress", this); - el.addEventListener("cut", this); - el.addEventListener("paste", this); - el.addEventListener(window.Touch ? "touchstart" : "mousedown", this); - document.addEventListener(window.Touch ? "touchend" : "mouseup", this); - - document.addEventListener("selectionchange", this, false); - // Check if the browser does not supports the DOM event selectionchange - if (this._hasSelectionChangeEvent === null) { - var thisRef = this; - setTimeout(function(){ - if (thisRef._hasSelectionChangeEvent === null) { - thisRef._hasSelectionChangeEvent = false; - } - }, 0); - } - if (this._hasSelectionChangeEvent === false) { - // We need to listen to more event in order to simulate a selectionchange event - el.addEventListener("keydup", this); - } - - // Turn off image resize (if supported) as we provide our own - document.execCommand("enableObjectResizing", false, false); - // Force use css for styling (if supported) - document.execCommand("styleWithCSS", false, true); - - // Update the states now that we have focus - this._updateStates(); - } - }, - - /** - Description TODO - @function - */ - captureBlur: { - enumerable: false, - value: function() { - var thisRef = this, - el = this.element, - content = this._innerElement, - isActive; - - this.dispatchBeforeOwnPropertyChange("hasFocus", thisRef._hasFocus); - thisRef._hasFocus = false; - this.dispatchOwnPropertyChange("hasFocus", thisRef._hasFocus); - isActive = (content && content === document.activeElement); - if (isActive != this._isActiveElement) { - this.dispatchBeforeOwnPropertyChange("isActiveElement", this._isActiveElement); - thisRef._isActiveElement = isActive; - this.dispatchOwnPropertyChange("isActiveElement", this._isActiveElement); - } - - // As we lost focus, we need to prevent the selection change timer to fired, else it will cause the RTE to regain focus - if (this._selectionChangeTimer) { - clearTimeout(this._selectionChangeTimer); - } - - el.removeEventListener("blur", this, true); - el.removeEventListener("input", this); - el.removeEventListener("keydown", this); - el.removeEventListener("keypress", this); - el.removeEventListener("cut", this); - el.removeEventListener("paste", this); - el.removeEventListener(window.Touch ? "touchstart" : "mousedown", this); - document.removeEventListener(window.Touch ? "touchend" : "mouseup", this); - - document.removeEventListener("selectionchange", this); - - if (this._hasSelectionChangeEvent === false) { - el.removeEventListener("keydup", this); - } - } - }, - - /** - Description TODO - @function - */ - handleKeydown: { - enumerable: false, - value: function(event) { - if (["Left", "Right", "Up", "Down", "Home", "End"].indexOf(event.keyIdentifier) != -1) { - this._stopTyping(); - } - } - }, - - /** - Description TODO - @function - */ - handleKeypress: { - enumerable: false, - value: function() { - if (this._hasSelectionChangeEvent === false) { - this.handleSelectionchange(); - } - - this.markDirty(); - } - }, - - /** - Description TODO - @function - */ - handleInput: { - enumerable: false, - value: function(event) { - if (!this._executingCommand && !this._ignoreNextInputEvent) { - this._startTyping(); - } - delete this._ignoreNextInputEvent; - - if (this._hasSelectionChangeEvent === false) { - this.handleSelectionchange(); - } - - this.handleDragend(event); - this.markDirty(); - } - }, - - /** - Description TODO - @function - */ - handleShortcut: { - enumerable: false, - value: function(event, action) { - this.doAction(action); - return true; - } - }, - - /** - Description TODO - @function - */ - handleMousedown: { - enumerable: false, - value: function(event) { - this._savedSelection = this._selectedRange; - this._callOverlays(event.type == "mousedown" ? "editorMouseDown" : "editorTouchStart", event); - } - }, - - /** - Description TODO - @function - */ - handleMouseup: { - enumerable: false, - value: function(event) { - if (!this._equalRange(this._savedSelection, this._selectedRange)) { - this._stopTyping(); - } - - if (this._hasSelectionChangeEvent === false) { - this.handleSelectionchange(); - } - this.handleDragend(event); - - this._callOverlays(event.type == "mouseup" ? "editorMouseUp" : "editorTouchEnd", event); - } - }, - - /** - Description TODO - @function - */ - handleTouchstart: { - enumerable: false, - value: function() { - this.handleMousedown(event); - } - }, - - /** - Description TODO - @function - */ - handleTouchend: { - enumerable: false, - value: function() { - this.handleMouseup(event); - } - }, - - /** - Description TODO - @function - */ - handleSelectionchange: { - enumerable: false, - value: function() { - var thisRef = this; - - if (this._hasSelectionChangeEvent == null) { - this._hasSelectionChangeEvent = true; - } - - if (this._ignoreSelectionchange || this._equalRange(this._selectedRange, this._savedSelectedRange)) { - // no change, ignore - return; - } - this._savedSelectedRange = this._selectedRange; - - if (this._selectionChangeTimer) { - clearTimeout(this._selectionChangeTimer); - } - this._selectionChangeTimer = setTimeout(function() { - thisRef._updateStates(); - thisRef._dispatchEditorEvent("editorSelect"); - }, 100); - - this._callOverlays("editorSelectionDidChange", this._savedSelectedRange); - } - }, - - /** - Description TODO - @function - */ - handleDragstart: { - enumerable: false, - value: function(event) { - var delegateMethod = this._delegateMethod("canDrag"); - - if (delegateMethod) { - if (!delegateMethod.call(this.delegate, this, event.srcElement)) { - event.preventDefault(); - event.stopPropagation(); - - return; - } - } - - // let's remember which element we are dragging - this._dragSourceElement = event.srcElement; - } - }, - - /** - Description TODO - @function - */ - handleDragenter: { - enumerable: false, - value: function(event) { - - this.hideOverlay(); - - var delegateMethod = this._delegateMethod("canDrop"); - if (delegateMethod) { - this._allowDrop = delegateMethod.call(this.delegate, this, event, this._dragSourceElement); - } else { - this._allowDrop = true; - } - - event.dataTransfer.dropEffect = this._allowDrop ? "copy" : "none"; - } - }, - - /** - Description TODO - @function - */ - handleDragend: { - enumerable: false, - value: function(event) { - delete this._dragSourceElement; - delete this._dragOverX; - delete this._dragOverY; - - this.handleSelectionchange(); - } - }, - - /** - Description TODO - @function - */ - handleDragover: { - enumerable: false, - value: function(event) { - var thisRef = this, - range; - - // If we are moving an element from within the ourselves, let the browser deal with it... - if (this._dragSourceElement && this._allowDrop) { - return; - } - - event.dataTransfer.dropEffect = this._allowDrop ? "copy" : "none"; - - event.preventDefault(); - event.stopPropagation(); - - // Update the caret - if (this._allowDrop && (event.x !== this._dragOverX || event.y !== this._dragOverY)) { - this._dragOverX = event.x; - this._dragOverY = event.y; - - this._ignoreSelectionchange = true; - if (document.caretRangeFromPoint) { - range = document.caretRangeFromPoint(event.x, event.y); - } else if (event.rangeParent && event.rangeOffset) { - range = document.createRange(); - range.setStart(event.rangeParent, event.rangeOffset); - range.setEnd(event.rangeParent, event.rangeOffset); - } - - if (range) { - this._selectedRange = range; - } - if (this._ignoreSelectionchangeTimer) { - clearTimeout(this._ignoreSelectionchangeTimer) - } - this._ignoreSelectionchangeTimer = setTimeout(function(){ - delete thisRef._ignoreSelectionchange; - thisRef._ignoreSelectionchangeTimer = null; - }, 0); - } - } - }, - - /** - Description TODO - @function - */ - handleDrop: { - enumerable: false, - value: function(event) { - var thisRef = this, - files = event.dataTransfer.files, - fileLength = files.length, - file, - data, - reader, - i, - delegateMethod, - response; - - if (this._dragSourceElement) { - // Let the browser do the job for us, just make sure we cleanup after us - - this._stopTyping(); - if (this.undoManager) { - this.undoManager.register("Move", Promise.resolve([this._undo, this, "Move", this._innerElement])); - } - this._ignoreNextInputEvent = true; - - this.handleDragend(event); - this.handleSelectionchange(); - return; - } - - event.preventDefault(); - event.stopPropagation(); - - if (fileLength) { - for (i = 0; i < fileLength; i ++) { - file = files[i]; - delegateMethod = this._delegateMethod("shouldDropFile"); - response = true; - - if (window.FileReader) { - reader = new FileReader(); - reader.onload = function() { - data = reader.result; - - if (delegateMethod) { - response = delegateMethod.call(thisRef.delegate, thisRef, file, data); - } - if (response === true) { - if (file.type.match(/^image\//i)) { - thisRef.execCommand("insertimage", false, data, "Drop"); - thisRef.markDirty(); - } - } else if (typeof response == "string") { - thisRef.execCommand("inserthtml", false, response, "Drop"); - thisRef.markDirty(); - } - } - reader.onprogress = function(e) { - } - reader.onerror = function(e) { - } - reader.readAsDataURL(file); - } else { - // Note: This browser does not support the File API, we cannot do a preview... - if (delegateMethod) { - response = delegateMethod.call(this.delegate, this, file); - } - if (typeof response == "string") { - thisRef.execCommand("inserthtml", false, response, "Drop"); - thisRef.markDirty(); - } - } - } - } else { - data = event.dataTransfer.getData("text/html"); - if (data) { - // Sanitize Fragment (CSS & JS) - if (this._sanitizer) { - data = this._sanitizer.willInsertHtmlData(data, this._uniqueId); - } - } else { - data = event.dataTransfer.getData("text/plain") || event.dataTransfer.getData("text"); - if (data) { - var div = document.createElement('div'); - if (div.innerText) { - div.innerText = data; - } else { - div.textContent = data; - } - data = div.innerHTML; - } - } - if (data) { - var delegateMethod = this._delegateMethod("shouldDrop"), - response; - - if (delegateMethod) { - response = delegateMethod.call(this.delegate, this, event, data, "text/html"); - if (response === true) { - data = data.replace(/\]+>/gi, ""); // Remove the meta tag. - } else { - data = response === false ? null : response ; - } - } else { - data = data.replace(/\]+>/gi, ""); // Remove the meta tag. - } - if (data && data.length) { - this.execCommand("inserthtml", false, data, "Drop"); - this.markDirty(); - } - } - } - this.handleDragend(event); - } - }, - - /** - Description TODO - @function - */ - handleCut: { - enumerable: false, - value: function(event) { - this._stopTyping() - if (this.undoManager) { - this.undoManager.register("Cut", Promise.resolve([this._undo, this, "Cut", this._innerElement])); - } - this._ignoreNextInputEvent = true; - } - }, - - - - /** - Description TODO - @function - */ - handlePaste: { - enumerable: false, - value: function(event) { - var thisRef = this, - clipboardData = event.clipboardData, - data = clipboardData.getData("text/html"), - delegateMethod, - response, - div, - isHTML, - item, - file, - reader; - - /* NOTE: Chrome, and maybe the other browser too, returns html or plain text data when calling getData("text/html), - To determine if the data is actually html, check the data starts with either an html or a meta tag - */ - isHTML = data && data.match(/^(]*>|)/i); - if (data && isHTML) { - // Sanitize Fragment (CSS & JS) - if (this._sanitizer) { - data = this._sanitizer.willInsertHtmlData(data, this._uniqueId); - } - } else { - data = clipboardData.getData("text/plain") || clipboardData.getData("text"); - if (data) { - // Convert plain text to html - div = document.createElement('div'); - if (div.innerText) { - div.innerText = data; - } else { - div.textContent = data; - } - data = div.innerHTML; - } - } - - if (data) { - delegateMethod = this._delegateMethod("shouldPaste"); - if (delegateMethod) { - response = delegateMethod.call(this.delegate, this, event, data, "text/html"); - if (response === true) { - data = data.replace(/\]+>/gi, ""); // Remove the meta tag. - } else { - data = response === false ? null : response ; - } - } else { - data = data.replace(/\]+>/gi, ""); // Remove the meta tag. - } - if (data && data.length) { - this.execCommand("inserthtml", false, data, "Paste"); - this.markDirty(); - } - } else { - // Maybe we have trying to paste an image as Blob... - if (clipboardData.items.length) { - item = clipboardData.items[0]; - if (item.kind == "file" && item.type.match(/^image\/.*$/)) { - file = item.getAsFile(); - - response = true; - delegateMethod = thisRef._delegateMethod("shouldPasteFile"); - - if (window.FileReader) { - reader = new FileReader(); - reader.onload = function() { - data = reader.result; - - if (delegateMethod) { - response = delegateMethod.call(thisRef.delegate, thisRef, file, data); - } - if (response === true) { - if (file.type.match(/^image\//i)) { - thisRef.execCommand("insertimage", false, data, "Paste"); - thisRef.markDirty(); - } - } - } - reader.onprogress = function(e) { - } - reader.onerror = function(e) { - } - reader.readAsDataURL(file); - } else { - // Note: This browser does not support the File API, we cannot handle it directly... - if (delegateMethod) { - response = delegateMethod.call(this.delegate, this, file); - } - if (response === true) { - // TODO: for now, we do nothing, up to the consumer to deal with that case - } - } - } - } - } - - event.preventDefault(); - event.stopPropagation(); - } - }, - - // Actions - /** - Description TODO - @function - */ - handleAction: { - enumerable: false, - value: function(event) { - var target = event.currentTarget, - action = target.action || target.identifier, - value = false; - - if (action) { - this.doAction(action, value); - } - } - }, - - /** - Description TODO - @function - */ - doAction: { - enumerable: true, - value: function(action, value) { - this.execCommand(action, false, value); - - // Force an update states right away - this._updateStates(); - } - }, - - - _undo: { - enumerable: false, - value: function(label, element) { - var editorElement = this._innerElement; - if (!element || element === editorElement) { - this._doingUndoRedo = true; - this._ignoreNextInputEvent = true; - document.execCommand("undo", false, null); - this.markDirty(); - if (this.undoManager) { - this.undoManager.register(label, Promise.resolve([this._redo, this, label, editorElement])); - } - this._doingUndoRedo = false; - } - } - }, - - /** - Description TODO - @function - */ - _redo: { - enumerable: false, - value: function(label, element) { - var editorElement = this._innerElement; - if (!element || element === editorElement) { - this._doingUndoRedo = true; - this._ignoreNextInputEvent = true; - document.execCommand("redo", false, null); - this.markDirty(); - if (this.undoManager) { - this.undoManager.register(label, Promise.resolve([this._undo, this, label, editorElement])); - } - this._doingUndoRedo = false; - } - } - }, - - // Private methods - - /** - Description TODO - @function - */ - _execCommandLabel : { - enumerable: false, - value: { - bold: "Bold", italic: "Italic", underline: "Underline", strikethrough: "strikeThrough", - subscript: "Subscript", superscript: "Superscript", - indent: "Indent", outdent: "Outdent", insertorderedlist: "Ordered List", insertunorderedlist: "Unordered List", - justifyleft: "Left Align", justifycenter: "Center", justifyright: "Right Align", justifyfull: "Justify", - fontname: "Set Font", fontsize: "Set Size", - forecolor: "Set Color", backcolor: "Set Color" - } - }, - - /** - Description TODO - @private - @function - */ - _dispatchEditorEvent: { - enumerable: false, - value: function(type, value) { - var editorEvent = document.createEvent("CustomEvent"); - editorEvent.initCustomEvent(type, true, false, value === undefined ? null : value); - editorEvent.type = type; - this.dispatchEvent(editorEvent); - } - }, - - /** - Description TODO - @private - @function - */ - _delegateMethod: { - enumerable: false, - value: function(name) { - var delegate, delegateFunctionName, delegateFunction; - if (typeof this.identifier === "string") { - delegateFunctionName = this.identifier + name.toCapitalized(); - } else { - delegateFunctionName = name; - } - if ((delegate = this.delegate) && typeof (delegateFunction = delegate[delegateFunctionName]) === "function") { - return delegateFunction; - } - - return null; - } - }, - - _callOverlays: { - value: function(method, param, forceCallAll) { - var i, - activeOverlay = this._activeOverlay, - overlay; - - // Call the active overlay first - if (activeOverlay) { - if (typeof activeOverlay[method] == "function") { - if (activeOverlay[method](param)) { - if (!forceCallAll) { - return true; - } - } - } - } - - // Then the other overlays - for (i in this._overlays) { - overlay = this._overlays[i]; - if (overlay !== activeOverlay) { - if (typeof overlay[method] == "function") { - if (overlay[method](param)) { - if (!forceCallAll) { - return true; - } - } - } - } - } - - return false; - } - }, - - /** - Description TODO - @private - @function - */ - _nodeOffset: { - enumerable: false, - value: function(node) { - var parentNode = node.parentNode, - childNodes = parentNode.childNodes, - i; - - for (i in childNodes) { - if (childNodes[i] === node) { - return parseInt(i, 10); // i is a string, we need an integer - } - } - return -1; - } - }, - - /** - Description TODO - @private - @function - */ - _lastInnerNode: { - enumerable: false, - value: function() { - var nodes = this._innerElement.childNodes, - nbrNodes = nodes.length, - node = null; - - while (nodes) { - nbrNodes = nodes.length; - if (nbrNodes) { - node = nodes[nbrNodes - 1]; - nodes = node.childNodes; - } else { - break; - } - } - - return node; - } - }, - - /** - Description TODO - @private - @function - */ - _selectedRange: { - enumerable: false, - set: function(range) { - if (window.getSelection) { - var selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); - } else { - range.select(); - } - }, - - get: function() { - var userSelection, - range; - - if (window.getSelection) { - userSelection = window.getSelection(); - } else if (document.selection) { // Opera! - userSelection = document.selection.createRange(); - } - - if (userSelection.getRangeAt) { - if (userSelection.rangeCount) { - return userSelection.getRangeAt(0); - } else { - // return an empty selection - return document.createRange(); - } - } - else { // Safari! - var range = document.createRange(); - range.setStart(userSelection.anchorNode, userSelection.anchorOffset); - range.setEnd(userSelection.focusNode, userSelection.focusOffset); - return range; - } - } - }, - - /** - Description TODO - @private - @function - */ - _equalRange: { - enumerable: false, - value: function(rangeA, rangeB) { - if (rangeA === rangeB) { - return true; - } - if (!rangeA || !rangeB) { - return false; - } - return (rangeA.startContainer == rangeB.startContainer && - rangeA.startOffset == rangeB.startOffset && - rangeA.endContainer == rangeB.endContainer && - rangeA.endOffset == rangeB.endOffset); - } - }, - - _innerText: { - enumerable: false, - value: function(contentNode) { - var result = "", - textNodeContents = [], - newLines = "", - gotText = false, - _walkNode = function(node) { - var nodeName = node.nodeName, - child - - if (nodeName.match(/^(TITLE|STYLE|SCRIPT)$/)) { - return; - } - - if (gotText && nodeName.match(/^(P|DIV|BR|TR|LI)$/)) { - newLines += "\n"; - } - - for (child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType == 3) { // text node - textNodeContents.push(newLines + child.nodeValue); - newLines = ""; - gotText = true; - } else { - if (child.nodeName != "BR" || child.nextSibling) { - _walkNode(child); - } - } - } - - if (gotText && nodeName.match(/^(TABLE|UL|OL)$/)) { - newLines += "\n"; - } - }; - - if (contentNode) { - _walkNode(contentNode); - result = textNodeContents.join(""); - } - - return result; - } - }, - - deserializedFromTemplate: { - value: function() { - this._originalDomContent = this.domContent; - } - } -}); diff --git a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.css b/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.css deleted file mode 100644 index b794cea0..00000000 --- a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.css +++ /dev/null @@ -1,26 +0,0 @@ - -.matte-Editor-container { - position: relative; - overflow: auto; - height: 100%; - width: 100%; -} - -.matte-Editor { - position: relative; - height: inherit; - outline: none; - overflow: auto; - - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; -} - -/* - Overlay -*/ -.matte-Editor-overlay { - z-index: 50; -} diff --git a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.html b/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.html deleted file mode 100644 index ee4e043e..00000000 --- a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -
-
-
-
- - diff --git a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js b/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js deleted file mode 100644 index 209dcf89..00000000 --- a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js +++ /dev/null @@ -1,683 +0,0 @@ -/** - module:"matte/ui/rich-text-editor/rich-text-editor.reel" -*/ -var RichTextEditorBase = require("./rich-text-editor-base").RichTextEditorBase, - Sanitizer = require("./rich-text-sanitizer").Sanitizer, - Promise = require("montage/core/promise").Promise; - -/** - @classdesc The RichTextEditor component is a lightweight Montage component that provides basic HTML editing capability. It wraps the HTML5 contentEditable property and largely relies on the browser's support of execCommand. - @class module:"matte/ui/rich-text-editor/rich-text-editor.reel".RichTextEditor - @extends module:montage/ui/component.Component - @summary -The easiest way to create a RichTextEditor is with a serialization and a <div> tag:

- -Serialization -

-{
-"editor": {
-   "prototype": "ui/rich-text-editor/rich-text-editor.reel",
-   "properties": {
-      "element": {"#": "editor" }
-   }
-}
-
-HTML -
-<body>
-<div data-montage-id="editor">
-    <span>Hello World!</span>
-</div>
-</body>
-
-*/ -exports.RichTextEditor = RichTextEditorBase.specialize(/** @lends module:"matte/ui/rich-text-editor/rich-text-editor.reel".RichTextEditor# */ { - -/** - Returns true if the edtior has focus, otherwise returns false. - @type {boolean} - @readonly -*/ - hasFocus: { - enumerable: true, - get: function() { - return this._hasFocus; - } - }, - -/** - Returns the editor's inner element, which is the element that is editable. - @type {Element} - @readonly -*/ - innerElement: { - enumerable: true, - get: function() { - return this._innerElement; - } - }, - - - /** - Sets the focus on the editor's element. The editor will also become the activeElement. - @function - */ - focus: { - enumerable: true, - value: function() { - this._needsFocus = true; - this.needsDraw = true; - } - }, - - /** - Returns true when the editor is the active element, otherwise return false. Normally the active element has also focus. However, in a multiple window environment it’s possible to be the active element without having focus. Typically, a toolbar item my steal the focus but not become the active element. - - @type {boolean} - @readonly - */ - isActiveElement: { - enumerable: true, - get: function() { - return this._isActiveElement; - } - }, - - /** - Returns true if the content is read only, otherwise returns false. When the editor is set to read only, the user is not able to modify the content. However it still possible to set the content programmatically with by setting the value or textValue properties. - @type {boolean} - */ - readOnly: { - enumerable: true, - get: function() { - return this._readOnly; - }, - set: function(value) { - if (this._readOnly !== value) { - this._readOnly = value; - if (value) { - // Remove any overlay - this.hideOverlay(); - } - this.needsDraw = true; - } - } - }, - - /** - Gets or sets the editor's content as HTML. By default, the HTML content assigned to the editor's DOM element is used. - The new value is passed through the editor's sanitizer before being assigned. - @type {string} - */ - value: { - get: function() { - var contentNode = this._innerElement, - content = "", - overlayElement = null, - overlayParent, - overlayNextSibling; - - if (this._dirtyValue && !this._value_locked) { - this._value_locked = true; - - if (contentNode) { - // Temporary orphan the overlay slot while retrieving the content - overlayElement = contentNode.querySelector("Editor-overlay"); - if (overlayElement) { - overlayParent = overlayElement.parentNode; - overlayNextSibling = overlayElement.nextSibling; - overlayParent.removeChild(overlayElement); - } - content = contentNode.innerHTML; - } - - if (content == "
") { - // when the contentEditable div is emptied, Chrome add a
, let's filter it out - content = ""; - } - if (this._sanitizer === undefined) { - this._sanitizer = new Sanitizer(); - } - if (this._sanitizer) { - content = this._sanitizer.didGetValue(content, this._uniqueId); - } - - // restore the overlay - if (overlayElement) { - overlayParent.insertBefore(overlayElement, overlayNextSibling); - } - - if (this._value != content) { - this.dispatchBeforeOwnPropertyChange("value", this._value); - this._value = content; - this.dispatchOwnPropertyChange("value", this._value); - } - - this._dirtyValue = false; - this._value_locked = false; - } - return this._value; - }, - set: function(value) { - if (this._value !== value || this._dirtyValue) { - // Remove any overlay - this.hideOverlay(); - - if (this._sanitizer === undefined) { - this._sanitizer = new Sanitizer(); - } - if (this._sanitizer) { - value = this._sanitizer.willSetValue(value, this._uniqueId); - } - this._value = value; - this._dirtyValue = false; - this._dirtyTextValue = true; - this._needsAssingValue = true; - this.needsDraw = true; - } - this._needsOriginalContent = false; - } - }, - -/** - Gets or sets the editor's content as plain text. By default, the text content assigned to the editor's DOM element is used. - @type {string} -*/ - textValue: { - enumerable: true, - get: function() { - var contentNode = this._innerElement, - content = "", - overlayElement = null, - overlayParent, - overlayNextSibling; - - if (this._dirtyTextValue && !this._textValue_locked) { - this._textValue_locked = true; - - if (contentNode) { - // Temporary orphan the overlay slot in order to retrieve the content - overlayElement = contentNode.querySelector("Editor-overlay"); - if (overlayElement) { - overlayParent = overlayElement.parentNode; - overlayNextSibling = overlayElement.nextSibling; - overlayParent.removeChild(overlayElement); - } - - content = this._innerText(contentNode); - - // restore the overlay - if (overlayElement) { - overlayParent.insertBefore(overlayElement, overlayNextSibling); - } - } - - if (this._textValue != content) { - this.dispatchBeforeOwnPropertyChange("textValue", this._textValue); - this._textValue = content; - this.dispatchOwnPropertyChange("textValue", this._textValue); - } - - this._dirtyTextValue = false; - this._textValue_locked = false; - } - return this._textValue; - }, - set: function (value) { - if (this._textValue !== value || this._dirtyTextValue) { - // Remove any overlay - this.hideOverlay(); - - this._textValue = value; - this._dirtyTextValue = false; - this._dirtyValue = true; - this._needsAssingValue = true; - this.needsDraw = true; - } - this._needsOriginalContent = false; - } - }, - - /** - Gets or sets the editor's delegate object that can define one or more delegate methods that a consumer can implement. For a list of delegate methods, see [Delegate methods]{@link http://tetsubo.org/docs/montage/using-the-rich…itor-component#Delegate_methods}. - @type {object} - */ - delegate: { - enumerable: true, - value: null - }, - - /** - The role of the sanitizer is to cleanup any data before its inserted, or extracted, from the editor. The default sanitizer removes any JavaScript, and scopes any CSS before injecting any data into the editor. However, JavaScript is not removed when the initial value is set using editor.value. - @type {object} - */ - sanitizer: { - enumerable: false, - get: function() { - return this._sanitizer; - }, - set: function(value) { - this._sanitizer = value; - } - }, - - /** - An array of overlay objects available to the editor. Overlays are UI components that are displayed on top of the editor based on the context. - @type {array} - */ - overlays: { - enumerable: false, - get: function() { - return this._overlays; - }, - set: function(value) { - this.hideOverlay(); - if (value instanceof Array) { - this._overlays = value; - this._callOverlays("initWithEditor", this, true); - } else { - this._overlays = null; - } - } - }, - - /** - Returns the overlay currently being displayed. - @type {object} - */ - activeOverlay: { - get: function() { - return this._activeOverlay; - } - }, - - /** - Displays the specified overlay. - @function - @param {object} overlay The overlay to display. - */ - showOverlay: { - value: function(overlay) { - var slot = this._overlaySlot, - slotElem = slot ? slot.element : null; - - if (slotElem) { - this._activeOverlay = overlay; - this._innerElement.appendChild(slotElem.parentNode ? slotElem.parentNode.removeChild(slotElem) : slotElem); - slot.attachToParentComponent(); - slot.content = overlay; - } - } - }, - - /** - Hides the active overlay. - @function - */ - hideOverlay: { - value: function(a) { - var slot = this._overlaySlot, - slotElem = slot ? slot.element : null; - - if (slotElem) { - if (slotElem.parentNode) { - slotElem.parentNode.removeChild(slotElem); - } - this._activeOverlay = null; - slot.content = null; - } - } - }, - - - // Edit Actions & Properties - - /** - Returns true if the current text selection is bold. If the selected text contains some text in bold and some not, the return value depends on the browser’s implementation. When set to true, adds the bold attribute to the selected text; when set to false, removes the bold attribute from the selected text. - @type {boolean} - */ - bold: { - enumerable: true, - get: function() { return this._genericCommandGetter("bold", "bold"); }, - set: function(value) { this._genericCommandSetter("bold", "bold", value); } - }, - - /** - Returns true if the current text selection is underlined. If the selected text contains some text in underline and some not, the return value depends on the browser’s implementation. When set to true, adds the underline attribute to the selected text; when set to false, removes the underline attribute from the selected text. - @type boolean - */ - underline: { - enumerable: true, - get: function() { return this._genericCommandGetter("underline", "underline"); }, - set: function(value) { this._genericCommandSetter("underline", "underline", value); } - }, - - /** - Returns true if the current text selection is italicized. If the selected text contains some text in italics and some not, the return value depends on the browser’s implementation. When set to true, adds the italic attribute to the selected text; when set to false, removes the italic attribute from the selected text. - @type boolean - */ - italic: { - enumerable: true, - get: function() { return this._genericCommandGetter("italic", "italic"); }, - set: function(value) { this._genericCommandSetter("italic", "italic", value); } - }, - - /** - Returns true if the current text selection has the strikethrough style applied. If the selected text contains some text with strikethrough and some not, the return value depends on the browser’s implementation. When set to true, adds the italic attribute to the selected text; when set to false, removes the italic attribute from the selected text. - @type boolean - */ - - strikeThrough: { - enumerable: false, - get: function() { return this._genericCommandGetter("strikeThrough", "strikethrough"); }, - set: function(value) { this._genericCommandSetter("strikeThrough", "strikethrough", value); } - }, - - /** - Gets and sets the baseline shift for the currently selected text. Valid values are "baseline", "subscript", or "superscript". - @type {string} - @default "baseline" - */ - baselineShift: { - enumerable: true, - get: function() { - this._baselineShift = this._baselineShiftGetState(); - return this._baselineShift; - }, - set: function(value) { - var state = this._baselineShiftGetState(); - - if (state != value) { - if (value == "baseline") { - if (state == "subscript") { - this.doAction("subscript"); - } else if (state == "superscript") { - this.doAction("superscript"); - } - } else if (value == "subscript") { - this.doAction("subscript"); - } else if (value == "superscript") { - this.doAction("superscript"); - } - } - } - }, - - /** - Indent the selected text. If the selected text is inside a list, calling this method moves the selection into a sub-list. - @function - */ - indent: { - enumerable: true, - value: function() { this.doAction("indent"); } - }, - - /** - Indent the selected text. If the selected text is inside a list, calling this method moves the selection either out of the list, or into the parent list. - @function - */ - outdent: { - enumerable: true, - value: function() { this.doAction("outdent"); } - }, - - /** - Gets and sets the list style for the selected text. Valid values are "none", "unordered", "ordered". This property can be used in combination with the [indent]{@link indent} and [outdent]{@link outdent} methods to create a list hierarchy. - @type {string} - */ - listStyle: { - enumerable: true, - get: function() { - this._listStyle = this._listStyleGetState(); - return this._listStyle; - }, - set: function(value) { - var state = this._listStyleGetState(); - - if (state != value) { - if (value == "none") { - this.doAction(state == "ordered" ? "insertorderedlist" : "insertunorderedlist"); - } else if (value == "ordered") { - this.doAction("insertorderedlist"); - } else if (value == "unordered") { - this.doAction("insertunorderedlist"); - } - } - } - }, - - /** - Gets and sets the justification on the selected text. Valid values are "left", "center", "right", and "full". If the current selection is across multiple lines with different justifications, the value of this property depends of the browser’s implementation. - @type {string} - */ - justify: { - enumerable: true, - get: function() { - this._justify = this._justifyGetState(); - return this._justify; - }, - set: function(value) { - var state = this._justifyGetState(); - if (state != value && ["left", "center", "right", "full"].indexOf(value) !== -1) { - this.doAction("justify" + value); - } - } - }, - - /** - Gets and sets the font name for the currently selected text as a CSS font-family. Can be set to any valid CSS font-family value, including multiple values. If the current selection is across multiple font-family elements, the specific return value depends of the browser’s implementation. - @type {string} - */ - fontName: { - enumerable: true, - get: function() { - this._fontName = this._fontNameGetState(); - return this._fontName; - }, - set: function(value) { this._genericCommandSetter("fontName", "fontname", value); } - }, - - /** - Gets and sets the font size for the current text selection. Only HTML font size values 1 through 7 are supported. If the current selection is a mix of font size, the return value depends of the browser’s implementation. - @type {string} - */ - fontSize: { - enumerable: true, - get: function() { return this._genericCommandGetter("fontSize", "fontsize"); }, - set: function(value) { this._genericCommandSetter("fontSize", "fontsize", value); } - }, - - /** - Gets and sets the background color of the currently selected text. This property can be set to any valid CSS color value; however, the color is always returned as an RGB color. If the current selection spans across elements with different background colors, the return value depends on the browser’s implementation. - @type {string} - */ - backColor: { - enumerable: true, - get: function() { return this._genericCommandGetter("backColor", "backcolor"); }, - set: function(value) { this._genericCommandSetter("backColor", "backcolor", value === null ? "inherit" : value); } - }, - - /** - Gets and sets the background color of the currently selected text. This property can be set to any valid CSS color value; however, the color is always returned as an RGB color. If the current selection spans across elements with different background colors, the return value depends on the browser’s implementation. To remove a background color, set it to null. - @type {string} - */ - foreColor: { - enumerable: true, - get: function() { return this._genericCommandGetter("foreColor", "forecolor"); }, - set: function(value) { this._genericCommandSetter("foreColor", "forecolor", value === null ? "inherit" : value); } - }, - - /** - Selects the all the content contained by the editor. Depending on the browser's implementation, some of the outer elements without direct text nodes won't be selected. Consequently, if the user presses the delete key after all the text is selected with this method, selecting all, some markup might still be there, you will have to Select all again to get rid of it. - @function - */ - selectAll: { - enumerable: true, - value: function() { this.doAction("selectall"); } - }, - - /** - Selects the specified DOM element. - @function - @param {element} element The element to select. - */ - selectElement: { - enumerable: true, - value: function(element) { - var offset, - range; - - offset = this._nodeOffset(element); - if (offset !== -1) { - range = document.createRange(); - range.setStart(element.parentNode, offset); - range.setEnd(element.parentNode, offset + 1); - this._selectedRange = range; - } - } - }, - - /** - Gets and sets the Montage undo manager for the editor. By default, it's assigned an instance of the default Montage UndoManager. The component also works with the native Undo Manager provided by the browser. To use the native undo manager, set this property to null - @type {object} - */ - undoManager: { - enumerable: true, - get: function() { return this._undoManager }, - set: function(value) { this._undoManager = value } - }, - - /** - Undo the last editing operation. - @function - */ - undo: { - enumerable: true, - value: function() { - if (this.undoManager) { - this.undoManager.undo(); - } else { - this._undo(); - } - } - }, - - /** - Redo the last editing operation that was canceled by calling undo(). - @function - */ - redo: { - enumerable: true, - value: function() { - if (this.undoManager) { - this.undoManager.redo(); - } else { - this._redo(); - } - } - }, - - /** - Equivalent to the native document.execCommand method, it also sets the focus on the editor before executing the command, marks the editor’s content as dirty, and add the command to the Montage Undo Manager stack using the label provided. - - You should only use this method if you are extending the editor’s functionality, or writing your own overlay. The typical usage would be to insert HTML via the insertHTML command. All other execCommand commands are exposed as bindable properties on the editor, like bold or italic, and those puse the editor property instead. - @function - @param {string} command The command to execute. - @param {boolean} showUI Specifies whether the default user interface should be drawn. - @param {string|number} value The value to pass as an argument to the command. Possible values depend on the command. - @param {string} label The label to use when adding this command to the undo stack managed by the Montage UndoManager. - */ - execCommand: { - enumerable: false, - value: function(command, showUI, value, label) { - var savedActiveElement = document.activeElement, - editorElement = this._innerElement, - retValue = false; - - if (!editorElement) { - return false; - } - - // Make sure we are the active element before calling execCommand - if (editorElement != savedActiveElement) { - editorElement.focus(); - } - - if (value === undefined) { - value = false; - } - - label = label || this._execCommandLabel[command] || "Typing"; - - this._executingCommand = true; - if (document.execCommand(command, showUI, value)) { - this._executingCommand = false; - if (["selectall"].indexOf(command) == -1) { - if (this.undoManager ) { - this._stopTyping(); - this.undoManager.register(label, Promise.resolve([this._undo, this, label, this._innerElement])); - } - } else { - this.markDirty(); - } - - this.handleSelectionchange(); - retValue = true; - } else { - this._executingCommand = false; - } - - // Reset the focus - if (editorElement != savedActiveElement) { - savedActiveElement.focus(); - } - - return retValue; - } - }, - - /** - Marks the editor content as dirty, causing the editor to generate an editorChange event, and update the editor's value and textValue properties. This method should only be called if you are extending the editor or writing an overlay. - @private - @function - */ - markDirty: { - enumerable: false, - value: function() { - var thisRef = this; - - var updateValues = function() { - var value, - descriptor; - - clearTimeout(thisRef._forceUpdateValuesTimeout); - delete thisRef._forceUpdateValuesTimeout; - clearTimeout(thisRef._updateValuesTimeout); - delete thisRef._updateValuesTimeout; - - if (thisRef._dirtyValue) { - thisRef.dispatchOwnPropertyChange("value", thisRef.value); - } - if (thisRef._dirtyTextValue) { - thisRef.dispatchOwnPropertyChange("textValue", thisRef.textValue); - } - thisRef._dispatchEditorEvent("editorChange"); - }; - - if (!this._needsAssingValue) { - // Clear the cached value - this._dirtyValue = true; - this._dirtyTextValue = true; - } - - if (!this._forceUpdateValuesTimeout) { - this._forceUpdateValuesTimeout = setTimeout(updateValues, 1000); - } - if (this._updateValuesTimeout) { - clearTimeout(this._updateValuesTimeout); - } - this._updateValuesTimeout = setTimeout(updateValues, 100); - } - } - -}); diff --git a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-sanitizer.js b/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-sanitizer.js deleted file mode 100644 index 8a44d744..00000000 --- a/node_modules/matte/ui/rich-text-editor/rich-text-editor.reel/rich-text-sanitizer.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - module:"matte/ui/rich-text-sanitizer.js" -*/ -var Montage = require("montage").Montage; - -/** - @class module:"matte/ui/rich-text-sanitizer.js".Sanitizer - @extends module:montage/core/core.Montage -*/ -exports.Sanitizer = Montage.specialize(/** @lends module:"matte/ui/rich-text-sanitizer.js".Sanitizer# */ { - - willSetValue: { - value: function(value, uniqueId) { - return this._scopeCSS(value, uniqueId); - } - }, - - didGetValue: { - value: function(value, uniqueId) { - return this._unscopeCSS(value, uniqueId); - } - }, - - willInsertHtmlData: { - value: function(data, uniqueId) { - return this._scopeCSS(this._removeScript(data), uniqueId); - } - }, - - _scopeCSS: { - enumerable: true, - value: function(htmlFragment, uniqueId) { - var identifierSelector = ".editor-" + uniqueId+ " "; - - if (typeof htmlFragment == "string") { - // Extract the style tag and its content - htmlFragment = htmlFragment.replace(/(