spree_editor 0.50.0 → 0.50.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/Versionfile +3 -0
  2. data/app/controllers/admin/editor_settings_controller.rb +5 -11
  3. data/app/views/admin/editor_settings/edit.html.erb +20 -19
  4. data/app/views/shared/editor_engines/_tiny_mce.html.erb +16 -33
  5. data/app/views/shared/editor_engines/_yui_rich_editor.html.erb +60 -7
  6. data/config/locales/en.yml +1 -0
  7. data/config/locales/es.yml +45 -0
  8. data/config/locales/ru.yml +2 -0
  9. data/lib/editor_configuration.rb +2 -2
  10. data/public/images/html_editor.gif +0 -0
  11. data/public/javascripts/tinymce/langs/en.js +56 -3
  12. data/public/javascripts/tinymce/plugins/advhr/langs/en_dlg.js +2 -0
  13. data/public/javascripts/tinymce/plugins/advhr/rule.htm +30 -29
  14. data/public/javascripts/tinymce/plugins/advimage/image.htm +34 -31
  15. data/public/javascripts/tinymce/plugins/advimage/js/image.js +20 -5
  16. data/public/javascripts/tinymce/plugins/advimage/langs/en_dlg.js +2 -0
  17. data/public/javascripts/tinymce/plugins/advlink/js/advlink.js +21 -17
  18. data/public/javascripts/tinymce/plugins/advlink/langs/en_dlg.js +4 -2
  19. data/public/javascripts/tinymce/plugins/advlink/link.htm +35 -30
  20. data/public/javascripts/tinymce/plugins/advlist/editor_plugin.js +1 -1
  21. data/public/javascripts/tinymce/plugins/advlist/editor_plugin_src.js +10 -3
  22. data/public/javascripts/tinymce/plugins/autolink/editor_plugin.js +1 -0
  23. data/public/javascripts/tinymce/plugins/autolink/editor_plugin_src.js +169 -0
  24. data/public/javascripts/tinymce/plugins/autoresize/editor_plugin.js +1 -1
  25. data/public/javascripts/tinymce/plugins/autoresize/editor_plugin_src.js +12 -3
  26. data/public/javascripts/tinymce/plugins/autosave/editor_plugin.js +1 -1
  27. data/public/javascripts/tinymce/plugins/autosave/editor_plugin_src.js +13 -4
  28. data/public/javascripts/tinymce/plugins/bbcode/editor_plugin.js +1 -1
  29. data/public/javascripts/tinymce/plugins/bbcode/editor_plugin_src.js +1 -1
  30. data/public/javascripts/tinymce/plugins/contextmenu/editor_plugin.js +1 -1
  31. data/public/javascripts/tinymce/plugins/contextmenu/editor_plugin_src.js +30 -16
  32. data/public/javascripts/tinymce/plugins/emotions/emotions.htm +15 -14
  33. data/public/javascripts/tinymce/plugins/fullpage/css/fullpage.css +3 -42
  34. data/public/javascripts/tinymce/plugins/fullpage/editor_plugin.js +1 -1
  35. data/public/javascripts/tinymce/plugins/fullpage/editor_plugin_src.js +309 -63
  36. data/public/javascripts/tinymce/plugins/fullpage/fullpage.htm +18 -330
  37. data/public/javascripts/tinymce/plugins/fullpage/js/fullpage.js +199 -438
  38. data/public/javascripts/tinymce/plugins/fullscreen/editor_plugin.js +1 -1
  39. data/public/javascripts/tinymce/plugins/fullscreen/editor_plugin_src.js +10 -2
  40. data/public/javascripts/tinymce/plugins/inlinepopups/editor_plugin.js +1 -1
  41. data/public/javascripts/tinymce/plugins/inlinepopups/editor_plugin_src.js +76 -15
  42. data/public/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -10
  43. data/public/javascripts/tinymce/plugins/layer/editor_plugin.js +1 -1
  44. data/public/javascripts/tinymce/plugins/layer/editor_plugin_src.js +2 -0
  45. data/public/javascripts/tinymce/plugins/legacyoutput/editor_plugin.js +1 -1
  46. data/public/javascripts/tinymce/plugins/legacyoutput/editor_plugin_src.js +31 -28
  47. data/public/javascripts/tinymce/plugins/lists/editor_plugin.js +1 -0
  48. data/public/javascripts/tinymce/plugins/lists/editor_plugin_src.js +617 -0
  49. data/public/javascripts/tinymce/plugins/media/css/media.css +5 -4
  50. data/public/javascripts/tinymce/plugins/media/editor_plugin.js +1 -1
  51. data/public/javascripts/tinymce/plugins/media/editor_plugin_src.js +652 -296
  52. data/public/javascripts/tinymce/plugins/media/js/media.js +327 -603
  53. data/public/javascripts/tinymce/plugins/media/langs/en_dlg.js +8 -2
  54. data/public/javascripts/tinymce/plugins/media/media.htm +283 -288
  55. data/public/javascripts/tinymce/plugins/media/moxieplayer.swf +0 -0
  56. data/public/javascripts/tinymce/plugins/nonbreaking/editor_plugin.js +1 -1
  57. data/public/javascripts/tinymce/plugins/nonbreaking/editor_plugin_src.js +1 -1
  58. data/public/javascripts/tinymce/plugins/noneditable/editor_plugin.js +1 -1
  59. data/public/javascripts/tinymce/plugins/noneditable/editor_plugin_src.js +2 -0
  60. data/public/javascripts/tinymce/plugins/pagebreak/editor_plugin.js +1 -1
  61. data/public/javascripts/tinymce/plugins/pagebreak/editor_plugin_src.js +1 -4
  62. data/public/javascripts/tinymce/plugins/paste/editor_plugin.js +1 -1
  63. data/public/javascripts/tinymce/plugins/paste/editor_plugin_src.js +118 -137
  64. data/public/javascripts/tinymce/plugins/searchreplace/editor_plugin.js +1 -1
  65. data/public/javascripts/tinymce/plugins/searchreplace/editor_plugin_src.js +4 -0
  66. data/public/javascripts/tinymce/plugins/searchreplace/js/searchreplace.js +14 -10
  67. data/public/javascripts/tinymce/plugins/searchreplace/searchreplace.htm +17 -16
  68. data/public/javascripts/tinymce/plugins/spellchecker/editor_plugin.js +1 -1
  69. data/public/javascripts/tinymce/plugins/spellchecker/editor_plugin_src.js +55 -37
  70. data/public/javascripts/tinymce/plugins/style/js/props.js +2 -8
  71. data/public/javascripts/tinymce/plugins/style/langs/en_dlg.js +8 -1
  72. data/public/javascripts/tinymce/plugins/style/props.htm +513 -398
  73. data/public/javascripts/tinymce/plugins/tabfocus/editor_plugin.js +1 -1
  74. data/public/javascripts/tinymce/plugins/tabfocus/editor_plugin_src.js +30 -28
  75. data/public/javascripts/tinymce/plugins/table/cell.htm +12 -12
  76. data/public/javascripts/tinymce/plugins/table/editor_plugin.js +1 -1
  77. data/public/javascripts/tinymce/plugins/table/editor_plugin_src.js +97 -34
  78. data/public/javascripts/tinymce/plugins/table/js/cell.js +9 -11
  79. data/public/javascripts/tinymce/plugins/table/js/row.js +13 -18
  80. data/public/javascripts/tinymce/plugins/table/js/table.js +8 -12
  81. data/public/javascripts/tinymce/plugins/table/langs/en_dlg.js +1 -1
  82. data/public/javascripts/tinymce/plugins/table/merge_cells.htm +11 -11
  83. data/public/javascripts/tinymce/plugins/table/row.htm +10 -8
  84. data/public/javascripts/tinymce/plugins/table/table.htm +54 -53
  85. data/public/javascripts/tinymce/plugins/template/js/template.js +1 -1
  86. data/public/javascripts/tinymce/plugins/visualchars/editor_plugin.js +1 -1
  87. data/public/javascripts/tinymce/plugins/visualchars/editor_plugin_src.js +1 -1
  88. data/public/javascripts/tinymce/plugins/wordcount/editor_plugin.js +1 -1
  89. data/public/javascripts/tinymce/plugins/wordcount/editor_plugin_src.js +35 -19
  90. data/public/javascripts/tinymce/plugins/xhtmlxtras/abbr.htm +6 -5
  91. data/public/javascripts/tinymce/plugins/xhtmlxtras/acronym.htm +6 -5
  92. data/public/javascripts/tinymce/plugins/xhtmlxtras/attributes.htm +6 -5
  93. data/public/javascripts/tinymce/plugins/xhtmlxtras/cite.htm +5 -4
  94. data/public/javascripts/tinymce/plugins/xhtmlxtras/del.htm +9 -8
  95. data/public/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin.js +1 -1
  96. data/public/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +6 -6
  97. data/public/javascripts/tinymce/plugins/xhtmlxtras/ins.htm +11 -10
  98. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/attributes.js +1 -16
  99. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/del.js +2 -2
  100. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/element_common.js +3 -5
  101. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/ins.js +4 -3
  102. data/public/javascripts/tinymce/themes/advanced/about.htm +3 -5
  103. data/public/javascripts/tinymce/themes/advanced/anchor.htm +5 -5
  104. data/public/javascripts/tinymce/themes/advanced/charmap.htm +39 -40
  105. data/public/javascripts/tinymce/themes/advanced/color_picker.htm +10 -9
  106. data/public/javascripts/tinymce/themes/advanced/editor_template.js +1 -1
  107. data/public/javascripts/tinymce/themes/advanced/editor_template_src.js +172 -41
  108. data/public/javascripts/tinymce/themes/advanced/image.htm +51 -51
  109. data/public/javascripts/tinymce/themes/advanced/img/flash.gif +0 -0
  110. data/public/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
  111. data/public/javascripts/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  112. data/public/javascripts/tinymce/themes/advanced/img/quicktime.gif +0 -0
  113. data/public/javascripts/tinymce/themes/advanced/img/realmedia.gif +0 -0
  114. data/public/javascripts/tinymce/themes/advanced/img/shockwave.gif +0 -0
  115. data/public/javascripts/tinymce/themes/advanced/img/trans.gif +0 -0
  116. data/public/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
  117. data/public/javascripts/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  118. data/public/javascripts/tinymce/themes/advanced/js/about.js +1 -0
  119. data/public/javascripts/tinymce/themes/advanced/js/anchor.js +5 -0
  120. data/public/javascripts/tinymce/themes/advanced/js/charmap.js +26 -6
  121. data/public/javascripts/tinymce/themes/advanced/js/color_picker.js +108 -32
  122. data/public/javascripts/tinymce/themes/advanced/js/image.js +3 -1
  123. data/public/javascripts/tinymce/themes/advanced/js/link.js +4 -7
  124. data/public/javascripts/tinymce/themes/advanced/js/source_editor.js +1 -1
  125. data/public/javascripts/tinymce/themes/advanced/langs/en.js +8 -2
  126. data/public/javascripts/tinymce/themes/advanced/langs/en_dlg.js +6 -3
  127. data/public/javascripts/tinymce/themes/advanced/link.htm +27 -28
  128. data/public/javascripts/tinymce/themes/advanced/shortcuts.htm +47 -0
  129. data/public/javascripts/tinymce/themes/advanced/skins/default/content.css +11 -0
  130. data/public/javascripts/tinymce/themes/advanced/skins/default/ui.css +4 -4
  131. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/content.css +23 -0
  132. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  133. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/ui.css +101 -0
  134. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/content.css +10 -0
  135. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/dialog.css +1 -0
  136. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui.css +5 -4
  137. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui_black.css +1 -1
  138. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui_silver.css +1 -1
  139. data/public/javascripts/tinymce/themes/advanced/source_editor.htm +3 -3
  140. data/public/javascripts/tinymce/themes/simple/editor_template.js +1 -1
  141. data/public/javascripts/tinymce/themes/simple/editor_template_src.js +1 -2
  142. data/public/javascripts/tinymce/tiny_mce.js +1 -1
  143. data/public/javascripts/tinymce/tiny_mce_popup.js +1 -1
  144. data/public/javascripts/tinymce/tiny_mce_src.js +6488 -4070
  145. data/public/javascripts/tinymce/utils/form_utils.js +14 -4
  146. data/public/javascripts/tinymce/utils/mctabs.js +95 -10
  147. data/public/javascripts/tinymce/utils/validate.js +35 -3
  148. data/public/stylesheets/editor.css +23 -0
  149. data/spree_editor.gemspec +2 -2
  150. metadata +25 -4
@@ -8,13 +8,12 @@
8
8
  <script type="text/javascript" src="js/fullpage.js"></script>
9
9
  <link href="css/fullpage.css" rel="stylesheet" type="text/css" />
10
10
  </head>
11
- <body id="advlink" style="display: none">
12
- <form onsubmit="updateAction();return false;" name="fullpage" action="#">
11
+ <body id="fullpage" style="display: none">
12
+ <form onsubmit="FullPageDialog.update();return false;" name="fullpage" action="#">
13
13
  <div class="tabs">
14
14
  <ul>
15
15
  <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>
16
16
  <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
17
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>
18
17
  </ul>
19
18
  </div>
20
19
 
@@ -72,9 +71,9 @@
72
71
  </td>
73
72
  </tr>
74
73
  <tr>
75
- <td class="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
74
+ <td class="nowrap"><label for="doctype">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
76
75
  <td>
77
- <select id="doctypes" name="doctypes">
76
+ <select id="doctype" name="doctype">
78
77
  <option value="">{#not_set}</option>
79
78
  </select>
80
79
  </td>
@@ -109,7 +108,7 @@
109
108
  <tr>
110
109
  <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
111
110
  <td>
112
- <select id="fontface" name="fontface" onchange="changedStyleField(this);">
111
+ <select id="fontface" name="fontface" onchange="FullPageDialog.changedStyleProp();">
113
112
  <option value="">{#not_set}</option>
114
113
  </select>
115
114
  </td>
@@ -118,7 +117,7 @@
118
117
  <tr>
119
118
  <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
120
119
  <td>
121
- <select id="fontsize" name="fontsize" onchange="changedStyleField(this);">
120
+ <select id="fontsize" name="fontsize" onchange="FullPageDialog.changedStyleProp();">
122
121
  <option value="">{#not_set}</option>
123
122
  </select>
124
123
  </td>
@@ -129,7 +128,7 @@
129
128
  <td>
130
129
  <table border="0" cellpadding="0" cellspacing="0">
131
130
  <tr>
132
- <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>
131
+ <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');FullPageDialog.changedStyleProp();" /></td>
133
132
  <td id="textcolor_pickcontainer">&nbsp;</td>
134
133
  </tr>
135
134
  </table>
@@ -147,7 +146,7 @@
147
146
  <td>
148
147
  <table border="0" cellpadding="0" cellspacing="0">
149
148
  <tr>
150
- <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>
149
+ <td><input id="bgimage" name="bgimage" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
151
150
  <td id="bgimage_pickcontainer">&nbsp;</td>
152
151
  </tr>
153
152
  </table>
@@ -158,7 +157,7 @@
158
157
  <td>
159
158
  <table border="0" cellpadding="0" cellspacing="0">
160
159
  <tr>
161
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>
160
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');FullPageDialog.changedStyleProp();" /></td>
162
161
  <td id="bgcolor_pickcontainer">&nbsp;</td>
163
162
  </tr>
164
163
  </table>
@@ -173,15 +172,15 @@
173
172
  <table border="0" cellpadding="4" cellspacing="0">
174
173
  <tr>
175
174
  <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
176
- <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
175
+ <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
177
176
  <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
178
- <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
177
+ <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
179
178
  </tr>
180
179
  <tr>
181
180
  <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
182
- <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
181
+ <td><input id="topmargin" name="topmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
183
182
  <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
184
- <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>
183
+ <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
185
184
  </tr>
186
185
  </table>
187
186
  </fieldset>
@@ -195,7 +194,7 @@
195
194
  <td>
196
195
  <table border="0" cellpadding="0" cellspacing="0">
197
196
  <tr>
198
- <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>
197
+ <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');FullPageDialog.changedStyleProp();" /></td>
199
198
  <td id="link_color_pickcontainer">&nbsp;</td>
200
199
  </tr>
201
200
  </table>
@@ -205,7 +204,7 @@
205
204
  <td>
206
205
  <table border="0" cellpadding="0" cellspacing="0">
207
206
  <tr>
208
- <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>
207
+ <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');FullPageDialog.changedStyleProp();" /></td>
209
208
  <td id="visited_color_pickcontainer">&nbsp;</td>
210
209
  </tr>
211
210
  </table>
@@ -217,7 +216,7 @@
217
216
  <td>
218
217
  <table border="0" cellpadding="0" cellspacing="0">
219
218
  <tr>
220
- <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>
219
+ <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');FullPageDialog.changedStyleProp();" /></td>
221
220
  <td id="active_color_pickcontainer">&nbsp;</td>
222
221
  </tr>
223
222
  </table>
@@ -225,16 +224,6 @@
225
224
 
226
225
  <td>&nbsp;</td>
227
226
  <td>&nbsp;</td>
228
-
229
- <!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td>
230
- <td>
231
- <table border="0" cellpadding="0" cellspacing="0">
232
- <tr>
233
- <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>
234
- <td id="hover_color_pickcontainer">&nbsp;</td>
235
- </tr>
236
- </table>
237
- </td> -->
238
227
  </tr>
239
228
  </table>
240
229
  </fieldset>
@@ -254,310 +243,9 @@
254
243
  </tr>
255
244
  <tr>
256
245
  <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
257
- <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>
258
- </tr>
259
- </table>
260
- </fieldset>
261
- </div>
262
-
263
- <div id="advanced_panel" class="panel">
264
- <div id="addmenu">
265
- <table border="0" cellpadding="0" cellspacing="0">
266
- <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>
267
- <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>
268
- <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>
269
- <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>
270
- <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>
271
- <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>
272
- <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>
273
- </table>
274
- </div>
275
-
276
- <fieldset>
277
- <legend>{#fullpage_dlg.head_elements}</legend>
278
-
279
- <div class="headlistwrapper">
280
- <div class="toolbar">
281
- <div style="float: left">
282
- <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>
283
- <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>
284
- </div>
285
- <div style="float: right">
286
- <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>
287
- <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>
288
- </div>
289
- <br style="clear: both" />
290
- </div>
291
- <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">
292
- <option value="title_0">&lt;title&gt;Some title bla bla bla&lt;/title&gt;</option>
293
- <option value="meta_1">&lt;meta name="keywords"&gt;Some bla bla bla&lt;/meta&gt;</option>
294
- <option value="meta_2">&lt;meta name="description"&gt;Some bla bla bla bla bla bla bla bla bla&lt;/meta&gt;</option>
295
- <option value="script_3">&lt;script language=&quot;javascript&quot;&gt;...&lt;/script&gt;</option>
296
- <option value="style_4">&lt;style&gt;...&lt;/style&gt;</option>
297
- <option value="base_5">&lt;base href="." /&gt;</option>
298
- <option value="comment_6">&lt;!-- ... --&gt;</option>
299
- <option value="link_7">&lt;link href="." /&gt;</option>
300
- </select>
301
- </div>
302
- </fieldset>
303
-
304
- <fieldset id="meta_element">
305
- <legend>{#fullpage_dlg.meta_element}</legend>
306
-
307
- <table border="0" cellpadding="4" cellspacing="0">
308
- <tr>
309
- <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td>
310
- <td><select id="element_meta_type">
311
- <option value="name">name</option>
312
- <option value="http-equiv">http-equiv</option>
313
- </select></td>
314
- </tr>
315
- <tr>
316
- <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td>
317
- <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>
318
- </tr>
319
- <tr>
320
- <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td>
321
- <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>
322
- </tr>
323
- </table>
324
-
325
- <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
326
- </fieldset>
327
-
328
- <fieldset id="title_element">
329
- <legend>{#fullpage_dlg.title_element}</legend>
330
-
331
- <table border="0" cellpadding="4" cellspacing="0">
332
- <tr>
333
- <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td>
334
- <td><input id="element_title" name="element_title" type="text" value="" /></td>
335
- </tr>
336
- </table>
337
-
338
- <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
339
- </fieldset>
340
-
341
- <fieldset id="script_element">
342
- <legend>{#fullpage_dlg.script_element}</legend>
343
-
344
- <div class="tabs">
345
- <ul>
346
- <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
347
- <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
348
- </ul>
349
- </div>
350
-
351
- <br style="clear: both" />
352
-
353
- <div class="panel_wrapper">
354
- <div id="script_props_panel" class="panel current">
355
- <table border="0" cellpadding="4" cellspacing="0">
356
- <tr>
357
- <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td>
358
- <td><select id="element_script_type">
359
- <option value="text/javascript">text/javascript</option>
360
- <option value="text/jscript">text/jscript</option>
361
- <option value="text/vbscript">text/vbscript</option>
362
- <option value="text/vbs">text/vbs</option>
363
- <option value="text/ecmascript">text/ecmascript</option>
364
- <option value="text/xml">text/xml</option>
365
- </select></td>
366
- </tr>
367
- <tr>
368
- <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td>
369
- <td><table border="0" cellpadding="0" cellspacing="0">
370
- <tr>
371
- <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>
372
- <td id="script_src_pickcontainer">&nbsp;</td>
373
- </tr>
374
- </table></td>
375
- </tr>
376
- <tr>
377
- <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td>
378
- <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>
379
- </tr>
380
- <tr>
381
- <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td>
382
- <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>
383
- </tr>
384
- </table>
385
- </div>
386
-
387
- <div id="script_value_panel" class="panel">
388
- <textarea id="element_script_value"></textarea>
389
- </div>
390
- </div>
391
-
392
- <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
393
- </fieldset>
394
-
395
- <fieldset id="style_element">
396
- <legend>{#fullpage_dlg.style_element}</legend>
397
-
398
- <div class="tabs">
399
- <ul>
400
- <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
401
- <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
402
- </ul>
403
- </div>
404
-
405
- <br style="clear: both" />
406
-
407
- <div class="panel_wrapper">
408
- <div id="style_props_panel" class="panel current">
409
- <table border="0" cellpadding="4" cellspacing="0">
410
- <tr>
411
- <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td>
412
- <td><select id="element_style_type">
413
- <option value="text/css">text/css</option>
414
- </select></td>
415
- </tr>
416
- <tr>
417
- <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td>
418
- <td><select id="element_style_media"></select></td>
419
- </tr>
420
- </table>
421
- </div>
422
-
423
- <div id="style_value_panel" class="panel">
424
- <textarea id="element_style_value"></textarea>
425
- </div>
426
- </div>
427
-
428
- <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
429
- </fieldset>
430
-
431
- <fieldset id="base_element">
432
- <legend>{#fullpage_dlg.base_element}</legend>
433
-
434
- <table border="0" cellpadding="4" cellspacing="0">
435
- <tr>
436
- <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td>
437
- <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>
438
- </tr>
439
- <tr>
440
- <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td>
441
- <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>
246
+ <td><input id="style" name="style" type="text" value="" onchange="FullPageDialog.changedStyle();" /></td>
442
247
  </tr>
443
248
  </table>
444
-
445
- <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
446
- </fieldset>
447
-
448
- <fieldset id="link_element">
449
- <legend>{#fullpage_dlg.link_element}</legend>
450
-
451
- <div class="tabs">
452
- <ul>
453
- <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>
454
- <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>
455
- </ul>
456
- </div>
457
-
458
- <br style="clear: both" />
459
-
460
- <div class="panel_wrapper">
461
- <div id="link_general_panel" class="panel current">
462
- <table border="0" cellpadding="4" cellspacing="0">
463
- <tr>
464
- <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td>
465
- <td><table border="0" cellpadding="0" cellspacing="0">
466
- <tr>
467
- <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>
468
- <td id="link_href_pickcontainer">&nbsp;</td>
469
- </tr>
470
- </table></td>
471
- </tr>
472
- <tr>
473
- <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td>
474
- <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>
475
- </tr>
476
- <tr>
477
- <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td>
478
- <td><select id="element_link_type" name="element_link_type">
479
- <option value="text/css">text/css</option>
480
- <option value="text/javascript">text/javascript</option>
481
- </select></td>
482
- </tr>
483
- <tr>
484
- <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td>
485
- <td><select id="element_link_media" name="element_link_media"></select></td>
486
- </tr>
487
- <tr>
488
- <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>
489
- <td><select id="element_style_rel" name="element_style_rel">
490
- <option value="">{#not_set}</option>
491
- <option value="stylesheet">Stylesheet</option>
492
- <option value="alternate">Alternate</option>
493
- <option value="designates">Designates</option>
494
- <option value="start">Start</option>
495
- <option value="next">Next</option>
496
- <option value="prev">Prev</option>
497
- <option value="contents">Contents</option>
498
- <option value="index">Index</option>
499
- <option value="glossary">Glossary</option>
500
- <option value="copyright">Copyright</option>
501
- <option value="chapter">Chapter</option>
502
- <option value="subsection">Subsection</option>
503
- <option value="appendix">Appendix</option>
504
- <option value="help">Help</option>
505
- <option value="bookmark">Bookmark</option>
506
- </select>
507
- </td>
508
- </tr>
509
- </table>
510
- </div>
511
-
512
- <div id="link_advanced_panel" class="panel">
513
- <table border="0" cellpadding="4" cellspacing="0">
514
- <tr>
515
- <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td>
516
- <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>
517
- </tr>
518
- <tr>
519
- <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td>
520
- <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>
521
- </tr>
522
- <tr>
523
- <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td>
524
- <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>
525
- </tr>
526
- <tr>
527
- <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>
528
- <td><select id="element_style_rev" name="element_style_rev">
529
- <option value="">{#not_set}</option>
530
- <option value="alternate">Alternate</option>
531
- <option value="designates">Designates</option>
532
- <option value="stylesheet">Stylesheet</option>
533
- <option value="start">Start</option>
534
- <option value="next">Next</option>
535
- <option value="prev">Prev</option>
536
- <option value="contents">Contents</option>
537
- <option value="index">Index</option>
538
- <option value="glossary">Glossary</option>
539
- <option value="copyright">Copyright</option>
540
- <option value="chapter">Chapter</option>
541
- <option value="subsection">Subsection</option>
542
- <option value="appendix">Appendix</option>
543
- <option value="help">Help</option>
544
- <option value="bookmark">Bookmark</option>
545
- </select>
546
- </td>
547
- </tr>
548
- </table>
549
- </div>
550
- </div>
551
-
552
- <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
553
- </fieldset>
554
-
555
- <fieldset id="comment_element">
556
- <legend>{#fullpage_dlg.comment_element}</legend>
557
-
558
- <textarea id="element_comment_value"></textarea>
559
-
560
- <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
561
249
  </fieldset>
562
250
  </div>
563
251
  </div>
@@ -566,6 +254,6 @@
566
254
  <input type="submit" id="insert" name="update" value="{#update}" />
567
255
  <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
568
256
  </div>
569
- </form>
257
+ </form>
570
258
  </body>
571
259
  </html>
@@ -8,464 +8,225 @@
8
8
  * Contributing: http://tinymce.moxiecode.com/contributing
9
9
  */
10
10
 
11
- tinyMCEPopup.requireLangPack();
12
-
13
- var doc;
14
-
15
- var defaultDocTypes =
16
- 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
17
- 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
18
- 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
19
- 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
20
- 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
21
- 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
22
- 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
23
-
24
- var defaultEncodings =
25
- 'Western european (iso-8859-1)=iso-8859-1,' +
26
- 'Central European (iso-8859-2)=iso-8859-2,' +
27
- 'Unicode (UTF-8)=utf-8,' +
28
- 'Chinese traditional (Big5)=big5,' +
29
- 'Cyrillic (iso-8859-5)=iso-8859-5,' +
30
- 'Japanese (iso-2022-jp)=iso-2022-jp,' +
31
- 'Greek (iso-8859-7)=iso-8859-7,' +
32
- 'Korean (iso-2022-kr)=iso-2022-kr,' +
33
- 'ASCII (us-ascii)=us-ascii';
34
-
35
- var defaultMediaTypes =
36
- 'all=all,' +
37
- 'screen=screen,' +
38
- 'print=print,' +
39
- 'tty=tty,' +
40
- 'tv=tv,' +
41
- 'projection=projection,' +
42
- 'handheld=handheld,' +
43
- 'braille=braille,' +
44
- 'aural=aural';
45
-
46
- 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';
47
- var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
48
-
49
- function init() {
50
- var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;
51
-
52
- // Setup doctype select box
53
- doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');
54
- for (i=0; i<doctypes.length; i++) {
55
- p = doctypes[i].split('=');
56
-
57
- if (p.length > 1)
58
- addSelectValue(f, 'doctypes', p[0], p[1]);
59
- }
60
-
61
- // Setup fonts select box
62
- fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');
63
- for (i=0; i<fonts.length; i++) {
64
- p = fonts[i].split('=');
65
-
66
- if (p.length > 1)
67
- addSelectValue(f, 'fontface', p[0], p[1]);
68
- }
69
-
70
- // Setup fontsize select box
71
- fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
72
- for (i=0; i<fonts.length; i++)
73
- addSelectValue(f, 'fontsize', fonts[i], fonts[i]);
74
-
75
- // Setup mediatype select boxs
76
- mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');
77
- for (i=0; i<mediaTypes.length; i++) {
78
- p = mediaTypes[i].split('=');
79
-
80
- if (p.length > 1) {
81
- addSelectValue(f, 'element_style_media', p[0], p[1]);
82
- addSelectValue(f, 'element_link_media', p[0], p[1]);
83
- }
84
- }
85
-
86
- // Setup encodings select box
87
- encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');
88
- for (i=0; i<encodings.length; i++) {
89
- p = encodings[i].split('=');
90
-
91
- if (p.length > 1) {
92
- addSelectValue(f, 'docencoding', p[0], p[1]);
93
- addSelectValue(f, 'element_script_charset', p[0], p[1]);
94
- addSelectValue(f, 'element_link_charset', p[0], p[1]);
95
- }
96
- }
97
-
98
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
99
- document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
100
- //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');
101
- document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
102
- document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
103
- document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
104
- document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
105
- document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');
106
- document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');
107
- document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
108
-
109
- // Resize some elements
110
- if (isVisible('stylesheetbrowser'))
111
- document.getElementById('stylesheet').style.width = '220px';
112
-
113
- if (isVisible('link_href_browser'))
114
- document.getElementById('element_link_href').style.width = '230px';
115
-
116
- if (isVisible('bgimage_browser'))
117
- document.getElementById('bgimage').style.width = '210px';
118
-
119
- // Add iframe
120
- dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});
121
- doc = dom.get('documentIframe').contentWindow.document;
122
- h = tinyMCEPopup.getWindowArg('head_html');
123
-
124
- // Preprocess the HTML disable scripts and urls
125
- h = h.replace(/<script>/gi, '<script type="text/javascript">');
126
- h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
127
- h = h.replace(/(src=|href=)/g, '_mce_$1');
128
-
129
- // Write in the content in the iframe
130
- doc.write(h + '</body></html>');
131
- doc.close();
132
-
133
- // Parse xml and doctype
134
- xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
135
- xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
136
- docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');
137
- f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
138
-
139
- // Parse title
140
- if (e = doc.getElementsByTagName('title')[0])
141
- el.metatitle.value = e.textContent || e.text;
142
-
143
- // Parse meta
144
- tinymce.each(doc.getElementsByTagName('meta'), function(n) {
145
- var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';
146
-
147
- e = el['meta' + na];
148
-
149
- if (na == 'robots') {
150
- selectByValue(f, 'metarobots', tinymce.trim(va), true, true);
151
- return;
152
- }
153
-
154
- switch (eq.toLowerCase()) {
155
- case "content-type":
156
- tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);
157
-
158
- // Override XML encoding
159
- if (tmp != "")
160
- xmlEnc = tmp;
161
-
162
- return;
163
- }
164
-
165
- if (e)
166
- e.value = va;
167
- });
168
-
169
- selectByValue(f, 'doctypes', docType, true, true);
170
- selectByValue(f, 'docencoding', xmlEnc, true, true);
171
- selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);
172
-
173
- if (xmlVer != '')
174
- el.xml_pi.checked = true;
175
-
176
- // Parse appearance
177
-
178
- // Parse primary stylesheet
179
- tinymce.each(doc.getElementsByTagName("link"), function(l) {
180
- var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
181
-
182
- if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
183
- f.stylesheet.value = l.getAttribute('_mce_href', 2) || '';
184
- return false;
185
- }
186
- });
187
-
188
- // Get from style elements
189
- tinymce.each(doc.getElementsByTagName("style"), function(st) {
190
- var tmp = parseStyleElement(st);
191
-
192
- for (x=0; x<tmp.length; x++) {
193
- if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])
194
- f.visited_color.value = tmp[x].data['color'];
195
-
196
- if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])
197
- f.link_color.value = tmp[x].data['color'];
198
-
199
- if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])
200
- f.active_color.value = tmp[x].data['color'];
201
- }
202
- });
203
-
204
- f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");
205
- f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");
206
- f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");
207
- f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");
208
- f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");
209
- f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");
210
-
211
- // Get from style info
212
- style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));
213
-
214
- if (style['font-family'])
215
- selectByValue(f, 'fontface', style['font-family'], true, true);
216
- else
217
- selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);
218
-
219
- if (style['font-size'])
220
- selectByValue(f, 'fontsize', style['font-size'], true, true);
221
- else
222
- selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);
223
-
224
- if (style['color'])
225
- f.textcolor.value = convertRGBToHex(style['color']);
226
-
227
- if (style['background-image'])
228
- f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
229
-
230
- if (style['background-color'])
231
- f.bgcolor.value = style['background-color'];
232
-
233
- if (style['margin']) {
234
- tmp = style['margin'].replace(/[^0-9 ]/g, '');
235
- tmp = tmp.split(/ +/);
236
- f.topmargin.value = tmp.length > 0 ? tmp[0] : '';
237
- f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];
238
- f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];
239
- f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];
240
- }
241
-
242
- if (style['margin-left'])
243
- f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');
244
-
245
- if (style['margin-right'])
246
- f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');
247
-
248
- if (style['margin-top'])
249
- f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');
250
-
251
- if (style['margin-bottom'])
252
- f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');
253
-
254
- f.style.value = tinyMCEPopup.dom.serializeStyle(style);
255
-
256
- // Update colors
257
- updateColor('textcolor_pick', 'textcolor');
258
- updateColor('bgcolor_pick', 'bgcolor');
259
- updateColor('visited_color_pick', 'visited_color');
260
- updateColor('active_color_pick', 'active_color');
261
- updateColor('link_color_pick', 'link_color');
262
- }
263
-
264
- function getReItem(r, s, i) {
265
- var c = r.exec(s);
266
-
267
- if (c && c.length > i)
268
- return c[i];
269
-
270
- return '';
271
- }
272
-
273
- function updateAction() {
274
- var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;
275
-
276
- head = doc.getElementsByTagName('head')[0];
277
-
278
- // Fix scripts without a type
279
- nl = doc.getElementsByTagName('script');
280
- for (i=0; i<nl.length; i++) {
281
- if (tinyMCEPopup.dom.getAttrib(nl[i], '_mce_type') == '')
282
- nl[i].setAttribute('_mce_type', 'text/javascript');
283
- }
284
-
285
- // Get primary stylesheet
286
- nl = doc.getElementsByTagName("link");
287
- for (i=0; i<nl.length; i++) {
288
- l = nl[i];
289
-
290
- tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
291
-
292
- if (tinyMCEPopup.dom.getAttrib(l, '_mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
293
- addlink = false;
294
-
295
- if (f.stylesheet.value == '')
296
- l.parentNode.removeChild(l);
11
+ (function() {
12
+ tinyMCEPopup.requireLangPack();
13
+
14
+ var defaultDocTypes =
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">,' +
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">,' +
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">,' +
18
+ 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
19
+ 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
20
+ 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
21
+ 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
22
+
23
+ var defaultEncodings =
24
+ 'Western european (iso-8859-1)=iso-8859-1,' +
25
+ 'Central European (iso-8859-2)=iso-8859-2,' +
26
+ 'Unicode (UTF-8)=utf-8,' +
27
+ 'Chinese traditional (Big5)=big5,' +
28
+ 'Cyrillic (iso-8859-5)=iso-8859-5,' +
29
+ 'Japanese (iso-2022-jp)=iso-2022-jp,' +
30
+ 'Greek (iso-8859-7)=iso-8859-7,' +
31
+ 'Korean (iso-2022-kr)=iso-2022-kr,' +
32
+ 'ASCII (us-ascii)=us-ascii';
33
+
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';
35
+ var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
36
+
37
+ function setVal(id, value) {
38
+ var elm = document.getElementById(id);
39
+
40
+ if (elm) {
41
+ value = value || '';
42
+
43
+ if (elm.nodeName == "SELECT")
44
+ selectByValue(document.forms[0], id, value);
45
+ else if (elm.type == "checkbox")
46
+ elm.checked = !!value;
297
47
  else
298
- l.setAttribute('_mce_href', f.stylesheet.value);
299
-
300
- break;
48
+ elm.value = value;
301
49
  }
302
- }
303
-
304
- // Add new link
305
- if (f.stylesheet.value != '') {
306
- l = doc.createElement('link');
307
-
308
- l.setAttribute('type', 'text/css');
309
- l.setAttribute('_mce_href', f.stylesheet.value);
310
- l.setAttribute('rel', 'stylesheet');
311
-
312
- head.appendChild(l);
313
- }
314
-
315
- setMeta(head, 'keywords', f.metakeywords.value);
316
- setMeta(head, 'description', f.metadescription.value);
317
- setMeta(head, 'author', f.metaauthor.value);
318
- setMeta(head, 'copyright', f.metacopyright.value);
319
- setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
320
- setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
321
-
322
- doc.body.dir = getSelectValue(f, 'langdir');
323
- doc.body.style.cssText = f.style.value;
324
-
325
- doc.body.setAttribute('vLink', f.visited_color.value);
326
- doc.body.setAttribute('link', f.link_color.value);
327
- doc.body.setAttribute('text', f.textcolor.value);
328
- doc.body.setAttribute('aLink', f.active_color.value);
50
+ };
329
51
 
330
- doc.body.style.fontFamily = getSelectValue(f, 'fontface');
331
- doc.body.style.fontSize = getSelectValue(f, 'fontsize');
332
- doc.body.style.backgroundColor = f.bgcolor.value;
52
+ function getVal(id) {
53
+ var elm = document.getElementById(id);
333
54
 
334
- if (f.leftmargin.value != '')
335
- doc.body.style.marginLeft = f.leftmargin.value + 'px';
55
+ if (elm.nodeName == "SELECT")
56
+ return elm.options[elm.selectedIndex].value;
336
57
 
337
- if (f.rightmargin.value != '')
338
- doc.body.style.marginRight = f.rightmargin.value + 'px';
58
+ if (elm.type == "checkbox")
59
+ return elm.checked;
339
60
 
340
- if (f.bottommargin.value != '')
341
- doc.body.style.marginBottom = f.bottommargin.value + 'px';
61
+ return elm.value;
62
+ };
342
63
 
343
- if (f.topmargin.value != '')
344
- doc.body.style.marginTop = f.topmargin.value + 'px';
64
+ window.FullPageDialog = {
65
+ changedStyle : function() {
66
+ var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));
345
67
 
346
- html = doc.getElementsByTagName('html')[0];
347
- html.setAttribute('lang', f.langcode.value);
348
- html.setAttribute('xml:lang', f.langcode.value);
68
+ setVal('fontface', styles['font-face']);
69
+ setVal('fontsize', styles['font-size']);
70
+ setVal('textcolor', styles['color']);
349
71
 
350
- if (f.bgimage.value != '')
351
- doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
352
- else
353
- doc.body.style.backgroundImage = '';
354
-
355
- ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();
356
- ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');
357
-
358
- h = ser.serialize(doc.documentElement);
359
- h = h.substring(0, h.lastIndexOf('</body>'));
360
-
361
- if (h.indexOf('<title>') == -1)
362
- h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
363
- else
364
- h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
365
-
366
- if ((v = getSelectValue(f, 'doctypes')) != '')
367
- h = v + '\n' + h;
368
-
369
- if (f.xml_pi.checked) {
370
- s = '<?xml version="1.0"';
371
-
372
- if ((v = getSelectValue(f, 'docencoding')) != '')
373
- s += ' encoding="' + v + '"';
374
-
375
- s += '?>\n';
376
- h = s + h;
377
- }
378
-
379
- h = h.replace(/type=\"\-mce\-/gi, 'type="');
380
-
381
- tinyMCEPopup.editor.plugins.fullpage.head = h;
382
- tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});
383
- tinyMCEPopup.close();
384
- }
72
+ if (val = styles['background-image'])
73
+ setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
74
+ else
75
+ setVal('bgimage', '');
76
+
77
+ setVal('bgcolor', styles['background-color']);
78
+
79
+ // Reset margin form elements
80
+ setVal('topmargin', '');
81
+ setVal('rightmargin', '');
82
+ setVal('bottommargin', '');
83
+ setVal('leftmargin', '');
84
+
85
+ // Expand margin
86
+ if (val = styles['margin']) {
87
+ val = val.split(' ');
88
+ styles['margin-top'] = val[0] || '';
89
+ styles['margin-right'] = val[1] || val[0] || '';
90
+ styles['margin-bottom'] = val[2] || val[0] || '';
91
+ styles['margin-left'] = val[3] || val[0] || '';
92
+ }
93
+
94
+ if (val = styles['margin-top'])
95
+ setVal('topmargin', val.replace(/px/, ''));
96
+
97
+ if (val = styles['margin-right'])
98
+ setVal('rightmargin', val.replace(/px/, ''));
99
+
100
+ if (val = styles['margin-bottom'])
101
+ setVal('bottommargin', val.replace(/px/, ''));
102
+
103
+ if (val = styles['margin-left'])
104
+ setVal('leftmargin', val.replace(/px/, ''));
105
+
106
+ updateColor('bgcolor_pick', 'bgcolor');
107
+ updateColor('textcolor_pick', 'textcolor');
108
+ },
109
+
110
+ changedStyleProp : function() {
111
+ var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
112
+
113
+ styles['font-face'] = getVal('fontface');
114
+ styles['font-size'] = getVal('fontsize');
115
+ styles['color'] = getVal('textcolor');
116
+ styles['background-color'] = getVal('bgcolor');
117
+
118
+ if (val = getVal('bgimage'))
119
+ styles['background-image'] = "url('" + val + "')";
120
+ else
121
+ styles['background-image'] = '';
385
122
 
386
- function changedStyleField(field) {
387
- }
123
+ delete styles['margin'];
388
124
 
389
- function setMeta(he, k, v) {
390
- var nl, i, m;
125
+ if (val = getVal('topmargin'))
126
+ styles['margin-top'] = val + "px";
127
+ else
128
+ styles['margin-top'] = '';
391
129
 
392
- nl = he.getElementsByTagName('meta');
393
- for (i=0; i<nl.length; i++) {
394
- if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {
395
- if (v == '')
396
- nl[i].parentNode.removeChild(nl[i]);
130
+ if (val = getVal('rightmargin'))
131
+ styles['margin-right'] = val + "px";
397
132
  else
398
- nl[i].setAttribute('content', "text/html; charset=" + v);
133
+ styles['margin-right'] = '';
399
134
 
400
- return;
401
- }
135
+ if (val = getVal('bottommargin'))
136
+ styles['margin-bottom'] = val + "px";
137
+ else
138
+ styles['margin-bottom'] = '';
402
139
 
403
- if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {
404
- if (v == '')
405
- nl[i].parentNode.removeChild(nl[i]);
140
+ if (val = getVal('leftmargin'))
141
+ styles['margin-left'] = val + "px";
406
142
  else
407
- nl[i].setAttribute('content', v);
408
- return;
143
+ styles['margin-left'] = '';
144
+
145
+ // Serialize, parse and reserialize this will compress redundant styles
146
+ setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
147
+ this.changedStyle();
148
+ },
149
+
150
+ update : function() {
151
+ var data = {};
152
+
153
+ tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) {
154
+ data[node.id] = getVal(node.id);
155
+ });
156
+
157
+ tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data);
158
+ tinyMCEPopup.close();
159
+ }
160
+ };
161
+
162
+ function init() {
163
+ var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
164
+
165
+ // Setup doctype select box
166
+ list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');
167
+ for (i = 0; i < list.length; i++) {
168
+ item = list[i].split('=');
169
+
170
+ if (item.length > 1)
171
+ addSelectValue(form, 'doctype', item[0], item[1]);
409
172
  }
410
- }
411
-
412
- if (v == '')
413
- return;
414
-
415
- m = doc.createElement('meta');
416
-
417
- if (k == 'Content-Type')
418
- m.httpEquiv = k;
419
- else
420
- m.setAttribute('name', k);
421
-
422
- m.setAttribute('content', v);
423
- he.appendChild(m);
424
- }
425
-
426
- function parseStyleElement(e) {
427
- var v = e.innerHTML;
428
- var p, i, r;
429
-
430
- v = v.replace(/<!--/gi, '');
431
- v = v.replace(/-->/gi, '');
432
- v = v.replace(/[\n\r]/gi, '');
433
- v = v.replace(/\s+/gi, ' ');
434
-
435
- r = [];
436
- p = v.split(/{|}/);
437
-
438
- for (i=0; i<p.length; i+=2) {
439
- if (p[i] != "")
440
- r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};
441
- }
442
-
443
- return r;
444
- }
445
-
446
- function serializeStyleElement(d) {
447
- var i, s, st;
448
-
449
- s = '<!--\n';
450
-
451
- for (i=0; i<d.length; i++) {
452
- s += d[i].rule + ' {\n';
453
-
454
- st = tinyMCE.serializeStyle(d[i].data);
455
173
 
456
- if (st != '')
457
- st += ';';
174
+ // Setup fonts select box
175
+ list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');
176
+ for (i = 0; i < list.length; i++) {
177
+ item = list[i].split('=');
458
178
 
459
- s += st.replace(/;/g, ';\n');
460
- s += '}\n';
179
+ if (item.length > 1)
180
+ addSelectValue(form, 'fontface', item[0], item[1]);
181
+ }
461
182
 
462
- if (i != d.length - 1)
463
- s += '\n';
464
- }
183
+ // Setup fontsize select box
184
+ list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
185
+ for (i = 0; i < list.length; i++)
186
+ addSelectValue(form, 'fontsize', list[i], list[i]);
465
187
 
466
- s += '\n-->';
188
+ // Setup encodings select box
189
+ list = editor.getParam("fullpage_encodings", defaultEncodings).split(',');
190
+ for (i = 0; i < list.length; i++) {
191
+ item = list[i].split('=');
467
192
 
468
- return s;
469
- }
193
+ if (item.length > 1)
194
+ addSelectValue(form, 'docencoding', item[0], item[1]);
195
+ }
470
196
 
471
- tinyMCEPopup.onInit.add(init);
197
+ // Setup color pickers
198
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
199
+ document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
200
+ document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
201
+ document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
202
+ document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
203
+ document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
204
+ document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
205
+
206
+ // Resize some elements
207
+ if (isVisible('stylesheetbrowser'))
208
+ document.getElementById('stylesheet').style.width = '220px';
209
+
210
+ if (isVisible('link_href_browser'))
211
+ document.getElementById('element_link_href').style.width = '230px';
212
+
213
+ if (isVisible('bgimage_browser'))
214
+ document.getElementById('bgimage').style.width = '210px';
215
+
216
+ // Update form
217
+ tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) {
218
+ setVal(key, value);
219
+ });
220
+
221
+ FullPageDialog.changedStyle();
222
+
223
+ // Update colors
224
+ updateColor('textcolor_pick', 'textcolor');
225
+ updateColor('bgcolor_pick', 'bgcolor');
226
+ updateColor('visited_color_pick', 'visited_color');
227
+ updateColor('active_color_pick', 'active_color');
228
+ updateColor('link_color_pick', 'link_color');
229
+ };
230
+
231
+ tinyMCEPopup.onInit.add(init);
232
+ })();