Lib_Js_TinyMCE - Version 3.2.5.0

Version Notes

3.2.5.0

Download this release

Release Info

Developer Magento Core Team
Extension Lib_Js_TinyMCE
Version 3.2.5.0
Comparing to
See all releases


Code changes from version 1.0.18800 to 3.2.5.0

Files changed (174) hide show
  1. js/tiny_mce/classes/AddOnManager.js +95 -0
  2. js/tiny_mce/classes/CommandManager.js +54 -0
  3. js/tiny_mce/classes/ControlManager.js +489 -0
  4. js/tiny_mce/classes/Developer.js +91 -0
  5. js/tiny_mce/classes/Editor.js +2295 -0
  6. js/tiny_mce/classes/EditorCommands.js +934 -0
  7. js/tiny_mce/classes/EditorManager.js +453 -0
  8. js/tiny_mce/classes/ForceBlocks.js +644 -0
  9. js/tiny_mce/classes/Popup.js +412 -0
  10. js/tiny_mce/classes/UndoManager.js +183 -0
  11. js/tiny_mce/classes/WindowManager.js +169 -0
  12. js/tiny_mce/classes/adapter/jquery/adapter.js +240 -0
  13. js/tiny_mce/classes/adapter/jquery/jquery.tinymce.js +179 -0
  14. js/tiny_mce/classes/adapter/prototype/adapter.js +38 -0
  15. js/tiny_mce/classes/commands/BlockQuote.js +135 -0
  16. js/tiny_mce/classes/commands/CutCopyPaste.js +24 -0
  17. js/tiny_mce/classes/commands/InsertHorizontalRule.js +15 -0
  18. js/tiny_mce/classes/commands/RemoveFormat.js +173 -0
  19. js/tiny_mce/classes/commands/UndoRedo.js +38 -0
  20. js/tiny_mce/classes/dom/DOMUtils.js +1823 -0
  21. js/tiny_mce/classes/dom/Element.js +199 -0
  22. js/tiny_mce/classes/dom/EventUtils.js +349 -0
  23. js/tiny_mce/classes/dom/Range.js +721 -0
  24. js/tiny_mce/classes/dom/ScriptLoader.js +351 -0
  25. js/tiny_mce/classes/dom/Selection.js +747 -0
  26. js/tiny_mce/classes/dom/Serializer.js +979 -0
  27. js/tiny_mce/classes/dom/Sizzle.js +975 -0
  28. js/tiny_mce/classes/dom/StringWriter.js +200 -0
  29. js/tiny_mce/classes/dom/TridentSelection.js +273 -0
  30. js/tiny_mce/classes/dom/XMLWriter.js +155 -0
  31. js/tiny_mce/classes/firebug/firebug-lite.js +2518 -0
  32. js/tiny_mce/classes/tinymce.js +549 -0
  33. js/tiny_mce/classes/ui/Button.js +68 -0
  34. js/tiny_mce/classes/ui/ColorSplitButton.js +212 -0
  35. js/tiny_mce/classes/ui/Container.js +56 -0
  36. js/tiny_mce/classes/ui/Control.js +182 -0
  37. js/tiny_mce/classes/ui/DropMenu.js +397 -0
  38. js/tiny_mce/classes/ui/ListBox.js +320 -0
  39. js/tiny_mce/classes/ui/Menu.js +175 -0
  40. js/tiny_mce/classes/ui/MenuButton.js +128 -0
  41. js/tiny_mce/classes/ui/MenuItem.js +69 -0
  42. js/tiny_mce/classes/ui/NativeListBox.js +198 -0
  43. js/tiny_mce/classes/ui/Separator.js +34 -0
  44. js/tiny_mce/classes/ui/SplitButton.js +99 -0
  45. js/tiny_mce/classes/ui/Toolbar.js +86 -0
  46. js/tiny_mce/classes/util/Cookie.js +126 -0
  47. js/tiny_mce/classes/util/Dispatcher.js +101 -0
  48. js/tiny_mce/classes/util/JSON.js +81 -0
  49. js/tiny_mce/classes/util/JSONP.js +25 -0
  50. js/tiny_mce/classes/util/JSONRequest.js +87 -0
  51. js/tiny_mce/classes/util/URI.js +289 -0
  52. js/tiny_mce/classes/util/XHR.js +80 -0
  53. js/tiny_mce/classes/xml/Parser.js +126 -0
  54. js/tiny_mce/jquery.tinymce.js +1 -0
  55. js/tiny_mce/langs/en.js +154 -41
  56. js/tiny_mce/langs/readme.txt +0 -9
  57. js/tiny_mce/plugins/advhr/css/advhr.css +5 -23
  58. js/tiny_mce/plugins/advhr/editor_plugin.js +1 -1
  59. js/tiny_mce/plugins/advhr/editor_plugin_src.js +47 -83
  60. js/tiny_mce/plugins/advhr/images/advhr.gif +0 -0
  61. js/tiny_mce/plugins/advhr/js/rule.js +43 -0
  62. js/tiny_mce/plugins/advhr/jscripts/rule.js +0 -43
  63. js/tiny_mce/plugins/advhr/langs/en.js +0 -8
  64. js/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
  65. js/tiny_mce/plugins/advhr/readme.txt +0 -1
  66. js/tiny_mce/plugins/advhr/rule.htm +16 -15
  67. js/tiny_mce/plugins/advimage/css/advimage.css +13 -66
  68. js/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
  69. js/tiny_mce/plugins/advimage/editor_plugin_src.js +40 -141
  70. js/tiny_mce/plugins/advimage/image.htm +74 -78
  71. js/tiny_mce/plugins/advimage/{images → img}/sample.gif +0 -0
  72. js/tiny_mce/plugins/advimage/js/image.js +443 -0
  73. js/tiny_mce/plugins/advimage/jscripts/functions.js +0 -538
  74. js/tiny_mce/plugins/advimage/langs/en.js +0 -27
  75. js/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
  76. js/tiny_mce/plugins/advimage/readme.txt +0 -1
  77. js/tiny_mce/plugins/advlink/css/advlink.css +8 -35
  78. js/tiny_mce/plugins/advlink/editor_plugin.js +1 -1
  79. js/tiny_mce/plugins/advlink/editor_plugin_src.js +51 -76
  80. js/tiny_mce/plugins/advlink/{jscripts/functions.js → js/advlink.js} +96 -155
  81. js/tiny_mce/plugins/advlink/langs/en.js +0 -46
  82. js/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
  83. js/tiny_mce/plugins/advlink/link.htm +63 -63
  84. js/tiny_mce/plugins/advlink/readme.txt +0 -1
  85. js/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  86. js/tiny_mce/plugins/autoresize/editor_plugin_src.js +111 -0
  87. js/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
  88. js/tiny_mce/plugins/autosave/editor_plugin_src.js +36 -31
  89. js/tiny_mce/plugins/autosave/langs/en.js +0 -5
  90. js/tiny_mce/plugins/autosave/readme.txt +0 -1
  91. js/tiny_mce/plugins/bbcode/editor_plugin.js +1 -1
  92. js/tiny_mce/plugins/bbcode/editor_plugin_src.js +103 -88
  93. js/tiny_mce/plugins/cleanup/editor_plugin.js +0 -0
  94. js/tiny_mce/plugins/cleanup/editor_plugin_src.js +0 -10
  95. js/tiny_mce/plugins/cleanup/readme.txt +0 -1
  96. js/tiny_mce/plugins/compat2x/editor_plugin.js +1 -0
  97. js/tiny_mce/plugins/compat2x/editor_plugin_src.js +616 -0
  98. js/tiny_mce/plugins/contextmenu/css/contextmenu.css +0 -74
  99. js/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  100. js/tiny_mce/plugins/contextmenu/editor_plugin_src.js +72 -337
  101. js/tiny_mce/plugins/contextmenu/readme.txt +0 -1
  102. js/tiny_mce/plugins/devkit/css/devkit.css +0 -117
  103. js/tiny_mce/plugins/devkit/css/devkit_ui.css +0 -15
  104. js/tiny_mce/plugins/devkit/devkit.htm +0 -140
  105. js/tiny_mce/plugins/devkit/editor_plugin.js +0 -1
  106. js/tiny_mce/plugins/devkit/editor_plugin_src.js +0 -325
  107. js/tiny_mce/plugins/devkit/images/flip_down.gif +0 -0
  108. js/tiny_mce/plugins/devkit/images/flip_up.gif +0 -0
  109. js/tiny_mce/plugins/devkit/jscripts/devkit.js +0 -331
  110. js/tiny_mce/plugins/devkit/jscripts/diff.js +0 -1192
  111. js/tiny_mce/plugins/devkit/langs/en.js +0 -23
  112. js/tiny_mce/plugins/directionality/editor_plugin.js +1 -1
  113. js/tiny_mce/plugins/directionality/editor_plugin_src.js +72 -83
  114. js/tiny_mce/plugins/directionality/images/ltr.gif +0 -0
  115. js/tiny_mce/plugins/directionality/images/rtl.gif +0 -0
  116. js/tiny_mce/plugins/directionality/langs/en.js +0 -6
  117. js/tiny_mce/plugins/directionality/readme.txt +0 -1
  118. js/tiny_mce/plugins/emotions/editor_plugin.js +1 -1
  119. js/tiny_mce/plugins/emotions/editor_plugin_src.js +33 -56
  120. js/tiny_mce/plugins/emotions/emotions.htm +22 -22
  121. js/tiny_mce/plugins/emotions/images/emotions.gif +0 -0
  122. js/tiny_mce/plugins/emotions/images/readme.txt +0 -2
  123. js/tiny_mce/plugins/emotions/{images → img}/smiley-cool.gif +0 -0
  124. js/tiny_mce/plugins/emotions/{images → img}/smiley-cry.gif +0 -0
  125. js/tiny_mce/plugins/emotions/{images → img}/smiley-embarassed.gif +0 -0
  126. js/tiny_mce/plugins/emotions/{images → img}/smiley-foot-in-mouth.gif +0 -0
  127. js/tiny_mce/plugins/emotions/{images → img}/smiley-frown.gif +0 -0
  128. js/tiny_mce/plugins/emotions/{images → img}/smiley-innocent.gif +0 -0
  129. js/tiny_mce/plugins/emotions/{images → img}/smiley-kiss.gif +0 -0
  130. js/tiny_mce/plugins/emotions/{images → img}/smiley-laughing.gif +0 -0
  131. js/tiny_mce/plugins/emotions/{images → img}/smiley-money-mouth.gif +0 -0
  132. js/tiny_mce/plugins/emotions/{images → img}/smiley-sealed.gif +0 -0
  133. js/tiny_mce/plugins/emotions/{images → img}/smiley-smile.gif +0 -0
  134. js/tiny_mce/plugins/emotions/{images → img}/smiley-surprised.gif +0 -0
  135. js/tiny_mce/plugins/emotions/{images → img}/smiley-tongue-out.gif +0 -0
  136. js/tiny_mce/plugins/emotions/{images → img}/smiley-undecided.gif +0 -0
  137. js/tiny_mce/plugins/emotions/{images → img}/smiley-wink.gif +0 -0
  138. js/tiny_mce/plugins/emotions/{images → img}/smiley-yell.gif +0 -0
  139. js/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  140. js/tiny_mce/plugins/emotions/jscripts/functions.js +0 -21
  141. js/tiny_mce/plugins/emotions/langs/en.js +0 -22
  142. js/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  143. js/tiny_mce/plugins/emotions/readme.txt +0 -1
  144. js/tiny_mce/plugins/example/dialog.htm +27 -0
  145. js/tiny_mce/plugins/example/editor_plugin.js +1 -0
  146. js/tiny_mce/plugins/example/editor_plugin_src.js +81 -0
  147. js/tiny_mce/plugins/example/img/example.gif +0 -0
  148. js/tiny_mce/plugins/example/js/dialog.js +19 -0
  149. js/tiny_mce/plugins/example/langs/en.js +3 -0
  150. js/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  151. js/tiny_mce/plugins/flash/css/content.css +0 -7
  152. js/tiny_mce/plugins/flash/css/flash.css +0 -11
  153. js/tiny_mce/plugins/flash/editor_plugin.js +0 -1
  154. js/tiny_mce/plugins/flash/editor_plugin_src.js +0 -285
  155. js/tiny_mce/plugins/flash/flash.htm +0 -70
  156. js/tiny_mce/plugins/flash/jscripts/flash.js +0 -107
  157. js/tiny_mce/plugins/flash/langs/en.js +0 -11
  158. js/tiny_mce/plugins/flash/readme.txt +0 -1
  159. js/tiny_mce/plugins/fullpage/blank.htm +0 -9
  160. js/tiny_mce/plugins/fullpage/css/fullpage.css +7 -1
  161. js/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  162. js/tiny_mce/plugins/fullpage/editor_plugin_src.js +120 -209
  163. js/tiny_mce/plugins/fullpage/fullpage.htm +117 -118
  164. js/tiny_mce/plugins/fullpage/images/add.gif +0 -0
  165. js/tiny_mce/plugins/fullpage/images/fullpage.gif +0 -0
  166. js/tiny_mce/plugins/fullpage/images/move_down.gif +0 -0
  167. js/tiny_mce/plugins/fullpage/images/move_up.gif +0 -0
  168. js/tiny_mce/plugins/fullpage/images/remove.gif +0 -0
  169. js/tiny_mce/plugins/fullpage/{jscripts → js}/fullpage.js +119 -238
  170. js/tiny_mce/plugins/fullpage/langs/en.js +0 -92
  171. js/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  172. js/tiny_mce/plugins/fullscreen/css/page.css +0 -21
  173. js/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -1
  174. js/tiny_mce/plugins/fullscreen/editor_plugin_src.js +2 -25
js/tiny_mce/classes/AddOnManager.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * $Id: PluginManager.js 352 2007-11-05 17:03:49Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ (function(tinymce) {
9
+ var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
10
+
11
+ /**#@+
12
+ * @class This class handles the loading of themes/plugins or other add-ons and their language packs.
13
+ * @member tinymce.AddOnManager
14
+ */
15
+ tinymce.create('tinymce.AddOnManager', {
16
+ items : [],
17
+ urls : {},
18
+ lookup : {},
19
+ onAdd : new Dispatcher(this),
20
+
21
+ /**#@+
22
+ * @method
23
+ */
24
+
25
+ /**
26
+ * Returns the specified add on by the short name.
27
+ *
28
+ * @param {String} n Add-on to look for.
29
+ * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.
30
+ */
31
+ get : function(n) {
32
+ return this.lookup[n];
33
+ },
34
+
35
+ /**
36
+ * Loads a language pack for the specified add-on.
37
+ *
38
+ * @param {String} n Short name of the add-on.
39
+ */
40
+ requireLangPack : function(n) {
41
+ var u, s = tinymce.EditorManager.settings;
42
+
43
+ if (s && s.language) {
44
+ u = this.urls[n] + '/langs/' + s.language + '.js';
45
+
46
+ if (!tinymce.dom.Event.domLoaded && !s.strict_mode)
47
+ tinymce.ScriptLoader.load(u);
48
+ else
49
+ tinymce.ScriptLoader.add(u);
50
+ }
51
+ },
52
+
53
+ /**
54
+ * Adds a instance of the add-on by it's short name.
55
+ *
56
+ * @param {String} id Short name/id for the add-on.
57
+ * @param {tinymce.Theme/tinymce.Plugin} o Theme or plugin to add.
58
+ * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
59
+ */
60
+ add : function(id, o) {
61
+ this.items.push(o);
62
+ this.lookup[id] = o;
63
+ this.onAdd.dispatch(this, id, o);
64
+
65
+ return o;
66
+ },
67
+
68
+ /**
69
+ * Loads an add-on from a specific url.
70
+ *
71
+ * @param {String} n Short name of the add-on that gets loaded.
72
+ * @param {String} u URL to the add-on that will get loaded.
73
+ * @param {function} cb Optional callback to execute ones the add-on is loaded.
74
+ * @param {Object} s Optional scope to execute the callback in.
75
+ */
76
+ load : function(n, u, cb, s) {
77
+ var t = this;
78
+
79
+ if (t.urls[n])
80
+ return;
81
+
82
+ if (u.indexOf('/') != 0 && u.indexOf('://') == -1)
83
+ u = tinymce.baseURL + '/' + u;
84
+
85
+ t.urls[n] = u.substring(0, u.lastIndexOf('/'));
86
+ tinymce.ScriptLoader.add(u, cb, s);
87
+ }
88
+
89
+ /**#@-*/
90
+ });
91
+
92
+ // Create plugin and theme managers
93
+ tinymce.PluginManager = new tinymce.AddOnManager();
94
+ tinymce.ThemeManager = new tinymce.AddOnManager();
95
+ }(tinymce));
js/tiny_mce/classes/CommandManager.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * $Id: ControlManager.js 999 2009-02-10 17:42:58Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ (function(tinymce) {
9
+ tinymce.CommandManager = function() {
10
+ var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};
11
+
12
+ function add(collection, cmd, func, scope) {
13
+ if (typeof(cmd) == 'string')
14
+ cmd = [cmd];
15
+
16
+ tinymce.each(cmd, function(cmd) {
17
+ collection[cmd.toLowerCase()] = {func : func, scope : scope};
18
+ });
19
+ };
20
+
21
+ tinymce.extend(this, {
22
+ add : function(cmd, func, scope) {
23
+ add(execCommands, cmd, func, scope);
24
+ },
25
+
26
+ addQueryStateHandler : function(cmd, func, scope) {
27
+ add(queryStateCommands, cmd, func, scope);
28
+ },
29
+
30
+ addQueryValueHandler : function(cmd, func, scope) {
31
+ add(queryValueCommands, cmd, func, scope);
32
+ },
33
+
34
+ execCommand : function(scope, cmd, ui, value, args) {
35
+ if (cmd = execCommands[cmd.toLowerCase()]) {
36
+ if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)
37
+ return true;
38
+ }
39
+ },
40
+
41
+ queryCommandValue : function() {
42
+ if (cmd = queryValueCommands[cmd.toLowerCase()])
43
+ return cmd.func.call(scope || cmd.scope, ui, value, args);
44
+ },
45
+
46
+ queryCommandState : function() {
47
+ if (cmd = queryStateCommands[cmd.toLowerCase()])
48
+ return cmd.func.call(scope || cmd.scope, ui, value, args);
49
+ }
50
+ });
51
+ };
52
+
53
+ tinymce.GlobalCommands = new tinymce.CommandManager();
54
+ })(tinymce);
js/tiny_mce/classes/ControlManager.js ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * $Id: ControlManager.js 1150 2009-06-01 11:50:46Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ (function(tinymce) {
9
+ // Shorten names
10
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
11
+
12
+ /**#@+
13
+ * @class This class is responsible for managing UI control instances. It's both a factory and a collection for the controls.
14
+ * @member tinymce.ControlManager
15
+ */
16
+ tinymce.create('tinymce.ControlManager', {
17
+ /**
18
+ * Constructs a new control manager instance.
19
+ * Consult the Wiki for more details on this class.
20
+ *
21
+ * @constructor
22
+ * @param {tinymce.Editor} ed TinyMCE editor instance to add the control to.
23
+ * @param {Object} s Optional settings object for the control manager.
24
+ */
25
+ ControlManager : function(ed, s) {
26
+ var t = this, i;
27
+
28
+ s = s || {};
29
+ t.editor = ed;
30
+ t.controls = {};
31
+ t.onAdd = new tinymce.util.Dispatcher(t);
32
+ t.onPostRender = new tinymce.util.Dispatcher(t);
33
+ t.prefix = s.prefix || ed.id + '_';
34
+ t._cls = {};
35
+
36
+ t.onPostRender.add(function() {
37
+ each(t.controls, function(c) {
38
+ c.postRender();
39
+ });
40
+ });
41
+ },
42
+
43
+ /**#@+
44
+ * @method
45
+ */
46
+
47
+ /**
48
+ * Returns a control by id or undefined it it wasn't found.
49
+ *
50
+ * @param {String} id Control instance name.
51
+ * @return {tinymce.ui.Control} Control instance or undefined.
52
+ */
53
+ get : function(id) {
54
+ return this.controls[this.prefix + id] || this.controls[id];
55
+ },
56
+
57
+ /**
58
+ * Sets the active state of a control by id.
59
+ *
60
+ * @param {String} id Control id to set state on.
61
+ * @param {bool} s Active state true/false.
62
+ * @return {tinymce.ui.Control} Control instance that got activated or null if it wasn't found.
63
+ */
64
+ setActive : function(id, s) {
65
+ var c = null;
66
+
67
+ if (c = this.get(id))
68
+ c.setActive(s);
69
+
70
+ return c;
71
+ },
72
+
73
+ /**
74
+ * Sets the dsiabled state of a control by id.
75
+ *
76
+ * @param {String} id Control id to set state on.
77
+ * @param {bool} s Active state true/false.
78
+ * @return {tinymce.ui.Control} Control instance that got disabled or null if it wasn't found.
79
+ */
80
+ setDisabled : function(id, s) {
81
+ var c = null;
82
+
83
+ if (c = this.get(id))
84
+ c.setDisabled(s);
85
+
86
+ return c;
87
+ },
88
+
89
+ /**
90
+ * Adds a control to the control collection inside the manager.
91
+ *
92
+ * @param {tinymce.ui.Control} Control instance to add to collection.
93
+ * @return {tinymce.ui.Control} Control instance that got passed in.
94
+ */
95
+ add : function(c) {
96
+ var t = this;
97
+
98
+ if (c) {
99
+ t.controls[c.id] = c;
100
+ t.onAdd.dispatch(c, t);
101
+ }
102
+
103
+ return c;
104
+ },
105
+
106
+ /**
107
+ * Creates a control by name, when a control is created it will automatically add it to the control collection.
108
+ * It first ask all plugins for the specified control if the plugins didn't return a control then the default behavior
109
+ * will be used.
110
+ *
111
+ * @param {String} n Control name to create for example "separator".
112
+ * @return {tinymce.ui.Control} Control instance that got created and added.
113
+ */
114
+ createControl : function(n) {
115
+ var c, t = this, ed = t.editor;
116
+
117
+ each(ed.plugins, function(p) {
118
+ if (p.createControl) {
119
+ c = p.createControl(n, t);
120
+
121
+ if (c)
122
+ return false;
123
+ }
124
+ });
125
+
126
+ switch (n) {
127
+ case "|":
128
+ case "separator":
129
+ return t.createSeparator();
130
+ }
131
+
132
+ if (!c && ed.buttons && (c = ed.buttons[n]))
133
+ return t.createButton(n, c);
134
+
135
+ return t.add(c);
136
+ },
137
+
138
+ /**
139
+ * Creates a drop menu control instance by id.
140
+ *
141
+ * @param {String} id Unique id for the new dropdown instance. For example "some menu".
142
+ * @param {Object} s Optional settings object for the control.
143
+ * @param {Object} cc Optional control class to use instead of the default one.
144
+ * @return {tinymce.ui.Control} Control instance that got created and added.
145
+ */
146
+ createDropMenu : function(id, s, cc) {
147
+ var t = this, ed = t.editor, c, bm, v, cls;
148
+
149
+ s = extend({
150
+ 'class' : 'mceDropDown',
151
+ constrain : ed.settings.constrain_menus
152
+ }, s);
153
+
154
+ s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';
155
+ if (v = ed.getParam('skin_variant'))
156
+ s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);
157
+
158
+ id = t.prefix + id;
159
+ cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;
160
+ c = t.controls[id] = new cls(id, s);
161
+ c.onAddItem.add(function(c, o) {
162
+ var s = o.settings;
163
+
164
+ s.title = ed.getLang(s.title, s.title);
165
+
166
+ if (!s.onclick) {
167
+ s.onclick = function(v) {
168
+ ed.execCommand(s.cmd, s.ui || false, s.value);
169
+ };
170
+ }
171
+ });
172
+
173
+ ed.onRemove.add(function() {
174
+ c.destroy();
175
+ });
176
+
177
+ // Fix for bug #1897785, #1898007
178
+ if (tinymce.isIE) {
179
+ c.onShowMenu.add(function() {
180
+ // IE 8 needs focus in order to store away a range with the current collapsed caret location
181
+ ed.focus();
182
+
183
+ bm = ed.selection.getBookmark(1);
184
+ });
185
+
186
+ c.onHideMenu.add(function() {
187
+ if (bm) {
188
+ ed.selection.moveToBookmark(bm);
189
+ bm = 0;
190
+ }
191
+ });
192
+ }
193
+
194
+ return t.add(c);
195
+ },
196
+
197
+ /**
198
+ * Creates a list box control instance by id. A list box is either a native select element or a DOM/JS based list box control. This
199
+ * depends on the use_native_selects settings state.
200
+ *
201
+ * @param {String} id Unique id for the new listbox instance. For example "styles".
202
+ * @param {Object} s Optional settings object for the control.
203
+ * @param {Object} cc Optional control class to use instead of the default one.
204
+ * @return {tinymce.ui.Control} Control instance that got created and added.
205
+ */
206
+ createListBox : function(id, s, cc) {
207
+ var t = this, ed = t.editor, cmd, c, cls;
208
+
209
+ if (t.get(id))
210
+ return null;
211
+
212
+ s.title = ed.translate(s.title);
213
+ s.scope = s.scope || ed;
214
+
215
+ if (!s.onselect) {
216
+ s.onselect = function(v) {
217
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
218
+ };
219
+ }
220
+
221
+ s = extend({
222
+ title : s.title,
223
+ 'class' : 'mce_' + id,
224
+ scope : s.scope,
225
+ control_manager : t
226
+ }, s);
227
+
228
+ id = t.prefix + id;
229
+
230
+ if (ed.settings.use_native_selects)
231
+ c = new tinymce.ui.NativeListBox(id, s);
232
+ else {
233
+ cls = cc || t._cls.listbox || tinymce.ui.ListBox;
234
+ c = new cls(id, s);
235
+ }
236
+
237
+ t.controls[id] = c;
238
+
239
+ // Fix focus problem in Safari
240
+ if (tinymce.isWebKit) {
241
+ c.onPostRender.add(function(c, n) {
242
+ // Store bookmark on mousedown
243
+ Event.add(n, 'mousedown', function() {
244
+ ed.bookmark = ed.selection.getBookmark(1);
245
+ });
246
+
247
+ // Restore on focus, since it might be lost
248
+ Event.add(n, 'focus', function() {
249
+ ed.selection.moveToBookmark(ed.bookmark);
250
+ ed.bookmark = null;
251
+ });
252
+ });
253
+ }
254
+
255
+ if (c.hideMenu)
256
+ ed.onMouseDown.add(c.hideMenu, c);
257
+
258
+ return t.add(c);
259
+ },
260
+
261
+ /**
262
+ * Creates a button control instance by id.
263
+ *
264
+ * @param {String} id Unique id for the new button instance. For example "bold".
265
+ * @param {Object} s Optional settings object for the control.
266
+ * @param {Object} cc Optional control class to use instead of the default one.
267
+ * @return {tinymce.ui.Control} Control instance that got created and added.
268
+ */
269
+ createButton : function(id, s, cc) {
270
+ var t = this, ed = t.editor, o, c, cls;
271
+
272
+ if (t.get(id))
273
+ return null;
274
+
275
+ s.title = ed.translate(s.title);
276
+ s.label = ed.translate(s.label);
277
+ s.scope = s.scope || ed;
278
+
279
+ if (!s.onclick && !s.menu_button) {
280
+ s.onclick = function() {
281
+ ed.execCommand(s.cmd, s.ui || false, s.value);
282
+ };
283
+ }
284
+
285
+ s = extend({
286
+ title : s.title,
287
+ 'class' : 'mce_' + id,
288
+ unavailable_prefix : ed.getLang('unavailable', ''),
289
+ scope : s.scope,
290
+ control_manager : t
291
+ }, s);
292
+
293
+ id = t.prefix + id;
294
+
295
+ if (s.menu_button) {
296
+ cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;
297
+ c = new cls(id, s);
298
+ ed.onMouseDown.add(c.hideMenu, c);
299
+ } else {
300
+ cls = t._cls.button || tinymce.ui.Button;
301
+ c = new cls(id, s);
302
+ }
303
+
304
+ return t.add(c);
305
+ },
306
+
307
+ /**
308
+ * Creates a menu button control instance by id.
309
+ *
310
+ * @param {String} id Unique id for the new menu button instance. For example "menu1".
311
+ * @param {Object} s Optional settings object for the control.
312
+ * @param {Object} cc Optional control class to use instead of the default one.
313
+ * @return {tinymce.ui.Control} Control instance that got created and added.
314
+ */
315
+ createMenuButton : function(id, s, cc) {
316
+ s = s || {};
317
+ s.menu_button = 1;
318
+
319
+ return this.createButton(id, s, cc);
320
+ },
321
+
322
+ /**
323
+ * Creates a split button control instance by id.
324
+ *
325
+ * @param {String} id Unique id for the new split button instance. For example "spellchecker".
326
+ * @param {Object} s Optional settings object for the control.
327
+ * @param {Object} cc Optional control class to use instead of the default one.
328
+ * @return {tinymce.ui.Control} Control instance that got created and added.
329
+ */
330
+ createSplitButton : function(id, s, cc) {
331
+ var t = this, ed = t.editor, cmd, c, cls;
332
+
333
+ if (t.get(id))
334
+ return null;
335
+
336
+ s.title = ed.translate(s.title);
337
+ s.scope = s.scope || ed;
338
+
339
+ if (!s.onclick) {
340
+ s.onclick = function(v) {
341
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
342
+ };
343
+ }
344
+
345
+ if (!s.onselect) {
346
+ s.onselect = function(v) {
347
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
348
+ };
349
+ }
350
+
351
+ s = extend({
352
+ title : s.title,
353
+ 'class' : 'mce_' + id,
354
+ scope : s.scope,
355
+ control_manager : t
356
+ }, s);
357
+
358
+ id = t.prefix + id;
359
+ cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;
360
+ c = t.add(new cls(id, s));
361
+ ed.onMouseDown.add(c.hideMenu, c);
362
+
363
+ return c;
364
+ },
365
+
366
+ /**
367
+ * Creates a color split button control instance by id.
368
+ *
369
+ * @param {String} id Unique id for the new color split button instance. For example "forecolor".
370
+ * @param {Object} s Optional settings object for the control.
371
+ * @param {Object} cc Optional control class to use instead of the default one.
372
+ * @return {tinymce.ui.Control} Control instance that got created and added.
373
+ */
374
+ createColorSplitButton : function(id, s, cc) {
375
+ var t = this, ed = t.editor, cmd, c, cls, bm;
376
+
377
+ if (t.get(id))
378
+ return null;
379
+
380
+ s.title = ed.translate(s.title);
381
+ s.scope = s.scope || ed;
382
+
383
+ if (!s.onclick) {
384
+ s.onclick = function(v) {
385
+ if (tinymce.isIE)
386
+ bm = ed.selection.getBookmark(1);
387
+
388
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
389
+ };
390
+ }
391
+
392
+ if (!s.onselect) {
393
+ s.onselect = function(v) {
394
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);
395
+ };
396
+ }
397
+
398
+ s = extend({
399
+ title : s.title,
400
+ 'class' : 'mce_' + id,
401
+ 'menu_class' : ed.getParam('skin') + 'Skin',
402
+ scope : s.scope,
403
+ more_colors_title : ed.getLang('more_colors')
404
+ }, s);
405
+
406
+ id = t.prefix + id;
407
+ cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;
408
+ c = new cls(id, s);
409
+ ed.onMouseDown.add(c.hideMenu, c);
410
+
411
+ // Remove the menu element when the editor is removed
412
+ ed.onRemove.add(function() {
413
+ c.destroy();
414
+ });
415
+
416
+ // Fix for bug #1897785, #1898007
417
+ if (tinymce.isIE) {
418
+ c.onShowMenu.add(function() {
419
+ // IE 8 needs focus in order to store away a range with the current collapsed caret location
420
+ ed.focus();
421
+ bm = ed.selection.getBookmark(1);
422
+ });
423
+
424
+ c.onHideMenu.add(function() {
425
+ if (bm) {
426
+ ed.selection.moveToBookmark(bm);
427
+ bm = 0;
428
+ }
429
+ });
430
+ }
431
+
432
+ return t.add(c);
433
+ },
434
+
435
+ /**
436
+ * Creates a toolbar container control instance by id.
437
+ *
438
+ * @param {String} id Unique id for the new toolbar container control instance. For example "toolbar1".
439
+ * @param {Object} s Optional settings object for the control.
440
+ * @param {Object} cc Optional control class to use instead of the default one.
441
+ * @return {tinymce.ui.Control} Control instance that got created and added.
442
+ */
443
+ createToolbar : function(id, s, cc) {
444
+ var c, t = this, cls;
445
+
446
+ id = t.prefix + id;
447
+ cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;
448
+ c = new cls(id, s);
449
+
450
+ if (t.get(id))
451
+ return null;
452
+
453
+ return t.add(c);
454
+ },
455
+
456
+ /**
457
+ * Creates a separator control instance.
458
+ *
459
+ * @param {Object} cc Optional control class to use instead of the default one.
460
+ * @return {tinymce.ui.Control} Control instance that got created and added.
461
+ */
462
+ createSeparator : function(cc) {
463
+ var cls = cc || this._cls.separator || tinymce.ui.Separator;
464
+
465
+ return new cls();
466
+ },
467
+
468
+ /**
469
+ * Overrides a specific control type with a custom class.
470
+ *
471
+ * @param {string} n Name of the control to override for example button or dropmenu.
472
+ * @param {function} c Class reference to use instead of the default one.
473
+ * @return {function} Same as the class reference.
474
+ */
475
+ setControlType : function(n, c) {
476
+ return this._cls[n.toLowerCase()] = c;
477
+ },
478
+
479
+ destroy : function() {
480
+ each(this.controls, function(c) {
481
+ c.destroy();
482
+ });
483
+
484
+ this.controls = null;
485
+ }
486
+
487
+ /**#@-*/
488
+ });
489
+ })(tinymce);
js/tiny_mce/classes/Developer.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * $Id: Developer.js 520 2008-01-07 16:30:32Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ (function() {
9
+ var EditorManager = tinymce.EditorManager, each = tinymce.each, DOM = tinymce.DOM;
10
+
11
+ /**
12
+ * This class patches in various development features. This class is only available for the dev version of TinyMCE.
13
+ */
14
+ tinymce.create('static tinymce.Developer', {
15
+ _piggyBack : function() {
16
+ var t = this, em = tinymce.EditorManager, lo = false;
17
+
18
+ // Makes sure that XML language pack is used instead of JS files
19
+ t._runBefore(em, 'init', function(s) {
20
+ var par = new tinymce.xml.Parser({async : false}), lng = s.language || "en", i18n = tinymce.EditorManager.i18n, sl = tinymce.ScriptLoader;
21
+
22
+ if (!s.translate_mode)
23
+ return;
24
+
25
+ if (lo)
26
+ return;
27
+
28
+ lo = true;
29
+
30
+ // Common language loaded
31
+ sl.markDone(tinymce.baseURL + '/langs/' + lng + '.js');
32
+
33
+ // Theme languages loaded
34
+ sl.markDone(tinymce.baseURL + '/themes/simple/langs/' + lng + '.js');
35
+ sl.markDone(tinymce.baseURL + '/themes/advanced/langs/' + lng + '.js');
36
+
37
+ // All plugin packs loaded
38
+ each(s.plugins.split(','), function(p) {
39
+ sl.markDone(tinymce.baseURL + '/plugins/' + p + '/langs/' + lng + '.js');
40
+ });
41
+
42
+ // Load XML language pack
43
+ par.load(tinymce.baseURL + '/langs/' + lng + '.xml', function(doc, ex) {
44
+ var c;
45
+
46
+ if (!doc) {
47
+ alert(ex.message);
48
+ return;
49
+ }
50
+
51
+ if (doc.documentElement.nodeName == 'parsererror') {
52
+ alert('Parse error!!');
53
+ return;
54
+ }
55
+
56
+ c = doc.getElementsByTagName('language')[0].getAttribute("code");
57
+
58
+ each(doc.getElementsByTagName('group'), function(g) {
59
+ var gn = g.getAttribute("target"), o = {};
60
+
61
+ // Build object from XML items
62
+ each(g.getElementsByTagName('item'), function(it) {
63
+ var itn = it.getAttribute("name");
64
+
65
+ if (gn == "common")
66
+ i18n[c + '.' + itn] = par.getText(it);
67
+ else
68
+ i18n[c + '.' + gn + "." + itn] = par.getText(it);
69
+ });
70
+ });
71
+ }, {
72
+ async : false
73
+ });
74
+ });
75
+ },
76
+
77
+ _runBefore : function(o, n, f) {
78
+ var e = o[n];
79
+
80
+ o[n] = function() {
81
+ var s = f.apply(o, arguments);
82
+
83
+ if (s !== false)
84
+ return e.apply(o, arguments);
85
+ };
86
+ }
87
+ });
88
+
89
+ tinymce.Developer._piggyBack();
90
+ })();
91
+
js/tiny_mce/classes/Editor.js ADDED
@@ -0,0 +1,2295 @@