diff options
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 | 148 |
1 files changed, 144 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..dac30da0 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,33 @@ 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 | this.application.ninja.stage.textTool.updateStates(); | ||
65 | } | ||
66 | }, | ||
67 | |||
68 | defaultFontSize: { | ||
69 | value: "12px" | ||
70 | }, | ||
71 | |||
48 | _subPrepare: { | 72 | _subPrepare: { |
49 | value: function() { | 73 | value: function() { |
50 | //this.divElement.addEventListener("click", this, false); | 74 | //this.divElement.addEventListener("click", this, false); |
@@ -54,6 +78,122 @@ exports.TextProperties = Montage.create(ToolProperties, { | |||
54 | handleClick: { | 78 | handleClick: { |
55 | value: function(event) { | 79 | value: function(event) { |
56 | // this.selectedElement = event._event.target.id; | 80 | // this.selectedElement = event._event.target.id; |
81 | |||
82 | } | ||
83 | }, | ||
84 | |||
85 | handleFontSizeChange: { | ||
86 | |||
87 | }, | ||
88 | |||
89 | handleBtnBoldAction: { | ||
90 | value: function(e) { | ||
91 | this.application.ninja.stage.textTool.doAction("bold", true); | ||
92 | } | ||
93 | }, | ||
94 | |||
95 | handleBtnItalicAction: { | ||
96 | value: function(e) { | ||
97 | this.application.ninja.stage.textTool.doAction("italic", true); | ||
98 | } | ||
99 | }, | ||
100 | |||
101 | handleBtnUnderlineAction: { | ||
102 | value: function(e) { | ||
103 | this.application.ninja.stage.textTool.doAction("underline", true); | ||
104 | } | ||
105 | }, | ||
106 | |||
107 | handleBtnStrikethroughAction: { | ||
108 | value: function(e) { | ||
109 | this.application.ninja.stage.textTool.doAction("strikethrough", true); | ||
110 | } | ||
111 | }, | ||
112 | |||
113 | handleAlignLeftAction: { | ||
114 | value: function(e) { | ||
115 | //this.alignLeft.value = false; | ||
116 | this.alignCenter.value = false; | ||
117 | this.alignRight.value = false; | ||
118 | this.alignJustify.value = false; | ||
119 | this.application.ninja.stage.textTool.doAction("justifyLeft", true); | ||
120 | } | ||
121 | }, | ||
122 | |||
123 | handleAlignCenterAction: { | ||
124 | value: function(e) { | ||
125 | this.alignLeft.value = false; | ||
126 | //this.alignCenter.value = false; | ||
127 | this.alignRight.value = false; | ||
128 | this.alignJustify.value = false; | ||
129 | this.application.ninja.stage.textTool.doAction("justifyCenter", true); | ||
57 | } | 130 | } |
58 | } | 131 | }, |
132 | |||
133 | handleAlignRightAction: { | ||
134 | value: function(e) { | ||
135 | this.alignLeft.value = false; | ||
136 | this.alignCenter.value = false; | ||
137 | //this.alignRight.value = false; | ||
138 | this.alignJustify.value = false; | ||
139 | this.application.ninja.stage.textTool.doAction("justifyRight", true); | ||
140 | } | ||
141 | }, | ||
142 | |||
143 | handleAlignJustifyAction: { | ||
144 | value: function(e) { | ||
145 | this.alignLeft.value = false; | ||
146 | this.alignCenter.value = false; | ||
147 | this.alignRight.value = false; | ||
148 | //this.alignJustify.value = false; | ||
149 | this.application.ninja.stage.textTool.doAction("strikethrough", null); | ||
150 | } | ||
151 | }, | ||
152 | |||
153 | handleIndentAction: { | ||
154 | value: function(e) { | ||
155 | this.application.ninja.stage.textTool.doAction("indent", null); | ||
156 | } | ||
157 | }, | ||
158 | |||
159 | handleOutdentAction: { | ||
160 | value: function(e) { | ||
161 | this.application.ninja.stage.textTool.doAction("outdent", null); | ||
162 | } | ||
163 | }, | ||
164 | |||
165 | handleFontSizeChange: { | ||
166 | value: function(e) { | ||
167 | |||
168 | } | ||
169 | }, | ||
170 | |||
171 | handleFontSizeChanging: { | ||
172 | value: function(e) { | ||
173 | |||
174 | } | ||
175 | }, | ||
176 | |||
177 | handleFontSelectionChange: { | ||
178 | value: function() { | ||
179 | this.application.ninja.stage.textTool.doAction("fontname", this.fontSelection.value); | ||
180 | } | ||
181 | }, | ||
182 | |||
183 | handleNumberedListAction: { | ||
184 | value: function(e) { | ||
185 | //this.numberedList.value = false; | ||
186 | this.bulletedList.value = false; | ||
187 | this.application.ninja.stage.textTool.doAction("insertnumberedlist", true); | ||
188 | } | ||
189 | }, | ||
190 | |||
191 | handleOrderedListAction: { | ||
192 | value: function(e) { | ||
193 | this.numberedList.value = false; | ||
194 | //this.bulletedList.value = false; | ||
195 | this.application.ninja.stage.textTool.doAction("insertnumberedlist", true); | ||
196 | } | ||
197 | }, | ||
198 | |||
59 | }); \ No newline at end of file | 199 | }); \ No newline at end of file |