TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.

Fixes #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40583 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2017-05-08 05:31:08 +00:00
parent 491f14540e
commit f4d3513802
50 changed files with 61685 additions and 58008 deletions

View File

@ -705,6 +705,12 @@ $_old_files = array(
'wp-includes/theme-compat/comments-popup.php', 'wp-includes/theme-compat/comments-popup.php',
// 4.6 // 4.6
'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628. 'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
// 4.8
'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',
'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',
'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',
'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',
'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',
); );
/** /**

View File

@ -947,6 +947,7 @@ final class _WP_Editors {
'cache_suffix' => 'wp-mce-' . $tinymce_version, 'cache_suffix' => 'wp-mce-' . $tinymce_version,
'resize' => 'vertical', 'resize' => 'vertical',
'menubar' => false, 'menubar' => false,
'branding' => false,
// Limit the preview styles in the menu/toolbar // Limit the preview styles in the menu/toolbar
'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform', 'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
@ -1039,6 +1040,9 @@ final class _WP_Editors {
'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ), 'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ), 'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ), 'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' =>
__( 'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' ),
'Id' => _x( 'Id', 'Id for link anchor (TinyMCE)' ),
// Fullpage plugin // Fullpage plugin
'Document properties' => __( 'Document properties' ), 'Document properties' => __( 'Document properties' ),
@ -1050,6 +1054,7 @@ final class _WP_Editors {
'Author' => __( 'Author' ), 'Author' => __( 'Author' ),
// Media, image plugins // Media, image plugins
'Image' => __( 'Image' ),
'Insert/edit image' => array( __( 'Insert/edit image' ), 'accessM' ), 'Insert/edit image' => array( __( 'Insert/edit image' ), 'accessM' ),
'General' => __( 'General' ), 'General' => __( 'General' ),
'Advanced' => __( 'Advanced' ), 'Advanced' => __( 'Advanced' ),
@ -1061,8 +1066,13 @@ final class _WP_Editors {
'Style' => __( 'Style' ), 'Style' => __( 'Style' ),
'Dimensions' => __( 'Dimensions' ), 'Dimensions' => __( 'Dimensions' ),
'Insert image' => __( 'Insert image' ), 'Insert image' => __( 'Insert image' ),
'Date/time' => __( 'Date/time' ),
'Insert date/time' => __( 'Insert date/time' ), 'Insert date/time' => __( 'Insert date/time' ),
'Insert/edit video' => __( 'Insert/edit video' ), 'Table of Contents' => __( 'Table of Contents' ),
'Insert/Edit code sample' => __( 'Insert/edit code sample' ),
'Language' => __( 'Language' ),
'Media' => __( 'Media' ),
'Insert/edit media' => __( 'Insert/edit media' ),
'Poster' => __( 'Poster' ), 'Poster' => __( 'Poster' ),
'Alternative source' => __( 'Alternative source' ), 'Alternative source' => __( 'Alternative source' ),
'Paste your embed code below:' => __( 'Paste your embed code below:' ), 'Paste your embed code below:' => __( 'Paste your embed code below:' ),
@ -1087,10 +1097,26 @@ final class _WP_Editors {
'Insert/edit link' => array( __( 'Insert/edit link' ), 'metaK' ), 'Insert/edit link' => array( __( 'Insert/edit link' ), 'metaK' ),
'Remove link' => array( __( 'Remove link' ), 'accessS' ), 'Remove link' => array( __( 'Remove link' ), 'accessS' ),
// Link plugin
'Link' => __( 'Link' ),
'Insert link' => __( 'Insert link' ),
'Insert/edit link' => __( 'Insert/edit link' ),
'Target' => __( 'Target' ),
'New window' => __( 'New window' ),
'Text to display' => __( 'Text to display' ),
'Url' => __( 'URL' ),
'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' =>
__( 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' ),
'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' =>
__( 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' ),
'Color' => __( 'Color' ), 'Color' => __( 'Color' ),
'Custom color' => __( 'Custom color' ), 'Custom color' => __( 'Custom color' ),
'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis 'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis
'No color' => __( 'No color' ), 'No color' => __( 'No color' ),
'R' => _x( 'R', 'Short for red in RGB' ),
'G' => _x( 'G', 'Short for green in RGB' ),
'B' => _x( 'B', 'Short for blue in RGB' ),
// Spelling, search/replace plugins // Spelling, search/replace plugins
'Could not find the specified string.' => __( 'Could not find the specified string.' ), 'Could not find the specified string.' => __( 'Could not find the specified string.' ),
@ -1235,16 +1261,27 @@ final class _WP_Editors {
); );
} }
/** /*
* Link plugin (not included): Imagetools plugin (not included):
* Insert link 'Edit image' => __( 'Edit image' ),
* Target 'Image options' => __( 'Image options' ),
* New window 'Back' => __( 'Back' ),
* Text to display 'Invert' => __( 'Invert' ),
* The URL you entered seems to be an email address. Do you want to add the required mailto: prefix? 'Flip horizontally' => __( 'Flip horizontally' ),
* The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix? 'Flip vertically' => __( 'Flip vertically' ),
* Url 'Crop' => __( 'Crop' ),
*/ 'Orientation' => __( 'Orientation' ),
'Resize' => __( 'Resize' ),
'Rotate clockwise' => __( 'Rotate clockwise' ),
'Rotate counterclockwise' => __( 'Rotate counterclockwise' ),
'Sharpen' => __( 'Sharpen' ),
'Brightness' => __( 'Brightness' ),
'Color levels' => __( 'Color levels' ),
'Contrast' => __( 'Contrast' ),
'Gamma' => __( 'Gamma' ),
'Zoom in' => __( 'Zoom in' ),
'Zoom out' => __( 'Zoom out' ),
*/
return self::$translation; return self::$translation;
} }
@ -1456,6 +1493,11 @@ final class _WP_Editors {
var init, id, $wrap; var init, id, $wrap;
if ( typeof tinymce !== 'undefined' ) { if ( typeof tinymce !== 'undefined' ) {
if ( tinymce.Env.ie && tinymce.Env.ie < 11 ) {
tinymce.$( '.wp-editor-wrap ' ).removeClass( 'tmce-active' ).addClass( 'html-active' );
return;
}
for ( id in tinyMCEPreInit.mceInit ) { for ( id in tinyMCEPreInit.mceInit ) {
init = tinyMCEPreInit.mceInit[id]; init = tinyMCEPreInit.mceInit[id];
$wrap = tinymce.$( '#wp-' + id + '-wrap' ); $wrap = tinymce.$( '#wp-' + id + '-wrap' );

View File

@ -2988,7 +2988,9 @@ function user_can_richedit() {
if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
if ( $is_safari ) { if ( $is_safari ) {
$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
} elseif ( $is_gecko || $is_chrome || $is_IE || $is_edge || ( $is_opera && !wp_is_mobile() ) ) { } elseif ( $is_IE ) {
$wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE ' ) === false );
} elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && !wp_is_mobile() ) ) {
$wp_rich_edit = true; $wp_rich_edit = true;
} }
} }

View File

@ -1,5 +1,5 @@
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999 Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc. Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@ -10,7 +10,7 @@
as the successor of the GNU Library Public License, version 2, hence as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.] the version number 2.1.]
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must former contains code derived from the library, whereas the latter must
be combined with the library in order to run. be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other 0. This License Agreement applies to any software library or other
@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing of all derivatives of our free software and of promoting the sharing
and reuse of software generally. and reuse of software generally.
NO WARRANTY NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries How to Apply These Terms to Your New Libraries

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,112 +1,255 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.colorpicker.Plugin","tinymce.core.PluginManager","tinymce.core.util.Color","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
'tinymce.core.PluginManager',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.PluginManager');
}
);
tinymce.PluginManager.add('colorpicker', function(editor) { /**
function colorPickerCallback(callback, value) { * ResolveGlobal.js
function setColor(value) { *
var color = new tinymce.util.Color(value), rgb = color.toRgb(); * Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
win.fromJSON({ define(
r: rgb.r, 'tinymce.core.util.Color',
g: rgb.g, [
b: rgb.b, 'global!tinymce.util.Tools.resolve'
hex: color.toHex().substr(1) ],
}); function (resolve) {
return resolve('tinymce.util.Color');
}
);
showPreview(color.toHex()); /**
} * Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
function showPreview(hexColor) { /**
win.find('#preview')[0].getEl().style.background = hexColor; * This class contains all core logic for the colorpicker plugin.
} *
* @class tinymce.colorpicker.Plugin
* @private
*/
define(
'tinymce.plugins.colorpicker.Plugin',
[
'tinymce.core.PluginManager',
'tinymce.core.util.Color'
],
function (PluginManager, Color) {
PluginManager.add('colorpicker', function (editor) {
function colorPickerCallback(callback, value) {
function setColor(value) {
var color = new Color(value), rgb = color.toRgb();
var win = editor.windowManager.open({ win.fromJSON({
title: 'Color', r: rgb.r,
items: { g: rgb.g,
type: 'container', b: rgb.b,
layout: 'flex', hex: color.toHex().substr(1)
direction: 'row', });
align: 'stretch',
padding: 5,
spacing: 10,
items: [
{
type: 'colorpicker',
value: value,
onchange: function() {
var rgb = this.rgb();
if (win) { showPreview(color.toHex());
win.find('#r').value(rgb.r); }
win.find('#g').value(rgb.g);
win.find('#b').value(rgb.b);
win.find('#hex').value(this.value().substr(1));
showPreview(this.value());
}
}
},
{
type: 'form',
padding: 0,
labelGap: 5,
defaults: {
type: 'textbox',
size: 7,
value: '0',
flex: 1,
spellcheck: false,
onchange: function() {
var colorPickerCtrl = win.find('colorpicker')[0];
var name, value;
name = this.name(); function showPreview(hexColor) {
value = this.value(); win.find('#preview')[0].getEl().style.background = hexColor;
}
if (name == "hex") { var win = editor.windowManager.open({
value = '#' + value; title: 'Color',
setColor(value); items: {
colorPickerCtrl.value(value); type: 'container',
return; layout: 'flex',
} direction: 'row',
align: 'stretch',
padding: 5,
spacing: 10,
items: [
{
type: 'colorpicker',
value: value,
onchange: function () {
var rgb = this.rgb();
value = { if (win) {
r: win.find('#r').value(), win.find('#r').value(rgb.r);
g: win.find('#g').value(), win.find('#g').value(rgb.g);
b: win.find('#b').value() win.find('#b').value(rgb.b);
}; win.find('#hex').value(this.value().substr(1));
showPreview(this.value());
}
}
},
{
type: 'form',
padding: 0,
labelGap: 5,
defaults: {
type: 'textbox',
size: 7,
value: '0',
flex: 1,
spellcheck: false,
onchange: function () {
var colorPickerCtrl = win.find('colorpicker')[0];
var name, value;
colorPickerCtrl.value(value); name = this.name();
setColor(value); value = this.value();
}
},
items: [
{name: 'r', label: 'R', autofocus: 1},
{name: 'g', label: 'G'},
{name: 'b', label: 'B'},
{name: 'hex', label: '#', value: '000000'},
{name: 'preview', type: 'container', border: 1}
]
}
]
},
onSubmit: function() {
callback('#' + this.toJSON().hex);
}
});
setColor(value); if (name == "hex") {
} value = '#' + value;
setColor(value);
colorPickerCtrl.value(value);
return;
}
if (!editor.settings.color_picker_callback) { value = {
editor.settings.color_picker_callback = colorPickerCallback; r: win.find('#r').value(),
} g: win.find('#g').value(),
}); b: win.find('#b').value()
};
colorPickerCtrl.value(value);
setColor(value);
}
},
items: [
{ name: 'r', label: 'R', autofocus: 1 },
{ name: 'g', label: 'G' },
{ name: 'b', label: 'B' },
{ name: 'hex', label: '#', value: '000000' },
{ name: 'preview', type: 'container', border: 1 }
]
}
]
},
onSubmit: function () {
callback('#' + this.toJSON().hex);
}
});
setColor(value);
}
if (!editor.settings.color_picker_callback) {
editor.settings.color_picker_callback = colorPickerCallback;
}
});
return function () { };
}
);
dem('tinymce.plugins.colorpicker.Plugin')();
})();

View File

@ -1 +1 @@
tinymce.PluginManager.add("colorpicker",function(e){function t(t,n){function r(e){var t=new tinymce.util.Color(e),n=t.toRgb();o.fromJSON({r:n.r,g:n.g,b:n.b,hex:t.toHex().substr(1)}),i(t.toHex())}function i(e){o.find("#preview")[0].getEl().style.background=e}var o=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:n,onchange:function(){var e=this.rgb();o&&(o.find("#r").value(e.r),o.find("#g").value(e.g),o.find("#b").value(e.b),o.find("#hex").value(this.value().substr(1)),i(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,t,n=o.find("colorpicker")[0];return e=this.name(),t=this.value(),"hex"==e?(t="#"+t,r(t),void n.value(t)):(t={r:o.find("#r").value(),g:o.find("#g").value(),b:o.find("#b").value()},n.value(t),void r(t))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){t("#"+this.toJSON().hex)}});r(n)}e.settings.color_picker_callback||(e.settings.color_picker_callback=t)}); !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",["3"],function(a){return a("tinymce.PluginManager")}),g("2",["3"],function(a){return a("tinymce.util.Color")}),g("0",["1","2"],function(a,b){return a.add("colorpicker",function(a){function c(c,d){function e(a){var c=new b(a),d=c.toRgb();g.fromJSON({r:d.r,g:d.g,b:d.b,hex:c.toHex().substr(1)}),f(c.toHex())}function f(a){g.find("#preview")[0].getEl().style.background=a}var g=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:d,onchange:function(){var a=this.rgb();g&&(g.find("#r").value(a.r),g.find("#g").value(a.g),g.find("#b").value(a.b),g.find("#hex").value(this.value().substr(1)),f(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=g.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,e(b),void c.value(b)):(b={r:g.find("#r").value(),g:g.find("#g").value(),b:g.find("#b").value()},c.value(b),void e(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){c("#"+this.toJSON().hex)}});e(d)}a.settings.color_picker_callback||(a.settings.color_picker_callback=c)}),function(){}}),d("0")()}();

View File

@ -2,7 +2,7 @@
* plugin.js * plugin.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
@ -19,288 +19,301 @@
* - No editor.onEvent * - No editor.onEvent
* - Can't cancel execCommands with beforeExecCommand * - Can't cancel execCommands with beforeExecCommand
*/ */
(function(tinymce) { (function (tinymce) {
var reported; var reported;
function noop() { function noop() {
} }
function log(apiCall) { function log(apiCall) {
if (!reported && window && window.console) { if (!reported && window && window.console) {
reported = true; reported = true;
console.log("Deprecated TinyMCE API call: " + apiCall); console.log("Deprecated TinyMCE API call: " + apiCall);
} }
} }
function Dispatcher(target, newEventName, argsMap, defaultScope) { function Dispatcher(target, newEventName, argsMap, defaultScope) {
target = target || this; target = target || this;
var cbs = [];
if (!newEventName) { if (!newEventName) {
this.add = this.addToTop = this.remove = this.dispatch = noop; this.add = this.addToTop = this.remove = this.dispatch = noop;
return; return;
} }
this.add = function(callback, scope, prepend) { this.add = function (callback, scope, prepend) {
log('<target>.on' + newEventName + ".add(..)"); log('<target>.on' + newEventName + ".add(..)");
// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2) // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
function patchedEventCallback(e) { function patchedEventCallback(e) {
var callbackArgs = []; var callbackArgs = [];
if (typeof argsMap == "string") { if (typeof argsMap == "string") {
argsMap = argsMap.split(" "); argsMap = argsMap.split(" ");
} }
if (argsMap && typeof argsMap != "function") { if (argsMap && typeof argsMap != "function") {
for (var i = 0; i < argsMap.length; i++) { for (var i = 0; i < argsMap.length; i++) {
callbackArgs.push(e[argsMap[i]]); callbackArgs.push(e[argsMap[i]]);
} }
} }
if (typeof argsMap == "function") { if (typeof argsMap == "function") {
callbackArgs = argsMap(newEventName, e, target); callbackArgs = argsMap(newEventName, e, target);
if (!callbackArgs) { if (!callbackArgs) {
return; return;
} }
} }
if (!argsMap) { if (!argsMap) {
callbackArgs = [e]; callbackArgs = [e];
} }
callbackArgs.unshift(defaultScope || target); callbackArgs.unshift(defaultScope || target);
if (callback.apply(scope || defaultScope || target, callbackArgs) === false) { if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
} }
} }
target.on(newEventName, patchedEventCallback, prepend); target.on(newEventName, patchedEventCallback, prepend);
return patchedEventCallback; var handlers = {
}; original: callback,
patched: patchedEventCallback
};
this.addToTop = function(callback, scope) { cbs.push(handlers);
this.add(callback, scope, true); return patchedEventCallback;
}; };
this.remove = function(callback) { this.addToTop = function (callback, scope) {
return target.off(newEventName, callback); this.add(callback, scope, true);
}; };
this.dispatch = function() { this.remove = function (callback) {
target.fire(newEventName); cbs.forEach(function (item, i) {
if (item.original === callback) {
cbs.splice(i, 1);
return target.off(newEventName, item.patched);
}
});
return true; return target.off(newEventName, callback);
}; };
}
tinymce.util.Dispatcher = Dispatcher; this.dispatch = function () {
tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload"); target.fire(newEventName);
tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor"); return true;
tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor"); };
}
tinymce.util.Cookie = { tinymce.util.Dispatcher = Dispatcher;
get: noop, getHash: noop, remove: noop, set: noop, setHash: noop tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
}; tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
function patchEditor(editor) { tinymce.util.Cookie = {
get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
};
function translate(str) { function patchEditor(editor) {
var prefix = editor.settings.language || "en";
var prefixedStr = [prefix, str].join('.');
var translatedStr = tinymce.i18n.translate(prefixedStr);
return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str); function translate(str) {
} var prefix = editor.settings.language || "en";
var prefixedStr = [prefix, str].join('.');
var translatedStr = tinymce.i18n.translate(prefixedStr);
function patchEditorEvents(oldEventNames, argsMap) { return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str);
tinymce.each(oldEventNames.split(" "), function(oldName) { }
editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
});
}
function convertUndoEventArgs(type, event, target) { function patchEditorEvents(oldEventNames, argsMap) {
return [ tinymce.each(oldEventNames.split(" "), function (oldName) {
event.level, editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
target });
]; }
}
function filterSelectionEvents(needsSelection) { function convertUndoEventArgs(type, event, target) {
return function(type, e) { return [
if ((!e.selection && !needsSelection) || e.selection == needsSelection) { event.level,
return [e]; target
} ];
}; }
}
if (editor.controlManager) { function filterSelectionEvents(needsSelection) {
return; return function (type, e) {
} if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
return [e];
}
};
}
function cmNoop() { if (editor.controlManager) {
var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' + return;
'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' + }
'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
log('editor.controlManager.*'); function cmNoop() {
var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
function _noop() { log('editor.controlManager.*');
return cmNoop();
}
tinymce.each(methods.split(' '), function(method) { function _noop() {
obj[method] = _noop; return cmNoop();
}); }
return obj; tinymce.each(methods.split(' '), function (method) {
} obj[method] = _noop;
});
editor.controlManager = { return obj;
buttons: {}, }
setDisabled: function(name, state) { editor.controlManager = {
log("controlManager.setDisabled(..)"); buttons: {},
if (this.buttons[name]) { setDisabled: function (name, state) {
this.buttons[name].disabled(state); log("controlManager.setDisabled(..)");
}
},
setActive: function(name, state) { if (this.buttons[name]) {
log("controlManager.setActive(..)"); this.buttons[name].disabled(state);
}
},
if (this.buttons[name]) { setActive: function (name, state) {
this.buttons[name].active(state); log("controlManager.setActive(..)");
}
},
onAdd: new Dispatcher(), if (this.buttons[name]) {
onPostRender: new Dispatcher(), this.buttons[name].active(state);
}
},
add: function(obj) { onAdd: new Dispatcher(),
return obj; onPostRender: new Dispatcher(),
},
createButton: cmNoop,
createColorSplitButton: cmNoop,
createControl: cmNoop,
createDropMenu: cmNoop,
createListBox: cmNoop,
createMenuButton: cmNoop,
createSeparator: cmNoop,
createSplitButton: cmNoop,
createToolbar: cmNoop,
createToolbarGroup: cmNoop,
destroy: noop,
get: noop,
setControlType: cmNoop
};
patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor"); add: function (obj) {
patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"); return obj;
patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported },
patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change"); createButton: cmNoop,
patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false)); createColorSplitButton: cmNoop,
patchEditorEvents("SetProgressState", "state time"); createControl: cmNoop,
patchEditorEvents("VisualAid", "element hasVisual"); createDropMenu: cmNoop,
patchEditorEvents("Undo Redo", convertUndoEventArgs); createListBox: cmNoop,
createMenuButton: cmNoop,
createSeparator: cmNoop,
createSplitButton: cmNoop,
createToolbar: cmNoop,
createToolbarGroup: cmNoop,
destroy: noop,
get: noop,
setControlType: cmNoop
};
patchEditorEvents("NodeChange", function(type, e) { patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
return [ patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
editor.controlManager, patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
e.element, patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
editor.selection.isCollapsed(), patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
e patchEditorEvents("SetProgressState", "state time");
]; patchEditorEvents("VisualAid", "element hasVisual");
}); patchEditorEvents("Undo Redo", convertUndoEventArgs);
var originalAddButton = editor.addButton; patchEditorEvents("NodeChange", function (type, e) {
editor.addButton = function(name, settings) { return [
var originalOnPostRender; editor.controlManager,
e.element,
editor.selection.isCollapsed(),
e
];
});
function patchedPostRender() { var originalAddButton = editor.addButton;
editor.controlManager.buttons[name] = this; editor.addButton = function (name, settings) {
var originalOnPostRender;
if (originalOnPostRender) { function patchedPostRender() {
return originalOnPostRender.apply(this, arguments); editor.controlManager.buttons[name] = this;
}
}
for (var key in settings) { if (originalOnPostRender) {
if (key.toLowerCase() === "onpostrender") { return originalOnPostRender.apply(this, arguments);
originalOnPostRender = settings[key]; }
settings.onPostRender = patchedPostRender; }
}
}
if (!originalOnPostRender) { for (var key in settings) {
settings.onPostRender = patchedPostRender; if (key.toLowerCase() === "onpostrender") {
} originalOnPostRender = settings[key];
settings.onPostRender = patchedPostRender;
}
}
if (settings.title) { if (!originalOnPostRender) {
settings.title = translate(settings.title); settings.onPostRender = patchedPostRender;
} }
return originalAddButton.call(this, name, settings); if (settings.title) {
}; settings.title = translate(settings.title);
}
editor.on('init', function() { return originalAddButton.call(this, name, settings);
var undoManager = editor.undoManager, selection = editor.selection; };
undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager); editor.on('init', function () {
undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager); var undoManager = editor.undoManager, selection = editor.selection;
undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection); undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection); undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection); undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection); undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
});
editor.on('BeforeRenderUI', function() { selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
var windowManager = editor.windowManager; selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
});
windowManager.onOpen = new Dispatcher(); editor.on('BeforeRenderUI', function () {
windowManager.onClose = new Dispatcher(); var windowManager = editor.windowManager;
windowManager.createInstance = function(className, a, b, c, d, e) {
log("windowManager.createInstance(..)");
var constr = tinymce.resolve(className); windowManager.onOpen = new Dispatcher();
return new constr(a, b, c, d, e); windowManager.onClose = new Dispatcher();
}; windowManager.createInstance = function (className, a, b, c, d, e) {
}); log("windowManager.createInstance(..)");
}
tinymce.on('SetupEditor', patchEditor); var constr = tinymce.resolve(className);
tinymce.PluginManager.add("compat3x", patchEditor); return new constr(a, b, c, d, e);
};
});
}
tinymce.addI18n = function(prefix, o) { tinymce.on('SetupEditor', patchEditor);
var I18n = tinymce.util.I18n, each = tinymce.each; tinymce.PluginManager.add("compat3x", patchEditor);
if (typeof prefix == "string" && prefix.indexOf('.') === -1) { tinymce.addI18n = function (prefix, o) {
I18n.add(prefix, o); var I18n = tinymce.util.I18n, each = tinymce.each;
return;
}
if (!tinymce.is(prefix, 'string')) { if (typeof prefix == "string" && prefix.indexOf('.') === -1) {
each(prefix, function(o, lc) { I18n.add(prefix, o);
each(o, function(o, g) { return;
each(o, function(o, k) { }
if (g === 'common') {
I18n.data[lc + '.' + k] = o; if (!tinymce.is(prefix, 'string')) {
} else { each(prefix, function (o, lc) {
I18n.data[lc + '.' + g + '.' + k] = o; each(o, function (o, g) {
} each(o, function (o, k) {
}); if (g === 'common') {
}); I18n.data[lc + '.' + k] = o;
}); } else {
} else { I18n.data[lc + '.' + g + '.' + k] = o;
each(o, function(o, k) { }
I18n.data[prefix + '.' + k] = o; });
}); });
} });
}; } else {
each(o, function (o, k) {
I18n.data[prefix + '.' + k] = o;
});
}
};
})(tinymce); })(tinymce);

View File

@ -1 +1 @@
!function(e){function t(){}function n(e){!o&&window&&window.console&&(o=!0,console.log("Deprecated TinyMCE API call: "+e))}function r(e,r,i,o){return e=e||this,r?(this.add=function(t,a,s){function l(n){var s=[];if("string"==typeof i&&(i=i.split(" ")),i&&"function"!=typeof i)for(var l=0;l<i.length;l++)s.push(n[i[l]]);("function"!=typeof i||(s=i(r,n,e)))&&(i||(s=[n]),s.unshift(o||e),t.apply(a||o||e,s)===!1&&n.stopImmediatePropagation())}return n("<target>.on"+r+".add(..)"),e.on(r,l,s),l},this.addToTop=function(e,t){this.add(e,t,!0)},this.remove=function(t){return e.off(r,t)},void(this.dispatch=function(){return e.fire(r),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=t)}function i(i){function o(t){var n=i.settings.language||"en",r=[n,t].join("."),o=e.i18n.translate(r);return r!==o?o:e.i18n.translate(t)}function a(t,n){e.each(t.split(" "),function(e){i["on"+e]=new r(i,e,n)})}function s(e,t,n){return[t.level,n]}function l(e){return function(t,n){if(!n.selection&&!e||n.selection==e)return[n]}}function u(){function t(){return u()}var r={},i="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return n("editor.controlManager.*"),e.each(i.split(" "),function(e){r[e]=t}),r}if(!i.controlManager){i.controlManager={buttons:{},setDisabled:function(e,t){n("controlManager.setDisabled(..)"),this.buttons[e]&&this.buttons[e].disabled(t)},setActive:function(e,t){n("controlManager.setActive(..)"),this.buttons[e]&&this.buttons[e].active(t)},onAdd:new r,onPostRender:new r,add:function(e){return e},createButton:u,createColorSplitButton:u,createControl:u,createDropMenu:u,createListBox:u,createMenuButton:u,createSeparator:u,createSplitButton:u,createToolbar:u,createToolbarGroup:u,destroy:t,get:t,setControlType:u},a("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),a("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),a("BeforeExecCommand ExecCommand","command ui value args"),a("PreProcess PostProcess LoadContent SaveContent Change"),a("BeforeSetContent BeforeGetContent SetContent GetContent",l(!1)),a("SetProgressState","state time"),a("VisualAid","element hasVisual"),a("Undo Redo",s),a("NodeChange",function(e,t){return[i.controlManager,t.element,i.selection.isCollapsed(),t]});var c=i.addButton;i.addButton=function(e,t){function n(){if(i.controlManager.buttons[e]=this,r)return r.apply(this,arguments)}var r;for(var a in t)"onpostrender"===a.toLowerCase()&&(r=t[a],t.onPostRender=n);return r||(t.onPostRender=n),t.title&&(t.title=o(t.title)),c.call(this,e,t)},i.on("init",function(){var e=i.undoManager,t=i.selection;e.onUndo=new r(i,"Undo",s,null,e),e.onRedo=new r(i,"Redo",s,null,e),e.onBeforeAdd=new r(i,"BeforeAddUndo",null,e),e.onAdd=new r(i,"AddUndo",null,e),t.onBeforeGetContent=new r(i,"BeforeGetContent",l(!0),t),t.onGetContent=new r(i,"GetContent",l(!0),t),t.onBeforeSetContent=new r(i,"BeforeSetContent",l(!0),t),t.onSetContent=new r(i,"SetContent",l(!0),t)}),i.on("BeforeRenderUI",function(){var t=i.windowManager;t.onOpen=new r,t.onClose=new r,t.createInstance=function(t,r,i,o,a,s){n("windowManager.createInstance(..)");var l=e.resolve(t);return new l(r,i,o,a,s)}})}}var o;e.util.Dispatcher=r,e.onBeforeUnload=new r(e,"BeforeUnload"),e.onAddEditor=new r(e,"AddEditor","editor"),e.onRemoveEditor=new r(e,"RemoveEditor","editor"),e.util.Cookie={get:t,getHash:t,remove:t,set:t,setHash:t},e.on("SetupEditor",i),e.PluginManager.add("compat3x",i),e.addI18n=function(t,n){var r=e.util.I18n,i=e.each;return"string"==typeof t&&t.indexOf(".")===-1?void r.add(t,n):void(e.is(t,"string")?i(n,function(e,n){r.data[t+"."+n]=e}):i(t,function(e,t){i(e,function(e,n){i(e,function(e,i){"common"===n?r.data[t+"."+i]=e:r.data[t+"."+n+"."+i]=e})})}))}}(tinymce); !function(a){function b(){}function c(a){!f&&window&&window.console&&(f=!0,console.log("Deprecated TinyMCE API call: "+a))}function d(a,d,e,f){a=a||this;var g=[];return d?(this.add=function(b,h,i){function j(c){var g=[];if("string"==typeof e&&(e=e.split(" ")),e&&"function"!=typeof e)for(var i=0;i<e.length;i++)g.push(c[e[i]]);("function"!=typeof e||(g=e(d,c,a)))&&(e||(g=[c]),g.unshift(f||a),b.apply(h||f||a,g)===!1&&c.stopImmediatePropagation())}c("<target>.on"+d+".add(..)"),a.on(d,j,i);var k={original:b,patched:j};return g.push(k),j},this.addToTop=function(a,b){this.add(a,b,!0)},this.remove=function(b){return g.forEach(function(c,e){if(c.original===b)return g.splice(e,1),a.off(d,c.patched)}),a.off(d,b)},void(this.dispatch=function(){return a.fire(d),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=b)}function e(e){function f(b){var c=e.settings.language||"en",d=[c,b].join("."),f=a.i18n.translate(d);return d!==f?f:a.i18n.translate(b)}function g(b,c){a.each(b.split(" "),function(a){e["on"+a]=new d(e,a,c)})}function h(a,b,c){return[b.level,c]}function i(a){return function(b,c){if(!c.selection&&!a||c.selection==a)return[c]}}function j(){function b(){return j()}var d={},e="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return c("editor.controlManager.*"),a.each(e.split(" "),function(a){d[a]=b}),d}if(!e.controlManager){e.controlManager={buttons:{},setDisabled:function(a,b){c("controlManager.setDisabled(..)"),this.buttons[a]&&this.buttons[a].disabled(b)},setActive:function(a,b){c("controlManager.setActive(..)"),this.buttons[a]&&this.buttons[a].active(b)},onAdd:new d,onPostRender:new d,add:function(a){return a},createButton:j,createColorSplitButton:j,createControl:j,createDropMenu:j,createListBox:j,createMenuButton:j,createSeparator:j,createSplitButton:j,createToolbar:j,createToolbarGroup:j,destroy:b,get:b,setControlType:j},g("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),g("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),g("BeforeExecCommand ExecCommand","command ui value args"),g("PreProcess PostProcess LoadContent SaveContent Change"),g("BeforeSetContent BeforeGetContent SetContent GetContent",i(!1)),g("SetProgressState","state time"),g("VisualAid","element hasVisual"),g("Undo Redo",h),g("NodeChange",function(a,b){return[e.controlManager,b.element,e.selection.isCollapsed(),b]});var k=e.addButton;e.addButton=function(a,b){function c(){if(e.controlManager.buttons[a]=this,d)return d.apply(this,arguments)}var d;for(var g in b)"onpostrender"===g.toLowerCase()&&(d=b[g],b.onPostRender=c);return d||(b.onPostRender=c),b.title&&(b.title=f(b.title)),k.call(this,a,b)},e.on("init",function(){var a=e.undoManager,b=e.selection;a.onUndo=new d(e,"Undo",h,null,a),a.onRedo=new d(e,"Redo",h,null,a),a.onBeforeAdd=new d(e,"BeforeAddUndo",null,a),a.onAdd=new d(e,"AddUndo",null,a),b.onBeforeGetContent=new d(e,"BeforeGetContent",i(!0),b),b.onGetContent=new d(e,"GetContent",i(!0),b),b.onBeforeSetContent=new d(e,"BeforeSetContent",i(!0),b),b.onSetContent=new d(e,"SetContent",i(!0),b)}),e.on("BeforeRenderUI",function(){var b=e.windowManager;b.onOpen=new d,b.onClose=new d,b.createInstance=function(b,d,e,f,g,h){c("windowManager.createInstance(..)");var i=a.resolve(b);return new i(d,e,f,g,h)}})}}var f;a.util.Dispatcher=d,a.onBeforeUnload=new d(a,"BeforeUnload"),a.onAddEditor=new d(a,"AddEditor","editor"),a.onRemoveEditor=new d(a,"RemoveEditor","editor"),a.util.Cookie={get:b,getHash:b,remove:b,set:b,setHash:b},a.on("SetupEditor",e),a.PluginManager.add("compat3x",e),a.addI18n=function(b,c){var d=a.util.I18n,e=a.each;return"string"==typeof b&&b.indexOf(".")===-1?void d.add(b,c):void(a.is(b,"string")?e(c,function(a,c){d.data[b+"."+c]=a}):e(b,function(a,b){e(a,function(a,c){e(a,function(a,e){"common"===c?d.data[b+"."+e]=a:d.data[b+"."+c+"."+e]=a})})}))}}(tinymce);

View File

@ -1,64 +1,207 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.directionality.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
'tinymce.core.PluginManager',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.PluginManager');
}
);
tinymce.PluginManager.add('directionality', function(editor) { /**
function setDir(dir) { * ResolveGlobal.js
var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks(); *
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
if (blocks.length) { define(
curDir = dom.getAttrib(blocks[0], "dir"); 'tinymce.core.util.Tools',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.util.Tools');
}
);
tinymce.each(blocks, function(block) { /**
// Add dir to block if the parent block doesn't already have that dir * Plugin.js
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { *
if (curDir != dir) { * Released under LGPL License.
dom.setAttrib(block, "dir", dir); * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
} else { *
dom.setAttrib(block, "dir", null); * License: http://www.tinymce.com/license
} * Contributing: http://www.tinymce.com/contributing
} */
});
editor.nodeChanged(); /**
} * This class contains all core logic for the directionality plugin.
} *
* @class tinymce.directionality.Plugin
* @private
*/
define(
'tinymce.plugins.directionality.Plugin',
[
'tinymce.core.PluginManager',
'tinymce.core.util.Tools'
],
function (PluginManager, Tools) {
PluginManager.add('directionality', function (editor) {
function setDir(dir) {
var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
function generateSelector(dir) { if (blocks.length) {
var selector = []; curDir = dom.getAttrib(blocks[0], "dir");
tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) { Tools.each(blocks, function (block) {
selector.push(name + '[dir=' + dir + ']'); // Add dir to block if the parent block doesn't already have that dir
}); if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
if (curDir != dir) {
dom.setAttrib(block, "dir", dir);
} else {
dom.setAttrib(block, "dir", null);
}
}
});
return selector.join(','); editor.nodeChanged();
} }
}
editor.addCommand('mceDirectionLTR', function() { function generateSelector(dir) {
setDir("ltr"); var selector = [];
});
editor.addCommand('mceDirectionRTL', function() { Tools.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
setDir("rtl"); selector.push(name + '[dir=' + dir + ']');
}); });
editor.addButton('ltr', { return selector.join(',');
title: 'Left to right', }
cmd: 'mceDirectionLTR',
stateSelector: generateSelector('ltr')
});
editor.addButton('rtl', { editor.addCommand('mceDirectionLTR', function () {
title: 'Right to left', setDir("ltr");
cmd: 'mceDirectionRTL', });
stateSelector: generateSelector('rtl')
}); editor.addCommand('mceDirectionRTL', function () {
}); setDir("rtl");
});
editor.addButton('ltr', {
title: 'Left to right',
cmd: 'mceDirectionLTR',
stateSelector: generateSelector('ltr')
});
editor.addButton('rtl', {
title: 'Right to left',
cmd: 'mceDirectionRTL',
stateSelector: generateSelector('rtl')
});
});
return function () { };
}
);
dem('tinymce.plugins.directionality.Plugin')();
})();

View File

@ -1 +1 @@
tinymce.PluginManager.add("directionality",function(e){function t(t){var n,r=e.dom,i=e.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),tinymce.each(i,function(e){r.getParent(e.parentNode,"*[dir='"+t+"']",r.getRoot())||(n!=t?r.setAttrib(e,"dir",t):r.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})}); !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",["3"],function(a){return a("tinymce.PluginManager")}),g("2",["3"],function(a){return a("tinymce.util.Tools")}),g("0",["1","2"],function(a,b){return a.add("directionality",function(a){function c(c){var d,e=a.dom,f=a.selection.getSelectedBlocks();f.length&&(d=e.getAttrib(f[0],"dir"),b.each(f,function(a){e.getParent(a.parentNode,"*[dir='"+c+"']",e.getRoot())||(d!=c?e.setAttrib(a,"dir",c):e.setAttrib(a,"dir",null))}),a.nodeChanged())}function d(a){var c=[];return b.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(b){c.push(b+"[dir="+a+"]")}),c.join(",")}a.addCommand("mceDirectionLTR",function(){c("ltr")}),a.addCommand("mceDirectionRTL",function(){c("rtl")}),a.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:d("ltr")}),a.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:d("rtl")})}),function(){}}),d("0")()}();

View File

@ -1,154 +1,299 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.fullscreen.Plugin","tinymce.core.dom.DOMUtils","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
'tinymce.core.dom.DOMUtils',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.dom.DOMUtils');
}
);
tinymce.PluginManager.add('fullscreen', function(editor) { /**
var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler; * ResolveGlobal.js
var containerWidth, containerHeight, scrollPos; *
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
if (editor.settings.inline) { define(
return; 'tinymce.core.PluginManager',
} [
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.PluginManager');
}
);
function getWindowSize() { /**
var w, h, win = window, doc = document; * Plugin.js
var body = doc.body; *
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
// Old IE /**
if (body.offsetWidth) { * This class contains all core logic for the fullscreen plugin.
w = body.offsetWidth; *
h = body.offsetHeight; * @class tinymce.fullscreen.Plugin
} * @private
*/
define(
'tinymce.plugins.fullscreen.Plugin',
[
'tinymce.core.dom.DOMUtils',
'tinymce.core.PluginManager'
],
function (DOMUtils, PluginManager) {
var DOM = DOMUtils.DOM;
// Modern browsers PluginManager.add('fullscreen', function (editor) {
if (win.innerWidth && win.innerHeight) { var fullscreenState = false, iframeWidth, iframeHeight, resizeHandler;
w = win.innerWidth; var containerWidth, containerHeight, scrollPos;
h = win.innerHeight;
}
return {w: w, h: h}; if (editor.settings.inline) {
} return;
}
function getScrollPos() { function getWindowSize() {
var vp = tinymce.DOM.getViewPort(); var w, h, win = window, doc = document;
var body = doc.body;
return { // Old IE
x: vp.x, if (body.offsetWidth) {
y: vp.y w = body.offsetWidth;
}; h = body.offsetHeight;
} }
function setScrollPos(pos) { // Modern browsers
scrollTo(pos.x, pos.y); if (win.innerWidth && win.innerHeight) {
} w = win.innerWidth;
h = win.innerHeight;
}
function toggleFullscreen() { return { w: w, h: h };
var body = document.body, documentElement = document.documentElement, editorContainerStyle; }
var editorContainer, iframe, iframeStyle;
function resize() { function getScrollPos() {
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); var vp = DOM.getViewPort();
}
fullscreenState = !fullscreenState; return {
x: vp.x,
y: vp.y
};
}
editorContainer = editor.getContainer(); function setScrollPos(pos) {
editorContainerStyle = editorContainer.style; window.scrollTo(pos.x, pos.y);
iframe = editor.getContentAreaContainer().firstChild; }
iframeStyle = iframe.style;
if (fullscreenState) { function toggleFullscreen() {
scrollPos = getScrollPos(); var body = document.body, documentElement = document.documentElement, editorContainerStyle;
iframeWidth = iframeStyle.width; var editorContainer, iframe, iframeStyle;
iframeHeight = iframeStyle.height;
iframeStyle.width = iframeStyle.height = '100%';
containerWidth = editorContainerStyle.width;
containerHeight = editorContainerStyle.height;
editorContainerStyle.width = editorContainerStyle.height = '';
DOM.addClass(body, 'mce-fullscreen'); function resize() {
DOM.addClass(documentElement, 'mce-fullscreen'); DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
DOM.addClass(editorContainer, 'mce-fullscreen'); }
DOM.bind(window, 'resize', resize); fullscreenState = !fullscreenState;
resize();
resizeHandler = resize;
} else {
iframeStyle.width = iframeWidth;
iframeStyle.height = iframeHeight;
if (containerWidth) { editorContainer = editor.getContainer();
editorContainerStyle.width = containerWidth; editorContainerStyle = editorContainer.style;
} iframe = editor.getContentAreaContainer().firstChild;
iframeStyle = iframe.style;
if (containerHeight) { if (fullscreenState) {
editorContainerStyle.height = containerHeight; scrollPos = getScrollPos();
} iframeWidth = iframeStyle.width;
iframeHeight = iframeStyle.height;
iframeStyle.width = iframeStyle.height = '100%';
containerWidth = editorContainerStyle.width;
containerHeight = editorContainerStyle.height;
editorContainerStyle.width = editorContainerStyle.height = '';
DOM.removeClass(body, 'mce-fullscreen'); DOM.addClass(body, 'mce-fullscreen');
DOM.removeClass(documentElement, 'mce-fullscreen'); DOM.addClass(documentElement, 'mce-fullscreen');
DOM.removeClass(editorContainer, 'mce-fullscreen'); DOM.addClass(editorContainer, 'mce-fullscreen');
DOM.unbind(window, 'resize', resizeHandler);
setScrollPos(scrollPos);
}
editor.fire('FullscreenStateChanged', {state: fullscreenState}); DOM.bind(window, 'resize', resize);
} resize();
resizeHandler = resize;
} else {
iframeStyle.width = iframeWidth;
iframeStyle.height = iframeHeight;
editor.on('init', function() { if (containerWidth) {
editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen); editorContainerStyle.width = containerWidth;
}); }
editor.on('remove', function() { if (containerHeight) {
if (resizeHandler) { editorContainerStyle.height = containerHeight;
DOM.unbind(window, 'resize', resizeHandler); }
}
});
editor.addCommand('mceFullScreen', toggleFullscreen); DOM.removeClass(body, 'mce-fullscreen');
DOM.removeClass(documentElement, 'mce-fullscreen');
DOM.removeClass(editorContainer, 'mce-fullscreen');
DOM.unbind(window, 'resize', resizeHandler);
setScrollPos(scrollPos);
}
editor.addMenuItem('fullscreen', { editor.fire('FullscreenStateChanged', { state: fullscreenState });
text: 'Fullscreen', }
shortcut: 'Ctrl+Shift+F',
selectable: true,
onClick: function() {
toggleFullscreen();
editor.focus();
},
onPostRender: function() {
var self = this;
editor.on('FullscreenStateChanged', function(e) { editor.on('init', function () {
self.active(e.state); editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen);
}); });
},
context: 'view'
});
editor.addButton('fullscreen', { editor.on('remove', function () {
tooltip: 'Fullscreen', if (resizeHandler) {
shortcut: 'Ctrl+Shift+F', DOM.unbind(window, 'resize', resizeHandler);
onClick: toggleFullscreen, }
onPostRender: function() { });
var self = this;
editor.on('FullscreenStateChanged', function(e) { editor.addCommand('mceFullScreen', toggleFullscreen);
self.active(e.state);
});
}
});
return { editor.addMenuItem('fullscreen', {
isFullscreen: function() { text: 'Fullscreen',
return fullscreenState; shortcut: 'Ctrl+Shift+F',
} selectable: true,
}; onClick: function () {
}); toggleFullscreen();
editor.focus();
},
onPostRender: function () {
var self = this;
editor.on('FullscreenStateChanged', function (e) {
self.active(e.state);
});
},
context: 'view'
});
editor.addButton('fullscreen', {
tooltip: 'Fullscreen',
shortcut: 'Ctrl+Shift+F',
onClick: toggleFullscreen,
onPostRender: function () {
var self = this;
editor.on('FullscreenStateChanged', function (e) {
self.active(e.state);
});
}
});
return {
isFullscreen: function () {
return fullscreenState;
}
};
});
return function () { };
}
);
dem('tinymce.plugins.fullscreen.Plugin')();
})();

View File

@ -1 +1 @@
tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,r=document,i=r.body;return i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){var e=tinymce.DOM.getViewPort();return{x:e.x,y:e.y}}function r(e){scrollTo(e.x,e.y)}function i(){function i(){f.setStyle(m,"height",t().h-(h.clientHeight-m.clientHeight))}var p,h,m,g,v=document.body,y=document.documentElement;d=!d,h=e.getContainer(),p=h.style,m=e.getContentAreaContainer().firstChild,g=m.style,d?(c=n(),o=g.width,a=g.height,g.width=g.height="100%",l=p.width,u=p.height,p.width=p.height="",f.addClass(v,"mce-fullscreen"),f.addClass(y,"mce-fullscreen"),f.addClass(h,"mce-fullscreen"),f.bind(window,"resize",i),i(),s=i):(g.width=o,g.height=a,l&&(p.width=l),u&&(p.height=u),f.removeClass(v,"mce-fullscreen"),f.removeClass(y,"mce-fullscreen"),f.removeClass(h,"mce-fullscreen"),f.unbind(window,"resize",s),r(c)),e.fire("FullscreenStateChanged",{state:d})}var o,a,s,l,u,c,d=!1,f=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Shift+F","",i)}),e.on("remove",function(){s&&f.unbind(window,"resize",s)}),e.addCommand("mceFullScreen",i),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){i(),e.focus()},onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Shift+F",onClick:i,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return d}}}); !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("3",tinymce.util.Tools.resolve),g("1",["3"],function(a){return a("tinymce.dom.DOMUtils")}),g("2",["3"],function(a){return a("tinymce.PluginManager")}),g("0",["1","2"],function(a,b){var c=a.DOM;return b.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function d(){var a=c.getViewPort();return{x:a.x,y:a.y}}function e(a){window.scrollTo(a.x,a.y)}function f(){function f(){c.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;m=!m,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,m?(l=d(),g=q.width,h=q.height,q.width=q.height="100%",j=n.width,k=n.height,n.width=n.height="",c.addClass(r,"mce-fullscreen"),c.addClass(s,"mce-fullscreen"),c.addClass(o,"mce-fullscreen"),c.bind(window,"resize",f),f(),i=f):(q.width=g,q.height=h,j&&(n.width=j),k&&(n.height=k),c.removeClass(r,"mce-fullscreen"),c.removeClass(s,"mce-fullscreen"),c.removeClass(o,"mce-fullscreen"),c.unbind(window,"resize",i),e(l)),a.fire("FullscreenStateChanged",{state:m})}var g,h,i,j,k,l,m=!1;if(!a.settings.inline)return a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",f)}),a.on("remove",function(){i&&c.unbind(window,"resize",i)}),a.addCommand("mceFullScreen",f),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){f(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Shift+F",onClick:f,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return m}}}),function(){}}),d("0")()}();

View File

@ -1,30 +1,152 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.hr.Plugin","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
'tinymce.core.PluginManager',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.PluginManager');
}
);
tinymce.PluginManager.add('hr', function(editor) { /**
editor.addCommand('InsertHorizontalRule', function() { * Plugin.js
editor.execCommand('mceInsertContent', false, '<hr />'); *
}); * Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
editor.addButton('hr', { /**
icon: 'hr', * This class contains all core logic for the hr plugin.
tooltip: 'Horizontal line', *
cmd: 'InsertHorizontalRule' * @class tinymce.hr.Plugin
}); * @private
*/
define(
'tinymce.plugins.hr.Plugin',
[
'tinymce.core.PluginManager'
],
function (PluginManager) {
PluginManager.add('hr', function (editor) {
editor.addCommand('InsertHorizontalRule', function () {
editor.execCommand('mceInsertContent', false, '<hr />');
});
editor.addMenuItem('hr', { editor.addButton('hr', {
icon: 'hr', icon: 'hr',
text: 'Horizontal line', tooltip: 'Horizontal line',
cmd: 'InsertHorizontalRule', cmd: 'InsertHorizontalRule'
context: 'insert' });
});
}); editor.addMenuItem('hr', {
icon: 'hr',
text: 'Horizontal line',
cmd: 'InsertHorizontalRule',
context: 'insert'
});
});
return function () { };
}
);
dem('tinymce.plugins.hr.Plugin')();
})();

View File

@ -1 +1 @@
tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("2",tinymce.util.Tools.resolve),g("1",["2"],function(a){return a("tinymce.PluginManager")}),g("0",["1"],function(a){return a.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),function(){}}),d("0")()}();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,120 +1,348 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.tabfocus.Plugin","tinymce.core.PluginManager","tinymce.core.dom.DOMUtils","tinymce.core.util.Tools","tinymce.core.EditorManager","tinymce.core.util.Delay","tinymce.core.Env","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
'tinymce.core.PluginManager',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.PluginManager');
}
);
tinymce.PluginManager.add('tabfocus', function(editor) { /**
var DOM = tinymce.DOM, each = tinymce.each, explode = tinymce.explode; * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
function tabCancel(e) { define(
if (e.keyCode === 9 && !e.ctrlKey && !e.altKey && !e.metaKey) { 'tinymce.core.dom.DOMUtils',
e.preventDefault(); [
} 'global!tinymce.util.Tools.resolve'
} ],
function (resolve) {
return resolve('tinymce.dom.DOMUtils');
}
);
function tabHandler(e) { /**
var x, el, v, i; * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { define(
return; 'tinymce.core.util.Tools',
} [
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.util.Tools');
}
);
function find(direction) { /**
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
function canSelectRecursive(e) { define(
return e.nodeName === "BODY" || (e.type != 'hidden' && 'tinymce.core.EditorManager',
e.style.display != "none" && [
e.style.visibility != "hidden" && canSelectRecursive(e.parentNode)); 'global!tinymce.util.Tools.resolve'
} ],
function (resolve) {
return resolve('tinymce.EditorManager');
}
);
function canSelect(el) { /**
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && tinymce.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el); * ResolveGlobal.js
} *
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
each(el, function(e, i) { define(
if (e.id == editor.id) { 'tinymce.core.util.Delay',
x = i; [
return false; 'global!tinymce.util.Tools.resolve'
} ],
}); function (resolve) {
if (direction > 0) { return resolve('tinymce.util.Delay');
for (i = x + 1; i < el.length; i++) { }
if (canSelect(el[i])) { );
return el[i];
}
}
} else {
for (i = x - 1; i >= 0; i--) {
if (canSelect(el[i])) {
return el[i];
}
}
}
return null; /**
} * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); define(
'tinymce.core.Env',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.Env');
}
);
if (v.length == 1) { /**
v[1] = v[0]; * Plugin.js
v[0] = ':prev'; *
} * Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
// Find element to focus /**
if (e.shiftKey) { * This class contains all core logic for the code plugin.
if (v[0] == ':prev') { *
el = find(-1); * @class tinymce.tabfocus.Plugin
} else { * @private
el = DOM.get(v[0]); */
} define(
} else { 'tinymce.plugins.tabfocus.Plugin',
if (v[1] == ':next') { [
el = find(1); 'tinymce.core.PluginManager',
} else { 'tinymce.core.dom.DOMUtils',
el = DOM.get(v[1]); 'tinymce.core.util.Tools',
} 'tinymce.core.EditorManager',
} 'tinymce.core.util.Delay',
'tinymce.core.Env'
],
function (PluginManager, DOMUtils, Tools, EditorManager, Delay, Env) {
PluginManager.add('tabfocus', function (editor) {
var DOM = DOMUtils.DOM;
if (el) { function tabCancel(e) {
var focusEditor = tinymce.get(el.id || el.name); if (e.keyCode === 9 && !e.ctrlKey && !e.altKey && !e.metaKey) {
e.preventDefault();
}
}
if (el.id && focusEditor) { function tabHandler(e) {
focusEditor.focus(); var x, el, v, i;
} else {
tinymce.util.Delay.setTimeout(function() {
if (!tinymce.Env.webkit) {
window.focus();
}
el.focus(); if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
}, 10); return;
} }
e.preventDefault(); function find(direction) {
} el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
}
editor.on('init', function() { function canSelectRecursive(e) {
if (editor.inline) { return e.nodeName === "BODY" || (e.type != 'hidden' &&
// Remove default tabIndex in inline mode e.style.display != "none" &&
tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null); e.style.visibility != "hidden" && canSelectRecursive(e.parentNode));
} }
editor.on('keyup', tabCancel); function canSelect(el) {
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && EditorManager.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el);
}
if (tinymce.Env.gecko) { Tools.each(el, function (e, i) {
editor.on('keypress keydown', tabHandler); if (e.id == editor.id) {
} else { x = i;
editor.on('keydown', tabHandler); return false;
} }
}); });
}); if (direction > 0) {
for (i = x + 1; i < el.length; i++) {
if (canSelect(el[i])) {
return el[i];
}
}
} else {
for (i = x - 1; i >= 0; i--) {
if (canSelect(el[i])) {
return el[i];
}
}
}
return null;
}
v = Tools.explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next')));
if (v.length == 1) {
v[1] = v[0];
v[0] = ':prev';
}
// Find element to focus
if (e.shiftKey) {
if (v[0] == ':prev') {
el = find(-1);
} else {
el = DOM.get(v[0]);
}
} else {
if (v[1] == ':next') {
el = find(1);
} else {
el = DOM.get(v[1]);
}
}
if (el) {
var focusEditor = EditorManager.get(el.id || el.name);
if (el.id && focusEditor) {
focusEditor.focus();
} else {
Delay.setTimeout(function () {
if (!Env.webkit) {
window.focus();
}
el.focus();
}, 10);
}
e.preventDefault();
}
}
editor.on('init', function () {
if (editor.inline) {
// Remove default tabIndex in inline mode
DOM.setAttrib(editor.getBody(), 'tabIndex', null);
}
editor.on('keyup', tabCancel);
if (Env.gecko) {
editor.on('keypress keydown', tabHandler);
} else {
editor.on('keydown', tabHandler);
}
});
});
return function () { };
}
);
dem('tinymce.plugins.tabfocus.Plugin')();
})();

View File

@ -1 +1 @@
tinymce.PluginManager.add("tabfocus",function(e){function t(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function n(t){function n(n){function o(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&o(e.parentNode)}function l(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&tinymce.get(t.id)&&e.tabIndex!=-1&&o(e)}if(s=r.select(":input:enabled,*[tabindex]:not(iframe)"),i(s,function(t,n){if(t.id==e.id)return a=n,!1}),n>0){for(u=a+1;u<s.length;u++)if(l(s[u]))return s[u]}else for(u=a-1;u>=0;u--)if(l(s[u]))return s[u];return null}var a,s,l,u;if(!(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(l=o(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==l.length&&(l[1]=l[0],l[0]=":prev"),s=t.shiftKey?":prev"==l[0]?n(-1):r.get(l[0]):":next"==l[1]?n(1):r.get(l[1]))){var c=tinymce.get(s.id||s.name);s.id&&c?c.focus():tinymce.util.Delay.setTimeout(function(){tinymce.Env.webkit||window.focus(),s.focus()},10),t.preventDefault()}}var r=tinymce.DOM,i=tinymce.each,o=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)})}); !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("7",tinymce.util.Tools.resolve),g("1",["7"],function(a){return a("tinymce.PluginManager")}),g("2",["7"],function(a){return a("tinymce.dom.DOMUtils")}),g("3",["7"],function(a){return a("tinymce.util.Tools")}),g("4",["7"],function(a){return a("tinymce.EditorManager")}),g("5",["7"],function(a){return a("tinymce.util.Delay")}),g("6",["7"],function(a){return a("tinymce.Env")}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){return a.add("tabfocus",function(a){function g(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function h(b){function g(e){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function g(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&d.get(b.id)&&a.tabIndex!=-1&&f(a)}if(j=i.select(":input:enabled,*[tabindex]:not(iframe)"),c.each(j,function(b,c){if(b.id==a.id)return h=c,!1}),e>0){for(l=h+1;l<j.length;l++)if(g(j[l]))return j[l]}else for(l=h-1;l>=0;l--)if(g(j[l]))return j[l];return null}var h,j,k,l;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(k=c.explode(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==k.length&&(k[1]=k[0],k[0]=":prev"),j=b.shiftKey?":prev"==k[0]?g(-1):i.get(k[0]):":next"==k[1]?g(1):i.get(k[1]))){var m=d.get(j.id||j.name);j.id&&m?m.focus():e.setTimeout(function(){f.webkit||window.focus(),j.focus()},10),b.preventDefault()}}var i=b.DOM;a.on("init",function(){a.inline&&i.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",g),f.gecko?a.on("keypress keydown",h):a.on("keydown",h)})}),function(){}}),d("0")()}();

View File

@ -1,297 +1,483 @@
(function () {
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
// Used when there is no 'main' module.
// The name is probably (hopefully) unique so minification removes for releases.
var register_3795 = function (id) {
var module = dem(id);
var fragments = id.split('.');
var target = Function('return this;')();
for (var i = 0; i < fragments.length - 1; ++i) {
if (target[fragments[i]] === undefined)
target[fragments[i]] = {};
target = target[fragments[i]];
}
target[fragments[fragments.length - 1]] = module;
};
var instantiate = function (id) {
var actual = defs[id];
var dependencies = actual.deps;
var definition = actual.defn;
var len = dependencies.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances[i] = dem(dependencies[i]);
var defResult = definition.apply(null, instances);
if (defResult === undefined)
throw 'module [' + id + '] returned undefined';
actual.instance = defResult;
};
var def = function (id, dependencies, definition) {
if (typeof id !== 'string')
throw 'module id must be a string';
else if (dependencies === undefined)
throw 'no dependencies for ' + id;
else if (definition === undefined)
throw 'no definition function for ' + id;
defs[id] = {
deps: dependencies,
defn: definition,
instance: undefined
};
};
var dem = function (id) {
var actual = defs[id];
if (actual === undefined)
throw 'module [' + id + '] was undefined';
else if (actual.instance === undefined)
instantiate(id);
return actual.instance;
};
var req = function (ids, callback) {
var len = ids.length;
var instances = new Array(len);
for (var i = 0; i < len; ++i)
instances.push(dem(ids[i]));
callback.apply(null, callback);
};
var ephox = {};
ephox.bolt = {
module: {
api: {
define: def,
require: req,
demand: dem
}
}
};
var define = def;
var require = req;
var demand = dem;
// this helps with minificiation when using a lot of global references
var defineGlobal = function (id, ref) {
define(id, [], function () { return ref; });
};
/*jsc
["tinymce.plugins.textcolor.Plugin","tinymce.core.dom.DOMUtils","tinymce.core.PluginManager","tinymce.core.util.I18n","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"]
jsc*/
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
/** /**
* plugin.js * ResolveGlobal.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/*global tinymce:true */ define(
/*eslint consistent-this:0 */ 'tinymce.core.dom.DOMUtils',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.dom.DOMUtils');
}
);
tinymce.PluginManager.add('textcolor', function(editor) { /**
var cols, rows; * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
rows = { define(
forecolor: editor.settings.forecolor_rows || editor.settings.textcolor_rows || 5, 'tinymce.core.PluginManager',
backcolor: editor.settings.backcolor_rows || editor.settings.textcolor_rows || 5 [
}; 'global!tinymce.util.Tools.resolve'
cols = { ],
forecolor: editor.settings.forecolor_cols || editor.settings.textcolor_cols || 8, function (resolve) {
backcolor: editor.settings.backcolor_cols || editor.settings.textcolor_cols || 8 return resolve('tinymce.PluginManager');
}; }
);
function getCurrentColor(format) { /**
var color; * ResolveGlobal.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
editor.dom.getParents(editor.selection.getStart(), function(elm) { define(
var value; 'tinymce.core.util.I18n',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.util.I18n');
}
);
if ((value = elm.style[format == 'forecolor' ? 'color' : 'background-color'])) { /**
color = value; * ResolveGlobal.js
} *
}); * Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
return color; define(
} 'tinymce.core.util.Tools',
[
'global!tinymce.util.Tools.resolve'
],
function (resolve) {
return resolve('tinymce.util.Tools');
}
);
function mapColors(type) { /**
var i, colors = [], colorMap; * Plugin.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
colorMap = [ /**
"000000", "Black", * This class contains all core logic for the code plugin.
"993300", "Burnt orange", *
"333300", "Dark olive", * @class tinymce.textcolor.Plugin
"003300", "Dark green", * @private
"003366", "Dark azure", */
"000080", "Navy Blue", define(
"333399", "Indigo", 'tinymce.plugins.textcolor.Plugin',
"333333", "Very dark gray", [
"800000", "Maroon", 'tinymce.core.dom.DOMUtils',
"FF6600", "Orange", 'tinymce.core.PluginManager',
"808000", "Olive", 'tinymce.core.util.I18n',
"008000", "Green", 'tinymce.core.util.Tools'
"008080", "Teal", ],
"0000FF", "Blue", function (DOMUtils, PluginManager, I18n, Tools) {
"666699", "Grayish blue", var translate = I18n.translate;
"808080", "Gray",
"FF0000", "Red",
"FF9900", "Amber",
"99CC00", "Yellow green",
"339966", "Sea green",
"33CCCC", "Turquoise",
"3366FF", "Royal blue",
"800080", "Purple",
"999999", "Medium gray",
"FF00FF", "Magenta",
"FFCC00", "Gold",
"FFFF00", "Yellow",
"00FF00", "Lime",
"00FFFF", "Aqua",
"00CCFF", "Sky blue",
"993366", "Red violet",
"FFFFFF", "White",
"FF99CC", "Pink",
"FFCC99", "Peach",
"FFFF99", "Light yellow",
"CCFFCC", "Pale green",
"CCFFFF", "Pale cyan",
"99CCFF", "Light sky blue",
"CC99FF", "Plum"
];
colorMap = editor.settings.textcolor_map || colorMap; PluginManager.add('textcolor', function (editor) {
colorMap = editor.settings[type + '_map'] || colorMap; var cols, rows;
for (i = 0; i < colorMap.length; i += 2) { rows = {
colors.push({ forecolor: editor.settings.forecolor_rows || editor.settings.textcolor_rows || 5,
text: colorMap[i + 1], backcolor: editor.settings.backcolor_rows || editor.settings.textcolor_rows || 5
color: '#' + colorMap[i] };
}); cols = {
} forecolor: editor.settings.forecolor_cols || editor.settings.textcolor_cols || 8,
backcolor: editor.settings.backcolor_cols || editor.settings.textcolor_cols || 8
};
return colors; function getCurrentColor(format) {
} var color;
function renderColorPicker() { editor.dom.getParents(editor.selection.getStart(), function (elm) {
var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0, type; var value;
type = ctrl.settings.origin; if ((value = elm.style[format == 'forecolor' ? 'color' : 'background-color'])) {
color = value;
}
});
function getColorCellHtml(color, title) { return color;
var isNoColor = color == 'transparent'; }
return ( function mapColors(type) {
'<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' + var i, colors = [], colorMap;
'<div id="' + id + '-' + (count++) + '"' +
' data-mce-color="' + (color ? color : '') + '"' +
' role="option"' +
' tabIndex="-1"' +
' style="' + (color ? 'background-color: ' + color : '') + '"' +
' title="' + tinymce.translate(title) + '">' +
(isNoColor ? '&#215;' : '') +
'</div>' +
'</td>'
);
}
colors = mapColors(type); colorMap = [
colors.push({ "000000", "Black",
text: tinymce.translate("No color"), "993300", "Burnt orange",
color: "transparent" "333300", "Dark olive",
}); "003300", "Dark green",
"003366", "Dark azure",
"000080", "Navy Blue",
"333399", "Indigo",
"333333", "Very dark gray",
"800000", "Maroon",
"FF6600", "Orange",
"808000", "Olive",
"008000", "Green",
"008080", "Teal",
"0000FF", "Blue",
"666699", "Grayish blue",
"808080", "Gray",
"FF0000", "Red",
"FF9900", "Amber",
"99CC00", "Yellow green",
"339966", "Sea green",
"33CCCC", "Turquoise",
"3366FF", "Royal blue",
"800080", "Purple",
"999999", "Medium gray",
"FF00FF", "Magenta",
"FFCC00", "Gold",
"FFFF00", "Yellow",
"00FF00", "Lime",
"00FFFF", "Aqua",
"00CCFF", "Sky blue",
"993366", "Red violet",
"FFFFFF", "White",
"FF99CC", "Pink",
"FFCC99", "Peach",
"FFFF99", "Light yellow",
"CCFFCC", "Pale green",
"CCFFFF", "Pale cyan",
"99CCFF", "Light sky blue",
"CC99FF", "Plum"
];
html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>'; colorMap = editor.settings.textcolor_map || colorMap;
last = colors.length - 1; colorMap = editor.settings[type + '_map'] || colorMap;
for (y = 0; y < rows[type]; y++) { for (i = 0; i < colorMap.length; i += 2) {
html += '<tr>'; colors.push({
text: colorMap[i + 1],
color: '#' + colorMap[i]
});
}
for (x = 0; x < cols[type]; x++) { return colors;
i = y * cols[type] + x; }
if (i > last) { function renderColorPicker() {
html += '<td></td>'; var self = this, colors, color, html, last, x, y, i, id = self._id, count = 0, type;
} else {
color = colors[i];
html += getColorCellHtml(color.color, color.text);
}
}
html += '</tr>'; type = self.settings.origin;
}
if (editor.settings.color_picker_callback) { function getColorCellHtml(color, title) {
html += ( var isNoColor = color == 'transparent';
'<tr>' +
'<td colspan="' + cols[type] + '" class="mce-custom-color-btn">' +
'<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' +
'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' +
'<button type="button" role="presentation" tabindex="-1">' + tinymce.translate('Custom...') + '</button>' +
'</div>' +
'</td>' +
'</tr>'
);
html += '<tr>'; return (
'<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' +
'<div id="' + id + '-' + (count++) + '"' +
' data-mce-color="' + (color ? color : '') + '"' +
' role="option"' +
' tabIndex="-1"' +
' style="' + (color ? 'background-color: ' + color : '') + '"' +
' title="' + translate(title) + '">' +
(isNoColor ? '&#215;' : '') +
'</div>' +
'</td>'
);
}
for (x = 0; x < cols[type]; x++) { colors = mapColors(type);
html += getColorCellHtml('', 'Custom color'); colors.push({
} text: translate("No color"),
color: "transparent"
});
html += '</tr>'; html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
} last = colors.length - 1;
html += '</tbody></table>'; for (y = 0; y < rows[type]; y++) {
html += '<tr>';
return html; for (x = 0; x < cols[type]; x++) {
} i = y * cols[type] + x;
function applyFormat(format, value) { if (i > last) {
editor.undoManager.transact(function() { html += '<td></td>';
editor.focus(); } else {
editor.formatter.apply(format, {value: value}); color = colors[i];
editor.nodeChanged(); html += getColorCellHtml(color.color, color.text);
}); }
} }
function removeFormat(format) { html += '</tr>';
editor.undoManager.transact(function() { }
editor.focus();
editor.formatter.remove(format, {value: null}, null, true);
editor.nodeChanged();
});
}
function onPanelClick(e) { if (editor.settings.color_picker_callback) {
var buttonCtrl = this.parent(), value, type; html += (
'<tr>' +
'<td colspan="' + cols[type] + '" class="mce-custom-color-btn">' +
'<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' +
'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' +
'<button type="button" role="presentation" tabindex="-1">' + translate('Custom...') + '</button>' +
'</div>' +
'</td>' +
'</tr>'
);
type = buttonCtrl.settings.origin; html += '<tr>';
function selectColor(value) { for (x = 0; x < cols[type]; x++) {
buttonCtrl.hidePanel(); html += getColorCellHtml('', 'Custom color');
buttonCtrl.color(value); }
applyFormat(buttonCtrl.settings.format, value);
}
function resetColor() { html += '</tr>';
buttonCtrl.hidePanel(); }
buttonCtrl.resetColor();
removeFormat(buttonCtrl.settings.format);
}
function setDivColor(div, value) { html += '</tbody></table>';
div.style.background = value;
div.setAttribute('data-mce-color', value);
}
if (tinymce.DOM.getParent(e.target, '.mce-custom-color-btn')) { return html;
buttonCtrl.hidePanel(); }
editor.settings.color_picker_callback.call(editor, function(value) { function applyFormat(format, value) {
var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0]; editor.undoManager.transact(function () {
var customColorCells, div, i; editor.focus();
editor.formatter.apply(format, { value: value });
editor.nodeChanged();
});
}
customColorCells = tinymce.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function(elm) { function removeFormat(format) {
return elm.firstChild; editor.undoManager.transact(function () {
}); editor.focus();
editor.formatter.remove(format, { value: null }, null, true);
editor.nodeChanged();
});
}
for (i = 0; i < customColorCells.length; i++) { function onPanelClick(e) {
div = customColorCells[i]; var buttonCtrl = this.parent(), value, type;
if (!div.getAttribute('data-mce-color')) {
break;
}
}
// Shift colors to the right type = buttonCtrl.settings.origin;
// TODO: Might need to be the left on RTL
if (i == cols[type]) {
for (i = 0; i < cols[type] - 1; i++) {
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
}
}
setDivColor(div, value); function selectColor(value) {
selectColor(value); buttonCtrl.hidePanel();
}, getCurrentColor(buttonCtrl.settings.format)); buttonCtrl.color(value);
} applyFormat(buttonCtrl.settings.format, value);
}
value = e.target.getAttribute('data-mce-color'); function resetColor() {
if (value) { buttonCtrl.hidePanel();
if (this.lastId) { buttonCtrl.resetColor();
document.getElementById(this.lastId).setAttribute('aria-selected', false); removeFormat(buttonCtrl.settings.format);
} }
e.target.setAttribute('aria-selected', true); function setDivColor(div, value) {
this.lastId = e.target.id; div.style.background = value;
div.setAttribute('data-mce-color', value);
}
if (value == 'transparent') { if (DOMUtils.DOM.getParent(e.target, '.mce-custom-color-btn')) {
resetColor(); buttonCtrl.hidePanel();
} else {
selectColor(value);
}
} else if (value !== null) {
buttonCtrl.hidePanel();
}
}
function onButtonClick() { editor.settings.color_picker_callback.call(editor, function (value) {
var self = this; var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
var customColorCells, div, i;
if (self._color) { customColorCells = Tools.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
applyFormat(self.settings.format, self._color); return elm.firstChild;
} else { });
removeFormat(self.settings.format);
}
}
editor.addButton('forecolor', { for (i = 0; i < customColorCells.length; i++) {
type: 'colorbutton', div = customColorCells[i];
tooltip: 'Text color', if (!div.getAttribute('data-mce-color')) {
format: 'forecolor', break;
panel: { }
origin: 'forecolor', }
role: 'application',
ariaRemember: true,
html: renderColorPicker,
onclick: onPanelClick
},
onclick: onButtonClick
});
editor.addButton('backcolor', { // Shift colors to the right
type: 'colorbutton', // TODO: Might need to be the left on RTL
tooltip: 'Background color', if (i == cols[type]) {
format: 'hilitecolor', for (i = 0; i < cols[type] - 1; i++) {
panel: { setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
origin: 'backcolor', }
role: 'application', }
ariaRemember: true,
html: renderColorPicker, setDivColor(div, value);
onclick: onPanelClick selectColor(value);
}, }, getCurrentColor(buttonCtrl.settings.format));
onclick: onButtonClick }
});
}); value = e.target.getAttribute('data-mce-color');
if (value) {
if (this.lastId) {
document.getElementById(this.lastId).setAttribute('aria-selected', false);
}
e.target.setAttribute('aria-selected', true);
this.lastId = e.target.id;
if (value == 'transparent') {
resetColor();
} else {
selectColor(value);
}
} else if (value !== null) {
buttonCtrl.hidePanel();
}
}
function onButtonClick() {
var self = this;
if (self._color) {
applyFormat(self.settings.format, self._color);
} else {
removeFormat(self.settings.format);
}
}
editor.addButton('forecolor', {
type: 'colorbutton',
tooltip: 'Text color',
format: 'forecolor',
panel: {
origin: 'forecolor',
role: 'application',
ariaRemember: true,
html: renderColorPicker,
onclick: onPanelClick
},
onclick: onButtonClick
});
editor.addButton('backcolor', {
type: 'colorbutton',
tooltip: 'Background color',
format: 'hilitecolor',
panel: {
origin: 'backcolor',
role: 'application',
ariaRemember: true,
html: renderColorPicker,
onclick: onPanelClick
},
onclick: onButtonClick
});
});
return function () { };
}
);
dem('tinymce.plugins.textcolor.Plugin')();
})();

File diff suppressed because one or more lines are too long

View File

@ -682,6 +682,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
mceIframe = document.getElementById( editor.id + '_ifr' ), mceIframe = document.getElementById( editor.id + '_ifr' ),
mceToolbar, mceToolbar,
mceStatusbar, mceStatusbar,
namesAdded,
wpStatusbar; wpStatusbar;
if ( container ) { if ( container ) {
@ -699,7 +700,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
buttonGroup; buttonGroup;
each( buttons, function( item ) { each( buttons, function( item ) {
var itemName; var itemName, ui, name;
function bindSelectorChanged() { function bindSelectorChanged() {
var selection = editor.selection; var selection = editor.selection;
@ -767,6 +768,19 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
buttonGroup = null; buttonGroup = null;
} else { } else {
// Add the new WP* types to the factory
if ( ! namesAdded ) {
ui = tinymce.ui;
for ( name in ui ) {
if ( name.toLowerCase().indexOf( 'wp' ) === 0 ) {
Factory.add( name, ui[name] );
}
}
namesAdded = true;
}
if ( ! buttonGroup ) { if ( ! buttonGroup ) {
buttonGroup = { buttonGroup = {
type: 'buttongroup', type: 'buttongroup',

View File

@ -92,13 +92,7 @@
} ); } );
// Replace any new markers nodes with views. // Replace any new markers nodes with views.
editor.on( 'setcontent', function( event ) { editor.on( 'setcontent', function() {
if ( event.load && ! event.initial && editor.quirks.refreshContentEditable ) {
// Make sure there is a selection in Gecko browsers.
// Or it will refresh the content internally which resets the iframes.
editor.quirks.refreshContentEditable();
}
wp.mce.views.render(); wp.mce.views.render();
} ); } );

View File

@ -1 +1 @@
.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1} .mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1}.mce-content-body p,.mce-content-body div,.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{line-height:1.2em}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-content-body a[data-mce-selected],.mce-content-body code[data-mce-selected]{background:#bfe6ff}.mce-content-body hr{cursor:default}

View File

@ -1 +1 @@
body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1} body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1}.mce-content-body p,.mce-content-body div,.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{line-height:1.2em}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-content-body a[data-mce-selected],.mce-content-body code[data-mce-selected]{background:#bfe6ff}.mce-content-body hr{cursor:default}

View File

@ -1 +0,0 @@
Icons are generated and provided by the http://icomoon.io service.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,69 +2,71 @@
* editable_selects.js * editable_selects.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
var TinyMCE_EditableSelects = { var TinyMCE_EditableSelects = {
editSelectElm : null, editSelectElm : null,
init : function() { init : function () {
var nl = document.getElementsByTagName("select"), i, d = document, o; var nl = document.getElementsByTagName("select"), i, d = document, o;
for (i=0; i<nl.length; i++) { for (i = 0; i < nl.length; i++) {
if (nl[i].className.indexOf('mceEditableSelect') != -1) { if (nl[i].className.indexOf('mceEditableSelect') != -1) {
o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__'); o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
o.className = 'mceAddSelectValue'; o.className = 'mceAddSelectValue';
nl[i].options[nl[i].options.length] = o; nl[i].options[nl[i].options.length] = o;
nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect; nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
} }
} }
}, },
onChangeEditableSelect : function(e) { onChangeEditableSelect : function (e) {
var d = document, ne, se = window.event ? window.event.srcElement : e.target; var d = document, ne, se = window.event ? window.event.srcElement : e.target;
if (se.options[se.selectedIndex].value == '__mce_add_custom__') { if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
ne = d.createElement("input"); ne = d.createElement("input");
ne.id = se.id + "_custom"; ne.id = se.id + "_custom";
ne.name = se.name + "_custom"; ne.name = se.name + "_custom";
ne.type = "text"; ne.type = "text";
ne.style.width = se.offsetWidth + 'px'; ne.style.width = se.offsetWidth + 'px';
se.parentNode.insertBefore(ne, se); se.parentNode.insertBefore(ne, se);
se.style.display = 'none'; se.style.display = 'none';
ne.focus(); ne.focus();
ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput; ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
ne.onkeydown = TinyMCE_EditableSelects.onKeyDown; ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
TinyMCE_EditableSelects.editSelectElm = se; TinyMCE_EditableSelects.editSelectElm = se;
} }
}, },
onBlurEditableSelectInput : function() { onBlurEditableSelectInput : function () {
var se = TinyMCE_EditableSelects.editSelectElm; var se = TinyMCE_EditableSelects.editSelectElm;
if (se) { if (se) {
if (se.previousSibling.value != '') { if (se.previousSibling.value != '') {
addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value); addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
selectByValue(document.forms[0], se.id, se.previousSibling.value); selectByValue(document.forms[0], se.id, se.previousSibling.value);
} else } else {
selectByValue(document.forms[0], se.id, ''); selectByValue(document.forms[0], se.id, '');
}
se.style.display = 'inline'; se.style.display = 'inline';
se.parentNode.removeChild(se.previousSibling); se.parentNode.removeChild(se.previousSibling);
TinyMCE_EditableSelects.editSelectElm = null; TinyMCE_EditableSelects.editSelectElm = null;
} }
}, },
onKeyDown : function(e) { onKeyDown : function (e) {
e = e || window.event; e = e || window.event;
if (e.keyCode == 13) if (e.keyCode == 13) {
TinyMCE_EditableSelects.onBlurEditableSelectInput(); TinyMCE_EditableSelects.onBlurEditableSelectInput();
} }
}
}; };

View File

@ -2,7 +2,7 @@
* form_utils.js * form_utils.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
@ -11,200 +11,212 @@
var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
function getColorPickerHTML(id, target_form_element) { function getColorPickerHTML(id, target_form_element) {
var h = "", dom = tinyMCEPopup.dom; var h = "", dom = tinyMCEPopup.dom;
if (label = dom.select('label[for=' + target_form_element + ']')[0]) { if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
label.id = label.id || dom.uniqueId(); label.id = label.id || dom.uniqueId();
} }
h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">'; h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element + '\');" onmousedown="return false;" class="pickcolor">';
h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>'; h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
return h; return h;
} }
function updateColor(img_id, form_element_id) { function updateColor(img_id, form_element_id) {
document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
} }
function setBrowserDisabled(id, state) { function setBrowserDisabled(id, state) {
var img = document.getElementById(id); var img = document.getElementById(id);
var lnk = document.getElementById(id + "_link"); var lnk = document.getElementById(id + "_link");
if (lnk) { if (lnk) {
if (state) { if (state) {
lnk.setAttribute("realhref", lnk.getAttribute("href")); lnk.setAttribute("realhref", lnk.getAttribute("href"));
lnk.removeAttribute("href"); lnk.removeAttribute("href");
tinyMCEPopup.dom.addClass(img, 'disabled'); tinyMCEPopup.dom.addClass(img, 'disabled');
} else { } else {
if (lnk.getAttribute("realhref")) if (lnk.getAttribute("realhref")) {
lnk.setAttribute("href", lnk.getAttribute("realhref")); lnk.setAttribute("href", lnk.getAttribute("realhref"));
}
tinyMCEPopup.dom.removeClass(img, 'disabled'); tinyMCEPopup.dom.removeClass(img, 'disabled');
} }
} }
} }
function getBrowserHTML(id, target_form_element, type, prefix) { function getBrowserHTML(id, target_form_element, type, prefix) {
var option = prefix + "_" + type + "_browser_callback", cb, html; var option = prefix + "_" + type + "_browser_callback", cb, html;
cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
if (!cb) if (!cb) {
return ""; return "";
}
html = ""; html = "";
html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">'; html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>'; html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
return html; return html;
} }
function openBrowser(img_id, target_form_element, type, option) { function openBrowser(img_id, target_form_element, type, option) {
var img = document.getElementById(img_id); var img = document.getElementById(img_id);
if (img.className != "mceButtonDisabled") if (img.className != "mceButtonDisabled") {
tinyMCEPopup.openBrowser(target_form_element, type, option); tinyMCEPopup.openBrowser(target_form_element, type, option);
}
} }
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
if (!form_obj || !form_obj.elements[field_name]) if (!form_obj || !form_obj.elements[field_name]) {
return; return;
}
if (!value) if (!value) {
value = ""; value = "";
}
var sel = form_obj.elements[field_name]; var sel = form_obj.elements[field_name];
var found = false; var found = false;
for (var i=0; i<sel.options.length; i++) { for (var i = 0; i < sel.options.length; i++) {
var option = sel.options[i]; var option = sel.options[i];
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
option.selected = true; option.selected = true;
found = true; found = true;
} else } else {
option.selected = false; option.selected = false;
} }
}
if (!found && add_custom && value != '') { if (!found && add_custom && value != '') {
var option = new Option(value, value); var option = new Option(value, value);
option.selected = true; option.selected = true;
sel.options[sel.options.length] = option; sel.options[sel.options.length] = option;
sel.selectedIndex = sel.options.length - 1; sel.selectedIndex = sel.options.length - 1;
} }
return found; return found;
} }
function getSelectValue(form_obj, field_name) { function getSelectValue(form_obj, field_name) {
var elm = form_obj.elements[field_name]; var elm = form_obj.elements[field_name];
if (elm == null || elm.options == null || elm.selectedIndex === -1) if (elm == null || elm.options == null || elm.selectedIndex === -1) {
return ""; return "";
}
return elm.options[elm.selectedIndex].value; return elm.options[elm.selectedIndex].value;
} }
function addSelectValue(form_obj, field_name, name, value) { function addSelectValue(form_obj, field_name, name, value) {
var s = form_obj.elements[field_name]; var s = form_obj.elements[field_name];
var o = new Option(name, value); var o = new Option(name, value);
s.options[s.options.length] = o; s.options[s.options.length] = o;
} }
function addClassesToList(list_id, specific_option) { function addClassesToList(list_id, specific_option) {
// Setup class droplist // Setup class droplist
var styleSelectElm = document.getElementById(list_id); var styleSelectElm = document.getElementById(list_id);
var styles = tinyMCEPopup.getParam('theme_advanced_styles', false); var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
styles = tinyMCEPopup.getParam(specific_option, styles); styles = tinyMCEPopup.getParam(specific_option, styles);
if (styles) { if (styles) {
var stylesAr = styles.split(';'); var stylesAr = styles.split(';');
for (var i=0; i<stylesAr.length; i++) { for (var i = 0; i < stylesAr.length; i++) {
if (stylesAr != "") { if (stylesAr != "") {
var key, value; var key, value;
key = stylesAr[i].split('=')[0]; key = stylesAr[i].split('=')[0];
value = stylesAr[i].split('=')[1]; value = stylesAr[i].split('=')[1];
styleSelectElm.options[styleSelectElm.length] = new Option(key, value); styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
} }
} }
} else { } else {
/*tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) { /*tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']); styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
});*/ });*/
} }
} }
function isVisible(element_id) { function isVisible(element_id) {
var elm = document.getElementById(element_id); var elm = document.getElementById(element_id);
return elm && elm.style.display != "none"; return elm && elm.style.display != "none";
} }
function convertRGBToHex(col) { function convertRGBToHex(col) {
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
var rgb = col.replace(re, "$1,$2,$3").split(','); var rgb = col.replace(re, "$1,$2,$3").split(',');
if (rgb.length == 3) { if (rgb.length == 3) {
r = parseInt(rgb[0]).toString(16); r = parseInt(rgb[0]).toString(16);
g = parseInt(rgb[1]).toString(16); g = parseInt(rgb[1]).toString(16);
b = parseInt(rgb[2]).toString(16); b = parseInt(rgb[2]).toString(16);
r = r.length == 1 ? '0' + r : r; r = r.length == 1 ? '0' + r : r;
g = g.length == 1 ? '0' + g : g; g = g.length == 1 ? '0' + g : g;
b = b.length == 1 ? '0' + b : b; b = b.length == 1 ? '0' + b : b;
return "#" + r + g + b; return "#" + r + g + b;
} }
return col; return col;
} }
function convertHexToRGB(col) { function convertHexToRGB(col) {
if (col.indexOf('#') != -1) { if (col.indexOf('#') != -1) {
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
r = parseInt(col.substring(0, 2), 16); r = parseInt(col.substring(0, 2), 16);
g = parseInt(col.substring(2, 4), 16); g = parseInt(col.substring(2, 4), 16);
b = parseInt(col.substring(4, 6), 16); b = parseInt(col.substring(4, 6), 16);
return "rgb(" + r + "," + g + "," + b + ")"; return "rgb(" + r + "," + g + "," + b + ")";
} }
return col; return col;
} }
function trimSize(size) { function trimSize(size) {
return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2'); return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
} }
function getCSSSize(size) { function getCSSSize(size) {
size = trimSize(size); size = trimSize(size);
if (size == "") if (size == "") {
return ""; return "";
}
// Add px // Add px
if (/^[0-9]+$/.test(size)) if (/^[0-9]+$/.test(size)) {
size += 'px'; size += 'px';
// Sanity check, IE doesn't like broken values }
else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size))) // Sanity check, IE doesn't like broken values
return ""; else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size))) {
return "";
}
return size; return size;
} }
function getStyle(elm, attrib, style) { function getStyle(elm, attrib, style) {
var val = tinyMCEPopup.dom.getAttrib(elm, attrib); var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
if (val != '') if (val != '') {
return '' + val; return '' + val;
}
if (typeof(style) == 'undefined') if (typeof (style) == 'undefined') {
style = attrib; style = attrib;
}
return tinyMCEPopup.dom.getStyle(elm, style); return tinyMCEPopup.dom.getStyle(elm, style);
} }

View File

@ -2,7 +2,7 @@
* mctabs.js * mctabs.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
@ -11,154 +11,158 @@
/*jshint globals: tinyMCEPopup */ /*jshint globals: tinyMCEPopup */
function MCTabs() { function MCTabs() {
this.settings = []; this.settings = [];
this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher'); this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.plugins.util.Dispatcher');
}
MCTabs.prototype.init = function (settings) {
this.settings = settings;
}; };
MCTabs.prototype.init = function(settings) { MCTabs.prototype.getParam = function (name, default_value) {
this.settings = settings; var value = null;
value = (typeof (this.settings[name]) == "undefined") ? default_value : this.settings[name];
// Fix bool values
if (value == "true" || value == "false") {
return (value == "true");
}
return value;
}; };
MCTabs.prototype.getParam = function(name, default_value) { MCTabs.prototype.showTab = function (tab) {
var value = null; tab.className = 'current';
tab.setAttribute("aria-selected", true);
value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; tab.setAttribute("aria-expanded", true);
tab.tabIndex = 0;
// Fix bool values
if (value == "true" || value == "false")
return (value == "true");
return value;
}; };
MCTabs.prototype.showTab =function(tab){ MCTabs.prototype.hideTab = function (tab) {
tab.className = 'current'; var t = this;
tab.setAttribute("aria-selected", true);
tab.setAttribute("aria-expanded", true); tab.className = '';
tab.tabIndex = 0; tab.setAttribute("aria-selected", false);
tab.setAttribute("aria-expanded", false);
tab.tabIndex = -1;
}; };
MCTabs.prototype.hideTab =function(tab){ MCTabs.prototype.showPanel = function (panel) {
var t=this; panel.className = 'current';
panel.setAttribute("aria-hidden", false);
tab.className = '';
tab.setAttribute("aria-selected", false);
tab.setAttribute("aria-expanded", false);
tab.tabIndex = -1;
}; };
MCTabs.prototype.showPanel = function(panel) { MCTabs.prototype.hidePanel = function (panel) {
panel.className = 'current'; panel.className = 'panel';
panel.setAttribute("aria-hidden", false); panel.setAttribute("aria-hidden", true);
}; };
MCTabs.prototype.hidePanel = function(panel) { MCTabs.prototype.getPanelForTab = function (tabElm) {
panel.className = 'panel'; return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
panel.setAttribute("aria-hidden", true);
}; };
MCTabs.prototype.getPanelForTab = function(tabElm) { MCTabs.prototype.displayTab = function (tab_id, panel_id, avoid_focus) {
return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls"); var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
tabElm = document.getElementById(tab_id);
if (panel_id === undefined) {
panel_id = t.getPanelForTab(tabElm);
}
panelElm = document.getElementById(panel_id);
panelContainerElm = panelElm ? panelElm.parentNode : null;
tabContainerElm = tabElm ? tabElm.parentNode : null;
selectionClass = t.getParam('selection_class', 'current');
if (tabElm && tabContainerElm) {
nodes = tabContainerElm.childNodes;
// Hide all other tabs
for (i = 0; i < nodes.length; i++) {
if (nodes[i].nodeName == "LI") {
t.hideTab(nodes[i]);
}
}
// Show selected tab
t.showTab(tabElm);
}
if (panelElm && panelContainerElm) {
nodes = panelContainerElm.childNodes;
// Hide all other panels
for (i = 0; i < nodes.length; i++) {
if (nodes[i].nodeName == "DIV") {
t.hidePanel(nodes[i]);
}
}
if (!avoid_focus) {
tabElm.focus();
}
// Show selected panel
t.showPanel(panelElm);
}
}; };
MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) { MCTabs.prototype.getAnchor = function () {
var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this; var pos, url = document.location.href;
tabElm = document.getElementById(tab_id); if ((pos = url.lastIndexOf('#')) != -1) {
return url.substring(pos + 1);
}
if (panel_id === undefined) { return "";
panel_id = t.getPanelForTab(tabElm);
}
panelElm= document.getElementById(panel_id);
panelContainerElm = panelElm ? panelElm.parentNode : null;
tabContainerElm = tabElm ? tabElm.parentNode : null;
selectionClass = t.getParam('selection_class', 'current');
if (tabElm && tabContainerElm) {
nodes = tabContainerElm.childNodes;
// Hide all other tabs
for (i = 0; i < nodes.length; i++) {
if (nodes[i].nodeName == "LI") {
t.hideTab(nodes[i]);
}
}
// Show selected tab
t.showTab(tabElm);
}
if (panelElm && panelContainerElm) {
nodes = panelContainerElm.childNodes;
// Hide all other panels
for (i = 0; i < nodes.length; i++) {
if (nodes[i].nodeName == "DIV")
t.hidePanel(nodes[i]);
}
if (!avoid_focus) {
tabElm.focus();
}
// Show selected panel
t.showPanel(panelElm);
}
};
MCTabs.prototype.getAnchor = function() {
var pos, url = document.location.href;
if ((pos = url.lastIndexOf('#')) != -1)
return url.substring(pos + 1);
return "";
}; };
//Global instance //Global instance
var mcTabs = new MCTabs(); var mcTabs = new MCTabs();
tinyMCEPopup.onInit.add(function() { tinyMCEPopup.onInit.add(function () {
var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each; var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
each(dom.select('div.tabs'), function(tabContainerElm) { each(dom.select('div.tabs'), function (tabContainerElm) {
//var keyNav; //var keyNav;
dom.setAttrib(tabContainerElm, "role", "tablist"); dom.setAttrib(tabContainerElm, "role", "tablist");
var items = tinyMCEPopup.dom.select('li', tabContainerElm); var items = tinyMCEPopup.dom.select('li', tabContainerElm);
var action = function(id) { var action = function (id) {
mcTabs.displayTab(id, mcTabs.getPanelForTab(id)); mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
mcTabs.onChange.dispatch(id); mcTabs.onChange.dispatch(id);
}; };
each(items, function(item) { each(items, function (item) {
dom.setAttrib(item, 'role', 'tab'); dom.setAttrib(item, 'role', 'tab');
dom.bind(item, 'click', function(evt) { dom.bind(item, 'click', function (evt) {
action(item.id); action(item.id);
}); });
}); });
dom.bind(dom.getRoot(), 'keydown', function(evt) { dom.bind(dom.getRoot(), 'keydown', function (evt) {
if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
//keyNav.moveFocus(evt.shiftKey ? -1 : 1); //keyNav.moveFocus(evt.shiftKey ? -1 : 1);
tinymce.dom.Event.cancel(evt); tinymce.dom.Event.cancel(evt);
} }
}); });
each(dom.select('a', tabContainerElm), function(a) { each(dom.select('a', tabContainerElm), function (a) {
dom.setAttrib(a, 'tabindex', '-1'); dom.setAttrib(a, 'tabindex', '-1');
}); });
/*keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { /*keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.plugins.ui.KeyboardNavigation', {
root: tabContainerElm, root: tabContainerElm,
items: items, items: items,
onAction: action, onAction: action,
actOnFocus: true, actOnFocus: true,
enableLeftRight: true, enableLeftRight: true,
enableUpDown: true enableUpDown: true
}, tinyMCEPopup.dom);*/ }, tinyMCEPopup.dom);*/
}); }
);
}); });

View File

@ -2,251 +2,266 @@
* validate.js * validate.js
* *
* Released under LGPL License. * Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
* *
* License: http://www.tinymce.com/license * License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
/** /**
// String validation: // String validation:
if (!Validator.isEmail('myemail')) if (!Validator.isEmail('myemail'))
alert('Invalid email.'); alert('Invalid email.');
// Form validation: // Form validation:
var f = document.forms['myform']; var f = document.forms['myform'];
if (!Validator.isEmail(f.myemail)) if (!Validator.isEmail(f.myemail))
alert('Invalid email.'); alert('Invalid email.');
*/ */
var Validator = { var Validator = {
isEmail : function(s) { isEmail : function (s) {
return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
}, },
isAbsUrl : function(s) { isAbsUrl : function (s) {
return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
}, },
isSize : function(s) { isSize : function (s) {
return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
}, },
isId : function(s) { isId : function (s) {
return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
}, },
isEmpty : function(s) { isEmpty : function (s) {
var nl, i; var nl, i;
if (s.nodeName == 'SELECT' && s.selectedIndex < 1) if (s.nodeName == 'SELECT' && s.selectedIndex < 1) {
return true; return true;
}
if (s.type == 'checkbox' && !s.checked) if (s.type == 'checkbox' && !s.checked) {
return true; return true;
}
if (s.type == 'radio') { if (s.type == 'radio') {
for (i=0, nl = s.form.elements; i<nl.length; i++) { for (i = 0, nl = s.form.elements; i < nl.length; i++) {
if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked) if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked) {
return false; return false;
} }
}
return true; return true;
} }
return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s); return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
}, },
isNumber : function(s, d) { isNumber : function (s, d) {
return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$')); return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
}, },
test : function(s, p) { test : function (s, p) {
s = s.nodeType == 1 ? s.value : s; s = s.nodeType == 1 ? s.value : s;
return s == '' || new RegExp(p).test(s); return s == '' || new RegExp(p).test(s);
} }
}; };
var AutoValidator = { var AutoValidator = {
settings : { settings : {
id_cls : 'id', id_cls : 'id',
int_cls : 'int', int_cls : 'int',
url_cls : 'url', url_cls : 'url',
number_cls : 'number', number_cls : 'number',
email_cls : 'email', email_cls : 'email',
size_cls : 'size', size_cls : 'size',
required_cls : 'required', required_cls : 'required',
invalid_cls : 'invalid', invalid_cls : 'invalid',
min_cls : 'min', min_cls : 'min',
max_cls : 'max' max_cls : 'max'
}, },
init : function(s) { init : function (s) {
var n; var n;
for (n in s) for (n in s) {
this.settings[n] = s[n]; this.settings[n] = s[n];
}, }
},
validate : function(f) { validate : function (f) {
var i, nl, s = this.settings, c = 0; var i, nl, s = this.settings, c = 0;
nl = this.tags(f, 'label'); nl = this.tags(f, 'label');
for (i=0; i<nl.length; i++) { for (i = 0; i < nl.length; i++) {
this.removeClass(nl[i], s.invalid_cls); this.removeClass(nl[i], s.invalid_cls);
nl[i].setAttribute('aria-invalid', false); nl[i].setAttribute('aria-invalid', false);
} }
c += this.validateElms(f, 'input'); c += this.validateElms(f, 'input');
c += this.validateElms(f, 'select'); c += this.validateElms(f, 'select');
c += this.validateElms(f, 'textarea'); c += this.validateElms(f, 'textarea');
return c == 3; return c == 3;
}, },
invalidate : function(n) { invalidate : function (n) {
this.mark(n.form, n); this.mark(n.form, n);
}, },
getErrorMessages : function(f) { getErrorMessages : function (f) {
var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor; var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
nl = this.tags(f, "label"); nl = this.tags(f, "label");
for (i=0; i<nl.length; i++) { for (i = 0; i < nl.length; i++) {
if (this.hasClass(nl[i], s.invalid_cls)) { if (this.hasClass(nl[i], s.invalid_cls)) {
field = document.getElementById(nl[i].getAttribute("for")); field = document.getElementById(nl[i].getAttribute("for"));
values = { field: nl[i].textContent }; values = { field: nl[i].textContent };
if (this.hasClass(field, s.min_cls, true)) { if (this.hasClass(field, s.min_cls, true)) {
message = ed.getLang('invalid_data_min'); message = ed.getLang('invalid_data_min');
values.min = this.getNum(field, s.min_cls); values.min = this.getNum(field, s.min_cls);
} else if (this.hasClass(field, s.number_cls)) { } else if (this.hasClass(field, s.number_cls)) {
message = ed.getLang('invalid_data_number'); message = ed.getLang('invalid_data_number');
} else if (this.hasClass(field, s.size_cls)) { } else if (this.hasClass(field, s.size_cls)) {
message = ed.getLang('invalid_data_size'); message = ed.getLang('invalid_data_size');
} else { } else {
message = ed.getLang('invalid_data'); message = ed.getLang('invalid_data');
} }
message = message.replace(/{\#([^}]+)\}/g, function(a, b) { message = message.replace(/{\#([^}]+)\}/g, function (a, b) {
return values[b] || '{#' + b + '}'; return values[b] || '{#' + b + '}';
}); });
messages.push(message); messages.push(message);
} }
} }
return messages; return messages;
}, },
reset : function(e) { reset : function (e) {
var t = ['label', 'input', 'select', 'textarea']; var t = ['label', 'input', 'select', 'textarea'];
var i, j, nl, s = this.settings; var i, j, nl, s = this.settings;
if (e == null) if (e == null) {
return; return;
}
for (i=0; i<t.length; i++) { for (i = 0; i < t.length; i++) {
nl = this.tags(e.form ? e.form : e, t[i]); nl = this.tags(e.form ? e.form : e, t[i]);
for (j=0; j<nl.length; j++) { for (j = 0; j < nl.length; j++) {
this.removeClass(nl[j], s.invalid_cls); this.removeClass(nl[j], s.invalid_cls);
nl[j].setAttribute('aria-invalid', false); nl[j].setAttribute('aria-invalid', false);
} }
} }
}, },
validateElms : function(f, e) { validateElms : function (f, e) {
var nl, i, n, s = this.settings, st = true, va = Validator, v; var nl, i, n, s = this.settings, st = true, va = Validator, v;
nl = this.tags(f, e); nl = this.tags(f, e);
for (i=0; i<nl.length; i++) { for (i = 0; i < nl.length; i++) {
n = nl[i]; n = nl[i];
this.removeClass(n, s.invalid_cls); this.removeClass(n, s.invalid_cls);
if (this.hasClass(n, s.required_cls) && va.isEmpty(n)) if (this.hasClass(n, s.required_cls) && va.isEmpty(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.number_cls) && !va.isNumber(n)) if (this.hasClass(n, s.number_cls) && !va.isNumber(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true)) if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n)) if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.email_cls) && !va.isEmail(n)) if (this.hasClass(n, s.email_cls) && !va.isEmail(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.size_cls) && !va.isSize(n)) if (this.hasClass(n, s.size_cls) && !va.isSize(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.id_cls) && !va.isId(n)) if (this.hasClass(n, s.id_cls) && !va.isId(n)) {
st = this.mark(f, n); st = this.mark(f, n);
}
if (this.hasClass(n, s.min_cls, true)) { if (this.hasClass(n, s.min_cls, true)) {
v = this.getNum(n, s.min_cls); v = this.getNum(n, s.min_cls);
if (isNaN(v) || parseInt(n.value) < parseInt(v)) if (isNaN(v) || parseInt(n.value) < parseInt(v)) {
st = this.mark(f, n); st = this.mark(f, n);
} }
}
if (this.hasClass(n, s.max_cls, true)) { if (this.hasClass(n, s.max_cls, true)) {
v = this.getNum(n, s.max_cls); v = this.getNum(n, s.max_cls);
if (isNaN(v) || parseInt(n.value) > parseInt(v)) if (isNaN(v) || parseInt(n.value) > parseInt(v)) {
st = this.mark(f, n); st = this.mark(f, n);
} }
} }
}
return st; return st;
}, },
hasClass : function(n, c, d) { hasClass : function (n, c, d) {
return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
}, },
getNum : function(n, c) { getNum : function (n, c) {
c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
c = c.replace(/[^0-9]/g, ''); c = c.replace(/[^0-9]/g, '');
return c; return c;
}, },
addClass : function(n, c, b) { addClass : function (n, c, b) {
var o = this.removeClass(n, c); var o = this.removeClass(n, c);
n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
}, },
removeClass : function(n, c) { removeClass : function (n, c) {
c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
return n.className = c != ' ' ? c : ''; return n.className = c != ' ' ? c : '';
}, },
tags : function(f, s) { tags : function (f, s) {
return f.getElementsByTagName(s); return f.getElementsByTagName(s);
}, },
mark : function(f, n) { mark : function (f, n) {
var s = this.settings; var s = this.settings;
this.addClass(n, s.invalid_cls); this.addClass(n, s.invalid_cls);
n.setAttribute('aria-invalid', 'true'); n.setAttribute('aria-invalid', 'true');
this.markLabels(f, n, s.invalid_cls); this.markLabels(f, n, s.invalid_cls);
return false; return false;
}, },
markLabels : function(f, n, ic) { markLabels : function (f, n, ic) {
var nl, i; var nl, i;
nl = this.tags(f, "label"); nl = this.tags(f, "label");
for (i=0; i<nl.length; i++) { for (i = 0; i < nl.length; i++) {
if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id) if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id) {
this.addClass(nl[i], ic); this.addClass(nl[i], ic);
} }
}
return null; return null;
} }
}; };

View File

@ -18,7 +18,7 @@ $wp_db_version = 38590;
* *
* @global string $tinymce_version * @global string $tinymce_version
*/ */
$tinymce_version = '4506-20170408'; $tinymce_version = '4600-20170506';
/** /**
* Holds the required PHP version * Holds the required PHP version