diff options
author | Armen Kesablyan | 2012-06-05 23:13:03 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-05 23:13:03 -0700 |
commit | 7d3bdf39e6d1534de1848ca2744aed66dfeb5d2a (patch) | |
tree | 12cf81e70f38e4bbe8739654d6c4aa4e5f8f498c /js | |
parent | 73a62c95b5635fee903457279f0f5b57f164e0b5 (diff) | |
download | ninja-7d3bdf39e6d1534de1848ca2744aed66dfeb5d2a.tar.gz |
Initial Text Tool Changes
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-x | js/components/tools-properties/text-properties.reel/text-properties.html | 9 | ||||
-rwxr-xr-x | js/components/tools-properties/text-properties.reel/text-properties.js | 154 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.css | 10 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.html | 2 | ||||
-rwxr-xr-x | js/tools/TextTool.js | 29 |
5 files changed, 96 insertions, 108 deletions
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.html b/js/components/tools-properties/text-properties.reel/text-properties.html index 725e1d22..a3477e99 100755 --- a/js/components/tools-properties/text-properties.reel/text-properties.html +++ b/js/components/tools-properties/text-properties.reel/text-properties.html | |||
@@ -93,14 +93,9 @@ | |||
93 | "identifier": "btnBold", | 93 | "identifier": "btnBold", |
94 | "pressedLabel": "B", | 94 | "pressedLabel": "B", |
95 | "unpressedLabel": "B" | 95 | "unpressedLabel": "B" |
96 | }, | 96 | } |
97 | "listeners": [ | ||
98 | { | ||
99 | "type": "action", | ||
100 | "listener": {"@": "owner"} | ||
101 | } | ||
102 | ] | ||
103 | }, | 97 | }, |
98 | |||
104 | "btnItalic": { | 99 | "btnItalic": { |
105 | "prototype": "montage/ui/toggle-button.reel", | 100 | "prototype": "montage/ui/toggle-button.reel", |
106 | "properties": { | 101 | "properties": { |
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.js b/js/components/tools-properties/text-properties.reel/text-properties.js index fa2ec066..35d46cc7 100755 --- a/js/components/tools-properties/text-properties.reel/text-properties.js +++ b/js/components/tools-properties/text-properties.reel/text-properties.js | |||
@@ -72,7 +72,7 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
72 | 72 | ||
73 | handleEditorSelect: { | 73 | handleEditorSelect: { |
74 | value: function(e) { | 74 | value: function(e) { |
75 | this.application.ninja.stage.textTool.updateStates(); | 75 | //this.application.ninja.stage.textTool.updateStates(); |
76 | // this.fontSelection.value = this.application.ninja.stage.textTool.states.fontname; | 76 | // this.fontSelection.value = this.application.ninja.stage.textTool.states.fontname; |
77 | // | 77 | // |
78 | // for( var i = 0; i < this.fontSize.items.length; i++) { | 78 | // for( var i = 0; i < this.fontSize.items.length; i++) { |
@@ -96,30 +96,6 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
96 | 96 | ||
97 | } | 97 | } |
98 | }, | 98 | }, |
99 | |||
100 | handleBtnBoldAction: { | ||
101 | value: function(e) { | ||
102 | this.application.ninja.stage.textTool.doAction("bold"); | ||
103 | } | ||
104 | }, | ||
105 | |||
106 | handleBtnItalicAction: { | ||
107 | value: function(e) { | ||
108 | this.application.ninja.stage.textTool.doAction("italic"); | ||
109 | } | ||
110 | }, | ||
111 | |||
112 | handleBtnUnderlineAction: { | ||
113 | value: function(e) { | ||
114 | this.application.ninja.stage.textTool.doAction("underline"); | ||
115 | } | ||
116 | }, | ||
117 | |||
118 | handleBtnStrikethroughAction: { | ||
119 | value: function(e) { | ||
120 | this.application.ninja.stage.textTool.doAction("strikethrough"); | ||
121 | } | ||
122 | }, | ||
123 | 99 | ||
124 | handleAlignLeftAction: { | 100 | handleAlignLeftAction: { |
125 | value: function(e) { | 101 | value: function(e) { |
@@ -211,87 +187,83 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
211 | 187 | ||
212 | Object.defineBinding(this.btnBold, "pressed", { | 188 | Object.defineBinding(this.btnBold, "pressed", { |
213 | boundObject: this.application.ninja.stage.textTool, | 189 | boundObject: this.application.ninja.stage.textTool, |
214 | boundObjectPropertyPath: "states.bold", | 190 | boundObjectPropertyPath: "bold", |
215 | boundValueMutator: this.validatePressed, | 191 | oneway: false |
216 | oneway: true | ||
217 | }); | 192 | }); |
218 | 193 | ||
219 | Object.defineBinding(this.btnItalic, "pressed", { | 194 | Object.defineBinding(this.btnItalic, "pressed", { |
220 | boundObject: this.application.ninja.stage.textTool, | 195 | boundObject: this.application.ninja.stage.textTool, |
221 | boundObjectPropertyPath: "states.italic", | 196 | boundObjectPropertyPath: "italic", |
222 | boundValueMutator: this.validatePressed, | 197 | oneway: false |
223 | oneway: true | ||
224 | }); | 198 | }); |
225 | 199 | ||
226 | Object.defineBinding(this.btnUnderline, "pressed", { | 200 | Object.defineBinding(this.btnUnderline, "pressed", { |
227 | boundObject: this.application.ninja.stage.textTool, | 201 | boundObject: this.application.ninja.stage.textTool, |
228 | boundObjectPropertyPath: "states.underline", | 202 | boundObjectPropertyPath: "underline", |
229 | boundValueMutator: this.validatePressed, | 203 | oneway: false |
230 | oneway: true | ||
231 | }); | 204 | }); |
232 | 205 | ||
233 | Object.defineBinding(this.btnStrikethrough, "pressed", { | 206 | Object.defineBinding(this.btnStrikethrough, "pressed", { |
234 | boundObject: this.application.ninja.stage.textTool, | 207 | boundObject: this.application.ninja.stage.textTool, |
235 | boundObjectPropertyPath: "states.strikethrough", | 208 | boundObjectPropertyPath: "strikeThrough", |
236 | boundValueMutator: this.validatePressed, | 209 | oneway: false |
237 | oneway: true | ||
238 | }); | 210 | }); |
239 | 211 | ||
240 | Object.defineBinding(this.alignLeft, "pressed", { | 212 | Object.defineBinding(this.alignLeft, "pressed", { |
241 | boundObject: this.application.ninja.stage.textTool, | 213 | boundObject: this.application.ninja.stage.textTool, |
242 | boundObjectPropertyPath: "states.justifyleft", | 214 | boundObjectPropertyPath: "justify", |
243 | boundValueMutator: this.validatePressed, | 215 | boundValueMutator: this.validateJustify, |
244 | oneway: true | 216 | oneway: false |
245 | }); | ||
246 | |||
247 | Object.defineBinding(this.alignCenter, "pressed", { | ||
248 | boundObject: this.application.ninja.stage.textTool, | ||
249 | boundObjectPropertyPath: "states.justifycenter", | ||
250 | boundValueMutator: this.validatePressed, | ||
251 | oneway: true | ||
252 | }); | ||
253 | |||
254 | Object.defineBinding(this.alignRight, "pressed", { | ||
255 | boundObject: this.application.ninja.stage.textTool, | ||
256 | boundObjectPropertyPath: "states.justifyright", | ||
257 | boundValueMutator: this.validatePressed, | ||
258 | oneway: true | ||
259 | }); | ||
260 | |||
261 | Object.defineBinding(this.alignJustify, "pressed", { | ||
262 | boundObject: this.application.ninja.stage.textTool, | ||
263 | boundObjectPropertyPath: "states.justifyfull", | ||
264 | boundValueMutator: this.validatePressed, | ||
265 | oneway: true | ||
266 | }); | ||
267 | |||
268 | Object.defineBinding(this.numberedList, "pressed", { | ||
269 | boundObject: this.application.ninja.stage.textTool, | ||
270 | boundObjectPropertyPath: "states.insertorderedlist", | ||
271 | boundValueMutator: this.validatePressed, | ||
272 | oneway: true | ||
273 | }); | ||
274 | |||
275 | Object.defineBinding(this.bulletedList, "pressed", { | ||
276 | boundObject: this.application.ninja.stage.textTool, | ||
277 | boundObjectPropertyPath: "states.insertunorderedlist", | ||
278 | boundValueMutator: this.validatePressed, | ||
279 | oneway: true | ||
280 | }); | ||
281 | |||
282 | Object.defineBinding(this.fontSelection, "value", { | ||
283 | boundObject: this.application.ninja.stage.textTool, | ||
284 | boundObjectPropertyPath: "states.fontname", | ||
285 | boundValueMutator: this.validateFont, | ||
286 | oneway: true | ||
287 | }); | ||
288 | |||
289 | Object.defineBinding(this.fontSize, "value", { | ||
290 | boundObject: this.application.ninja.stage.textTool, | ||
291 | boundObjectPropertyPath: "states.fontsize", | ||
292 | boundValueMutator: this.validateFontSize.bind(this), | ||
293 | oneway: true | ||
294 | }); | 217 | }); |
218 | // | ||
219 | // Object.defineBinding(this.alignCenter, "pressed", { | ||
220 | // boundObject: this.application.ninja.stage.textTool, | ||
221 | // boundObjectPropertyPath: "justifycenter", | ||
222 | // boundValueMutator: this.validatePressed, | ||
223 | // oneway: true | ||
224 | // }); | ||
225 | // | ||
226 | // Object.defineBinding(this.alignRight, "pressed", { | ||
227 | // boundObject: this.application.ninja.stage.textTool, | ||
228 | // boundObjectPropertyPath: "justifyright", | ||
229 | // boundValueMutator: this.validatePressed, | ||
230 | // oneway: true | ||
231 | // }); | ||
232 | // | ||
233 | // Object.defineBinding(this.alignJustify, "pressed", { | ||
234 | // boundObject: this.application.ninja.stage.textTool, | ||
235 | // boundObjectPropertyPath: "justifyfull", | ||