tinymce-rails 3.4.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. data/README.md +57 -0
  2. data/Rakefile +52 -0
  3. data/assets/integration/tinymce.jquery.js +3 -0
  4. data/assets/integration/tinymce.js +2 -0
  5. data/assets/integration/tinymce.preinit.js.erb +1 -0
  6. data/assets/vendor/tinymce/jquery.tinymce.js +1 -0
  7. data/assets/vendor/tinymce/langs/en.js +223 -0
  8. data/assets/vendor/tinymce/license.txt +504 -0
  9. data/assets/vendor/tinymce/plugins/advhr/css/advhr.css +5 -0
  10. data/assets/vendor/tinymce/plugins/advhr/editor_plugin.js +57 -0
  11. data/assets/vendor/tinymce/plugins/advhr/js/rule.js +43 -0
  12. data/assets/vendor/tinymce/plugins/advhr/langs/en_dlg.js +7 -0
  13. data/assets/vendor/tinymce/plugins/advhr/rule.htm +58 -0
  14. data/assets/vendor/tinymce/plugins/advimage/css/advimage.css +13 -0
  15. data/assets/vendor/tinymce/plugins/advimage/editor_plugin.js +50 -0
  16. data/assets/vendor/tinymce/plugins/advimage/image.htm +235 -0
  17. data/assets/vendor/tinymce/plugins/advimage/img/sample.gif +0 -0
  18. data/assets/vendor/tinymce/plugins/advimage/js/image.js +458 -0
  19. data/assets/vendor/tinymce/plugins/advimage/langs/en_dlg.js +45 -0
  20. data/assets/vendor/tinymce/plugins/advlink/css/advlink.css +8 -0
  21. data/assets/vendor/tinymce/plugins/advlink/editor_plugin.js +61 -0
  22. data/assets/vendor/tinymce/plugins/advlink/js/advlink.js +532 -0
  23. data/assets/vendor/tinymce/plugins/advlink/langs/en_dlg.js +54 -0
  24. data/assets/vendor/tinymce/plugins/advlink/link.htm +338 -0
  25. data/assets/vendor/tinymce/plugins/advlist/editor_plugin.js +176 -0
  26. data/assets/vendor/tinymce/plugins/autolink/editor_plugin.js +172 -0
  27. data/assets/vendor/tinymce/plugins/autoresize/editor_plugin.js +137 -0
  28. data/assets/vendor/tinymce/plugins/autosave/editor_plugin.js +431 -0
  29. data/assets/vendor/tinymce/plugins/autosave/langs/en.js +4 -0
  30. data/assets/vendor/tinymce/plugins/bbcode/editor_plugin.js +120 -0
  31. data/assets/vendor/tinymce/plugins/contextmenu/editor_plugin.js +160 -0
  32. data/assets/vendor/tinymce/plugins/directionality/editor_plugin.js +82 -0
  33. data/assets/vendor/tinymce/plugins/emotions/editor_plugin.js +43 -0
  34. data/assets/vendor/tinymce/plugins/emotions/emotions.htm +41 -0
  35. data/assets/vendor/tinymce/plugins/emotions/img/smiley-cool.gif +0 -0
  36. data/assets/vendor/tinymce/plugins/emotions/img/smiley-cry.gif +0 -0
  37. data/assets/vendor/tinymce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  38. data/assets/vendor/tinymce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  39. data/assets/vendor/tinymce/plugins/emotions/img/smiley-frown.gif +0 -0
  40. data/assets/vendor/tinymce/plugins/emotions/img/smiley-innocent.gif +0 -0
  41. data/assets/vendor/tinymce/plugins/emotions/img/smiley-kiss.gif +0 -0
  42. data/assets/vendor/tinymce/plugins/emotions/img/smiley-laughing.gif +0 -0
  43. data/assets/vendor/tinymce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  44. data/assets/vendor/tinymce/plugins/emotions/img/smiley-sealed.gif +0 -0
  45. data/assets/vendor/tinymce/plugins/emotions/img/smiley-smile.gif +0 -0
  46. data/assets/vendor/tinymce/plugins/emotions/img/smiley-surprised.gif +0 -0
  47. data/assets/vendor/tinymce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  48. data/assets/vendor/tinymce/plugins/emotions/img/smiley-undecided.gif +0 -0
  49. data/assets/vendor/tinymce/plugins/emotions/img/smiley-wink.gif +0 -0
  50. data/assets/vendor/tinymce/plugins/emotions/img/smiley-yell.gif +0 -0
  51. data/assets/vendor/tinymce/plugins/emotions/js/emotions.js +22 -0
  52. data/assets/vendor/tinymce/plugins/emotions/langs/en_dlg.js +20 -0
  53. data/assets/vendor/tinymce/plugins/example/dialog.htm +22 -0
  54. data/assets/vendor/tinymce/plugins/example/editor_plugin.js +84 -0
  55. data/assets/vendor/tinymce/plugins/example/img/example.gif +0 -0
  56. data/assets/vendor/tinymce/plugins/example/js/dialog.js +19 -0
  57. data/assets/vendor/tinymce/plugins/example/langs/en.js +3 -0
  58. data/assets/vendor/tinymce/plugins/example/langs/en_dlg.js +3 -0
  59. data/assets/vendor/tinymce/plugins/example_dependency/editor_plugin.js +50 -0
  60. data/assets/vendor/tinymce/plugins/fullpage/css/fullpage.css +143 -0
  61. data/assets/vendor/tinymce/plugins/fullpage/editor_plugin.js +399 -0
  62. data/assets/vendor/tinymce/plugins/fullpage/fullpage.htm +259 -0
  63. data/assets/vendor/tinymce/plugins/fullpage/js/fullpage.js +232 -0
  64. data/assets/vendor/tinymce/plugins/fullpage/langs/en_dlg.js +85 -0
  65. data/assets/vendor/tinymce/plugins/fullscreen/editor_plugin.js +159 -0
  66. data/assets/vendor/tinymce/plugins/fullscreen/fullscreen.htm +109 -0
  67. data/assets/vendor/tinymce/plugins/iespell/editor_plugin.js +54 -0
  68. data/assets/vendor/tinymce/plugins/inlinepopups/editor_plugin.js +696 -0
  69. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  70. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  71. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  72. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  73. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  74. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  75. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  76. data/assets/vendor/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  77. data/assets/vendor/tinymce/plugins/inlinepopups/template.htm +387 -0
  78. data/assets/vendor/tinymce/plugins/insertdatetime/editor_plugin.js +83 -0
  79. data/assets/vendor/tinymce/plugins/layer/editor_plugin.js +214 -0
  80. data/assets/vendor/tinymce/plugins/legacyoutput/editor_plugin.js +139 -0
  81. data/assets/vendor/tinymce/plugins/lists/editor_plugin.js +688 -0
  82. data/assets/vendor/tinymce/plugins/media/css/media.css +17 -0
  83. data/assets/vendor/tinymce/plugins/media/editor_plugin.js +777 -0
  84. data/assets/vendor/tinymce/plugins/media/js/embed.js +73 -0
  85. data/assets/vendor/tinymce/plugins/media/js/media.js +355 -0
  86. data/assets/vendor/tinymce/plugins/media/langs/en_dlg.js +109 -0
  87. data/assets/vendor/tinymce/plugins/media/media.htm +812 -0
  88. data/assets/vendor/tinymce/plugins/media/moxieplayer.swf +0 -0
  89. data/assets/vendor/tinymce/plugins/nonbreaking/editor_plugin.js +53 -0
  90. data/assets/vendor/tinymce/plugins/noneditable/editor_plugin.js +95 -0
  91. data/assets/vendor/tinymce/plugins/pagebreak/editor_plugin.js +74 -0
  92. data/assets/vendor/tinymce/plugins/paste/editor_plugin.js +942 -0
  93. data/assets/vendor/tinymce/plugins/paste/js/pastetext.js +36 -0
  94. data/assets/vendor/tinymce/plugins/paste/js/pasteword.js +51 -0
  95. data/assets/vendor/tinymce/plugins/paste/langs/en_dlg.js +5 -0
  96. data/assets/vendor/tinymce/plugins/paste/pastetext.htm +27 -0
  97. data/assets/vendor/tinymce/plugins/paste/pasteword.htm +21 -0
  98. data/assets/vendor/tinymce/plugins/preview/editor_plugin.js +53 -0
  99. data/assets/vendor/tinymce/plugins/preview/example.html +28 -0
  100. data/assets/vendor/tinymce/plugins/preview/jscripts/embed.js +73 -0
  101. data/assets/vendor/tinymce/plugins/preview/preview.html +17 -0
  102. data/assets/vendor/tinymce/plugins/print/editor_plugin.js +34 -0
  103. data/assets/vendor/tinymce/plugins/save/editor_plugin.js +101 -0
  104. data/assets/vendor/tinymce/plugins/searchreplace/css/searchreplace.css +6 -0
  105. data/assets/vendor/tinymce/plugins/searchreplace/editor_plugin.js +61 -0
  106. data/assets/vendor/tinymce/plugins/searchreplace/js/searchreplace.js +142 -0
  107. data/assets/vendor/tinymce/plugins/searchreplace/langs/en_dlg.js +16 -0
  108. data/assets/vendor/tinymce/plugins/searchreplace/searchreplace.htm +100 -0
  109. data/assets/vendor/tinymce/plugins/spellchecker/css/content.css +1 -0
  110. data/assets/vendor/tinymce/plugins/spellchecker/editor_plugin.js +434 -0
  111. data/assets/vendor/tinymce/plugins/spellchecker/img/wline.gif +0 -0
  112. data/assets/vendor/tinymce/plugins/style/css/props.css +13 -0
  113. data/assets/vendor/tinymce/plugins/style/editor_plugin.js +55 -0
  114. data/assets/vendor/tinymce/plugins/style/js/props.js +635 -0
  115. data/assets/vendor/tinymce/plugins/style/langs/en_dlg.js +70 -0
  116. data/assets/vendor/tinymce/plugins/style/props.htm +838 -0
  117. data/assets/vendor/tinymce/plugins/tabfocus/editor_plugin.js +114 -0
  118. data/assets/vendor/tinymce/plugins/table/cell.htm +180 -0
  119. data/assets/vendor/tinymce/plugins/table/css/cell.css +17 -0
  120. data/assets/vendor/tinymce/plugins/table/css/row.css +25 -0
  121. data/assets/vendor/tinymce/plugins/table/css/table.css +13 -0
  122. data/assets/vendor/tinymce/plugins/table/editor_plugin.js +1263 -0
  123. data/assets/vendor/tinymce/plugins/table/js/cell.js +319 -0
  124. data/assets/vendor/tinymce/plugins/table/js/merge_cells.js +27 -0
  125. data/assets/vendor/tinymce/plugins/table/js/row.js +237 -0
  126. data/assets/vendor/tinymce/plugins/table/js/table.js +450 -0
  127. data/assets/vendor/tinymce/plugins/table/langs/en_dlg.js +75 -0
  128. data/assets/vendor/tinymce/plugins/table/merge_cells.htm +32 -0
  129. data/assets/vendor/tinymce/plugins/table/row.htm +158 -0
  130. data/assets/vendor/tinymce/plugins/table/table.htm +188 -0
  131. data/assets/vendor/tinymce/plugins/template/blank.htm +12 -0
  132. data/assets/vendor/tinymce/plugins/template/css/template.css +23 -0
  133. data/assets/vendor/tinymce/plugins/template/editor_plugin.js +159 -0
  134. data/assets/vendor/tinymce/plugins/template/js/template.js +106 -0
  135. data/assets/vendor/tinymce/plugins/template/langs/en_dlg.js +15 -0
  136. data/assets/vendor/tinymce/plugins/template/template.htm +31 -0
  137. data/assets/vendor/tinymce/plugins/visualchars/editor_plugin.js +83 -0
  138. data/assets/vendor/tinymce/plugins/wordcount/editor_plugin.js +114 -0
  139. data/assets/vendor/tinymce/plugins/xhtmlxtras/abbr.htm +142 -0
  140. data/assets/vendor/tinymce/plugins/xhtmlxtras/acronym.htm +142 -0
  141. data/assets/vendor/tinymce/plugins/xhtmlxtras/attributes.htm +149 -0
  142. data/assets/vendor/tinymce/plugins/xhtmlxtras/cite.htm +142 -0
  143. data/assets/vendor/tinymce/plugins/xhtmlxtras/css/attributes.css +11 -0
  144. data/assets/vendor/tinymce/plugins/xhtmlxtras/css/popup.css +9 -0
  145. data/assets/vendor/tinymce/plugins/xhtmlxtras/del.htm +162 -0
  146. data/assets/vendor/tinymce/plugins/xhtmlxtras/editor_plugin.js +132 -0
  147. data/assets/vendor/tinymce/plugins/xhtmlxtras/ins.htm +162 -0
  148. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/abbr.js +28 -0
  149. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/acronym.js +28 -0
  150. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/attributes.js +111 -0
  151. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/cite.js +28 -0
  152. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/del.js +53 -0
  153. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/element_common.js +229 -0
  154. data/assets/vendor/tinymce/plugins/xhtmlxtras/js/ins.js +53 -0
  155. data/assets/vendor/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  156. data/assets/vendor/tinymce/themes/advanced/about.htm +52 -0
  157. data/assets/vendor/tinymce/themes/advanced/anchor.htm +26 -0
  158. data/assets/vendor/tinymce/themes/advanced/charmap.htm +51 -0
  159. data/assets/vendor/tinymce/themes/advanced/color_picker.htm +74 -0
  160. data/assets/vendor/tinymce/themes/advanced/editor_template.js +1358 -0
  161. data/assets/vendor/tinymce/themes/advanced/image.htm +80 -0
  162. data/assets/vendor/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
  163. data/assets/vendor/tinymce/themes/advanced/img/flash.gif +0 -0
  164. data/assets/vendor/tinymce/themes/advanced/img/icons.gif +0 -0
  165. data/assets/vendor/tinymce/themes/advanced/img/iframe.gif +0 -0
  166. data/assets/vendor/tinymce/themes/advanced/img/pagebreak.gif +0 -0
  167. data/assets/vendor/tinymce/themes/advanced/img/quicktime.gif +0 -0
  168. data/assets/vendor/tinymce/themes/advanced/img/realmedia.gif +0 -0
  169. data/assets/vendor/tinymce/themes/advanced/img/shockwave.gif +0 -0
  170. data/assets/vendor/tinymce/themes/advanced/img/trans.gif +0 -0
  171. data/assets/vendor/tinymce/themes/advanced/img/video.gif +0 -0
  172. data/assets/vendor/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
  173. data/assets/vendor/tinymce/themes/advanced/js/about.js +73 -0
  174. data/assets/vendor/tinymce/themes/advanced/js/anchor.js +42 -0
  175. data/assets/vendor/tinymce/themes/advanced/js/charmap.js +355 -0
  176. data/assets/vendor/tinymce/themes/advanced/js/color_picker.js +329 -0
  177. data/assets/vendor/tinymce/themes/advanced/js/image.js +247 -0
  178. data/assets/vendor/tinymce/themes/advanced/js/link.js +153 -0
  179. data/assets/vendor/tinymce/themes/advanced/js/source_editor.js +56 -0
  180. data/assets/vendor/tinymce/themes/advanced/langs/en.js +68 -0
  181. data/assets/vendor/tinymce/themes/advanced/langs/en_dlg.js +54 -0
  182. data/assets/vendor/tinymce/themes/advanced/link.htm +57 -0
  183. data/assets/vendor/tinymce/themes/advanced/shortcuts.htm +47 -0
  184. data/assets/vendor/tinymce/themes/advanced/skins/default/content.css +47 -0
  185. data/assets/vendor/tinymce/themes/advanced/skins/default/dialog.css +117 -0
  186. data/assets/vendor/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
  187. data/assets/vendor/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
  188. data/assets/vendor/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  189. data/assets/vendor/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  190. data/assets/vendor/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
  191. data/assets/vendor/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
  192. data/assets/vendor/tinymce/themes/advanced/skins/default/ui.css +214 -0
  193. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/content.css +23 -0
  194. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  195. data/assets/vendor/tinymce/themes/advanced/skins/highcontrast/ui.css +102 -0
  196. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/content.css +46 -0
  197. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/dialog.css +117 -0
  198. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  199. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  200. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  201. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui.css +217 -0
  202. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  203. data/assets/vendor/tinymce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  204. data/assets/vendor/tinymce/themes/advanced/source_editor.htm +25 -0
  205. data/assets/vendor/tinymce/themes/simple/editor_template.js +84 -0
  206. data/assets/vendor/tinymce/themes/simple/img/icons.gif +0 -0
  207. data/assets/vendor/tinymce/themes/simple/langs/en.js +11 -0
  208. data/assets/vendor/tinymce/themes/simple/skins/default/content.css +25 -0
  209. data/assets/vendor/tinymce/themes/simple/skins/default/ui.css +32 -0
  210. data/assets/vendor/tinymce/themes/simple/skins/o2k7/content.css +17 -0
  211. data/assets/vendor/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  212. data/assets/vendor/tinymce/themes/simple/skins/o2k7/ui.css +35 -0
  213. data/assets/vendor/tinymce/tiny_mce.js +15338 -0
  214. data/assets/vendor/tinymce/tiny_mce_popup.js +5 -0
  215. data/assets/vendor/tinymce/utils/editable_selects.js +70 -0
  216. data/assets/vendor/tinymce/utils/form_utils.js +210 -0
  217. data/assets/vendor/tinymce/utils/mctabs.js +162 -0
  218. data/assets/vendor/tinymce/utils/validate.js +252 -0
  219. data/lib/tinymce-rails.rb +2 -0
  220. data/lib/tinymce/railtie.rb +17 -0
  221. data/lib/tinymce/version.rb +3 -0
  222. metadata +300 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * ins.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('ins');
13
+ if (SXE.currentAction == "update") {
14
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
15
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
16
+ SXE.showRemoveButton();
17
+ }
18
+ }
19
+
20
+ function setElementAttribs(elm) {
21
+ setAllCommonAttribs(elm);
22
+ setAttrib(elm, 'datetime');
23
+ setAttrib(elm, 'cite');
24
+ elm.removeAttribute('data-mce-new');
25
+ }
26
+
27
+ function insertIns() {
28
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
29
+
30
+ if (elm == null) {
31
+ var s = SXE.inst.selection.getContent();
32
+ if(s.length > 0) {
33
+ insertInlineElement('ins');
34
+ var elementArray = SXE.inst.dom.select('ins[data-mce-new]');
35
+ for (var i=0; i<elementArray.length; i++) {
36
+ var elm = elementArray[i];
37
+ setElementAttribs(elm);
38
+ }
39
+ }
40
+ } else {
41
+ setElementAttribs(elm);
42
+ }
43
+ tinyMCEPopup.editor.nodeChanged();
44
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
45
+ tinyMCEPopup.close();
46
+ }
47
+
48
+ function removeIns() {
49
+ SXE.removeElement('ins');
50
+ tinyMCEPopup.close();
51
+ }
52
+
53
+ tinyMCEPopup.onInit.add(init);
@@ -0,0 +1,32 @@
1
+ tinyMCE.addI18n('en.xhtmlxtras_dlg',{
2
+ attribute_label_title:"Title",
3
+ attribute_label_id:"ID",
4
+ attribute_label_class:"Class",
5
+ attribute_label_style:"Style",
6
+ attribute_label_cite:"Cite",
7
+ attribute_label_datetime:"Date/Time",
8
+ attribute_label_langdir:"Text Direction",
9
+ attribute_option_ltr:"Left to right",
10
+ attribute_option_rtl:"Right to left",
11
+ attribute_label_langcode:"Language",
12
+ attribute_label_tabindex:"TabIndex",
13
+ attribute_label_accesskey:"AccessKey",
14
+ attribute_events_tab:"Events",
15
+ attribute_attrib_tab:"Attributes",
16
+ general_tab:"General",
17
+ attrib_tab:"Attributes",
18
+ events_tab:"Events",
19
+ fieldset_general_tab:"General Settings",
20
+ fieldset_attrib_tab:"Element Attributes",
21
+ fieldset_events_tab:"Element Events",
22
+ title_ins_element:"Insertion Element",
23
+ title_del_element:"Deletion Element",
24
+ title_acronym_element:"Acronym Element",
25
+ title_abbr_element:"Abbreviation Element",
26
+ title_cite_element:"Citation Element",
27
+ remove:"Remove",
28
+ insert_date:"Insert current date/time",
29
+ option_ltr:"Left to right",
30
+ option_rtl:"Right to left",
31
+ attribs_title:"Insert/Edit Attributes"
32
+ });
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advanced_dlg.about_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="js/about.js"></script>
8
+ </head>
9
+ <body id="about" style="display: none">
10
+ <div class="tabs">
11
+ <ul>
12
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
13
+ <li id="help_tab" style="display:none" aria-hidden="true" aria-controls="help_panel"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
14
+ <li id="plugins_tab" aria-controls="plugins_panel"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
15
+ </ul>
16
+ </div>
17
+
18
+ <div class="panel_wrapper">
19
+ <div id="general_panel" class="panel current">
20
+ <h3>{#advanced_dlg.about_title}</h3>
21
+ <p>Version: <span id="version"></span> (<span id="date"></span>)</p>
22
+ <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
23
+ by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
24
+ <p>Copyright &copy; 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
25
+ <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
26
+
27
+ <div id="buttoncontainer">
28
+ <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
29
+ </div>
30
+ </div>
31
+
32
+ <div id="plugins_panel" class="panel">
33
+ <div id="pluginscontainer">
34
+ <h3>{#advanced_dlg.about_loaded}</h3>
35
+
36
+ <div id="plugintablecontainer">
37
+ </div>
38
+
39
+ <p>&nbsp;</p>
40
+ </div>
41
+ </div>
42
+
43
+ <div id="help_panel" class="panel noscroll" style="overflow: visible;">
44
+ <div id="iframecontainer"></div>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="mceActionPanel">
49
+ <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
50
+ </div>
51
+ </body>
52
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advanced_dlg.anchor_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="js/anchor.js"></script>
7
+ </head>
8
+ <body style="display: none" role="application" aria-labelledby="app_title">
9
+ <form onsubmit="AnchorDialog.update();return false;" action="#">
10
+ <table border="0" cellpadding="4" cellspacing="0" role="presentation">
11
+ <tr>
12
+ <td colspan="2" class="title" id="app_title">{#advanced_dlg.anchor_title}</td>
13
+ </tr>
14
+ <tr>
15
+ <td class="nowrap"><label for="anchorName">{#advanced_dlg.anchor_name}:</label></td>
16
+ <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" aria-required="true" /></td>
17
+ </tr>
18
+ </table>
19
+
20
+ <div class="mceActionPanel">
21
+ <input type="submit" id="insert" name="insert" value="{#update}" />
22
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
23
+ </div>
24
+ </form>
25
+ </body>
26
+ </html>
@@ -0,0 +1,51 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advanced_dlg.charmap_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="js/charmap.js"></script>
7
+ </head>
8
+ <body id="charmap" style="display:none">
9
+ <table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
10
+ <tr>
11
+ <td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
12
+ </tr>
13
+ <tr>
14
+ <td id="charmapView" rowspan="2" align="left" valign="top">
15
+ <!-- Chars will be rendered here -->
16
+ </td>
17
+ <td width="100" align="center" valign="top">
18
+ <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px" role="presentation">
19
+ <tr>
20
+ <td id="codeV">&nbsp;</td>
21
+ </tr>
22
+ <tr>
23
+ <td id="codeN">&nbsp;</td>
24
+ </tr>
25
+ </table>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td valign="bottom" style="padding-bottom: 3px;">
30
+ <table width="100" align="center" border="0" cellpadding="2" cellspacing="0" role="presentation">
31
+ <tr>
32
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeA">HTML-Code</label></td>
33
+ </tr>
34
+ <tr>
35
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
36
+ </tr>
37
+ <tr>
38
+ <td style="font-size: 1px;">&nbsp;</td>
39
+ </tr>
40
+ <tr>
41
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeB">NUM-Code</label></td>
42
+ </tr>
43
+ <tr>
44
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
45
+ </tr>
46
+ </table>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </body>
51
+ </html>
@@ -0,0 +1,74 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advanced_dlg.colorpicker_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="js/color_picker.js"></script>
8
+ </head>
9
+ <body id="colorpicker" style="display: none" role="application" aria-labelledby="app_label">
10
+ <span class="mceVoiceLabel" id="app_label" style="display:none;">{#advanced_dlg.colorpicker_title}</span>
11
+ <form onsubmit="insertAction();return false" action="#">
12
+ <div class="tabs">
13
+ <ul>
14
+ <li id="picker_tab" aria-controls="picker_panel" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
15
+ <li id="rgb_tab" aria-controls="rgb_panel"><span><a href="javascript:;" onclick="mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
16
+ <li id="named_tab" aria-controls="named_panel"><span><a href="javascript:;" onclick="javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
17
+ </ul>
18
+ </div>
19
+
20
+ <div class="panel_wrapper">
21
+ <div id="picker_panel" class="panel current">
22
+ <fieldset>
23
+ <legend>{#advanced_dlg.colorpicker_picker_title}</legend>
24
+ <div id="picker">
25
+ <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
26
+
27
+ <div id="light">
28
+ <!-- Will be filled with divs -->
29
+ </div>
30
+
31
+ <br style="clear: both" />
32
+ </div>
33
+ </fieldset>
34
+ </div>
35
+
36
+ <div id="rgb_panel" class="panel">
37
+ <fieldset>
38
+ <legend id="webcolors_title">{#advanced_dlg.colorpicker_palette_title}</legend>
39
+ <div id="webcolors">
40
+ <!-- Gets filled with web safe colors-->
41
+ </div>
42
+
43
+ <br style="clear: both" />
44
+ </fieldset>
45
+ </div>
46
+
47
+ <div id="named_panel" class="panel">
48
+ <fieldset id="named_picker_label">
49
+ <legend id="named_title">{#advanced_dlg.colorpicker_named_title}</legend>
50
+ <div id="namedcolors" role="listbox" tabindex="0" aria-labelledby="named_picker_label">
51
+ <!-- Gets filled with named colors-->
52
+ </div>
53
+
54
+ <br style="clear: both" />
55
+
56
+ <div id="colornamecontainer">
57
+ {#advanced_dlg.colorpicker_name} <span id="colorname"></span>
58
+ </div>
59
+ </fieldset>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="mceActionPanel">
64
+ <input type="submit" id="insert" name="insert" value="{#apply}" />
65
+
66
+ <div id="preview"></div>
67
+
68
+ <div id="previewblock">
69
+ <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" />
70
+ </div>
71
+ </div>
72
+ </form>
73
+ </body>
74
+ </html>
@@ -0,0 +1,1358 @@
1
+ /**
2
+ * editor_template_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function(tinymce) {
12
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
13
+
14
+ // Tell it to load theme specific language pack(s)
15
+ tinymce.ThemeManager.requireLangPack('advanced');
16
+
17
+ tinymce.create('tinymce.themes.AdvancedTheme', {
18
+ sizes : [8, 10, 12, 14, 18, 24, 36],
19
+
20
+ // Control name lookup, format: title, command
21
+ controls : {
22
+ bold : ['bold_desc', 'Bold'],
23
+ italic : ['italic_desc', 'Italic'],
24
+ underline : ['underline_desc', 'Underline'],
25
+ strikethrough : ['striketrough_desc', 'Strikethrough'],
26
+ justifyleft : ['justifyleft_desc', 'JustifyLeft'],
27
+ justifycenter : ['justifycenter_desc', 'JustifyCenter'],
28
+ justifyright : ['justifyright_desc', 'JustifyRight'],
29
+ justifyfull : ['justifyfull_desc', 'JustifyFull'],
30
+ bullist : ['bullist_desc', 'InsertUnorderedList'],
31
+ numlist : ['numlist_desc', 'InsertOrderedList'],
32
+ outdent : ['outdent_desc', 'Outdent'],
33
+ indent : ['indent_desc', 'Indent'],
34
+ cut : ['cut_desc', 'Cut'],
35
+ copy : ['copy_desc', 'Copy'],
36
+ paste : ['paste_desc', 'Paste'],
37
+ undo : ['undo_desc', 'Undo'],
38
+ redo : ['redo_desc', 'Redo'],
39
+ link : ['link_desc', 'mceLink'],
40
+ unlink : ['unlink_desc', 'unlink'],
41
+ image : ['image_desc', 'mceImage'],
42
+ cleanup : ['cleanup_desc', 'mceCleanup'],
43
+ help : ['help_desc', 'mceHelp'],
44
+ code : ['code_desc', 'mceCodeEditor'],
45
+ hr : ['hr_desc', 'InsertHorizontalRule'],
46
+ removeformat : ['removeformat_desc', 'RemoveFormat'],
47
+ sub : ['sub_desc', 'subscript'],
48
+ sup : ['sup_desc', 'superscript'],
49
+ forecolor : ['forecolor_desc', 'ForeColor'],
50
+ forecolorpicker : ['forecolor_desc', 'mceForeColor'],
51
+ backcolor : ['backcolor_desc', 'HiliteColor'],
52
+ backcolorpicker : ['backcolor_desc', 'mceBackColor'],
53
+ charmap : ['charmap_desc', 'mceCharMap'],
54
+ visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
55
+ anchor : ['anchor_desc', 'mceInsertAnchor'],
56
+ newdocument : ['newdocument_desc', 'mceNewDocument'],
57
+ blockquote : ['blockquote_desc', 'mceBlockQuote']
58
+ },
59
+
60
+ stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
61
+
62
+ init : function(ed, url) {
63
+ var t = this, s, v, o;
64
+
65
+ t.editor = ed;
66
+ t.url = url;
67
+ t.onResolveName = new tinymce.util.Dispatcher(this);
68
+
69
+ ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
70
+ ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
71
+
72
+ // Default settings
73
+ t.settings = s = extend({
74
+ theme_advanced_path : true,
75
+ theme_advanced_toolbar_location : 'bottom',
76
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
77
+ theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
78
+ theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
79
+ theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
80
+ theme_advanced_toolbar_align : "center",
81
+ theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
82
+ theme_advanced_more_colors : 1,
83
+ theme_advanced_row_height : 23,
84
+ theme_advanced_resize_horizontal : 1,
85
+ theme_advanced_resizing_use_cookie : 1,
86
+ theme_advanced_font_sizes : "1,2,3,4,5,6,7",
87
+ theme_advanced_font_selector : "span",
88
+ theme_advanced_show_current_color: 0,
89
+ readonly : ed.settings.readonly
90
+ }, ed.settings);
91
+
92
+ // Setup default font_size_style_values
93
+ if (!s.font_size_style_values)
94
+ s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
95
+
96
+ if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
97
+ s.font_size_style_values = tinymce.explode(s.font_size_style_values);
98
+ s.font_size_classes = tinymce.explode(s.font_size_classes || '');
99
+
100
+ // Parse string value
101
+ o = {};
102
+ ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
103
+ each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
104
+ var cl;
105
+
106
+ if (k == v && v >= 1 && v <= 7) {
107
+ k = v + ' (' + t.sizes[v - 1] + 'pt)';
108
+ cl = s.font_size_classes[v - 1];
109
+ v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
110
+ }
111
+
112
+ if (/^\s*\./.test(v))
113
+ cl = v.replace(/\./g, '');
114
+
115
+ o[k] = cl ? {'class' : cl} : {fontSize : v};
116
+ });
117
+
118
+ s.theme_advanced_font_sizes = o;
119
+ }
120
+
121
+ if ((v = s.theme_advanced_path_location) && v != 'none')
122
+ s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
123
+
124
+ if (s.theme_advanced_statusbar_location == 'none')
125
+ s.theme_advanced_statusbar_location = 0;
126
+
127
+ if (ed.settings.content_css !== false)
128
+ ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
129
+
130
+ // Init editor
131
+ ed.onInit.add(function() {
132
+ if (!ed.settings.readonly) {
133
+ ed.onNodeChange.add(t._nodeChanged, t);
134
+ ed.onKeyUp.add(t._updateUndoStatus, t);
135
+ ed.onMouseUp.add(t._updateUndoStatus, t);
136
+ ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {
137
+ t._updateUndoStatus(ed);
138
+ });
139
+ }
140
+ });
141
+
142
+ ed.onSetProgressState.add(function(ed, b, ti) {
143
+ var co, id = ed.id, tb;
144
+
145
+ if (b) {
146
+ t.progressTimer = setTimeout(function() {
147
+ co = ed.getContainer();
148
+ co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
149
+ tb = DOM.get(ed.id + '_tbl');
150
+
151
+ DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
152
+ DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
153
+ }, ti || 0);
154
+ } else {
155
+ DOM.remove(id + '_blocker');
156
+ DOM.remove(id + '_progress');
157
+ clearTimeout(t.progressTimer);
158
+ }
159
+ });
160
+
161
+ DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
162
+
163
+ if (s.skin_variant)
164
+ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
165
+ },
166
+
167
+ _isHighContrast : function() {
168
+ var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});
169
+
170
+ actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');
171
+ DOM.remove(div);
172
+
173
+ return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';
174
+ },
175
+
176
+ createControl : function(n, cf) {
177
+ var cd, c;
178
+
179
+ if (c = cf.createControl(n))
180
+ return c;
181
+
182
+ switch (n) {
183
+ case "styleselect":
184
+ return this._createStyleSelect();
185
+
186
+ case "formatselect":
187
+ return this._createBlockFormats();
188
+
189
+ case "fontselect":
190
+ return this._createFontSelect();
191
+
192
+ case "fontsizeselect":
193
+ return this._createFontSizeSelect();
194
+
195
+ case "forecolor":
196
+ return this._createForeColorMenu();
197
+
198
+ case "backcolor":
199
+ return this._createBackColorMenu();
200
+ }
201
+
202
+ if ((cd = this.controls[n]))
203
+ return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
204
+ },
205
+
206
+ execCommand : function(cmd, ui, val) {
207
+ var f = this['_' + cmd];
208
+
209
+ if (f) {
210
+ f.call(this, ui, val);
211
+ return true;
212
+ }
213
+
214
+ return false;
215
+ },
216
+
217
+ _importClasses : function(e) {
218
+ var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
219
+
220
+ if (ctrl.getLength() == 0) {
221
+ each(ed.dom.getClasses(), function(o, idx) {
222
+ var name = 'style_' + idx;
223
+
224
+ ed.formatter.register(name, {
225
+ inline : 'span',
226
+ attributes : {'class' : o['class']},
227
+ selector : '*'
228
+ });
229
+
230
+ ctrl.add(o['class'], name);
231
+ });
232
+ }
233
+ },
234
+
235
+ _createStyleSelect : function(n) {
236
+ var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
237
+
238
+ // Setup style select box
239
+ ctrl = ctrlMan.createListBox('styleselect', {
240
+ title : 'advanced.style_select',
241
+ onselect : function(name) {
242
+ var matches, formatNames = [];
243
+
244
+ each(ctrl.items, function(item) {
245
+ formatNames.push(item.value);
246
+ });
247
+
248
+ ed.focus();
249
+ ed.undoManager.add();
250
+
251
+ // Toggle off the current format
252
+ matches = ed.formatter.matchAll(formatNames);
253
+ if (!name || matches[0] == name) {
254
+ if (matches[0])
255
+ ed.formatter.remove(matches[0]);
256
+ } else
257
+ ed.formatter.apply(name);
258
+
259
+ ed.undoManager.add();
260
+ ed.nodeChanged();
261
+
262
+ return false; // No auto select
263
+ }
264
+ });
265
+
266
+ // Handle specified format
267
+ ed.onInit.add(function() {
268
+ var counter = 0, formats = ed.getParam('style_formats');
269
+
270
+ if (formats) {
271
+ each(formats, function(fmt) {
272
+ var name, keys = 0;
273
+
274
+ each(fmt, function() {keys++;});
275
+
276
+ if (keys > 1) {
277
+ name = fmt.name = fmt.name || 'style_' + (counter++);
278
+ ed.formatter.register(name, fmt);
279
+ ctrl.add(fmt.title, name);
280
+ } else
281
+ ctrl.add(fmt.title);
282
+ });
283
+ } else {
284
+ each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
285
+ var name;
286
+
287
+ if (val) {
288
+ name = 'style_' + (counter++);
289
+
290
+ ed.formatter.register(name, {
291
+ inline : 'span',
292
+ classes : val,
293
+ selector : '*'
294
+ });
295
+
296
+ ctrl.add(t.editor.translate(key), name);
297
+ }
298
+ });
299
+ }
300
+ });
301
+
302
+ // Auto import classes if the ctrl box is empty
303
+ if (ctrl.getLength() == 0) {
304
+ ctrl.onPostRender.add(function(ed, n) {
305
+ if (!ctrl.NativeListBox) {
306
+ Event.add(n.id + '_text', 'focus', t._importClasses, t);
307
+ Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
308
+ Event.add(n.id + '_open', 'focus', t._importClasses, t);
309
+ Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
310
+ } else
311
+ Event.add(n.id, 'focus', t._importClasses, t);
312
+ });
313
+ }
314
+
315
+ return ctrl;
316
+ },
317
+
318
+ _createFontSelect : function() {
319
+ var c, t = this, ed = t.editor;
320
+
321
+ c = ed.controlManager.createListBox('fontselect', {
322
+ title : 'advanced.fontdefault',
323
+ onselect : function(v) {
324
+ var cur = c.items[c.selectedIndex];
325
+
326
+ if (!v && cur) {
327
+ ed.execCommand('FontName', false, cur.value);
328
+ return;
329
+ }
330
+
331
+ ed.execCommand('FontName', false, v);
332
+
333
+ // Fake selection, execCommand will fire a nodeChange and update the selection
334
+ c.select(function(sv) {
335
+ return v == sv;
336
+ });
337
+
338
+ if (cur && cur.value == v) {
339
+ c.select(null);
340
+ }
341
+
342
+ return false; // No auto select
343
+ }
344
+ });
345
+
346
+ if (c) {
347
+ each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
348
+ c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
349
+ });
350
+ }
351
+
352
+ return c;
353
+ },
354
+
355
+ _createFontSizeSelect : function() {
356
+ var t = this, ed = t.editor, c, i = 0, cl = [];
357
+
358
+ c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
359
+ var cur = c.items[c.selectedIndex];
360
+
361
+ if (!v && cur) {
362
+ cur = cur.value;
363
+
364
+ if (cur['class']) {
365
+ ed.formatter.toggle('fontsize_class', {value : cur['class']});
366
+ ed.undoManager.add();
367
+ ed.nodeChanged();
368
+ } else {
369
+ ed.execCommand('FontSize', false, cur.fontSize);
370
+ }
371
+
372
+ return;
373
+ }
374
+
375
+ if (v['class']) {
376
+ ed.focus();
377
+ ed.undoManager.add();
378
+ ed.formatter.toggle('fontsize_class', {value : v['class']});
379
+ ed.undoManager.add();
380
+ ed.nodeChanged();
381
+ } else
382
+ ed.execCommand('FontSize', false, v.fontSize);
383
+
384
+ // Fake selection, execCommand will fire a nodeChange and update the selection
385
+ c.select(function(sv) {
386
+ return v == sv;
387
+ });
388
+
389
+ if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) {
390
+ c.select(null);
391
+ }
392
+
393
+ return false; // No auto select
394
+ }});
395
+
396
+ if (c) {
397
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {
398
+ var fz = v.fontSize;
399
+
400
+ if (fz >= 1 && fz <= 7)
401
+ fz = t.sizes[parseInt(fz) - 1] + 'pt';
402
+
403
+ c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
404
+ });
405
+ }
406
+
407
+ return c;
408
+ },
409
+
410
+ _createBlockFormats : function() {
411
+ var c, fmts = {
412
+ p : 'advanced.paragraph',
413
+ address : 'advanced.address',
414
+ pre : 'advanced.pre',
415
+ h1 : 'advanced.h1',
416
+ h2 : 'advanced.h2',
417
+ h3 : 'advanced.h3',
418
+ h4 : 'advanced.h4',
419
+ h5 : 'advanced.h5',
420
+ h6 : 'advanced.h6',
421
+ div : 'advanced.div',
422
+ blockquote : 'advanced.blockquote',
423
+ code : 'advanced.code',
424
+ dt : 'advanced.dt',
425
+ dd : 'advanced.dd',
426
+ samp : 'advanced.samp'
427
+ }, t = this;
428
+
429
+ c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {
430
+ t.editor.execCommand('FormatBlock', false, v);
431
+ return false;
432
+ }});
433
+
434
+ if (c) {
435
+ each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
436
+ c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
437
+ });
438
+ }
439
+
440
+ return c;
441
+ },
442
+
443
+ _createForeColorMenu : function() {
444
+ var c, t = this, s = t.settings, o = {}, v;
445
+
446
+ if (s.theme_advanced_more_colors) {
447
+ o.more_colors_func = function() {
448
+ t._mceColorPicker(0, {
449
+ color : c.value,
450
+ func : function(co) {
451
+ c.setColor(co);
452
+ }
453
+ });
454
+ };
455
+ }
456
+
457
+ if (v = s.theme_advanced_text_colors)
458
+ o.colors = v;
459
+
460
+ if (s.theme_advanced_default_foreground_color)
461
+ o.default_color = s.theme_advanced_default_foreground_color;
462
+
463
+ o.title = 'advanced.forecolor_desc';
464
+ o.cmd = 'ForeColor';
465
+ o.scope = this;
466
+
467
+ c = t.editor.controlManager.createColorSplitButton('forecolor', o);
468
+
469
+ return c;
470
+ },
471
+
472
+ _createBackColorMenu : function() {
473
+ var c, t = this, s = t.settings, o = {}, v;
474
+
475
+ if (s.theme_advanced_more_colors) {
476
+ o.more_colors_func = function() {
477
+ t._mceColorPicker(0, {
478
+ color : c.value,
479
+ func : function(co) {
480
+ c.setColor(co);
481
+ }
482
+ });
483
+ };
484
+ }
485
+
486
+ if (v = s.theme_advanced_background_colors)
487
+ o.colors = v;
488
+
489
+ if (s.theme_advanced_default_background_color)
490
+ o.default_color = s.theme_advanced_default_background_color;
491
+
492
+ o.title = 'advanced.backcolor_desc';
493
+ o.cmd = 'HiliteColor';
494
+ o.scope = this;
495
+
496
+ c = t.editor.controlManager.createColorSplitButton('backcolor', o);
497
+
498
+ return c;
499
+ },
500
+
501
+ renderUI : function(o) {
502
+ var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
503
+
504
+ if (ed.settings) {
505
+ ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');
506
+ }
507
+
508
+ // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
509
+ // Maybe actually inherit it from the original textara?
510
+ n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
511
+ DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
512
+
513
+ if (!DOM.boxModel)
514
+ n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
515
+
516
+ n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
517
+ n = tb = DOM.add(n, 'tbody');
518
+
519
+ switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
520
+ case "rowlayout":
521
+ ic = t._rowLayout(s, tb, o);
522
+ break;
523
+
524
+ case "customlayout":
525
+ ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
526
+ break;
527
+
528
+ default:
529
+ ic = t._simpleLayout(s, tb, o, p);
530
+ }
531
+
532
+ n = o.targetNode;
533
+
534
+ // Add classes to first and last TRs
535
+ nl = sc.rows;
536
+ DOM.addClass(nl[0], 'mceFirst');
537
+ DOM.addClass(nl[nl.length - 1], 'mceLast');
538
+
539
+ // Add classes to first and last TDs
540
+ each(DOM.select('tr', tb), function(n) {
541
+ DOM.addClass(n.firstChild, 'mceFirst');
542
+ DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
543
+ });
544
+
545
+ if (DOM.get(s.theme_advanced_toolbar_container))
546
+ DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
547
+ else
548
+ DOM.insertAfter(p, n);
549
+
550
+ Event.add(ed.id + '_path_row', 'click', function(e) {
551
+ e = e.target;
552
+
553
+ if (e.nodeName == 'A') {
554
+ t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
555
+
556
+ return Event.cancel(e);
557
+ }
558
+ });
559
+ /*
560
+ if (DOM.get(ed.id + '_path_row')) {
561
+ Event.add(ed.id + '_tbl', 'mouseover', function(e) {
562
+ var re;
563
+
564
+ e = e.target;
565
+
566
+ if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
567
+ re = DOM.get(ed.id + '_path_row');
568
+ t.lastPath = re.innerHTML;
569
+ DOM.setHTML(re, e.parentNode.title);
570
+ }
571
+ });
572
+
573
+ Event.add(ed.id + '_tbl', 'mouseout', function(e) {
574
+ if (t.lastPath) {
575
+ DOM.setHTML(ed.id + '_path_row', t.lastPath);
576
+ t.lastPath = 0;
577
+ }
578
+ });
579
+ }
580
+ */
581
+
582
+ if (!ed.getParam('accessibility_focus'))
583
+ Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
584
+
585
+ if (s.theme_advanced_toolbar_location == 'external')
586
+ o.deltaHeight = 0;
587
+
588
+ t.deltaHeight = o.deltaHeight;
589
+ o.targetNode = null;
590
+
591
+ ed.onKeyDown.add(function(ed, evt) {
592
+ var DOM_VK_F10 = 121, DOM_VK_F11 = 122;
593
+
594
+ if (evt.altKey) {
595
+ if (evt.keyCode === DOM_VK_F10) {
596
+ window.focus();
597
+ t.toolbarGroup.focus();
598
+ return Event.cancel(evt);
599
+ } else if (evt.keyCode === DOM_VK_F11) {
600
+ DOM.get(ed.id + '_path_row').focus();
601
+ return Event.cancel(evt);
602
+ }
603
+ }
604
+ });
605
+
606
+ // alt+0 is the UK recommended shortcut for accessing the list of access controls.
607
+ ed.addShortcut('alt+0', '', 'mceShortcuts', t);
608
+
609
+ return {
610
+ iframeContainer : ic,
611
+ editorContainer : ed.id + '_parent',
612
+ sizeContainer : sc,
613
+ deltaHeight : o.deltaHeight
614
+ };
615
+ },
616
+
617
+ getInfo : function() {
618
+ return {
619
+ longname : 'Advanced theme',
620
+ author : 'Moxiecode Systems AB',
621
+ authorurl : 'http://tinymce.moxiecode.com',
622
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
623
+ }
624
+ },
625
+
626
+ resizeBy : function(dw, dh) {
627
+ var e = DOM.get(this.editor.id + '_ifr');
628
+
629
+ this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
630
+ },
631
+
632
+ resizeTo : function(w, h, store) {
633
+ var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
634
+
635
+ // Boundery fix box
636
+ w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
637
+ h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
638
+ w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
639
+ h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
640
+
641
+ // Resize iframe and container
642
+ DOM.setStyle(e, 'height', '');
643
+ DOM.setStyle(ifr, 'height', h);
644
+
645
+ if (s.theme_advanced_resize_horizontal) {
646
+ DOM.setStyle(e, 'width', '');
647
+ DOM.setStyle(ifr, 'width', w);
648
+
649
+ // Make sure that the size is never smaller than the over all ui
650
+ if (w < e.clientWidth) {
651
+ w = e.clientWidth;
652
+ DOM.setStyle(ifr, 'width', e.clientWidth);
653
+ }
654
+ }
655
+
656
+ // Store away the size
657
+ if (store && s.theme_advanced_resizing_use_cookie) {
658
+ Cookie.setHash("TinyMCE_" + ed.id + "_size", {
659
+ cw : w,
660
+ ch : h
661
+ });
662
+ }
663
+ },
664
+
665
+ destroy : function() {
666
+ var id = this.editor.id;
667
+
668
+ Event.clear(id + '_resize');
669
+ Event.clear(id + '_path_row');
670
+ Event.clear(id + '_external_close');
671
+ },
672
+
673
+ // Internal functions
674
+
675
+ _simpleLayout : function(s, tb, o, p) {
676
+ var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
677
+
678
+ if (s.readonly) {
679
+ n = DOM.add(tb, 'tr');
680
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
681
+ return ic;
682
+ }
683
+
684
+ // Create toolbar container at top
685
+ if (lo == 'top')
686
+ t._addToolbars(tb, o);
687
+
688
+ // Create external toolbar
689
+ if (lo == 'external') {
690
+ n = c = DOM.create('div', {style : 'position:relative'});
691
+ n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
692
+ DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
693
+ n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
694
+ etb = DOM.add(n, 'tbody');
695
+
696
+ if (p.firstChild.className == 'mceOldBoxModel')
697
+ p.firstChild.appendChild(c);
698
+ else
699
+ p.insertBefore(c, p.firstChild);
700
+
701
+ t._addToolbars(etb, o);
702
+
703
+ ed.onMouseUp.add(function() {
704
+ var e = DOM.get(ed.id + '_external');
705
+ DOM.show(e);
706
+
707
+ DOM.hide(lastExtID);
708
+
709
+ var f = Event.add(ed.id + '_external_close', 'click', function() {
710
+ DOM.hide(ed.id + '_external');
711
+ Event.remove(ed.id + '_external_close', 'click', f);
712
+ });
713
+
714
+ DOM.show(e);
715
+ DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
716
+
717
+ // Fixes IE rendering bug
718
+ DOM.hide(e);
719
+ DOM.show(e);
720
+ e.style.filter = '';
721
+
722
+ lastExtID = ed.id + '_external';
723
+
724
+ e = null;
725
+ });
726
+ }
727
+
728
+ if (sl == 'top')
729
+ t._addStatusBar(tb, o);
730
+
731
+ // Create iframe container
732
+ if (!s.theme_advanced_toolbar_container) {
733
+ n = DOM.add(tb, 'tr');
734
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
735
+ }
736
+
737
+ // Create toolbar container at bottom
738
+ if (lo == 'bottom')
739
+ t._addToolbars(tb, o);
740
+
741
+ if (sl == 'bottom')
742
+ t._addStatusBar(tb, o);
743
+
744
+ return ic;
745
+ },
746
+
747
+ _rowLayout : function(s, tb, o) {
748
+ var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
749
+
750
+ dc = s.theme_advanced_containers_default_class || '';
751
+ da = s.theme_advanced_containers_default_align || 'center';
752
+
753
+ each(explode(s.theme_advanced_containers || ''), function(c, i) {
754
+ var v = s['theme_advanced_container_' + c] || '';
755
+
756
+ switch (c.toLowerCase()) {
757
+ case 'mceeditor':
758
+ n = DOM.add(tb, 'tr');
759
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
760
+ break;
761
+
762
+ case 'mceelementpath':
763
+ t._addStatusBar(tb, o);
764
+ break;
765
+
766
+ default:
767
+ a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
768
+ a = 'mce' + t._ufirst(a);
769
+
770
+ n = DOM.add(DOM.add(tb, 'tr'), 'td', {
771
+ 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
772
+ });
773
+
774
+ to = cf.createToolbar("toolbar" + i);
775
+ t._addControls(v, to);
776
+ DOM.setHTML(n, to.renderHTML());
777
+ o.deltaHeight -= s.theme_advanced_row_height;
778
+ }
779
+ });
780
+
781
+ return ic;
782
+ },
783
+
784
+ _addControls : function(v, tb) {
785
+ var t = this, s = t.settings, di, cf = t.editor.controlManager;
786
+
787
+ if (s.theme_advanced_disable && !t._disabled) {
788
+ di = {};
789
+
790
+ each(explode(s.theme_advanced_disable), function(v) {
791
+ di[v] = 1;
792
+ });
793
+
794
+ t._disabled = di;
795
+ } else
796
+ di = t._disabled;
797
+
798
+ each(explode(v), function(n) {
799
+ var c;
800
+
801
+ if (di && di[n])
802
+ return;
803
+
804
+ // Compatiblity with 2.x
805
+ if (n == 'tablecontrols') {
806
+ each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
807
+ n = t.createControl(n, cf);
808
+
809
+ if (n)
810
+ tb.add(n);
811
+ });
812
+
813
+ return;
814
+ }
815
+
816
+ c = t.createControl(n, cf);
817
+
818
+ if (c)
819
+ tb.add(c);
820
+ });
821
+ },
822
+
823
+ _addToolbars : function(c, o) {
824
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
825
+
826
+ toolbarGroup = cf.createToolbarGroup('toolbargroup', {
827
+ 'name': ed.getLang('advanced.toolbar'),
828
+ 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')
829
+ });
830
+
831
+ t.toolbarGroup = toolbarGroup;
832
+
833
+ a = s.theme_advanced_toolbar_align.toLowerCase();
834
+ a = 'mce' + t._ufirst(a);
835
+
836
+ n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
837
+
838
+ // Create toolbar and add the controls
839
+ for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
840
+ tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
841
+
842
+ if (s['theme_advanced_buttons' + i + '_add'])
843
+ v += ',' + s['theme_advanced_buttons' + i + '_add'];
844
+
845
+ if (s['theme_advanced_buttons' + i + '_add_before'])
846
+ v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
847
+
848
+ t._addControls(v, tb);
849
+ toolbarGroup.add(tb);
850
+
851
+ o.deltaHeight -= s.theme_advanced_row_height;
852
+ }
853
+ h.push(toolbarGroup.renderHTML());
854
+ h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
855
+ DOM.setHTML(n, h.join(''));
856
+ },
857
+
858
+ _addStatusBar : function(tb, o) {
859
+ var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
860
+
861
+ n = DOM.add(tb, 'tr');
862
+ n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
863
+ n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
864
+ if (s.theme_advanced_path) {
865
+ DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
866
+ DOM.add(n, 'span', {}, ': ');
867
+ } else {
868
+ DOM.add(n, 'span', {}, '&#160;');
869
+ }
870
+
871
+
872
+ if (s.theme_advanced_resizing) {
873
+ DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
874
+
875
+ if (s.theme_advanced_resizing_use_cookie) {
876
+ ed.onPostRender.add(function() {
877
+ var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
878
+
879
+ if (!o)
880
+ return;
881
+
882
+ t.resizeTo(o.cw, o.ch);
883
+ });
884
+ }
885
+
886
+ ed.onPostRender.add(function() {
887
+ Event.add(ed.id + '_resize', 'click', function(e) {
888
+ e.preventDefault();
889
+ });
890
+
891
+ Event.add(ed.id + '_resize', 'mousedown', function(e) {
892
+ var mouseMoveHandler1, mouseMoveHandler2,
893
+ mouseUpHandler1, mouseUpHandler2,
894
+ startX, startY, startWidth, startHeight, width, height, ifrElm;
895
+
896
+ function resizeOnMove(e) {
897
+ e.preventDefault();
898
+
899
+ width = startWidth + (e.screenX - startX);
900
+ height = startHeight + (e.screenY - startY);
901
+
902
+ t.resizeTo(width, height);
903
+ };
904
+
905
+ function endResize(e) {
906
+ // Stop listening
907
+ Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
908
+ Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
909
+ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
910
+ Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
911
+
912
+ width = startWidth + (e.screenX - startX);
913
+ height = startHeight + (e.screenY - startY);
914
+ t.resizeTo(width, height, true);
915
+ };
916
+
917
+ e.preventDefault();
918
+
919
+ // Get the current rect size
920
+ startX = e.screenX;
921
+ startY = e.screenY;
922
+ ifrElm = DOM.get(t.editor.id + '_ifr');
923
+ startWidth = width = ifrElm.clientWidth;
924
+ startHeight = height = ifrElm.clientHeight;
925
+
926
+ // Register envent handlers
927
+ mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
928
+ mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
929
+ mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
930
+ mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
931
+ });
932
+ });
933
+ }
934
+
935
+ o.deltaHeight -= 21;
936
+ n = tb = null;
937
+ },
938
+
939
+ _updateUndoStatus : function(ed) {
940
+ var cm = ed.controlManager, um = ed.undoManager;
941
+
942
+ cm.setDisabled('undo', !um.hasUndo() && !um.typing);
943
+ cm.setDisabled('redo', !um.hasRedo());
944
+ },
945
+
946
+ _nodeChanged : function(ed, cm, n, co, ob) {
947
+ var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;
948
+
949
+ tinymce.each(t.stateControls, function(c) {
950
+ cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
951
+ });
952
+
953
+ function getParent(name) {
954
+ var i, parents = ob.parents, func = name;
955
+
956
+ if (typeof(name) == 'string') {
957
+ func = function(node) {
958
+ return node.nodeName == name;
959
+ };
960
+ }
961
+
962
+ for (i = 0; i < parents.length; i++) {
963
+ if (func(parents[i]))
964
+ return parents[i];
965
+ }
966
+ };
967
+
968
+ cm.setActive('visualaid', ed.hasVisual);
969
+ t._updateUndoStatus(ed);
970
+ cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
971
+
972
+ p = getParent('A');
973
+ if (c = cm.get('link')) {
974
+ if (!p || !p.name) {
975
+ c.setDisabled(!p && co);
976
+ c.setActive(!!p);
977
+ }
978
+ }
979
+
980
+ if (c = cm.get('unlink')) {
981
+ c.setDisabled(!p && co);
982
+ c.setActive(!!p && !p.name);
983
+ }
984
+
985
+ if (c = cm.get('anchor')) {
986
+ c.setActive(!co && !!p && p.name);
987
+ }
988
+
989
+ p = getParent('IMG');
990
+ if (c = cm.get('image'))
991
+ c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
992
+
993
+ if (c = cm.get('styleselect')) {
994
+ t._importClasses();
995
+
996
+ formatNames = [];
997
+ each(c.items, function(item) {
998
+ formatNames.push(item.value);
999
+ });
1000
+
1001
+ matches = ed.formatter.matchAll(formatNames);
1002
+ c.select(matches[0]);
1003
+ }
1004
+
1005
+ if (c = cm.get('formatselect')) {
1006
+ p = getParent(DOM.isBlock);
1007
+
1008
+ if (p)
1009
+ c.select(p.nodeName.toLowerCase());
1010
+ }
1011
+
1012
+ // Find out current fontSize, fontFamily and fontClass
1013
+ getParent(function(n) {
1014
+ if (n.nodeName === 'SPAN') {
1015
+ if (!cl && n.className)
1016
+ cl = n.className;
1017
+ }
1018
+
1019
+ if (ed.dom.is(n, s.theme_advanced_font_selector)) {
1020
+ if (!fz && n.style.fontSize)
1021
+ fz = n.style.fontSize;
1022
+
1023
+ if (!fn && n.style.fontFamily)
1024
+ fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
1025
+
1026
+ if (!fc && n.style.color)
1027
+ fc = n.style.color;
1028
+
1029
+ if (!bc && n.style.backgroundColor)
1030
+ bc = n.style.backgroundColor;
1031
+ }
1032
+
1033
+ return false;
1034
+ });
1035
+
1036
+ if (c = cm.get('fontselect')) {
1037
+ c.select(function(v) {
1038
+ return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
1039
+ });
1040
+ }
1041
+
1042
+ // Select font size
1043
+ if (c = cm.get('fontsizeselect')) {
1044
+ // Use computed style
1045
+ if (s.theme_advanced_runtime_fontsize && !fz && !cl)
1046
+ fz = ed.dom.getStyle(n, 'fontSize', true);
1047
+
1048
+ c.select(function(v) {
1049
+ if (v.fontSize && v.fontSize === fz)
1050
+ return true;
1051
+
1052
+ if (v['class'] && v['class'] === cl)
1053
+ return true;
1054
+ });
1055
+ }
1056
+
1057
+ if (s.theme_advanced_show_current_color) {
1058
+ function updateColor(controlId, color) {
1059
+ if (c = cm.get(controlId)) {
1060
+ if (!color)
1061
+ color = c.settings.default_color;
1062
+ if (color !== c.value) {
1063
+ c.displayColor(color);
1064
+ }
1065
+ }
1066
+ }
1067
+ updateColor('forecolor', fc);
1068
+ updateColor('backcolor', bc);
1069
+ }
1070
+
1071
+ if (s.theme_advanced_show_current_color) {
1072
+ function updateColor(controlId, color) {
1073
+ if (c = cm.get(controlId)) {
1074
+ if (!color)
1075
+ color = c.settings.default_color;
1076
+ if (color !== c.value) {
1077
+ c.displayColor(color);
1078
+ }
1079
+ }
1080
+ };
1081
+
1082
+ updateColor('forecolor', fc);
1083
+ updateColor('backcolor', bc);
1084
+ }
1085
+
1086
+ if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
1087
+ p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
1088
+
1089
+ if (t.statusKeyboardNavigation) {
1090
+ t.statusKeyboardNavigation.destroy();
1091
+ t.statusKeyboardNavigation = null;
1092
+ }
1093
+
1094
+ DOM.setHTML(p, '');
1095
+
1096
+ getParent(function(n) {
1097
+ var na = n.nodeName.toLowerCase(), u, pi, ti = '';
1098
+
1099
+ // Ignore non element and bogus/hidden elements
1100
+ if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))
1101
+ return;
1102
+
1103
+ // Handle prefix
1104
+ if (tinymce.isIE && n.scopeName !== 'HTML')
1105
+ na = n.scopeName + ':' + na;
1106
+
1107
+ // Remove internal prefix
1108
+ na = na.replace(/mce\:/g, '');
1109
+
1110
+ // Handle node name
1111
+ switch (na) {
1112
+ case 'b':
1113
+ na = 'strong';
1114
+ break;
1115
+
1116
+ case 'i':
1117
+ na = 'em';
1118
+ break;
1119
+
1120
+ case 'img':
1121
+ if (v = DOM.getAttrib(n, 'src'))
1122
+ ti += 'src: ' + v + ' ';
1123
+
1124
+ break;
1125
+
1126
+ case 'a':
1127
+ if (v = DOM.getAttrib(n, 'name')) {
1128
+ ti += 'name: ' + v + ' ';
1129
+ na += '#' + v;
1130
+ }
1131
+
1132
+ if (v = DOM.getAttrib(n, 'href'))
1133
+ ti += 'href: ' + v + ' ';
1134
+
1135
+ break;
1136
+
1137
+ case 'font':
1138
+ if (v = DOM.getAttrib(n, 'face'))
1139
+ ti += 'font: ' + v + ' ';
1140
+
1141
+ if (v = DOM.getAttrib(n, 'size'))
1142
+ ti += 'size: ' + v + ' ';
1143
+
1144
+ if (v = DOM.getAttrib(n, 'color'))
1145
+ ti += 'color: ' + v + ' ';
1146
+
1147
+ break;
1148
+
1149
+ case 'span':
1150
+ if (v = DOM.getAttrib(n, 'style'))
1151
+ ti += 'style: ' + v + ' ';
1152
+
1153
+ break;
1154
+ }
1155
+
1156
+ if (v = DOM.getAttrib(n, 'id'))
1157
+ ti += 'id: ' + v + ' ';
1158
+
1159
+ if (v = n.className) {
1160
+ v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
1161
+
1162
+ if (v) {
1163
+ ti += 'class: ' + v + ' ';
1164
+
1165
+ if (DOM.isBlock(n) || na == 'img' || na == 'span')
1166
+ na += '.' + v;
1167
+ }
1168
+ }
1169
+
1170
+ na = na.replace(/(html:)/g, '');
1171
+ na = {name : na, node : n, title : ti};
1172
+ t.onResolveName.dispatch(t, na);
1173
+ ti = na.title;
1174
+ na = na.name;
1175
+
1176
+ //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
1177
+ pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
1178
+
1179
+ if (p.hasChildNodes()) {
1180
+ p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);
1181
+ p.insertBefore(pi, p.firstChild);
1182
+ } else
1183
+ p.appendChild(pi);
1184
+ }, ed.getBody());
1185
+
1186
+ if (DOM.select('a', p).length > 0) {
1187
+ t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({
1188
+ root: ed.id + "_path_row",
1189
+ items: DOM.select('a', p),
1190
+ excludeFromTabOrder: true,
1191
+ onCancel: function() {
1192
+ ed.focus();
1193
+ }
1194
+ }, DOM);
1195
+ }
1196
+ }
1197
+ },
1198
+
1199
+ // Commands gets called by execCommand
1200
+
1201
+ _sel : function(v) {
1202
+ this.editor.execCommand('mceSelectNodeDepth', false, v);
1203
+ },
1204
+
1205
+ _mceInsertAnchor : function(ui, v) {
1206
+ var ed = this.editor;
1207
+
1208
+ ed.windowManager.open({
1209
+ url : this.url + '/anchor.htm',
1210
+ width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
1211
+ height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
1212
+ inline : true
1213
+ }, {
1214
+ theme_url : this.url
1215
+ });
1216
+ },
1217
+
1218
+ _mceCharMap : function() {
1219
+ var ed = this.editor;
1220
+
1221
+ ed.windowManager.open({
1222
+ url : this.url + '/charmap.htm',
1223
+ width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
1224
+ height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
1225
+ inline : true
1226
+ }, {
1227
+ theme_url : this.url
1228
+ });
1229
+ },
1230
+
1231
+ _mceHelp : function() {
1232
+ var ed = this.editor;
1233
+
1234
+ ed.windowManager.open({
1235
+ url : this.url + '/about.htm',
1236
+ width : 480,
1237
+ height : 380,
1238
+ inline : true
1239
+ }, {
1240
+ theme_url : this.url
1241
+ });
1242
+ },
1243
+
1244
+ _mceShortcuts : function() {
1245
+ var ed = this.editor;
1246
+ ed.windowManager.open({
1247
+ url: this.url + '/shortcuts.htm',
1248
+ width: 480,
1249
+ height: 380,
1250
+ inline: true
1251
+ }, {
1252
+ theme_url: this.url
1253
+ });
1254
+ },
1255
+
1256
+ _mceColorPicker : function(u, v) {
1257
+ var ed = this.editor;
1258
+
1259
+ v = v || {};
1260
+
1261
+ ed.windowManager.open({
1262
+ url : this.url + '/color_picker.htm',
1263
+ width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
1264
+ height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
1265
+ close_previous : false,
1266
+ inline : true
1267
+ }, {
1268
+ input_color : v.color,
1269
+ func : v.func,
1270
+ theme_url : this.url
1271
+ });
1272
+ },
1273
+
1274
+ _mceCodeEditor : function(ui, val) {
1275
+ var ed = this.editor;
1276
+
1277
+ ed.windowManager.open({
1278
+ url : this.url + '/source_editor.htm',
1279
+ width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
1280
+ height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
1281
+ inline : true,
1282
+ resizable : true,
1283
+ maximizable : true
1284
+ }, {
1285
+ theme_url : this.url
1286
+ });
1287
+ },
1288
+
1289
+ _mceImage : function(ui, val) {
1290
+ var ed = this.editor;
1291
+
1292
+ // Internal image object like a flash placeholder
1293
+ if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
1294
+ return;
1295
+
1296
+ ed.windowManager.open({
1297
+ url : this.url + '/image.htm',
1298
+ width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
1299
+ height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
1300
+ inline : true
1301
+ }, {
1302
+ theme_url : this.url
1303
+ });
1304
+ },
1305
+
1306
+ _mceLink : function(ui, val) {
1307
+ var ed = this.editor;
1308
+
1309
+ ed.windowManager.open({
1310
+ url : this.url + '/link.htm',
1311
+ width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
1312
+ height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
1313
+ inline : true
1314
+ }, {
1315
+ theme_url : this.url
1316
+ });
1317
+ },
1318
+
1319
+ _mceNewDocument : function() {
1320
+ var ed = this.editor;
1321
+
1322
+ ed.windowManager.confirm('advanced.newdocument', function(s) {
1323
+ if (s)
1324
+ ed.execCommand('mceSetContent', false, '');
1325
+ });
1326
+ },
1327
+
1328
+ _mceForeColor : function() {
1329
+ var t = this;
1330
+
1331
+ this._mceColorPicker(0, {
1332
+ color: t.fgColor,
1333
+ func : function(co) {
1334
+ t.fgColor = co;
1335
+ t.editor.execCommand('ForeColor', false, co);
1336
+ }
1337
+ });
1338
+ },
1339
+
1340
+ _mceBackColor : function() {
1341
+ var t = this;
1342
+
1343
+ this._mceColorPicker(0, {
1344
+ color: t.bgColor,
1345
+ func : function(co) {
1346
+ t.bgColor = co;
1347
+ t.editor.execCommand('HiliteColor', false, co);
1348
+ }
1349
+ });
1350
+ },
1351
+
1352
+ _ufirst : function(s) {
1353
+ return s.substring(0, 1).toUpperCase() + s.substring(1);
1354
+ }
1355
+ });
1356
+
1357
+ tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
1358
+ }(tinymce));