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