aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/text-properties.reel
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-11 11:17:41 -0700
committerArmen Kesablyan2012-06-11 11:17:41 -0700
commit278769df00ced8620fd73371e38fe2e43f07ca3b (patch)
treedeb505c8a66b660eee1f17a2c6c4c575c7939f6f /js/components/tools-properties/text-properties.reel
parent555fd6efa605b937800b3979a4c68fa7eb8666ae (diff)
parent0f040acabfb7a4bf3138debec5aff869487ceb11 (diff)
downloadninja-278769df00ced8620fd73371e38fe2e43f07ca3b.tar.gz
Merge branch 'refs/heads/master' into binding
Conflicts: js/document/models/html.js js/document/views/design.js js/ninja.reel/ninja.js Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/components/tools-properties/text-properties.reel')
-rwxr-xr-xjs/components/tools-properties/text-properties.reel/text-properties.html9
-rwxr-xr-xjs/components/tools-properties/text-properties.reel/text-properties.js154
2 files changed, 65 insertions, 98 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,