aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-18 13:48:51 -0700
committerValerio Virgillito2012-04-18 13:48:51 -0700
commit2e04af953463643791f6362bd8ef4c6ba190abfa (patch)
treed07aaf646091ddf9dad5b030a7905055fd323490 /node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js
parent616a8532099fec2a15855eac97cd85cb60c4451c (diff)
downloadninja-2e04af953463643791f6362bd8ef4c6ba190abfa.tar.gz
Squashed commit of the following:
commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 10 14:33:00 2012 -0700 fixed the text area case issue Text area was renamed from TextArea to Textarea Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito <valerio@motorola.com> Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito <valerio@motorola.com> Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js')
-rw-r--r--node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js568
1 files changed, 568 insertions, 0 deletions
diff --git a/node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js
new file mode 100644
index 00000000..c8a00ef8
--- /dev/null
+++ b/node_modules/montage/ui/rich-text-editor/overlays/rich-text-resizer.reel/rich-text-resizer.js
@@ -0,0 +1,568 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6/**
7 @module "montage/ui/rich-text-editor/overlays/rich-text-resizer.reel"
8 @requires montage/core/core
9 @requires montage/core/geometry/point
10 @requires montage/ui/component
11 @requires montage/ui/dom
12*/
13var Montage = require("montage").Montage,
14 Component = require("ui/component").Component,
15 dom = require("ui/dom"),
16 Point = require("core/geometry/point").Point;
17
18/**
19 @class module:"montage/ui/rich-text-editor/overlays/rich-text-resizer.reel".RichTextResizer
20 @extends module:montage/ui/component.Component
21*/
22exports.RichTextResizer = Montage.create(Component,/** @lends module:"montage/ui/rich-text-editor/overlays/rich-text-resizer.reel".RichTextResizer# */ {
23
24 /**
25 Description TODO
26 @private
27 */
28 _isActive: {
29 enumerable: false,
30 value: false
31 },
32 /**
33 Description TODO
34 @private
35 */
36 _editor: {
37 enumerable: false,
38 value: null
39 },
40
41 /**
42 Description TODO
43 @private
44 */
45 target: {
46 enumerable: false,
47 value: null
48 },
49
50 /**
51 Description TODO
52 @private
53 */
54 _draggedElement: {
55 enumerable: false,
56 value: null
57 },
58
59 /**
60 Description TODO
61 @private
62 */
63 _needsReset: {
64 enumerable: false,
65 value: false
66 },
67
68 /**
69 Description TODO
70 @type {Function}
71 */
72 initWithEditor: {
73 value: function(editor) {
74 this._editor = editor;
75 }
76 },
77
78 /**
79 Description TODO
80 @type {Function}
81 */
82 editorMouseDown: {
83 value: function(event) {
84 var target = event.target;
85
86 if (this._isActive && target === this.element) {
87 event.preventDefault();
88 event.stopPropagation();
89 return true;
90 }
91 }
92 },
93
94 /**
95 Description TODO
96 @type {Function}
97 */
98 editorTouchStart: {
99 value: function(event) {
100 this.editorMouseDown(event);
101 }
102 },
103
104 /**
105 Description TODO
106 @type {Function}
107 */
108 editorMouseUp: {
109 value: function(event) {
110 var target = event.target,
111 previousTarget = this.target;
112
113 // Ignore this call if we are curently capturing the pointer
114 if (this._observedPointer) {
115 return true;
116 } else {
117 if (target === this.element && this._editor.activeOverlay == this) {
118 this._editor.hideOverlay();
119 // We need to stop the event propagation to prevent the selection to be reset
120 event.target = this.target; // Retarget the event
121 event.preventDefault();
122 event.stopPropagation();
123 } else if (target.tagName === "IMG") {
124 if (target !== previousTarget) {
125 if (previousTarget) {
126 previousTarget.classList.remove("montage-resizer-element");
127 if (previousTarget.classList.length == 0) {
128 previousTarget.removeAttribute("class");
129 }
130 }
131 this.target = target;
132 this._needsReset = true;
133 if (this._isActive) {
134 this.needsDraw = true;
135 } else {
136 this._ignoreNextSelectionchanged = true;
137 this._editor.showOverlay(this);
138 }
139 }
140 event.preventDefault();
141 event.stopPropagation();
142 return true;
143 } else if (this._editor.activeOverlay == this) {
144 this._editor.hideOverlay();
145 }
146 }
147
148 return false;
149 }
150 },
151
152 /**
153 Description TODO
154 @type {Function}
155 */
156 editorTouchEnd: {
157 value: function(event) {
158 this.editorMouseUp(event);
159 }
160 },
161
162 /**
163 Description TODO
164 @type {Function}
165 */
166 editorSelectionDidChange: {
167 value: function(range) {
168 if (this._ignoreNextSelectionchanged) {
169 this._ignoreNextSelectionchanged = false;
170 } else if (this._editor.activeOverlay == this) {
171 this._editor.hideOverlay();
172 }
173
174 return false;
175 }
176 },
177
178 /**
179 Description TODO
180 @function