annotate WebContent/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js @ 8:11baadcdd2c8

start of new Annotator API implementation.
author casties
date Mon, 19 Mar 2012 14:50:28 +0100
parents 0be9d53a6967
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 /**
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2 * fullpage.js
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 * Copyright 2009, Moxiecode Systems AB
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 * Released under LGPL License.
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 * License: http://tinymce.moxiecode.com/license
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 * Contributing: http://tinymce.moxiecode.com/contributing
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 */
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 (function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 tinyMCEPopup.requireLangPack();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 var defaultDocTypes =
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 var defaultEncodings =
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 'Western european (iso-8859-1)=iso-8859-1,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 'Central European (iso-8859-2)=iso-8859-2,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 'Unicode (UTF-8)=utf-8,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 'Chinese traditional (Big5)=big5,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 'Cyrillic (iso-8859-5)=iso-8859-5,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 'Japanese (iso-2022-jp)=iso-2022-jp,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 'Greek (iso-8859-7)=iso-8859-7,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31 'Korean (iso-2022-kr)=iso-2022-kr,' +
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 'ASCII (us-ascii)=us-ascii';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34 var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37 function setVal(id, value) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 var elm = document.getElementById(id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 if (elm) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 value = value || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 if (elm.nodeName == "SELECT")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 selectByValue(document.forms[0], id, value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 else if (elm.type == "checkbox")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 elm.checked = !!value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 elm.value = value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 function getVal(id) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 var elm = document.getElementById(id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 if (elm.nodeName == "SELECT")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 return elm.options[elm.selectedIndex].value;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
58 if (elm.type == "checkbox")
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
59 return elm.checked;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
60
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
61 return elm.value;
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 window.FullPageDialog = {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
65 changedStyle : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
66 var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
67
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
68 setVal('fontface', styles['font-face']);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
69 setVal('fontsize', styles['font-size']);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
70 setVal('textcolor', styles['color']);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
71
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
72 if (val = styles['background-image'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
73 setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
74 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
75 setVal('bgimage', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
76
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
77 setVal('bgcolor', styles['background-color']);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
78
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
79 // Reset margin form elements
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
80 setVal('topmargin', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
81 setVal('rightmargin', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
82 setVal('bottommargin', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
83 setVal('leftmargin', '');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
84
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
85 // Expand margin
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
86 if (val = styles['margin']) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
87 val = val.split(' ');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
88 styles['margin-top'] = val[0] || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
89 styles['margin-right'] = val[1] || val[0] || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
90 styles['margin-bottom'] = val[2] || val[0] || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
91 styles['margin-left'] = val[3] || val[0] || '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
92 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
93
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
94 if (val = styles['margin-top'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
95 setVal('topmargin', val.replace(/px/, ''));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
96
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
97 if (val = styles['margin-right'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
98 setVal('rightmargin', val.replace(/px/, ''));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
99
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
100 if (val = styles['margin-bottom'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
101 setVal('bottommargin', val.replace(/px/, ''));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
102
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
103 if (val = styles['margin-left'])
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
104 setVal('leftmargin', val.replace(/px/, ''));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
105
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
106 updateColor('bgcolor_pick', 'bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
107 updateColor('textcolor_pick', 'textcolor');
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 changedStyleProp : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
111 var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
112
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
113 styles['font-face'] = getVal('fontface');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
114 styles['font-size'] = getVal('fontsize');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
115 styles['color'] = getVal('textcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
116 styles['background-color'] = getVal('bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
117
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
118 if (val = getVal('bgimage'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
119 styles['background-image'] = "url('" + val + "')";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
120 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
121 styles['background-image'] = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
122
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
123 delete styles['margin'];
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
124
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
125 if (val = getVal('topmargin'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
126 styles['margin-top'] = val + "px";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
127 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
128 styles['margin-top'] = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
129
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
130 if (val = getVal('rightmargin'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
131 styles['margin-right'] = val + "px";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
132 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
133 styles['margin-right'] = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
134
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
135 if (val = getVal('bottommargin'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
136 styles['margin-bottom'] = val + "px";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
137 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
138 styles['margin-bottom'] = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
139
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
140 if (val = getVal('leftmargin'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
141 styles['margin-left'] = val + "px";
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
142 else
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
143 styles['margin-left'] = '';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
144
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
145 // Serialize, parse and reserialize this will compress redundant styles
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
146 setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
147 this.changedStyle();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
148 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
149
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
150 update : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
151 var data = {};
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
152
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
153 tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
154 data[node.id] = getVal(node.id);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
155 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
156
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
157 tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
158 tinyMCEPopup.close();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
159 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
160 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
161
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
162 function init() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
163 var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
164
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
165 // Setup doctype select box
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
166 list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
167 for (i = 0; i < list.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
168 item = list[i].split('=');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
169
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
170 if (item.length > 1)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
171 addSelectValue(form, 'doctype', item[0], item[1]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
172 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
173
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
174 // Setup fonts select box
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
175 list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
176 for (i = 0; i < list.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
177 item = list[i].split('=');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
178
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
179 if (item.length > 1)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
180 addSelectValue(form, 'fontface', item[0], item[1]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
181 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
182
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
183 // Setup fontsize select box
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
184 list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
185 for (i = 0; i < list.length; i++)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
186 addSelectValue(form, 'fontsize', list[i], list[i]);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
187
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
188 // Setup encodings select box
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
189 list = editor.getParam("fullpage_encodings", defaultEncodings).split(',');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
190 for (i = 0; i < list.length; i++) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
191 item = list[i].split('=');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
192
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
193 if (item.length > 1)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
194 addSelectValue(form, 'docencoding', item[0], item[1]);
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 // Setup color pickers
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
198 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
199 document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
200 document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
201 document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
202 document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
203 document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
204 document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
205
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
206 // Resize some elements
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
207 if (isVisible('stylesheetbrowser'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
208 document.getElementById('stylesheet').style.width = '220px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
209
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
210 if (isVisible('link_href_browser'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
211 document.getElementById('element_link_href').style.width = '230px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
212
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
213 if (isVisible('bgimage_browser'))
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
214 document.getElementById('bgimage').style.width = '210px';
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
215
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
216 // Update form
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
217 tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
218 setVal(key, value);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
219 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
220
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
221 FullPageDialog.changedStyle();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
222
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
223 // Update colors
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
224 updateColor('textcolor_pick', 'textcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
225 updateColor('bgcolor_pick', 'bgcolor');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
226 updateColor('visited_color_pick', 'visited_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
227 updateColor('active_color_pick', 'active_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
228 updateColor('link_color_pick', 'link_color');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
229 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
230
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
231 tinyMCEPopup.onInit.add(init);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
232 })();