spud_core 0.9.22 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/glyphicons-halflings-regular.eot +0 -0
  3. data/app/assets/images/glyphicons-halflings-regular.svg +229 -0
  4. data/app/assets/images/glyphicons-halflings-regular.ttf +0 -0
  5. data/app/assets/images/glyphicons-halflings-regular.woff +0 -0
  6. data/app/assets/javascripts/spud/admin/application.js +5 -2
  7. data/app/assets/javascripts/spud/admin/editor.js +55 -21
  8. data/app/assets/javascripts/spud/admin/preinit.js +1 -1
  9. data/app/assets/libs/bootstrap3/css/bootstrap-theme.css +397 -0
  10. data/app/assets/libs/bootstrap3/css/bootstrap-theme.min.css +7 -0
  11. data/app/assets/libs/bootstrap3/css/bootstrap.css.erb +7118 -0
  12. data/app/assets/libs/bootstrap3/css/bootstrap.min.css +7 -0
  13. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.eot +0 -0
  14. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.svg +229 -0
  15. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.ttf +0 -0
  16. data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.woff +0 -0
  17. data/app/assets/libs/bootstrap3/js/bootstrap.js +2006 -0
  18. data/app/assets/libs/bootstrap3/js/bootstrap.min.js +7 -0
  19. data/app/assets/stylesheets/spud/admin/{application.css → application.css.erb} +4 -4
  20. data/app/assets/stylesheets/spud/admin/navbar.css +31 -0
  21. data/app/controllers/spud/admin/users_controller.rb +6 -2
  22. data/app/controllers/spud/application_controller.rb +0 -1
  23. data/app/controllers/spud/sitemaps_controller.rb +1 -1
  24. data/app/controllers/spud/users_controller.rb +10 -4
  25. data/app/models/spud_admin_permission.rb +0 -2
  26. data/app/models/spud_user.rb +0 -2
  27. data/app/views/spud/admin/users/index.html.erb +1 -1
  28. data/config/routes.rb +1 -0
  29. data/lib/spud_core/configuration.rb +13 -3
  30. data/lib/spud_core/engine.rb +3 -7
  31. data/lib/spud_core/version.rb +1 -1
  32. data/spec/controllers/spud/sitemap_controllers_spec.rb +6 -5
  33. data/spec/dummy/config/environments/development.rb +1 -5
  34. data/spec/dummy/config/environments/production.rb +2 -0
  35. data/spec/dummy/config/environments/test.rb +1 -5
  36. metadata +104 -190
  37. data/app/assets/libs/tiny_mce/jquery.tinymce.js +0 -1
  38. data/app/assets/libs/tiny_mce/langs/en.js +0 -1
  39. data/app/assets/libs/tiny_mce/license.txt +0 -504
  40. data/app/assets/libs/tiny_mce/plugins/advhr/css/advhr.css +0 -5
  41. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin.js +0 -1
  42. data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin_src.js +0 -57
  43. data/app/assets/libs/tiny_mce/plugins/advhr/js/rule.js +0 -43
  44. data/app/assets/libs/tiny_mce/plugins/advhr/langs/en_dlg.js +0 -1
  45. data/app/assets/libs/tiny_mce/plugins/advhr/rule.htm +0 -58
  46. data/app/assets/libs/tiny_mce/plugins/advimage/css/advimage.css +0 -13
  47. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin.js +0 -1
  48. data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin_src.js +0 -50
  49. data/app/assets/libs/tiny_mce/plugins/advimage/image.htm +0 -235
  50. data/app/assets/libs/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  51. data/app/assets/libs/tiny_mce/plugins/advimage/js/image.js +0 -462
  52. data/app/assets/libs/tiny_mce/plugins/advimage/langs/en_dlg.js +0 -1
  53. data/app/assets/libs/tiny_mce/plugins/advlink/css/advlink.css +0 -8
  54. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin.js +0 -1
  55. data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin_src.js +0 -61
  56. data/app/assets/libs/tiny_mce/plugins/advlink/js/advlink.js +0 -539
  57. data/app/assets/libs/tiny_mce/plugins/advlink/langs/en_dlg.js +0 -1
  58. data/app/assets/libs/tiny_mce/plugins/advlink/link.htm +0 -338
  59. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin.js +0 -1
  60. data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin_src.js +0 -176
  61. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin.js +0 -1
  62. data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin_src.js +0 -174
  63. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin.js +0 -1
  64. data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin_src.js +0 -119
  65. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin.js +0 -1
  66. data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin_src.js +0 -161
  67. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin.js +0 -1
  68. data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin_src.js +0 -82
  69. data/app/assets/libs/tiny_mce/plugins/example/dialog.htm +0 -22
  70. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin.js +0 -1
  71. data/app/assets/libs/tiny_mce/plugins/example/editor_plugin_src.js +0 -84
  72. data/app/assets/libs/tiny_mce/plugins/example/img/example.gif +0 -0
  73. data/app/assets/libs/tiny_mce/plugins/example/js/dialog.js +0 -19
  74. data/app/assets/libs/tiny_mce/plugins/example/langs/en.js +0 -3
  75. data/app/assets/libs/tiny_mce/plugins/example/langs/en_dlg.js +0 -3
  76. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin.js +0 -1
  77. data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin_src.js +0 -50
  78. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin.js +0 -1
  79. data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin_src.js +0 -54
  80. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
  81. data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +0 -699
  82. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  83. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  84. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  85. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  86. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  87. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  88. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  89. data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
  90. data/app/assets/libs/tiny_mce/plugins/inlinepopups/template.htm +0 -387
  91. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin.js +0 -1
  92. data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin_src.js +0 -262
  93. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin.js +0 -1
  94. data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin_src.js +0 -951
  95. data/app/assets/libs/tiny_mce/plugins/media/css/media.css +0 -17
  96. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin.js +0 -1
  97. data/app/assets/libs/tiny_mce/plugins/media/editor_plugin_src.js +0 -890
  98. data/app/assets/libs/tiny_mce/plugins/media/js/embed.js +0 -73
  99. data/app/assets/libs/tiny_mce/plugins/media/js/media.js +0 -470
  100. data/app/assets/libs/tiny_mce/plugins/media/langs/en_dlg.js +0 -1
  101. data/app/assets/libs/tiny_mce/plugins/media/media.htm +0 -922
  102. data/app/assets/libs/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  103. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin.js +0 -1
  104. data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin_src.js +0 -871
  105. data/app/assets/libs/tiny_mce/plugins/paste/js/pastetext.js +0 -36
  106. data/app/assets/libs/tiny_mce/plugins/paste/js/pasteword.js +0 -51
  107. data/app/assets/libs/tiny_mce/plugins/paste/langs/en_dlg.js +0 -1
  108. data/app/assets/libs/tiny_mce/plugins/paste/pastetext.htm +0 -27
  109. data/app/assets/libs/tiny_mce/plugins/paste/pasteword.htm +0 -21
  110. data/app/assets/libs/tiny_mce/plugins/spellchecker/css/content.css +0 -1
  111. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin.js +0 -1
  112. data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin_src.js +0 -436
  113. data/app/assets/libs/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  114. data/app/assets/libs/tiny_mce/plugins/style/css/props.css +0 -14
  115. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin.js +0 -1
  116. data/app/assets/libs/tiny_mce/plugins/style/editor_plugin_src.js +0 -71
  117. data/app/assets/libs/tiny_mce/plugins/style/js/props.js +0 -709
  118. data/app/assets/libs/tiny_mce/plugins/style/langs/en_dlg.js +0 -1
  119. data/app/assets/libs/tiny_mce/plugins/style/props.htm +0 -845
  120. data/app/assets/libs/tiny_mce/plugins/style/readme.txt +0 -19
  121. data/app/assets/libs/tiny_mce/plugins/table/cell.htm +0 -180
  122. data/app/assets/libs/tiny_mce/plugins/table/css/cell.css +0 -17
  123. data/app/assets/libs/tiny_mce/plugins/table/css/row.css +0 -25
  124. data/app/assets/libs/tiny_mce/plugins/table/css/table.css +0 -13
  125. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin.js +0 -1
  126. data/app/assets/libs/tiny_mce/plugins/table/editor_plugin_src.js +0 -1428
  127. data/app/assets/libs/tiny_mce/plugins/table/js/cell.js +0 -319
  128. data/app/assets/libs/tiny_mce/plugins/table/js/merge_cells.js +0 -27
  129. data/app/assets/libs/tiny_mce/plugins/table/js/row.js +0 -237
  130. data/app/assets/libs/tiny_mce/plugins/table/js/table.js +0 -489
  131. data/app/assets/libs/tiny_mce/plugins/table/langs/en_dlg.js +0 -1
  132. data/app/assets/libs/tiny_mce/plugins/table/merge_cells.htm +0 -32
  133. data/app/assets/libs/tiny_mce/plugins/table/row.htm +0 -158
  134. data/app/assets/libs/tiny_mce/plugins/table/table.htm +0 -188
  135. data/app/assets/libs/tiny_mce/themes/advanced/about.htm +0 -52
  136. data/app/assets/libs/tiny_mce/themes/advanced/anchor.htm +0 -26
  137. data/app/assets/libs/tiny_mce/themes/advanced/charmap.htm +0 -55
  138. data/app/assets/libs/tiny_mce/themes/advanced/color_picker.htm +0 -70
  139. data/app/assets/libs/tiny_mce/themes/advanced/editor_template.js +0 -1
  140. data/app/assets/libs/tiny_mce/themes/advanced/editor_template_src.js +0 -1467
  141. data/app/assets/libs/tiny_mce/themes/advanced/image.htm +0 -80
  142. data/app/assets/libs/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  143. data/app/assets/libs/tiny_mce/themes/advanced/img/flash.gif +0 -0
  144. data/app/assets/libs/tiny_mce/themes/advanced/img/icons.gif +0 -0
  145. data/app/assets/libs/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  146. data/app/assets/libs/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  147. data/app/assets/libs/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  148. data/app/assets/libs/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  149. data/app/assets/libs/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  150. data/app/assets/libs/tiny_mce/themes/advanced/img/trans.gif +0 -0
  151. data/app/assets/libs/tiny_mce/themes/advanced/img/video.gif +0 -0
  152. data/app/assets/libs/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  153. data/app/assets/libs/tiny_mce/themes/advanced/js/about.js +0 -73
  154. data/app/assets/libs/tiny_mce/themes/advanced/js/anchor.js +0 -44
  155. data/app/assets/libs/tiny_mce/themes/advanced/js/charmap.js +0 -363
  156. data/app/assets/libs/tiny_mce/themes/advanced/js/color_picker.js +0 -345
  157. data/app/assets/libs/tiny_mce/themes/advanced/js/image.js +0 -251
  158. data/app/assets/libs/tiny_mce/themes/advanced/js/link.js +0 -153
  159. data/app/assets/libs/tiny_mce/themes/advanced/js/source_editor.js +0 -78
  160. data/app/assets/libs/tiny_mce/themes/advanced/langs/en.js +0 -1
  161. data/app/assets/libs/tiny_mce/themes/advanced/langs/en_dlg.js +0 -1
  162. data/app/assets/libs/tiny_mce/themes/advanced/link.htm +0 -57
  163. data/app/assets/libs/tiny_mce/themes/advanced/shortcuts.htm +0 -47
  164. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/content.css +0 -51
  165. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/dialog.css +0 -118
  166. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  167. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  168. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  169. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  170. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  171. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  172. data/app/assets/libs/tiny_mce/themes/advanced/skins/default/ui.css +0 -215
  173. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -25
  174. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -106
  175. data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -102
  176. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -49
  177. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -118
  178. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  179. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  180. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  181. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -218
  182. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
  183. data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
  184. data/app/assets/libs/tiny_mce/themes/advanced/source_editor.htm +0 -25
  185. data/app/assets/libs/tiny_mce/themes/simple/editor_template.js +0 -1
  186. data/app/assets/libs/tiny_mce/themes/simple/editor_template_src.js +0 -84
  187. data/app/assets/libs/tiny_mce/themes/simple/img/icons.gif +0 -0
  188. data/app/assets/libs/tiny_mce/themes/simple/langs/en.js +0 -1
  189. data/app/assets/libs/tiny_mce/themes/simple/skins/default/content.css +0 -25
  190. data/app/assets/libs/tiny_mce/themes/simple/skins/default/ui.css +0 -32
  191. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/content.css +0 -17
  192. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  193. data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/ui.css +0 -35
  194. data/app/assets/libs/tiny_mce/tiny_mce.js +0 -1
  195. data/app/assets/libs/tiny_mce/tiny_mce_popup.js +0 -5
  196. data/app/assets/libs/tiny_mce/tiny_mce_src.js +0 -16753
  197. data/app/assets/libs/tiny_mce/utils/editable_selects.js +0 -70
  198. data/app/assets/libs/tiny_mce/utils/form_utils.js +0 -210
  199. data/app/assets/libs/tiny_mce/utils/mctabs.js +0 -162
  200. data/app/assets/libs/tiny_mce/utils/validate.js +0 -252
  201. data/app/assets/stylesheets/spud/admin/settings.css +0 -4
  202. data/app/assets/stylesheets/spud/admin/users.css +0 -4
  203. data/app/assets/stylesheets/spud/password_resets.css +0 -4
  204. data/app/assets/stylesheets/spud/setup.css +0 -4
  205. data/app/assets/stylesheets/spud/sitemaps.css +0 -4
  206. data/app/assets/stylesheets/spud/user_sessions.css +0 -4
  207. data/app/assets/stylesheets/spud/users.css +0 -4
  208. /data/app/assets/{libs/tiny_mce → javascripts/tinymce}/plugins/tableDropdown/editor_plugin.js +0 -0
@@ -1,1467 +0,0 @@
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
- // Generates a preview for a format
15
- function getPreviewCss(ed, fmt) {
16
- var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
17
-
18
- previewStyles = ed.settings.preview_styles;
19
-
20
- // No preview forced
21
- if (previewStyles === false)
22
- return '';
23
-
24
- // Default preview
25
- if (!previewStyles)
26
- previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color';
27
-
28
- // Removes any variables since these can't be previewed
29
- function removeVars(val) {
30
- return val.replace(/%(\w+)/g, '');
31
- };
32
-
33
- // Create block/inline element to use for preview
34
- name = fmt.block || fmt.inline || 'span';
35
- previewElm = dom.create(name);
36
-
37
- // Add format styles to preview element
38
- each(fmt.styles, function(value, name) {
39
- value = removeVars(value);
40
-
41
- if (value)
42
- dom.setStyle(previewElm, name, value);
43
- });
44
-
45
- // Add attributes to preview element
46
- each(fmt.attributes, function(value, name) {
47
- value = removeVars(value);
48
-
49
- if (value)
50
- dom.setAttrib(previewElm, name, value);
51
- });
52
-
53
- // Add classes to preview element
54
- each(fmt.classes, function(value) {
55
- value = removeVars(value);
56
-
57
- if (!dom.hasClass(previewElm, value))
58
- dom.addClass(previewElm, value);
59
- });
60
-
61
- // Add the previewElm outside the visual area
62
- dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF});
63
- ed.getBody().appendChild(previewElm);
64
-
65
- // Get parent container font size so we can compute px values out of em/% for older IE:s
66
- parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true);
67
- parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
68
-
69
- each(previewStyles.split(' '), function(name) {
70
- var value = dom.getStyle(previewElm, name, true);
71
-
72
- // Old IE won't calculate the font size so we need to do that manually
73
- if (name == 'font-size') {
74
- if (/em|%$/.test(value)) {
75
- if (parentFontSize === 0) {
76
- return;
77
- }
78
-
79
- // Convert font size from em/% to px
80
- value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1);
81
- value = (value * parentFontSize) + 'px';
82
- }
83
- }
84
-
85
- previewCss += name + ':' + value + ';';
86
- });
87
-
88
- dom.remove(previewElm);
89
-
90
- return previewCss;
91
- };
92
-
93
- // Tell it to load theme specific language pack(s)
94
- tinymce.ThemeManager.requireLangPack('advanced');
95
-
96
- tinymce.create('tinymce.themes.AdvancedTheme', {
97
- sizes : [8, 10, 12, 14, 18, 24, 36],
98
-
99
- // Control name lookup, format: title, command
100
- controls : {
101
- bold : ['bold_desc', 'Bold'],
102
- italic : ['italic_desc', 'Italic'],
103
- underline : ['underline_desc', 'Underline'],
104
- strikethrough : ['striketrough_desc', 'Strikethrough'],
105
- justifyleft : ['justifyleft_desc', 'JustifyLeft'],
106
- justifycenter : ['justifycenter_desc', 'JustifyCenter'],
107
- justifyright : ['justifyright_desc', 'JustifyRight'],
108
- justifyfull : ['justifyfull_desc', 'JustifyFull'],
109
- bullist : ['bullist_desc', 'InsertUnorderedList'],
110
- numlist : ['numlist_desc', 'InsertOrderedList'],
111
- outdent : ['outdent_desc', 'Outdent'],
112
- indent : ['indent_desc', 'Indent'],
113
- cut : ['cut_desc', 'Cut'],
114
- copy : ['copy_desc', 'Copy'],
115
- paste : ['paste_desc', 'Paste'],
116
- undo : ['undo_desc', 'Undo'],
117
- redo : ['redo_desc', 'Redo'],
118
- link : ['link_desc', 'mceLink'],
119
- unlink : ['unlink_desc', 'unlink'],
120
- image : ['image_desc', 'mceImage'],
121
- cleanup : ['cleanup_desc', 'mceCleanup'],
122
- help : ['help_desc', 'mceHelp'],
123
- code : ['code_desc', 'mceCodeEditor'],
124
- hr : ['hr_desc', 'InsertHorizontalRule'],
125
- removeformat : ['removeformat_desc', 'RemoveFormat'],
126
- sub : ['sub_desc', 'subscript'],
127
- sup : ['sup_desc', 'superscript'],
128
- forecolor : ['forecolor_desc', 'ForeColor'],
129
- forecolorpicker : ['forecolor_desc', 'mceForeColor'],
130
- backcolor : ['backcolor_desc', 'HiliteColor'],
131
- backcolorpicker : ['backcolor_desc', 'mceBackColor'],
132
- charmap : ['charmap_desc', 'mceCharMap'],
133
- visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
134
- anchor : ['anchor_desc', 'mceInsertAnchor'],
135
- newdocument : ['newdocument_desc', 'mceNewDocument'],
136
- blockquote : ['blockquote_desc', 'mceBlockQuote']
137
- },
138
-
139
- stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
140
-
141
- init : function(ed, url) {
142
- var t = this, s, v, o;
143
-
144
- t.editor = ed;
145
- t.url = url;
146
- t.onResolveName = new tinymce.util.Dispatcher(this);
147
-
148
- ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
149
- ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
150
-
151
- // Default settings
152
- t.settings = s = extend({
153
- theme_advanced_path : true,
154
- theme_advanced_toolbar_location : 'bottom',
155
- theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
156
- theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
157
- theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
158
- theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
159
- theme_advanced_toolbar_align : "center",
160
- 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",
161
- theme_advanced_more_colors : 1,
162
- theme_advanced_row_height : 23,
163
- theme_advanced_resize_horizontal : 1,
164
- theme_advanced_resizing_use_cookie : 1,
165
- theme_advanced_font_sizes : "1,2,3,4,5,6,7",
166
- theme_advanced_font_selector : "span",
167
- theme_advanced_show_current_color: 0,
168
- readonly : ed.settings.readonly
169
- }, ed.settings);
170
-
171
- // Setup default font_size_style_values
172
- if (!s.font_size_style_values)
173
- s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
174
-
175
- if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
176
- s.font_size_style_values = tinymce.explode(s.font_size_style_values);
177
- s.font_size_classes = tinymce.explode(s.font_size_classes || '');
178
-
179
- // Parse string value
180
- o = {};
181
- ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
182
- each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
183
- var cl;
184
-
185
- if (k == v && v >= 1 && v <= 7) {
186
- k = v + ' (' + t.sizes[v - 1] + 'pt)';
187
- cl = s.font_size_classes[v - 1];
188
- v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
189
- }
190
-
191
- if (/^\s*\./.test(v))
192
- cl = v.replace(/\./g, '');
193
-
194
- o[k] = cl ? {'class' : cl} : {fontSize : v};
195
- });
196
-
197
- s.theme_advanced_font_sizes = o;
198
- }
199
-
200
- if ((v = s.theme_advanced_path_location) && v != 'none')
201
- s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
202
-
203
- if (s.theme_advanced_statusbar_location == 'none')
204
- s.theme_advanced_statusbar_location = 0;
205
-
206
- if (ed.settings.content_css !== false)
207
- ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
208
-
209
- // Init editor
210
- ed.onInit.add(function() {
211
- if (!ed.settings.readonly) {
212
- ed.onNodeChange.add(t._nodeChanged, t);
213
- ed.onKeyUp.add(t._updateUndoStatus, t);
214
- ed.onMouseUp.add(t._updateUndoStatus, t);
215
- ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {
216
- t._updateUndoStatus(ed);
217
- });
218
- }
219
- });
220
-
221
- ed.onSetProgressState.add(function(ed, b, ti) {
222
- var co, id = ed.id, tb;
223
-
224
- if (b) {
225
- t.progressTimer = setTimeout(function() {
226
- co = ed.getContainer();
227
- co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
228
- tb = DOM.get(ed.id + '_tbl');
229
-
230
- DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
231
- DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
232
- }, ti || 0);
233
- } else {
234
- DOM.remove(id + '_blocker');
235
- DOM.remove(id + '_progress');
236
- clearTimeout(t.progressTimer);
237
- }
238
- });
239
-
240
- DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
241
-
242
- if (s.skin_variant)
243
- DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
244
- },
245
-
246
- _isHighContrast : function() {
247
- var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});
248
-
249
- actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');
250
- DOM.remove(div);
251
-
252
- return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';
253
- },
254
-
255
- createControl : function(n, cf) {
256
- var cd, c;
257
-
258
- if (c = cf.createControl(n))
259
- return c;
260
-
261
- switch (n) {
262
- case "styleselect":
263
- return this._createStyleSelect();
264
-
265
- case "formatselect":
266
- return this._createBlockFormats();
267
-
268
- case "fontselect":
269
- return this._createFontSelect();
270
-
271
- case "fontsizeselect":
272
- return this._createFontSizeSelect();
273
-
274
- case "forecolor":
275
- return this._createForeColorMenu();
276
-
277
- case "backcolor":
278
- return this._createBackColorMenu();
279
- }
280
-
281
- if ((cd = this.controls[n]))
282
- return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
283
- },
284
-
285
- execCommand : function(cmd, ui, val) {
286
- var f = this['_' + cmd];
287
-
288
- if (f) {
289
- f.call(this, ui, val);
290
- return true;
291
- }
292
-
293
- return false;
294
- },
295
-
296
- _importClasses : function(e) {
297
- var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
298
-
299
- if (ctrl.getLength() == 0) {
300
- each(ed.dom.getClasses(), function(o, idx) {
301
- var name = 'style_' + idx, fmt;
302
-
303
- fmt = {
304
- inline : 'span',
305
- attributes : {'class' : o['class']},
306
- selector : '*'
307
- };
308
-
309
- ed.formatter.register(name, fmt);
310
-
311
- ctrl.add(o['class'], name, {
312
- style: function() {
313
- return getPreviewCss(ed, fmt);
314
- }
315
- });
316
- });
317
- }
318
- },
319
-
320
- _createStyleSelect : function(n) {
321
- var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
322
-
323
- // Setup style select box
324
- ctrl = ctrlMan.createListBox('styleselect', {
325
- title : 'advanced.style_select',
326
- onselect : function(name) {
327
- var matches, formatNames = [], removedFormat;
328
-
329
- each(ctrl.items, function(item) {
330
- formatNames.push(item.value);
331
- });
332
-
333
- ed.focus();
334
- ed.undoManager.add();
335
-
336
- // Toggle off the current format(s)
337
- matches = ed.formatter.matchAll(formatNames);
338
- tinymce.each(matches, function(match) {
339
- if (!name || match == name) {
340
- if (match)
341
- ed.formatter.remove(match);
342
-
343
- removedFormat = true;
344
- }
345
- });
346
-
347
- if (!removedFormat)
348
- ed.formatter.apply(name);
349
-
350
- ed.undoManager.add();
351
- ed.nodeChanged();
352
-
353
- return false; // No auto select
354
- }
355
- });
356
-
357
- // Handle specified format
358
- ed.onPreInit.add(function() {
359
- var counter = 0, formats = ed.getParam('style_formats');
360
-
361
- if (formats) {
362
- each(formats, function(fmt) {
363
- var name, keys = 0;
364
-
365
- each(fmt, function() {keys++;});
366
-
367
- if (keys > 1) {
368
- name = fmt.name = fmt.name || 'style_' + (counter++);
369
- ed.formatter.register(name, fmt);
370
- ctrl.add(fmt.title, name, {
371
- style: function() {
372
- return getPreviewCss(ed, fmt);
373
- }
374
- });
375
- } else
376
- ctrl.add(fmt.title);
377
- });
378
- } else {
379
- each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
380
- var name, fmt;
381
-
382
- if (val) {
383
- name = 'style_' + (counter++);
384
- fmt = {
385
- inline : 'span',
386
- classes : val,
387
- selector : '*'
388
- };
389
-
390
- ed.formatter.register(name, fmt);
391
- ctrl.add(t.editor.translate(key), name, {
392
- style: function() {
393
- return getPreviewCss(ed, fmt);
394
- }
395
- });
396
- }
397
- });
398
- }
399
- });
400
-
401
- // Auto import classes if the ctrl box is empty
402
- if (ctrl.getLength() == 0) {
403
- ctrl.onPostRender.add(function(ed, n) {
404
- if (!ctrl.NativeListBox) {
405
- Event.add(n.id + '_text', 'focus', t._importClasses, t);
406
- Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
407
- Event.add(n.id + '_open', 'focus', t._importClasses, t);
408
- Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
409
- } else
410
- Event.add(n.id, 'focus', t._importClasses, t);
411
- });
412
- }
413
-
414
- return ctrl;
415
- },
416
-
417
- _createFontSelect : function() {
418
- var c, t = this, ed = t.editor;
419
-
420
- c = ed.controlManager.createListBox('fontselect', {
421
- title : 'advanced.fontdefault',
422
- onselect : function(v) {
423
- var cur = c.items[c.selectedIndex];
424
-
425
- if (!v && cur) {
426
- ed.execCommand('FontName', false, cur.value);
427
- return;
428
- }
429
-
430
- ed.execCommand('FontName', false, v);
431
-
432
- // Fake selection, execCommand will fire a nodeChange and update the selection
433
- c.select(function(sv) {
434
- return v == sv;
435
- });
436
-
437
- if (cur && cur.value == v) {
438
- c.select(null);
439
- }
440
-
441
- return false; // No auto select
442
- }
443
- });
444
-
445
- if (c) {
446
- each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
447
- c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
448
- });
449
- }
450
-
451
- return c;
452
- },
453
-
454
- _createFontSizeSelect : function() {
455
- var t = this, ed = t.editor, c, i = 0, cl = [];
456
-
457
- c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
458
- var cur = c.items[c.selectedIndex];
459
-
460
- if (!v && cur) {
461
- cur = cur.value;
462
-
463
- if (cur['class']) {
464
- ed.formatter.toggle('fontsize_class', {value : cur['class']});
465
- ed.undoManager.add();
466
- ed.nodeChanged();
467
- } else {
468
- ed.execCommand('FontSize', false, cur.fontSize);
469
- }
470
-
471
- return;
472
- }
473
-
474
- if (v['class']) {
475
- ed.focus();
476
- ed.undoManager.add();
477
- ed.formatter.toggle('fontsize_class', {value : v['class']});
478
- ed.undoManager.add();
479
- ed.nodeChanged();
480
- } else
481
- ed.execCommand('FontSize', false, v.fontSize);
482
-
483
- // Fake selection, execCommand will fire a nodeChange and update the selection
484
- c.select(function(sv) {
485
- return v == sv;
486
- });
487
-
488
- if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) {
489
- c.select(null);
490
- }
491
-
492
- return false; // No auto select
493
- }});
494
-
495
- if (c) {
496
- each(t.settings.theme_advanced_font_sizes, function(v, k) {
497
- var fz = v.fontSize;
498
-
499
- if (fz >= 1 && fz <= 7)
500
- fz = t.sizes[parseInt(fz) - 1] + 'pt';
501
-
502
- c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
503
- });
504
- }
505
-
506
- return c;
507
- },
508
-
509
- _createBlockFormats : function() {
510
- var c, fmts = {
511
- p : 'advanced.paragraph',
512
- address : 'advanced.address',
513
- pre : 'advanced.pre',
514
- h1 : 'advanced.h1',
515
- h2 : 'advanced.h2',
516
- h3 : 'advanced.h3',
517
- h4 : 'advanced.h4',
518
- h5 : 'advanced.h5',
519
- h6 : 'advanced.h6',
520
- div : 'advanced.div',
521
- blockquote : 'advanced.blockquote',
522
- code : 'advanced.code',
523
- dt : 'advanced.dt',
524
- dd : 'advanced.dd',
525
- samp : 'advanced.samp'
526
- }, t = this;
527
-
528
- c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {
529
- t.editor.execCommand('FormatBlock', false, v);
530
- return false;
531
- }});
532
-
533
- if (c) {
534
- each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
535
- c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() {
536
- return getPreviewCss(t.editor, {block: v});
537
- }});
538
- });
539
- }
540
-
541
- return c;
542
- },
543
-
544
- _createForeColorMenu : function() {
545
- var c, t = this, s = t.settings, o = {}, v;
546
-
547
- if (s.theme_advanced_more_colors) {
548
- o.more_colors_func = function() {
549
- t._mceColorPicker(0, {
550
- color : c.value,
551
- func : function(co) {
552
- c.setColor(co);
553
- }
554
- });
555
- };
556
- }
557
-
558
- if (v = s.theme_advanced_text_colors)
559
- o.colors = v;
560
-
561
- if (s.theme_advanced_default_foreground_color)
562
- o.default_color = s.theme_advanced_default_foreground_color;
563
-
564
- o.title = 'advanced.forecolor_desc';
565
- o.cmd = 'ForeColor';
566
- o.scope = this;
567
-
568
- c = t.editor.controlManager.createColorSplitButton('forecolor', o);
569
-
570
- return c;
571
- },
572
-
573
- _createBackColorMenu : function() {
574
- var c, t = this, s = t.settings, o = {}, v;
575
-
576
- if (s.theme_advanced_more_colors) {
577
- o.more_colors_func = function() {
578
- t._mceColorPicker(0, {
579
- color : c.value,
580
- func : function(co) {
581
- c.setColor(co);
582
- }
583
- });
584
- };
585
- }
586
-
587
- if (v = s.theme_advanced_background_colors)
588
- o.colors = v;
589
-
590
- if (s.theme_advanced_default_background_color)
591
- o.default_color = s.theme_advanced_default_background_color;
592
-
593
- o.title = 'advanced.backcolor_desc';
594
- o.cmd = 'HiliteColor';
595
- o.scope = this;
596
-
597
- c = t.editor.controlManager.createColorSplitButton('backcolor', o);
598
-
599
- return c;
600
- },
601
-
602
- renderUI : function(o) {
603
- var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
604
-
605
- if (ed.settings) {
606
- ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');
607
- }
608
-
609
- // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
610
- // Maybe actually inherit it from the original textara?
611
- 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) : '')});
612
- DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
613
-
614
- if (!DOM.boxModel)
615
- n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
616
-
617
- n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
618
- n = tb = DOM.add(n, 'tbody');
619
-
620
- switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
621
- case "rowlayout":
622
- ic = t._rowLayout(s, tb, o);
623
- break;
624
-
625
- case "customlayout":
626
- ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
627
- break;
628
-
629
- default:
630
- ic = t._simpleLayout(s, tb, o, p);
631
- }
632
-
633
- n = o.targetNode;
634
-
635
- // Add classes to first and last TRs
636
- nl = sc.rows;
637
- DOM.addClass(nl[0], 'mceFirst');
638
- DOM.addClass(nl[nl.length - 1], 'mceLast');
639
-
640
- // Add classes to first and last TDs
641
- each(DOM.select('tr', tb), function(n) {
642
- DOM.addClass(n.firstChild, 'mceFirst');
643
- DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
644
- });
645
-
646
- if (DOM.get(s.theme_advanced_toolbar_container))
647
- DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
648
- else
649
- DOM.insertAfter(p, n);
650
-
651
- Event.add(ed.id + '_path_row', 'click', function(e) {
652
- e = e.target;
653
-
654
- if (e.nodeName == 'A') {
655
- t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
656
- return false;
657
- }
658
- });
659
- /*
660
- if (DOM.get(ed.id + '_path_row')) {
661
- Event.add(ed.id + '_tbl', 'mouseover', function(e) {
662
- var re;
663
-
664
- e = e.target;
665
-
666
- if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
667
- re = DOM.get(ed.id + '_path_row');
668
- t.lastPath = re.innerHTML;
669
- DOM.setHTML(re, e.parentNode.title);
670
- }
671
- });
672
-
673
- Event.add(ed.id + '_tbl', 'mouseout', function(e) {
674
- if (t.lastPath) {
675
- DOM.setHTML(ed.id + '_path_row', t.lastPath);
676
- t.lastPath = 0;
677
- }
678
- });
679
- }
680
- */
681
-
682
- if (!ed.getParam('accessibility_focus'))
683
- Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
684
-
685
- if (s.theme_advanced_toolbar_location == 'external')
686
- o.deltaHeight = 0;
687
-
688
- t.deltaHeight = o.deltaHeight;
689
- o.targetNode = null;
690
-
691
- ed.onKeyDown.add(function(ed, evt) {
692
- var DOM_VK_F10 = 121, DOM_VK_F11 = 122;
693
-
694
- if (evt.altKey) {
695
- if (evt.keyCode === DOM_VK_F10) {
696
- // Make sure focus is given to toolbar in Safari.
697
- // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame
698
- if (tinymce.isWebKit) {
699
- window.focus();
700
- }
701
- t.toolbarGroup.focus();
702
- return Event.cancel(evt);
703
- } else if (evt.keyCode === DOM_VK_F11) {
704
- DOM.get(ed.id + '_path_row').focus();
705
- return Event.cancel(evt);
706
- }
707
- }
708
- });
709
-
710
- // alt+0 is the UK recommended shortcut for accessing the list of access controls.
711
- ed.addShortcut('alt+0', '', 'mceShortcuts', t);
712
-
713
- return {
714
- iframeContainer : ic,
715
- editorContainer : ed.id + '_parent',
716
- sizeContainer : sc,
717
- deltaHeight : o.deltaHeight
718
- };
719
- },
720
-
721
- getInfo : function() {
722
- return {
723
- longname : 'Advanced theme',
724
- author : 'Moxiecode Systems AB',
725
- authorurl : 'http://tinymce.moxiecode.com',
726
- version : tinymce.majorVersion + "." + tinymce.minorVersion
727
- }
728
- },
729
-
730
- resizeBy : function(dw, dh) {
731
- var e = DOM.get(this.editor.id + '_ifr');
732
-
733
- this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
734
- },
735
-
736
- resizeTo : function(w, h, store) {
737
- var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
738
-
739
- // Boundery fix box
740
- w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
741
- h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
742
- w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
743
- h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
744
-
745
- // Resize iframe and container
746
- DOM.setStyle(e, 'height', '');
747
- DOM.setStyle(ifr, 'height', h);
748
-
749
- if (s.theme_advanced_resize_horizontal) {
750
- DOM.setStyle(e, 'width', '');
751
- DOM.setStyle(ifr, 'width', w);
752
-
753
- // Make sure that the size is never smaller than the over all ui
754
- if (w < e.clientWidth) {
755
- w = e.clientWidth;
756
- DOM.setStyle(ifr, 'width', e.clientWidth);
757
- }
758
- }
759
-
760
- // Store away the size
761
- if (store && s.theme_advanced_resizing_use_cookie) {
762
- Cookie.setHash("TinyMCE_" + ed.id + "_size", {
763
- cw : w,
764
- ch : h
765
- });
766
- }
767
- },
768
-
769
- destroy : function() {
770
- var id = this.editor.id;
771
-
772
- Event.clear(id + '_resize');
773
- Event.clear(id + '_path_row');
774
- Event.clear(id + '_external_close');
775
- },
776
-
777
- // Internal functions
778
-
779
- _simpleLayout : function(s, tb, o, p) {
780
- var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
781
-
782
- if (s.readonly) {
783
- n = DOM.add(tb, 'tr');
784
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
785
- return ic;
786
- }
787
-
788
- // Create toolbar container at top
789
- if (lo == 'top')
790
- t._addToolbars(tb, o);
791
-
792
- // Create external toolbar
793
- if (lo == 'external') {
794
- n = c = DOM.create('div', {style : 'position:relative'});
795
- n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
796
- DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
797
- n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
798
- etb = DOM.add(n, 'tbody');
799
-
800
- if (p.firstChild.className == 'mceOldBoxModel')
801
- p.firstChild.appendChild(c);
802
- else
803
- p.insertBefore(c, p.firstChild);
804
-
805
- t._addToolbars(etb, o);
806
-
807
- ed.onMouseUp.add(function() {
808
- var e = DOM.get(ed.id + '_external');
809
- DOM.show(e);
810
-
811
- DOM.hide(lastExtID);
812
-
813
- var f = Event.add(ed.id + '_external_close', 'click', function() {
814
- DOM.hide(ed.id + '_external');
815
- Event.remove(ed.id + '_external_close', 'click', f);
816
- });
817
-
818
- DOM.show(e);
819
- DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
820
-
821
- // Fixes IE rendering bug
822
- DOM.hide(e);
823
- DOM.show(e);
824
- e.style.filter = '';
825
-
826
- lastExtID = ed.id + '_external';
827
-
828
- e = null;
829
- });
830
- }
831
-
832
- if (sl == 'top')
833
- t._addStatusBar(tb, o);
834
-
835
- // Create iframe container
836
- if (!s.theme_advanced_toolbar_container) {
837
- n = DOM.add(tb, 'tr');
838
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
839
- }
840
-
841
- // Create toolbar container at bottom
842
- if (lo == 'bottom')
843
- t._addToolbars(tb, o);
844
-
845
- if (sl == 'bottom')
846
- t._addStatusBar(tb, o);
847
-
848
- return ic;
849
- },
850
-
851
- _rowLayout : function(s, tb, o) {
852
- var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
853
-
854
- dc = s.theme_advanced_containers_default_class || '';
855
- da = s.theme_advanced_containers_default_align || 'center';
856
-
857
- each(explode(s.theme_advanced_containers || ''), function(c, i) {
858
- var v = s['theme_advanced_container_' + c] || '';
859
-
860
- switch (c.toLowerCase()) {
861
- case 'mceeditor':
862
- n = DOM.add(tb, 'tr');
863
- n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
864
- break;
865
-
866
- case 'mceelementpath':
867
- t._addStatusBar(tb, o);
868
- break;
869
-
870
- default:
871
- a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
872
- a = 'mce' + t._ufirst(a);
873
-
874
- n = DOM.add(DOM.add(tb, 'tr'), 'td', {
875
- 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
876
- });
877
-
878
- to = cf.createToolbar("toolbar" + i);
879
- t._addControls(v, to);
880
- DOM.setHTML(n, to.renderHTML());
881
- o.deltaHeight -= s.theme_advanced_row_height;
882
- }
883
- });
884
-
885
- return ic;
886
- },
887
-
888
- _addControls : function(v, tb) {
889
- var t = this, s = t.settings, di, cf = t.editor.controlManager;
890
-
891
- if (s.theme_advanced_disable && !t._disabled) {
892
- di = {};
893
-
894
- each(explode(s.theme_advanced_disable), function(v) {
895
- di[v] = 1;
896
- });
897
-
898
- t._disabled = di;
899
- } else
900
- di = t._disabled;
901
-
902
- each(explode(v), function(n) {
903
- var c;
904
-
905
- if (di && di[n])
906
- return;
907
-
908
- // Compatiblity with 2.x
909
- if (n == 'tablecontrols') {
910
- each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
911
- n = t.createControl(n, cf);
912
-
913
- if (n)
914
- tb.add(n);
915
- });
916
-
917
- return;
918
- }
919
-
920
- c = t.createControl(n, cf);
921
-
922
- if (c)
923
- tb.add(c);
924
- });
925
- },
926
-
927
- _addToolbars : function(c, o) {
928
- var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
929
-
930
- toolbarGroup = cf.createToolbarGroup('toolbargroup', {
931
- 'name': ed.getLang('advanced.toolbar'),
932
- 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')
933
- });
934
-
935
- t.toolbarGroup = toolbarGroup;
936
-
937
- a = s.theme_advanced_toolbar_align.toLowerCase();
938
- a = 'mce' + t._ufirst(a);
939
-
940
- n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
941
-
942
- // Create toolbar and add the controls
943
- for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
944
- tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
945
-
946
- if (s['theme_advanced_buttons' + i + '_add'])
947
- v += ',' + s['theme_advanced_buttons' + i + '_add'];
948
-
949
- if (s['theme_advanced_buttons' + i + '_add_before'])
950
- v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
951
-
952
- t._addControls(v, tb);
953
- toolbarGroup.add(tb);
954
-
955
- o.deltaHeight -= s.theme_advanced_row_height;
956
- }
957
- h.push(toolbarGroup.renderHTML());
958
- h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
959
- DOM.setHTML(n, h.join(''));
960
- },
961
-
962
- _addStatusBar : function(tb, o) {
963
- var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
964
-
965
- n = DOM.add(tb, 'tr');
966
- n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
967
- n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
968
- if (s.theme_advanced_path) {
969
- DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
970
- DOM.add(n, 'span', {}, ': ');
971
- } else {
972
- DOM.add(n, 'span', {}, '&#160;');
973
- }
974
-
975
-
976
- if (s.theme_advanced_resizing) {
977
- DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
978
-
979
- if (s.theme_advanced_resizing_use_cookie) {
980
- ed.onPostRender.add(function() {
981
- var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
982
-
983
- if (!o)
984
- return;
985
-
986
- t.resizeTo(o.cw, o.ch);
987
- });
988
- }
989
-
990
- ed.onPostRender.add(function() {
991
- Event.add(ed.id + '_resize', 'click', function(e) {
992
- e.preventDefault();
993
- });
994
-
995
- Event.add(ed.id + '_resize', 'mousedown', function(e) {
996
- var mouseMoveHandler1, mouseMoveHandler2,
997
- mouseUpHandler1, mouseUpHandler2,
998
- startX, startY, startWidth, startHeight, width, height, ifrElm;
999
-
1000
- function resizeOnMove(e) {
1001
- e.preventDefault();
1002
-
1003
- width = startWidth + (e.screenX - startX);
1004
- height = startHeight + (e.screenY - startY);
1005
-
1006
- t.resizeTo(width, height);
1007
- };
1008
-
1009
- function endResize(e) {
1010
- // Stop listening
1011
- Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
1012
- Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
1013
- Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
1014
- Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
1015
-
1016
- width = startWidth + (e.screenX - startX);
1017
- height = startHeight + (e.screenY - startY);
1018
- t.resizeTo(width, height, true);
1019
- };
1020
-
1021
- e.preventDefault();
1022
-
1023
- // Get the current rect size
1024
- startX = e.screenX;
1025
- startY = e.screenY;
1026
- ifrElm = DOM.get(t.editor.id + '_ifr');
1027
- startWidth = width = ifrElm.clientWidth;
1028
- startHeight = height = ifrElm.clientHeight;
1029
-
1030
- // Register envent handlers
1031
- mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
1032
- mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
1033
- mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
1034
- mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
1035
- });
1036
- });
1037
- }
1038
-
1039
- o.deltaHeight -= 21;
1040
- n = tb = null;
1041
- },
1042
-
1043
- _updateUndoStatus : function(ed) {
1044
- var cm = ed.controlManager, um = ed.undoManager;
1045
-
1046
- cm.setDisabled('undo', !um.hasUndo() && !um.typing);
1047
- cm.setDisabled('redo', !um.hasRedo());
1048
- },
1049
-
1050
- _nodeChanged : function(ed, cm, n, co, ob) {
1051
- var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;
1052
-
1053
- tinymce.each(t.stateControls, function(c) {
1054
- cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
1055
- });
1056
-
1057
- function getParent(name) {
1058
- var i, parents = ob.parents, func = name;
1059
-
1060
- if (typeof(name) == 'string') {
1061
- func = function(node) {
1062
- return node.nodeName == name;
1063
- };
1064
- }
1065
-
1066
- for (i = 0; i < parents.length; i++) {
1067
- if (func(parents[i]))
1068
- return parents[i];
1069
- }
1070
- };
1071
-
1072
- cm.setActive('visualaid', ed.hasVisual);
1073
- t._updateUndoStatus(ed);
1074
- cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
1075
-
1076
- p = getParent('A');
1077
- if (c = cm.get('link')) {
1078
- if (!p || !p.name) {
1079
- c.setDisabled(!p && co);
1080
- c.setActive(!!p);
1081
- }
1082
- }
1083
-
1084
- if (c = cm.get('unlink')) {
1085
- c.setDisabled(!p && co);
1086
- c.setActive(!!p && !p.name);
1087
- }
1088
-
1089
- if (c = cm.get('anchor')) {
1090
- c.setActive(!co && !!p && p.name);
1091
- }
1092
-
1093
- p = getParent('IMG');
1094
- if (c = cm.get('image'))
1095
- c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
1096
-
1097
- if (c = cm.get('styleselect')) {
1098
- t._importClasses();
1099
-
1100
- formatNames = [];
1101
- each(c.items, function(item) {
1102
- formatNames.push(item.value);
1103
- });
1104
-
1105
- matches = ed.formatter.matchAll(formatNames);
1106
- c.select(matches[0]);
1107
- tinymce.each(matches, function(match, index) {
1108
- if (index > 0) {
1109
- c.mark(match);
1110
- }
1111
- });
1112
- }
1113
-
1114
- if (c = cm.get('formatselect')) {
1115
- p = getParent(ed.dom.isBlock);
1116
-
1117
- if (p)
1118
- c.select(p.nodeName.toLowerCase());
1119
- }
1120
-
1121
- // Find out current fontSize, fontFamily and fontClass
1122
- getParent(function(n) {
1123
- if (n.nodeName === 'SPAN') {
1124
- if (!cl && n.className)
1125
- cl = n.className;
1126
- }
1127
-
1128
- if (ed.dom.is(n, s.theme_advanced_font_selector)) {
1129
- if (!fz && n.style.fontSize)
1130
- fz = n.style.fontSize;
1131
-
1132
- if (!fn && n.style.fontFamily)
1133
- fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
1134
-
1135
- if (!fc && n.style.color)
1136
- fc = n.style.color;
1137
-
1138
- if (!bc && n.style.backgroundColor)
1139
- bc = n.style.backgroundColor;
1140
- }
1141
-
1142
- return false;
1143
- });
1144
-
1145
- if (c = cm.get('fontselect')) {
1146
- c.select(function(v) {
1147
- return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
1148
- });
1149
- }
1150
-
1151
- // Select font size
1152
- if (c = cm.get('fontsizeselect')) {
1153
- // Use computed style
1154
- if (s.theme_advanced_runtime_fontsize && !fz && !cl)
1155
- fz = ed.dom.getStyle(n, 'fontSize', true);
1156
-
1157
- c.select(function(v) {
1158
- if (v.fontSize && v.fontSize === fz)
1159
- return true;
1160
-
1161
- if (v['class'] && v['class'] === cl)
1162
- return true;
1163
- });
1164
- }
1165
-
1166
- if (s.theme_advanced_show_current_color) {
1167
- function updateColor(controlId, color) {
1168
- if (c = cm.get(controlId)) {
1169
- if (!color)
1170
- color = c.settings.default_color;
1171
- if (color !== c.value) {
1172
- c.displayColor(color);
1173
- }
1174
- }
1175
- }
1176
- updateColor('forecolor', fc);
1177
- updateColor('backcolor', bc);
1178
- }
1179
-
1180
- if (s.theme_advanced_show_current_color) {
1181
- function updateColor(controlId, color) {
1182
- if (c = cm.get(controlId)) {
1183
- if (!color)
1184
- color = c.settings.default_color;
1185
- if (color !== c.value) {
1186
- c.displayColor(color);
1187
- }
1188
- }
1189
- };
1190
-
1191
- updateColor('forecolor', fc);
1192
- updateColor('backcolor', bc);
1193
- }
1194
-
1195
- if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
1196
- p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
1197
-
1198
- if (t.statusKeyboardNavigation) {
1199
- t.statusKeyboardNavigation.destroy();
1200
- t.statusKeyboardNavigation = null;
1201
- }
1202
-
1203
- DOM.setHTML(p, '');
1204
-
1205
- getParent(function(n) {
1206
- var na = n.nodeName.toLowerCase(), u, pi, ti = '';
1207
-
1208
- // Ignore non element and bogus/hidden elements
1209
- if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))
1210
- return;
1211
-
1212
- // Handle prefix
1213
- if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName)
1214
- na = n.scopeName + ':' + na;
1215
-
1216
- // Remove internal prefix
1217
- na = na.replace(/mce\:/g, '');
1218
-
1219
- // Handle node name
1220
- switch (na) {
1221
- case 'b':
1222
- na = 'strong';
1223
- break;
1224
-
1225
- case 'i':
1226
- na = 'em';
1227
- break;
1228
-
1229
- case 'img':
1230
- if (v = DOM.getAttrib(n, 'src'))
1231
- ti += 'src: ' + v + ' ';
1232
-
1233
- break;
1234
-
1235
- case 'a':
1236
- if (v = DOM.getAttrib(n, 'name')) {
1237
- ti += 'name: ' + v + ' ';
1238
- na += '#' + v;
1239
- }
1240
-
1241
- if (v = DOM.getAttrib(n, 'href'))
1242
- ti += 'href: ' + v + ' ';
1243
-
1244
- break;
1245
-
1246
- case 'font':
1247
- if (v = DOM.getAttrib(n, 'face'))
1248
- ti += 'font: ' + v + ' ';
1249
-
1250
- if (v = DOM.getAttrib(n, 'size'))
1251
- ti += 'size: ' + v + ' ';
1252
-
1253
- if (v = DOM.getAttrib(n, 'color'))
1254
- ti += 'color: ' + v + ' ';
1255
-
1256
- break;
1257
-
1258
- case 'span':
1259
- if (v = DOM.getAttrib(n, 'style'))
1260
- ti += 'style: ' + v + ' ';
1261
-
1262
- break;
1263
- }
1264
-
1265
- if (v = DOM.getAttrib(n, 'id'))
1266
- ti += 'id: ' + v + ' ';
1267
-
1268
- if (v = n.className) {
1269
- v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
1270
-
1271
- if (v) {
1272
- ti += 'class: ' + v + ' ';
1273
-
1274
- if (ed.dom.isBlock(n) || na == 'img' || na == 'span')
1275
- na += '.' + v;
1276
- }
1277
- }
1278
-
1279
- na = na.replace(/(html:)/g, '');
1280
- na = {name : na, node : n, title : ti};
1281
- t.onResolveName.dispatch(t, na);
1282
- ti = na.title;
1283
- na = na.name;
1284
-
1285
- //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
1286
- pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
1287
-
1288
- if (p.hasChildNodes()) {
1289
- p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);
1290
- p.insertBefore(pi, p.firstChild);
1291
- } else
1292
- p.appendChild(pi);
1293
- }, ed.getBody());
1294
-
1295
- if (DOM.select('a', p).length > 0) {
1296
- t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({
1297
- root: ed.id + "_path_row",
1298
- items: DOM.select('a', p),
1299
- excludeFromTabOrder: true,
1300
- onCancel: function() {
1301
- ed.focus();
1302
- }
1303
- }, DOM);
1304
- }
1305
- }
1306
- },
1307
-
1308
- // Commands gets called by execCommand
1309
-
1310
- _sel : function(v) {
1311
- this.editor.execCommand('mceSelectNodeDepth', false, v);
1312
- },
1313
-
1314
- _mceInsertAnchor : function(ui, v) {
1315
- var ed = this.editor;
1316
-
1317
- ed.windowManager.open({
1318
- url : this.url + '/anchor.htm',
1319
- width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
1320
- height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
1321
- inline : true
1322
- }, {
1323
- theme_url : this.url
1324
- });
1325
- },
1326
-
1327
- _mceCharMap : function() {
1328
- var ed = this.editor;
1329
-
1330
- ed.windowManager.open({
1331
- url : this.url + '/charmap.htm',
1332
- width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
1333
- height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
1334
- inline : true
1335
- }, {
1336
- theme_url : this.url
1337
- });
1338
- },
1339
-
1340
- _mceHelp : function() {
1341
- var ed = this.editor;
1342
-
1343
- ed.windowManager.open({
1344
- url : this.url + '/about.htm',
1345
- width : 480,
1346
- height : 380,
1347
- inline : true
1348
- }, {
1349
- theme_url : this.url
1350
- });
1351
- },
1352
-
1353
- _mceShortcuts : function() {
1354
- var ed = this.editor;
1355
- ed.windowManager.open({
1356
- url: this.url + '/shortcuts.htm',
1357
- width: 480,
1358
- height: 380,
1359
- inline: true
1360
- }, {
1361
- theme_url: this.url
1362
- });
1363
- },
1364
-
1365
- _mceColorPicker : function(u, v) {
1366
- var ed = this.editor;
1367
-
1368
- v = v || {};
1369
-
1370
- ed.windowManager.open({
1371
- url : this.url + '/color_picker.htm',
1372
- width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
1373
- height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
1374
- close_previous : false,
1375
- inline : true
1376
- }, {
1377
- input_color : v.color,
1378
- func : v.func,
1379
- theme_url : this.url
1380
- });
1381
- },
1382
-
1383
- _mceCodeEditor : function(ui, val) {
1384
- var ed = this.editor;
1385
-
1386
- ed.windowManager.open({
1387
- url : this.url + '/source_editor.htm',
1388
- width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
1389
- height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
1390
- inline : true,
1391
- resizable : true,
1392
- maximizable : true
1393
- }, {
1394
- theme_url : this.url
1395
- });
1396
- },
1397
-
1398
- _mceImage : function(ui, val) {
1399
- var ed = this.editor;
1400
-
1401
- // Internal image object like a flash placeholder
1402
- if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
1403
- return;
1404
-
1405
- ed.windowManager.open({
1406
- url : this.url + '/image.htm',
1407
- width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
1408
- height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
1409
- inline : true
1410
- }, {
1411
- theme_url : this.url
1412
- });
1413
- },
1414
-
1415
- _mceLink : function(ui, val) {
1416
- var ed = this.editor;
1417
-
1418
- ed.windowManager.open({
1419
- url : this.url + '/link.htm',
1420
- width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
1421
- height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
1422
- inline : true
1423
- }, {
1424
- theme_url : this.url
1425
- });
1426
- },
1427
-
1428
- _mceNewDocument : function() {
1429
- var ed = this.editor;
1430
-
1431
- ed.windowManager.confirm('advanced.newdocument', function(s) {
1432
- if (s)
1433
- ed.execCommand('mceSetContent', false, '');
1434
- });
1435
- },
1436
-
1437
- _mceForeColor : function() {
1438
- var t = this;
1439
-
1440
- this._mceColorPicker(0, {
1441
- color: t.fgColor,
1442
- func : function(co) {
1443
- t.fgColor = co;
1444
- t.editor.execCommand('ForeColor', false, co);
1445
- }
1446
- });
1447
- },
1448
-
1449
- _mceBackColor : function() {
1450
- var t = this;
1451
-
1452
- this._mceColorPicker(0, {
1453
- color: t.bgColor,
1454
- func : function(co) {
1455
- t.bgColor = co;
1456
- t.editor.execCommand('HiliteColor', false, co);
1457
- }
1458
- });
1459
- },
1460
-
1461
- _ufirst : function(s) {
1462
- return s.substring(0, 1).toUpperCase() + s.substring(1);
1463
- }
1464
- });
1465
-
1466
- tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
1467
- }(tinymce));