aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/text-properties.reel
diff options
context:
space:
mode:
authorKruti Shah2012-06-27 09:25:42 -0700
committerKruti Shah2012-06-27 09:25:42 -0700
commitd6bffa2450f68bdf9bfff0f4e155778f59f3624a (patch)
treec37300f67a3fb502d7f4e277600944739d48fd82 /js/components/tools-properties/text-properties.reel
parentb52747edbeba7d210fca98acccb2d2df52134bca (diff)
parent46174eb0ce93d660c8d2e9276fbdc4f9a03f056a (diff)
downloadninja-d6bffa2450f68bdf9bfff0f4e155778f59f3624a.tar.gz
Merge branch 'refs/heads/ninjainternalmaster' into Timeline-local-kruti
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.js160
2 files changed, 70 insertions, 99 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 f47ca0c8..8899ff3c 100755
--- a/js/components/tools-properties/text-properties.reel/text-properties.html
+++ b/js/components/tools-properties/text-properties.reel/text-properties.html
@@ -92,14 +92,9 @@
92 "identifier": "btnBold", 92 "identifier": "btnBold",
93 "pressedLabel": "B", 93 "pressedLabel": "B",
94 "unpressedLabel": "B" 94 "unpressedLabel": "B"
95 }, 95 }
96 "listeners": [
97 {
98 "type": "action",
99 "listener": {"@": "owner"}
100 }
101 ]
102 }, 96 },
97
103 "btnItalic": { 98 "btnItalic": {
104 "prototype": "montage/ui/toggle-button.reel", 99 "prototype": "montage/ui/toggle-button.reel",
105 "properties": { 100 "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 7fe5537c..c5729e98 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",
236// boundValueMutator: this.validatePressed,