annotate WebContent/jscripts/tiny_mce/plugins/table/js/row.js @ 5:0be9d53a6967

editor for annotations
author dwinter
date Tue, 13 Dec 2011 17:43:46 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 tinyMCEPopup.requireLangPack();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 function init() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 tinyMCEPopup.resizeToInnerSize();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6 document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 var inst = tinyMCEPopup.editor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10 var dom = inst.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 var trElm = dom.getParent(inst.selection.getStart(), "tr");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 var formObj = document.forms[0];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13 var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 // Get table row data
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 var rowtype = trElm.parentNode.nodeName.toLowerCase();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 var align = dom.getAttrib(trElm, 'align');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 var valign = dom.getAttrib(trElm, 'valign');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 var height = trimSize(getStyle(trElm, 'height', 'height'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20 var className = dom.getAttrib(trElm, 'class');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22 var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 var id = dom.getAttrib(trElm, 'id');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 var lang = dom.getAttrib(trElm, 'lang');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 var dir = dom.getAttrib(trElm, 'dir');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 selectByValue(formObj, 'rowtype', rowtype);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 // Any cells selected
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31 // Setup form
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 addClassesToList('class', 'table_row_styles');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 TinyMCE_EditableSelects.init();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 formObj.bgcolor.value = bgcolor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36 formObj.backgroundimage.value = backgroundimage;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37 formObj.height.value = height;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 formObj.id.value = id;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 formObj.lang.value = lang;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 formObj.style.value = dom.serializeStyle(st);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 selectByValue(formObj, 'align', align);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 selectByValue(formObj, 'valign', valign);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 selectByValue(formObj, 'class', className, true, true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 selectByValue(formObj, 'dir', dir);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 // Resize some elements
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 if (isVisible('backgroundimagebrowser'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 document.getElementById('backgroundimage').style.width = '180px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 updateColor('bgcolor_pick', 'bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 } else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 tinyMCEPopup.dom.hide('action');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 function updateAction() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57 var action = getSelectValue(formObj, 'action');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
58
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
59 if (!AutoValidator.validate(formObj)) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
60 tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
61 return false;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
62 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
63
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
64 tinyMCEPopup.restoreSelection();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
65 trElm = dom.getParent(inst.selection.getStart(), "tr");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
66 tableElm = dom.getParent(inst.selection.getStart(), "table");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
67
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
68 // Update all selected rows
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
69 if (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
70 tinymce.each(tableElm.rows, function(tr) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
71 var i;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
72
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
73 for (i = 0; i < tr.cells.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
74 if (dom.hasClass(tr.cells[i], 'mceSelected')) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
75 updateRow(tr, true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
76 return;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
77 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
78 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
79 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
80
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
81 inst.addVisual();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
82 inst.nodeChanged();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
83 inst.execCommand('mceEndUndoLevel');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
84 tinyMCEPopup.close();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
85 return;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
86 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
87
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
88 switch (action) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
89 case "row":
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
90 updateRow(trElm);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
91 break;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
92
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
93 case "all":
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
94 var rows = tableElm.getElementsByTagName("tr");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
95
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
96 for (var i=0; i<rows.length; i++)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
97 updateRow(rows[i], true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
98
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
99 break;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
100
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
101 case "odd":
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
102 case "even":
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
103 var rows = tableElm.getElementsByTagName("tr");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
104
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
105 for (var i=0; i<rows.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
106 if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
107 updateRow(rows[i], true, true);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
108 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
109
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
110 break;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
111 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
112
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
113 inst.addVisual();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
114 inst.nodeChanged();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
115 inst.execCommand('mceEndUndoLevel');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
116 tinyMCEPopup.close();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
117 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
118
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
119 function updateRow(tr_elm, skip_id, skip_parent) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
120 var inst = tinyMCEPopup.editor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
121 var formObj = document.forms[0];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
122 var dom = inst.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
123 var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
124 var rowtype = getSelectValue(formObj, 'rowtype');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
125 var doc = inst.getDoc();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
126
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
127 // Update row element
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
128 if (!skip_id)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
129 dom.setAttrib(tr_elm, 'id', formObj.id.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
130
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
131 dom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
132 dom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
133 dom.setAttrib(tr_elm, 'lang', formObj.lang.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
134 dom.setAttrib(tr_elm, 'dir', getSelectValue(formObj, 'dir'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
135 dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
136 dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
137
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
138 // Clear deprecated attributes
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
139 dom.setAttrib(tr_elm, 'background', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
140 dom.setAttrib(tr_elm, 'bgColor', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
141 dom.setAttrib(tr_elm, 'height', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
142
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
143 // Set styles
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
144 tr_elm.style.height = getCSSSize(formObj.height.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
145 tr_elm.style.backgroundColor = formObj.bgcolor.value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
146
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
147 if (formObj.backgroundimage.value != "")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
148 tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
149 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
150 tr_elm.style.backgroundImage = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
151
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
152 // Setup new rowtype
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
153 if (curRowType != rowtype && !skip_parent) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
154 // first, clone the node we are working on
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
155 var newRow = tr_elm.cloneNode(1);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
156
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
157 // next, find the parent of its new destination (creating it if necessary)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
158 var theTable = dom.getParent(tr_elm, "table");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
159 var dest = rowtype;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
160 var newParent = null;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
161 for (var i = 0; i < theTable.childNodes.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
162 if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
163 newParent = theTable.childNodes[i];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
164 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
165
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
166 if (newParent == null) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
167 newParent = doc.createElement(dest);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
168
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
169 if (theTable.firstChild.nodeName == 'CAPTION')
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
170 inst.dom.insertAfter(newParent, theTable.firstChild);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
171 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
172 theTable.insertBefore(newParent, theTable.firstChild);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
173 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
174
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
175 // append the row to the new parent
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
176 newParent.appendChild(newRow);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
177
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
178 // remove the original
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
179 tr_elm.parentNode.removeChild(tr_elm);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
180
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
181 // set tr_elm to the new node
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
182 tr_elm = newRow;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
183 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
184
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
185 dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
186 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
187
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
188 function changedBackgroundImage() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
189 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
190 var st = dom.parseStyle(formObj.style.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
191
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
192 st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
193
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
194 formObj.style.value = dom.serializeStyle(st);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
195 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
196
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
197 function changedStyle() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
198 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
199 var st = dom.parseStyle(formObj.style.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
200
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
201 if (st['background-image'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
202 formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
203 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
204 formObj.backgroundimage.value = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
205
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
206 if (st['height'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
207 formObj.height.value = trimSize(st['height']);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
208
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
209 if (st['background-color']) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
210 formObj.bgcolor.value = st['background-color'];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
211 updateColor('bgcolor_pick','bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
212 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
213 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
214
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
215 function changedSize() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
216 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
217 var st = dom.parseStyle(formObj.style.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
218
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
219 var height = formObj.height.value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
220 if (height != "")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
221 st['height'] = getCSSSize(height);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
222 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
223 st['height'] = "";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
224
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
225 formObj.style.value = dom.serializeStyle(st);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
226 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
227
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
228 function changedColor() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
229 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
230 var st = dom.parseStyle(formObj.style.value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
231
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
232 st['background-color'] = formObj.bgcolor.value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
233
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
234 formObj.style.value = dom.serializeStyle(st);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
235 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
236
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
237 tinyMCEPopup.onInit.add(init);