diff options
author | Armen Kesablyan | 2012-02-07 16:30:47 -0800 |
---|---|---|
committer | Armen Kesablyan | 2012-02-07 16:30:47 -0800 |
commit | d7ead10b566e7de121b2cd2c99fecca8469d63b8 (patch) | |
tree | 3e91822410c9834b269e59c4a0b9962ef0a12b04 /js/components/tools-properties/text-properties.reel/text-properties.js | |
parent | 2082fa6912eec2ffabd2081b7706e8e1b88a9711 (diff) | |
download | ninja-d7ead10b566e7de121b2cd2c99fecca8469d63b8.tar.gz |
Initial Text tool completion.
Diffstat (limited to 'js/components/tools-properties/text-properties.reel/text-properties.js')
-rw-r--r-- | js/components/tools-properties/text-properties.reel/text-properties.js | 149 |
1 files changed, 145 insertions, 4 deletions
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 313693b1..de0b5fa3 100644 --- a/js/components/tools-properties/text-properties.reel/text-properties.js +++ b/js/components/tools-properties/text-properties.reel/text-properties.js | |||
@@ -25,8 +25,8 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
25 | alignCenter: {value: null}, | 25 | alignCenter: {value: null}, |
26 | alignRight: {value: null}, | 26 | alignRight: {value: null}, |
27 | alignJustify: {value: null}, | 27 | alignJustify: {value: null}, |
28 | indentRight: {value: null}, | 28 | indent: {value: null}, |
29 | indentLeft: {value: null}, | 29 | outdent: {value: null}, |
30 | numberedList: {value: null}, | 30 | numberedList: {value: null}, |
31 | bulletedList: {value: null}, | 31 | bulletedList: {value: null}, |
32 | 32 | ||
@@ -42,9 +42,34 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
42 | this.alignCenter.label = "Center"; | 42 | this.alignCenter.label = "Center"; |
43 | this.alignRight.label = "Right"; | 43 | this.alignRight.label = "Right"; |
44 | this.alignJustify.label = "Justify"; | 44 | this.alignJustify.label = "Justify"; |
45 | this.indent.label = "-->" | ||
46 | this.outdent.label = "<--"; | ||
47 | this.numberedList.label = "1 2 3"; | ||
48 | this.bulletedList.label = "• • •"; | ||
49 | this.fontSelection.items = ["Arial", "Arial Black", "Courier New", "Garamond", "Georgia", "Open Sans", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana"]; | ||
50 | this.tagType.items = ["div", "span", "p", "section", "article", "h1", "h2", "h3", "h4", "h5", "h6"]; | ||
51 | |||
52 | |||
53 | this.application.ninja.stage.textTool.addEventListener("editorSelect", this, false); | ||
54 | Object.defineBinding(this.application.ninja.stage.textTool.states, "bold", { | ||
55 | boundObject: this.btnBold, | ||
56 | boundObjectPropertyPath: "value" | ||
57 | }); | ||
58 | |||
45 | } | 59 | } |
46 | }, | 60 | }, |
47 | 61 | ||
62 | handleEditorSelect: { | ||
63 | value: function(e) { | ||
64 | console.log("hello"); | ||
65 | this.application.ninja.stage.textTool.updateStates(); | ||
66 | } | ||
67 | }, | ||
68 | |||
69 | defaultFontSize: { | ||
70 | value: "12px" | ||
71 | }, | ||
72 | |||
48 | _subPrepare: { | 73 | _subPrepare: { |
49 | value: function() { | 74 | value: function() { |
50 | //this.divElement.addEventListener("click", this, false); | 75 | //this.divElement.addEventListener("click", this, false); |
@@ -54,6 +79,122 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
54 | handleClick: { | 79 | handleClick: { |
55 | value: function(event) { | 80 | value: function(event) { |
56 | // this.selectedElement = event._event.target.id; | 81 | // this.selectedElement = event._event.target.id; |
82 | |||
83 | } | ||
84 | }, | ||
85 | |||
86 | handleFontSizeChange: { | ||
87 | |||
88 | }, | ||
89 | |||
90 | handleBtnBoldAction: { | ||
91 | value: function(e) { | ||
92 | this.application.ninja.stage.textTool.doAction("bold", true); | ||
93 | } | ||
94 | }, | ||
95 | |||
96 | handleBtnItalicAction: { | ||
97 | value: function(e) { | ||
98 | this.application.ninja.stage.textTool.doAction("italic", true); | ||
99 | } | ||
100 | }, | ||
101 | |||
102 | handleBtnUnderlineAction: { | ||
103 | value: function(e) { | ||
104 | this.application.ninja.stage.textTool.doAction("underline", true); | ||
105 | } | ||
106 | }, | ||
107 | |||
108 | handleBtnStrikethroughAction: { | ||
109 | value: function(e) { | ||
110 | this.application.ninja.stage.textTool.doAction("strikethrough", true); | ||
111 | } | ||
112 | }, | ||
113 | |||
114 | handleAlignLeftAction: { | ||
115 | value: function(e) { | ||
116 | //this.alignLeft.value = false; | ||
117 | this.alignCenter.value = false; | ||
118 | this.alignRight.value = false; | ||
119 | this.alignJustify.value = false; | ||
120 | this.application.ninja.stage.textTool.doAction("justifyLeft", true); | ||
121 | } | ||
122 | }, | ||
123 | |||
124 | handleAlignCenterAction: { | ||
125 | value: function(e) { | ||
126 | this.alignLeft.value = false; | ||
127 | //this.alignCenter.value = false; | ||
128 | this.alignRight.value = false; | ||
129 | this.alignJustify.value = false; | ||
130 | this.application.ninja.stage.textTool.doAction("justifyCenter", true); | ||
57 | } | 131 | } |
58 | } | 132 | }, |
133 | |||
134 | handleAlignRightAction: { | ||
135 | value: function(e) { | ||
136 | this.alignLeft.value = false; | ||
137 | this.alignCenter.value = false; | ||
138 | //this.alignRight.value = false; | ||
139 | this.alignJustify.value = false; | ||
140 | this.application.ninja.stage.textTool.doAction("justifyRight", true); | ||
141 | } | ||
142 | }, | ||
143 | |||
144 | handleAlignJustifyAction: { | ||
145 | value: function(e) { | ||
146 | this.alignLeft.value = false; | ||
147 | this.alignCenter.value = false; | ||
148 | this.alignRight.value = false; | ||
149 | //this.alignJustify.value = false; | ||
150 | this.application.ninja.stage.textTool.doAction("strikethrough", null); | ||
151 | } | ||
152 | }, | ||
153 | |||
154 | handleIndentAction: { | ||
155 | value: function(e) { | ||
156 | this.application.ninja.stage.textTool.doAction("indent", null); | ||
157 | } | ||
158 | }, | ||
159 | |||
160 | handleOutdentAction: { | ||
161 | value: function(e) { | ||
162 | this.application.ninja.stage.textTool.doAction("outdent", null); | ||
163 | } | ||
164 | }, | ||
165 | |||
166 | handleFontSizeChange: { | ||
167 | value: function(e) { | ||
168 | |||
169 | } | ||
170 | }, | ||
171 | |||
172 | handleFontSizeChanging: { | ||
173 | value: function(e) { | ||
174 | |||
175 | } | ||
176 | }, | ||
177 | |||
178 | handleFontSelectionChange: { | ||
179 | value: function() { | ||
180 | this.application.ninja.stage.textTool.doAction("fontname", this.fontSelection.value); | ||
181 | } | ||
182 | }, | ||
183 | |||
184 | handleNumberedListAction: { | ||
185 | value: function(e) { | ||
186 | //this.numberedList.value = false; | ||
187 | this.bulletedList.value = false; | ||
188 | this.application.ninja.stage.textTool.doAction("insertnumberedlist", true); | ||
189 | } | ||
190 | }, | ||
191 | |||
192 | handleOrderedListAction: { | ||
193 | value: function(e) { | ||
194 | this.numberedList.value = false; | ||
195 | //this.bulletedList.value = false; | ||
196 | this.application.ninja.stage.textTool.doAction("insertnumberedlist", true); | ||
197 | } | ||
198 | }, | ||
199 | |||
59 | }); \ No newline at end of file | 200 | }); \ No newline at end of file |