Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,126 +1,126 @@
|
|||
(function () {
|
||||
var colorpicker = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color');
|
||||
|
||||
var showPreview = function (win, hexColor) {
|
||||
win.find('#preview')[0].getEl().style.background = hexColor;
|
||||
};
|
||||
var setColor = function (win, value) {
|
||||
var color = global$1(value), rgb = color.toRgb();
|
||||
win.fromJSON({
|
||||
r: rgb.r,
|
||||
g: rgb.g,
|
||||
b: rgb.b,
|
||||
hex: color.toHex().substr(1)
|
||||
});
|
||||
showPreview(win, color.toHex());
|
||||
};
|
||||
var open = function (editor, callback, value) {
|
||||
var win = editor.windowManager.open({
|
||||
title: 'Color',
|
||||
items: {
|
||||
type: 'container',
|
||||
layout: 'flex',
|
||||
direction: 'row',
|
||||
align: 'stretch',
|
||||
padding: 5,
|
||||
spacing: 10,
|
||||
items: [
|
||||
{
|
||||
type: 'colorpicker',
|
||||
value: value,
|
||||
onchange: function () {
|
||||
var rgb = this.rgb();
|
||||
if (win) {
|
||||
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(win, this.value());
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'form',
|
||||
padding: 0,
|
||||
labelGap: 5,
|
||||
defaults: {
|
||||
type: 'textbox',
|
||||
size: 7,
|
||||
value: '0',
|
||||
flex: 1,
|
||||
spellcheck: false,
|
||||
var showPreview = function (win, hexColor) {
|
||||
win.find('#preview')[0].getEl().style.background = hexColor;
|
||||
};
|
||||
var setColor = function (win, value) {
|
||||
var color = global$1(value), rgb = color.toRgb();
|
||||
win.fromJSON({
|
||||
r: rgb.r,
|
||||
g: rgb.g,
|
||||
b: rgb.b,
|
||||
hex: color.toHex().substr(1)
|
||||
});
|
||||
showPreview(win, color.toHex());
|
||||
};
|
||||
var open = function (editor, callback, value) {
|
||||
var win = editor.windowManager.open({
|
||||
title: 'Color',
|
||||
items: {
|
||||
type: 'container',
|
||||
layout: 'flex',
|
||||
direction: 'row',
|
||||
align: 'stretch',
|
||||
padding: 5,
|
||||
spacing: 10,
|
||||
items: [
|
||||
{
|
||||
type: 'colorpicker',
|
||||
value: value,
|
||||
onchange: function () {
|
||||
var colorPickerCtrl = win.find('colorpicker')[0];
|
||||
var name, value;
|
||||
name = this.name();
|
||||
value = this.value();
|
||||
if (name === 'hex') {
|
||||
value = '#' + value;
|
||||
setColor(win, value);
|
||||
colorPickerCtrl.value(value);
|
||||
return;
|
||||
var rgb = this.rgb();
|
||||
if (win) {
|
||||
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(win, this.value());
|
||||
}
|
||||
value = {
|
||||
r: win.find('#r').value(),
|
||||
g: win.find('#g').value(),
|
||||
b: win.find('#b').value()
|
||||
};
|
||||
colorPickerCtrl.value(value);
|
||||
setColor(win, value);
|
||||
}
|
||||
},
|
||||
items: [
|
||||
{
|
||||
name: 'r',
|
||||
label: 'R',
|
||||
autofocus: 1
|
||||
{
|
||||
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();
|
||||
value = this.value();
|
||||
if (name === 'hex') {
|
||||
value = '#' + value;
|
||||
setColor(win, value);
|
||||
colorPickerCtrl.value(value);
|
||||
return;
|
||||
}
|
||||
value = {
|
||||
r: win.find('#r').value(),
|
||||
g: win.find('#g').value(),
|
||||
b: win.find('#b').value()
|
||||
};
|
||||
colorPickerCtrl.value(value);
|
||||
setColor(win, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'g',
|
||||
label: 'G'
|
||||
},
|
||||
{
|
||||
name: 'b',
|
||||
label: 'B'
|
||||
},
|
||||
{
|
||||
name: 'hex',
|
||||
label: '#',
|
||||
value: '000000'
|
||||
},
|
||||
{
|
||||
name: 'preview',
|
||||
type: 'container',
|
||||
border: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
onSubmit: function () {
|
||||
callback('#' + win.toJSON().hex);
|
||||
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('#' + win.toJSON().hex);
|
||||
}
|
||||
});
|
||||
setColor(win, value);
|
||||
};
|
||||
var Dialog = { open: open };
|
||||
|
||||
global.add('colorpicker', function (editor) {
|
||||
if (!editor.settings.color_picker_callback) {
|
||||
editor.settings.color_picker_callback = function (callback, value) {
|
||||
Dialog.open(editor, callback, value);
|
||||
};
|
||||
}
|
||||
});
|
||||
setColor(win, value);
|
||||
};
|
||||
var $_2gqaphanjjgwebmu = { open: open };
|
||||
|
||||
global.add('colorpicker', function (editor) {
|
||||
if (!editor.settings.color_picker_callback) {
|
||||
editor.settings.color_picker_callback = function (callback, value) {
|
||||
$_2gqaphanjjgwebmu.open(editor, callback, value);
|
||||
};
|
||||
function Plugin () {
|
||||
}
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,66 +1,66 @@
|
|||
(function () {
|
||||
var directionality = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var setDir = function (editor, dir) {
|
||||
var dom = editor.dom;
|
||||
var curDir;
|
||||
var blocks = editor.selection.getSelectedBlocks();
|
||||
if (blocks.length) {
|
||||
curDir = dom.getAttrib(blocks[0], 'dir');
|
||||
global$1.each(blocks, function (block) {
|
||||
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
|
||||
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
|
||||
}
|
||||
var setDir = function (editor, dir) {
|
||||
var dom = editor.dom;
|
||||
var curDir;
|
||||
var blocks = editor.selection.getSelectedBlocks();
|
||||
if (blocks.length) {
|
||||
curDir = dom.getAttrib(blocks[0], 'dir');
|
||||
global$1.each(blocks, function (block) {
|
||||
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
|
||||
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
|
||||
}
|
||||
});
|
||||
editor.nodeChanged();
|
||||
}
|
||||
};
|
||||
var Direction = { setDir: setDir };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceDirectionLTR', function () {
|
||||
Direction.setDir(editor, 'ltr');
|
||||
});
|
||||
editor.nodeChanged();
|
||||
editor.addCommand('mceDirectionRTL', function () {
|
||||
Direction.setDir(editor, 'rtl');
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var generateSelector = function (dir) {
|
||||
var selector = [];
|
||||
global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
|
||||
selector.push(name + '[dir=' + dir + ']');
|
||||
});
|
||||
return selector.join(',');
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('ltr', {
|
||||
title: 'Left to right',
|
||||
cmd: 'mceDirectionLTR',
|
||||
stateSelector: generateSelector('ltr')
|
||||
});
|
||||
editor.addButton('rtl', {
|
||||
title: 'Right to left',
|
||||
cmd: 'mceDirectionRTL',
|
||||
stateSelector: generateSelector('rtl')
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('directionality', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
};
|
||||
var $_fd54yfb4jjgwebo5 = { setDir: setDir };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceDirectionLTR', function () {
|
||||
$_fd54yfb4jjgwebo5.setDir(editor, 'ltr');
|
||||
});
|
||||
editor.addCommand('mceDirectionRTL', function () {
|
||||
$_fd54yfb4jjgwebo5.setDir(editor, 'rtl');
|
||||
});
|
||||
};
|
||||
var $_cpb3fob3jjgwebo4 = { register: register };
|
||||
|
||||
var generateSelector = function (dir) {
|
||||
var selector = [];
|
||||
global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
|
||||
selector.push(name + '[dir=' + dir + ']');
|
||||
});
|
||||
return selector.join(',');
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('ltr', {
|
||||
title: 'Left to right',
|
||||
cmd: 'mceDirectionLTR',
|
||||
stateSelector: generateSelector('ltr')
|
||||
});
|
||||
editor.addButton('rtl', {
|
||||
title: 'Right to left',
|
||||
cmd: 'mceDirectionRTL',
|
||||
stateSelector: generateSelector('rtl')
|
||||
});
|
||||
};
|
||||
var $_8ch9fzb6jjgwebo7 = { register: register$1 };
|
||||
|
||||
global.add('directionality', function (editor) {
|
||||
$_cpb3fob3jjgwebo4.register(editor);
|
||||
$_8ch9fzb6jjgwebo7.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,177 +1,177 @@
|
|||
(function () {
|
||||
var fullscreen = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var get = function (fullscreenState) {
|
||||
return {
|
||||
isFullscreen: function () {
|
||||
return fullscreenState.get() !== null;
|
||||
}
|
||||
};
|
||||
};
|
||||
var $_6qfcwucejjgwebu0 = { get: get };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var fireFullscreenStateChanged = function (editor, state) {
|
||||
editor.fire('FullscreenStateChanged', { state: state });
|
||||
};
|
||||
var $_en5ltwcijjgwebu6 = { fireFullscreenStateChanged: fireFullscreenStateChanged };
|
||||
|
||||
var DOM = global$1.DOM;
|
||||
var getWindowSize = function () {
|
||||
var w;
|
||||
var h;
|
||||
var win = window;
|
||||
var doc = document;
|
||||
var body = doc.body;
|
||||
if (body.offsetWidth) {
|
||||
w = body.offsetWidth;
|
||||
h = body.offsetHeight;
|
||||
}
|
||||
if (win.innerWidth && win.innerHeight) {
|
||||
w = win.innerWidth;
|
||||
h = win.innerHeight;
|
||||
}
|
||||
return {
|
||||
w: w,
|
||||
h: h
|
||||
};
|
||||
};
|
||||
var getScrollPos = function () {
|
||||
var vp = DOM.getViewPort();
|
||||
return {
|
||||
x: vp.x,
|
||||
y: vp.y
|
||||
};
|
||||
};
|
||||
var setScrollPos = function (pos) {
|
||||
window.scrollTo(pos.x, pos.y);
|
||||
};
|
||||
var toggleFullscreen = function (editor, fullscreenState) {
|
||||
var body = document.body;
|
||||
var documentElement = document.documentElement;
|
||||
var editorContainerStyle;
|
||||
var editorContainer, iframe, iframeStyle;
|
||||
var fullscreenInfo = fullscreenState.get();
|
||||
var resize = function () {
|
||||
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
||||
};
|
||||
var removeResize = function () {
|
||||
DOM.unbind(window, 'resize', resize);
|
||||
};
|
||||
editorContainer = editor.getContainer();
|
||||
editorContainerStyle = editorContainer.style;
|
||||
iframe = editor.getContentAreaContainer().firstChild;
|
||||
iframeStyle = iframe.style;
|
||||
if (!fullscreenInfo) {
|
||||
var newFullScreenInfo = {
|
||||
scrollPos: getScrollPos(),
|
||||
containerWidth: editorContainerStyle.width,
|
||||
containerHeight: editorContainerStyle.height,
|
||||
iframeWidth: iframeStyle.width,
|
||||
iframeHeight: iframeStyle.height,
|
||||
resizeHandler: resize,
|
||||
removeHandler: removeResize
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
iframeStyle.width = iframeStyle.height = '100%';
|
||||
editorContainerStyle.width = editorContainerStyle.height = '';
|
||||
DOM.addClass(body, 'mce-fullscreen');
|
||||
DOM.addClass(documentElement, 'mce-fullscreen');
|
||||
DOM.addClass(editorContainer, 'mce-fullscreen');
|
||||
DOM.bind(window, 'resize', resize);
|
||||
editor.on('remove', removeResize);
|
||||
resize();
|
||||
fullscreenState.set(newFullScreenInfo);
|
||||
$_en5ltwcijjgwebu6.fireFullscreenStateChanged(editor, true);
|
||||
} else {
|
||||
iframeStyle.width = fullscreenInfo.iframeWidth;
|
||||
iframeStyle.height = fullscreenInfo.iframeHeight;
|
||||
if (fullscreenInfo.containerWidth) {
|
||||
editorContainerStyle.width = fullscreenInfo.containerWidth;
|
||||
}
|
||||
if (fullscreenInfo.containerHeight) {
|
||||
editorContainerStyle.height = fullscreenInfo.containerHeight;
|
||||
}
|
||||
DOM.removeClass(body, 'mce-fullscreen');
|
||||
DOM.removeClass(documentElement, 'mce-fullscreen');
|
||||
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
||||
setScrollPos(fullscreenInfo.scrollPos);
|
||||
DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler);
|
||||
editor.off('remove', fullscreenInfo.removeHandler);
|
||||
fullscreenState.set(null);
|
||||
$_en5ltwcijjgwebu6.fireFullscreenStateChanged(editor, false);
|
||||
}
|
||||
};
|
||||
var $_dvg07kcgjjgwebu3 = { toggleFullscreen: toggleFullscreen };
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var register = function (editor, fullscreenState) {
|
||||
editor.addCommand('mceFullScreen', function () {
|
||||
$_dvg07kcgjjgwebu3.toggleFullscreen(editor, fullscreenState);
|
||||
});
|
||||
};
|
||||
var $_bebdcrcfjjgwebu1 = { register: register };
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var postRender = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('FullscreenStateChanged', function (e) {
|
||||
ctrl.active(e.state);
|
||||
var get = function (fullscreenState) {
|
||||
return {
|
||||
isFullscreen: function () {
|
||||
return fullscreenState.get() !== null;
|
||||
}
|
||||
};
|
||||
};
|
||||
var Api = { get: get };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var fireFullscreenStateChanged = function (editor, state) {
|
||||
editor.fire('FullscreenStateChanged', { state: state });
|
||||
};
|
||||
var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
|
||||
|
||||
var DOM = global$1.DOM;
|
||||
var getWindowSize = function () {
|
||||
var w;
|
||||
var h;
|
||||
var win = window;
|
||||
var doc = document;
|
||||
var body = doc.body;
|
||||
if (body.offsetWidth) {
|
||||
w = body.offsetWidth;
|
||||
h = body.offsetHeight;
|
||||
}
|
||||
if (win.innerWidth && win.innerHeight) {
|
||||
w = win.innerWidth;
|
||||
h = win.innerHeight;
|
||||
}
|
||||
return {
|
||||
w: w,
|
||||
h: h
|
||||
};
|
||||
};
|
||||
var getScrollPos = function () {
|
||||
var vp = DOM.getViewPort();
|
||||
return {
|
||||
x: vp.x,
|
||||
y: vp.y
|
||||
};
|
||||
};
|
||||
var setScrollPos = function (pos) {
|
||||
window.scrollTo(pos.x, pos.y);
|
||||
};
|
||||
var toggleFullscreen = function (editor, fullscreenState) {
|
||||
var body = document.body;
|
||||
var documentElement = document.documentElement;
|
||||
var editorContainerStyle;
|
||||
var editorContainer, iframe, iframeStyle;
|
||||
var fullscreenInfo = fullscreenState.get();
|
||||
var resize = function () {
|
||||
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
||||
};
|
||||
var removeResize = function () {
|
||||
DOM.unbind(window, 'resize', resize);
|
||||
};
|
||||
editorContainer = editor.getContainer();
|
||||
editorContainerStyle = editorContainer.style;
|
||||
iframe = editor.getContentAreaContainer().firstChild;
|
||||
iframeStyle = iframe.style;
|
||||
if (!fullscreenInfo) {
|
||||
var newFullScreenInfo = {
|
||||
scrollPos: getScrollPos(),
|
||||
containerWidth: editorContainerStyle.width,
|
||||
containerHeight: editorContainerStyle.height,
|
||||
iframeWidth: iframeStyle.width,
|
||||
iframeHeight: iframeStyle.height,
|
||||
resizeHandler: resize,
|
||||
removeHandler: removeResize
|
||||
};
|
||||
iframeStyle.width = iframeStyle.height = '100%';
|
||||
editorContainerStyle.width = editorContainerStyle.height = '';
|
||||
DOM.addClass(body, 'mce-fullscreen');
|
||||
DOM.addClass(documentElement, 'mce-fullscreen');
|
||||
DOM.addClass(editorContainer, 'mce-fullscreen');
|
||||
DOM.bind(window, 'resize', resize);
|
||||
editor.on('remove', removeResize);
|
||||
resize();
|
||||
fullscreenState.set(newFullScreenInfo);
|
||||
Events.fireFullscreenStateChanged(editor, true);
|
||||
} else {
|
||||
iframeStyle.width = fullscreenInfo.iframeWidth;
|
||||
iframeStyle.height = fullscreenInfo.iframeHeight;
|
||||
if (fullscreenInfo.containerWidth) {
|
||||
editorContainerStyle.width = fullscreenInfo.containerWidth;
|
||||
}
|
||||
if (fullscreenInfo.containerHeight) {
|
||||
editorContainerStyle.height = fullscreenInfo.containerHeight;
|
||||
}
|
||||
DOM.removeClass(body, 'mce-fullscreen');
|
||||
DOM.removeClass(documentElement, 'mce-fullscreen');
|
||||
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
||||
setScrollPos(fullscreenInfo.scrollPos);
|
||||
DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler);
|
||||
editor.off('remove', fullscreenInfo.removeHandler);
|
||||
fullscreenState.set(null);
|
||||
Events.fireFullscreenStateChanged(editor, false);
|
||||
}
|
||||
};
|
||||
var Actions = { toggleFullscreen: toggleFullscreen };
|
||||
|
||||
var register = function (editor, fullscreenState) {
|
||||
editor.addCommand('mceFullScreen', function () {
|
||||
Actions.toggleFullscreen(editor, fullscreenState);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addMenuItem('fullscreen', {
|
||||
text: 'Fullscreen',
|
||||
shortcut: 'Ctrl+Shift+F',
|
||||
selectable: true,
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor),
|
||||
context: 'view'
|
||||
});
|
||||
editor.addButton('fullscreen', {
|
||||
active: false,
|
||||
tooltip: 'Fullscreen',
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor)
|
||||
});
|
||||
};
|
||||
var $_tne4sckjjgwebuo = { register: register$1 };
|
||||
var Commands = { register: register };
|
||||
|
||||
global.add('fullscreen', function (editor) {
|
||||
var fullscreenState = Cell(null);
|
||||
if (editor.settings.inline) {
|
||||
return $_6qfcwucejjgwebu0.get(fullscreenState);
|
||||
var postRender = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('FullscreenStateChanged', function (e) {
|
||||
ctrl.active(e.state);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addMenuItem('fullscreen', {
|
||||
text: 'Fullscreen',
|
||||
shortcut: 'Ctrl+Shift+F',
|
||||
selectable: true,
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor),
|
||||
context: 'view'
|
||||
});
|
||||
editor.addButton('fullscreen', {
|
||||
active: false,
|
||||
tooltip: 'Fullscreen',
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor)
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('fullscreen', function (editor) {
|
||||
var fullscreenState = Cell(null);
|
||||
if (editor.settings.inline) {
|
||||
return Api.get(fullscreenState);
|
||||
}
|
||||
Commands.register(editor, fullscreenState);
|
||||
Buttons.register(editor);
|
||||
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
|
||||
return Api.get(fullscreenState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
$_bebdcrcfjjgwebu1.register(editor, fullscreenState);
|
||||
$_tne4sckjjgwebuo.register(editor);
|
||||
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
|
||||
return $_6qfcwucejjgwebu0.get(fullscreenState);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,39 +1,39 @@
|
|||
(function () {
|
||||
var hr = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('InsertHorizontalRule', function () {
|
||||
editor.execCommand('mceInsertContent', false, '<hr />');
|
||||
var register = function (editor) {
|
||||
editor.addCommand('InsertHorizontalRule', function () {
|
||||
editor.execCommand('mceInsertContent', false, '<hr />');
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('hr', {
|
||||
icon: 'hr',
|
||||
tooltip: 'Horizontal line',
|
||||
cmd: 'InsertHorizontalRule'
|
||||
});
|
||||
editor.addMenuItem('hr', {
|
||||
icon: 'hr',
|
||||
text: 'Horizontal line',
|
||||
cmd: 'InsertHorizontalRule',
|
||||
context: 'insert'
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('hr', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
});
|
||||
};
|
||||
var $_cqh592cnjjgwebvk = { register: register };
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('hr', {
|
||||
icon: 'hr',
|
||||
tooltip: 'Horizontal line',
|
||||
cmd: 'InsertHorizontalRule'
|
||||
});
|
||||
editor.addMenuItem('hr', {
|
||||
icon: 'hr',
|
||||
text: 'Horizontal line',
|
||||
cmd: 'InsertHorizontalRule',
|
||||
context: 'insert'
|
||||
});
|
||||
};
|
||||
var $_13g834cojjgwebvl = { register: register$1 };
|
||||
|
||||
global.add('hr', function (editor) {
|
||||
$_cqh592cnjjgwebvk.register(editor);
|
||||
$_13g834cojjgwebvl.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
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 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 it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -1,124 +1,124 @@
|
|||
(function () {
|
||||
var tabfocus = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
var getTabFocusElements = function (editor) {
|
||||
return editor.getParam('tabfocus_elements', ':prev,:next');
|
||||
};
|
||||
var getTabFocus = function (editor) {
|
||||
return editor.getParam('tab_focus', getTabFocusElements(editor));
|
||||
};
|
||||
var $_8rita4kwjjgwed4m = { getTabFocus: getTabFocus };
|
||||
var getTabFocusElements = function (editor) {
|
||||
return editor.getParam('tabfocus_elements', ':prev,:next');
|
||||
};
|
||||
var getTabFocus = function (editor) {
|
||||
return editor.getParam('tab_focus', getTabFocusElements(editor));
|
||||
};
|
||||
var Settings = { getTabFocus: getTabFocus };
|
||||
|
||||
var DOM = global$1.DOM;
|
||||
var tabCancel = function (e) {
|
||||
if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
var setup = function (editor) {
|
||||
function tabHandler(e) {
|
||||
var x, el, v, i;
|
||||
if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
function find(direction) {
|
||||
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||
function canSelectRecursive(e) {
|
||||
return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
|
||||
}
|
||||
function canSelect(el) {
|
||||
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
|
||||
}
|
||||
global$5.each(el, function (e, i) {
|
||||
if (e.id === editor.id) {
|
||||
x = i;
|
||||
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 = global$5.explode($_8rita4kwjjgwed4m.getTabFocus(editor));
|
||||
if (v.length === 1) {
|
||||
v[1] = v[0];
|
||||
v[0] = ':prev';
|
||||
}
|
||||
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 = global$2.get(el.id || el.name);
|
||||
if (el.id && focusEditor) {
|
||||
focusEditor.focus();
|
||||
} else {
|
||||
global$4.setTimeout(function () {
|
||||
if (!global$3.webkit) {
|
||||
window.focus();
|
||||
}
|
||||
el.focus();
|
||||
}, 10);
|
||||
}
|
||||
var DOM = global$1.DOM;
|
||||
var tabCancel = function (e) {
|
||||
if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
editor.on('init', function () {
|
||||
if (editor.inline) {
|
||||
DOM.setAttrib(editor.getBody(), 'tabIndex', null);
|
||||
}
|
||||
editor.on('keyup', tabCancel);
|
||||
if (global$3.gecko) {
|
||||
editor.on('keypress keydown', tabHandler);
|
||||
} else {
|
||||
editor.on('keydown', tabHandler);
|
||||
};
|
||||
var setup = function (editor) {
|
||||
function tabHandler(e) {
|
||||
var x, el, v, i;
|
||||
if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
function find(direction) {
|
||||
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||
function canSelectRecursive(e) {
|
||||
return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
|
||||
}
|
||||
function canSelect(el) {
|
||||
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
|
||||
}
|
||||
global$5.each(el, function (e, i) {
|
||||
if (e.id === editor.id) {
|
||||
x = i;
|
||||
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 = global$5.explode(Settings.getTabFocus(editor));
|
||||
if (v.length === 1) {
|
||||
v[1] = v[0];
|
||||
v[0] = ':prev';
|
||||
}
|
||||
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 = global$2.get(el.id || el.name);
|
||||
if (el.id && focusEditor) {
|
||||
focusEditor.focus();
|
||||
} else {
|
||||
global$4.setTimeout(function () {
|
||||
if (!global$3.webkit) {
|
||||
window.focus();
|
||||
}
|
||||
el.focus();
|
||||
}, 10);
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
editor.on('init', function () {
|
||||
if (editor.inline) {
|
||||
DOM.setAttrib(editor.getBody(), 'tabIndex', null);
|
||||
}
|
||||
editor.on('keyup', tabCancel);
|
||||
if (global$3.gecko) {
|
||||
editor.on('keypress keydown', tabHandler);
|
||||
} else {
|
||||
editor.on('keydown', tabHandler);
|
||||
}
|
||||
});
|
||||
};
|
||||
var Keyboard = { setup: setup };
|
||||
|
||||
global.add('tabfocus', function (editor) {
|
||||
Keyboard.setup(editor);
|
||||
});
|
||||
};
|
||||
var $_6zogdykpjjgwed4h = { setup: setup };
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
global.add('tabfocus', function (editor) {
|
||||
$_6zogdykpjjgwed4h.setup(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,346 +1,346 @@
|
|||
(function () {
|
||||
var textcolor = (function () {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var getCurrentColor = function (editor, format) {
|
||||
var color;
|
||||
editor.dom.getParents(editor.selection.getStart(), function (elm) {
|
||||
var value;
|
||||
if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) {
|
||||
color = value;
|
||||
}
|
||||
});
|
||||
return color;
|
||||
};
|
||||
var mapColors = function (colorMap) {
|
||||
var i;
|
||||
var colors = [];
|
||||
for (i = 0; i < colorMap.length; i += 2) {
|
||||
colors.push({
|
||||
text: colorMap[i + 1],
|
||||
color: '#' + colorMap[i]
|
||||
var getCurrentColor = function (editor, format) {
|
||||
var color;
|
||||
editor.dom.getParents(editor.selection.getStart(), function (elm) {
|
||||
var value;
|
||||
if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) {
|
||||
color = color ? color : value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return colors;
|
||||
};
|
||||
var applyFormat = function (editor, format, value) {
|
||||
editor.undoManager.transact(function () {
|
||||
editor.focus();
|
||||
editor.formatter.apply(format, { value: value });
|
||||
editor.nodeChanged();
|
||||
});
|
||||
};
|
||||
var removeFormat = function (editor, format) {
|
||||
editor.undoManager.transact(function () {
|
||||
editor.focus();
|
||||
editor.formatter.remove(format, { value: null }, null, true);
|
||||
editor.nodeChanged();
|
||||
});
|
||||
};
|
||||
var $_b0p88yrijjgwefd2 = {
|
||||
getCurrentColor: getCurrentColor,
|
||||
mapColors: mapColors,
|
||||
applyFormat: applyFormat,
|
||||
removeFormat: removeFormat
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceApplyTextcolor', function (format, value) {
|
||||
$_b0p88yrijjgwefd2.applyFormat(editor, format, value);
|
||||
});
|
||||
editor.addCommand('mceRemoveTextcolor', function (format) {
|
||||
$_b0p88yrijjgwefd2.removeFormat(editor, format);
|
||||
});
|
||||
};
|
||||
var $_g2o2pirhjjgwefd1 = { register: register };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var defaultColorMap = [
|
||||
'000000',
|
||||
'Black',
|
||||
'993300',
|
||||
'Burnt orange',
|
||||
'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'
|
||||
];
|
||||
var getTextColorMap = function (editor) {
|
||||
return editor.getParam('textcolor_map', defaultColorMap);
|
||||
};
|
||||
var getForeColorMap = function (editor) {
|
||||
return editor.getParam('forecolor_map', getTextColorMap(editor));
|
||||
};
|
||||
var getBackColorMap = function (editor) {
|
||||
return editor.getParam('backcolor_map', getTextColorMap(editor));
|
||||
};
|
||||
var getTextColorRows = function (editor) {
|
||||
return editor.getParam('textcolor_rows', 5);
|
||||
};
|
||||
var getTextColorCols = function (editor) {
|
||||
return editor.getParam('textcolor_cols', 8);
|
||||
};
|
||||
var getForeColorRows = function (editor) {
|
||||
return editor.getParam('forecolor_rows', getTextColorRows(editor));
|
||||
};
|
||||
var getBackColorRows = function (editor) {
|
||||
return editor.getParam('backcolor_rows', getTextColorRows(editor));
|
||||
};
|
||||
var getForeColorCols = function (editor) {
|
||||
return editor.getParam('forecolor_cols', getTextColorCols(editor));
|
||||
};
|
||||
var getBackColorCols = function (editor) {
|
||||
return editor.getParam('backcolor_cols', getTextColorCols(editor));
|
||||
};
|
||||
var getColorPickerCallback = function (editor) {
|
||||
return editor.getParam('color_picker_callback', null);
|
||||
};
|
||||
var hasColorPicker = function (editor) {
|
||||
return typeof getColorPickerCallback(editor) === 'function';
|
||||
};
|
||||
var $_2rfqb7rmjjgwefd9 = {
|
||||
getForeColorMap: getForeColorMap,
|
||||
getBackColorMap: getBackColorMap,
|
||||
getForeColorRows: getForeColorRows,
|
||||
getBackColorRows: getBackColorRows,
|
||||
getForeColorCols: getForeColorCols,
|
||||
getBackColorCols: getBackColorCols,
|
||||
getColorPickerCallback: getColorPickerCallback,
|
||||
hasColorPicker: hasColorPicker
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
||||
|
||||
var getHtml = function (cols, rows, colorMap, hasColorPicker) {
|
||||
var colors, color, html, last, x, y, i, count = 0;
|
||||
var id = global$1.DOM.uniqueId('mcearia');
|
||||
var getColorCellHtml = function (color, title) {
|
||||
var isNoColor = color === 'transparent';
|
||||
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="' + global$3.translate(title) + '">' + (isNoColor ? '×' : '') + '</div>' + '</td>';
|
||||
return color;
|
||||
};
|
||||
colors = $_b0p88yrijjgwefd2.mapColors(colorMap);
|
||||
colors.push({
|
||||
text: global$3.translate('No color'),
|
||||
color: 'transparent'
|
||||
});
|
||||
html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
|
||||
last = colors.length - 1;
|
||||
for (y = 0; y < rows; y++) {
|
||||
html += '<tr>';
|
||||
for (x = 0; x < cols; x++) {
|
||||
i = y * cols + x;
|
||||
if (i > last) {
|
||||
html += '<td></td>';
|
||||
} else {
|
||||
color = colors[i];
|
||||
html += getColorCellHtml(color.color, color.text);
|
||||
}
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
if (hasColorPicker) {
|
||||
html += '<tr>' + '<td colspan="' + cols + '" 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">' + global$3.translate('Custom...') + '</button>' + '</div>' + '</td>' + '</tr>';
|
||||
html += '<tr>';
|
||||
for (x = 0; x < cols; x++) {
|
||||
html += getColorCellHtml('', 'Custom color');
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
return html;
|
||||
};
|
||||
var $_fihh7qrnjjgwefdb = { getHtml: getHtml };
|
||||
|
||||
var setDivColor = function setDivColor(div, value) {
|
||||
div.style.background = value;
|
||||
div.setAttribute('data-mce-color', value);
|
||||
};
|
||||
var onButtonClick = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
if (ctrl._color) {
|
||||
editor.execCommand('mceApplyTextcolor', ctrl.settings.format, ctrl._color);
|
||||
} else {
|
||||
editor.execCommand('mceRemoveTextcolor', ctrl.settings.format);
|
||||
var mapColors = function (colorMap) {
|
||||
var i;
|
||||
var colors = [];
|
||||
for (i = 0; i < colorMap.length; i += 2) {
|
||||
colors.push({
|
||||
text: colorMap[i + 1],
|
||||
color: '#' + colorMap[i]
|
||||
});
|
||||
}
|
||||
return colors;
|
||||
};
|
||||
};
|
||||
var onPanelClick = function (editor, cols) {
|
||||
return function (e) {
|
||||
var buttonCtrl = this.parent();
|
||||
var value;
|
||||
var currentColor = $_b0p88yrijjgwefd2.getCurrentColor(editor, buttonCtrl.settings.format);
|
||||
var selectColor = function (value) {
|
||||
editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value);
|
||||
buttonCtrl.hidePanel();
|
||||
buttonCtrl.color(value);
|
||||
var applyFormat = function (editor, format, value) {
|
||||
editor.undoManager.transact(function () {
|
||||
editor.focus();
|
||||
editor.formatter.apply(format, { value: value });
|
||||
editor.nodeChanged();
|
||||
});
|
||||
};
|
||||
var removeFormat = function (editor, format) {
|
||||
editor.undoManager.transact(function () {
|
||||
editor.focus();
|
||||
editor.formatter.remove(format, { value: null }, null, true);
|
||||
editor.nodeChanged();
|
||||
});
|
||||
};
|
||||
var TextColor = {
|
||||
getCurrentColor: getCurrentColor,
|
||||
mapColors: mapColors,
|
||||
applyFormat: applyFormat,
|
||||
removeFormat: removeFormat
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceApplyTextcolor', function (format, value) {
|
||||
TextColor.applyFormat(editor, format, value);
|
||||
});
|
||||
editor.addCommand('mceRemoveTextcolor', function (format) {
|
||||
TextColor.removeFormat(editor, format);
|
||||
});
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var defaultColorMap = [
|
||||
'000000',
|
||||
'Black',
|
||||
'993300',
|
||||
'Burnt orange',
|
||||
'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'
|
||||
];
|
||||
var getTextColorMap = function (editor) {
|
||||
return editor.getParam('textcolor_map', defaultColorMap);
|
||||
};
|
||||
var getForeColorMap = function (editor) {
|
||||
return editor.getParam('forecolor_map', getTextColorMap(editor));
|
||||
};
|
||||
var getBackColorMap = function (editor) {
|
||||
return editor.getParam('backcolor_map', getTextColorMap(editor));
|
||||
};
|
||||
var getTextColorRows = function (editor) {
|
||||
return editor.getParam('textcolor_rows', 5);
|
||||
};
|
||||
var getTextColorCols = function (editor) {
|
||||
return editor.getParam('textcolor_cols', 8);
|
||||
};
|
||||
var getForeColorRows = function (editor) {
|
||||
return editor.getParam('forecolor_rows', getTextColorRows(editor));
|
||||
};
|
||||
var getBackColorRows = function (editor) {
|
||||
return editor.getParam('backcolor_rows', getTextColorRows(editor));
|
||||
};
|
||||
var getForeColorCols = function (editor) {
|
||||
return editor.getParam('forecolor_cols', getTextColorCols(editor));
|
||||
};
|
||||
var getBackColorCols = function (editor) {
|
||||
return editor.getParam('backcolor_cols', getTextColorCols(editor));
|
||||
};
|
||||
var getColorPickerCallback = function (editor) {
|
||||
return editor.getParam('color_picker_callback', null);
|
||||
};
|
||||
var hasColorPicker = function (editor) {
|
||||
return typeof getColorPickerCallback(editor) === 'function';
|
||||
};
|
||||
var Settings = {
|
||||
getForeColorMap: getForeColorMap,
|
||||
getBackColorMap: getBackColorMap,
|
||||
getForeColorRows: getForeColorRows,
|
||||
getBackColorRows: getBackColorRows,
|
||||
getForeColorCols: getForeColorCols,
|
||||
getBackColorCols: getBackColorCols,
|
||||
getColorPickerCallback: getColorPickerCallback,
|
||||
hasColorPicker: hasColorPicker
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
||||
|
||||
var getHtml = function (cols, rows, colorMap, hasColorPicker) {
|
||||
var colors, color, html, last, x, y, i, count = 0;
|
||||
var id = global$1.DOM.uniqueId('mcearia');
|
||||
var getColorCellHtml = function (color, title) {
|
||||
var isNoColor = color === 'transparent';
|
||||
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="' + global$3.translate(title) + '">' + (isNoColor ? '×' : '') + '</div>' + '</td>';
|
||||
};
|
||||
var resetColor = function () {
|
||||
editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format);
|
||||
buttonCtrl.hidePanel();
|
||||
buttonCtrl.resetColor();
|
||||
};
|
||||
if (global$1.DOM.getParent(e.target, '.mce-custom-color-btn')) {
|
||||
buttonCtrl.hidePanel();
|
||||
var colorPickerCallback = $_2rfqb7rmjjgwefd9.getColorPickerCallback(editor);
|
||||
colorPickerCallback.call(editor, function (value) {
|
||||
var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
|
||||
var customColorCells, div, i;
|
||||
customColorCells = global$2.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
|
||||
return elm.firstChild;
|
||||
});
|
||||
for (i = 0; i < customColorCells.length; i++) {
|
||||
div = customColorCells[i];
|
||||
if (!div.getAttribute('data-mce-color')) {
|
||||
break;
|
||||
}
|
||||
colors = TextColor.mapColors(colorMap);
|
||||
colors.push({
|
||||
text: global$3.translate('No color'),
|
||||
color: 'transparent'
|
||||
});
|
||||
html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
|
||||
last = colors.length - 1;
|
||||
for (y = 0; y < rows; y++) {
|
||||
html += '<tr>';
|
||||
for (x = 0; x < cols; x++) {
|
||||
i = y * cols + x;
|
||||
if (i > last) {
|
||||
html += '<td></td>';
|
||||
} else {
|
||||
color = colors[i];
|
||||
html += getColorCellHtml(color.color, color.text);
|
||||
}
|
||||
if (i === cols) {
|
||||
for (i = 0; i < cols - 1; i++) {
|
||||
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
|
||||
}
|
||||
}
|
||||
setDivColor(div, value);
|
||||
selectColor(value);
|
||||
}, currentColor);
|
||||
}
|
||||
value = e.target.getAttribute('data-mce-color');
|
||||
if (value) {
|
||||
if (this.lastId) {
|
||||
global$1.DOM.get(this.lastId).setAttribute('aria-selected', 'false');
|
||||
}
|
||||
e.target.setAttribute('aria-selected', true);
|
||||
this.lastId = e.target.id;
|
||||
if (value === 'transparent') {
|
||||
resetColor();
|
||||
html += '</tr>';
|
||||
}
|
||||
if (hasColorPicker) {
|
||||
html += '<tr>' + '<td colspan="' + cols + '" 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">' + global$3.translate('Custom...') + '</button>' + '</div>' + '</td>' + '</tr>';
|
||||
html += '<tr>';
|
||||
for (x = 0; x < cols; x++) {
|
||||
html += getColorCellHtml('', 'Custom color');
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
return html;
|
||||
};
|
||||
var ColorPickerHtml = { getHtml: getHtml };
|
||||
|
||||
var setDivColor = function setDivColor(div, value) {
|
||||
div.style.background = value;
|
||||
div.setAttribute('data-mce-color', value);
|
||||
};
|
||||
var onButtonClick = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
if (ctrl._color) {
|
||||
editor.execCommand('mceApplyTextcolor', ctrl.settings.format, ctrl._color);
|
||||
} else {
|
||||
selectColor(value);
|
||||
editor.execCommand('mceRemoveTextcolor', ctrl.settings.format);
|
||||
}
|
||||
} else if (value !== null) {
|
||||
buttonCtrl.hidePanel();
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
var renderColorPicker = function (editor, foreColor) {
|
||||
return function () {
|
||||
var cols = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorCols(editor) : $_2rfqb7rmjjgwefd9.getBackColorCols(editor);
|
||||
var rows = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorRows(editor) : $_2rfqb7rmjjgwefd9.getBackColorRows(editor);
|
||||
var colorMap = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorMap(editor) : $_2rfqb7rmjjgwefd9.getBackColorMap(editor);
|
||||
var hasColorPicker = $_2rfqb7rmjjgwefd9.hasColorPicker(editor);
|
||||
return $_fihh7qrnjjgwefdb.getHtml(cols, rows, colorMap, hasColorPicker);
|
||||
var onPanelClick = function (editor, cols) {
|
||||
return function (e) {
|
||||
var buttonCtrl = this.parent();
|
||||
var value;
|
||||
var currentColor = TextColor.getCurrentColor(editor, buttonCtrl.settings.format);
|
||||
var selectColor = function (value) {
|
||||
editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value);
|
||||
buttonCtrl.hidePanel();
|
||||
buttonCtrl.color(value);
|
||||
};
|
||||
var resetColor = function () {
|
||||
editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format);
|
||||
buttonCtrl.hidePanel();
|
||||
buttonCtrl.resetColor();
|
||||
};
|
||||
if (global$1.DOM.getParent(e.target, '.mce-custom-color-btn')) {
|
||||
buttonCtrl.hidePanel();
|
||||
var colorPickerCallback = Settings.getColorPickerCallback(editor);
|
||||
colorPickerCallback.call(editor, function (value) {
|
||||
var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
|
||||
var customColorCells, div, i;
|
||||
customColorCells = global$2.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
|
||||
return elm.firstChild;
|
||||
});
|
||||
for (i = 0; i < customColorCells.length; i++) {
|
||||
div = customColorCells[i];
|
||||
if (!div.getAttribute('data-mce-color')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i === cols) {
|
||||
for (i = 0; i < cols - 1; i++) {
|
||||
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
|
||||
}
|
||||
}
|
||||
setDivColor(div, value);
|
||||
selectColor(value);
|
||||
}, currentColor);
|
||||
}
|
||||
value = e.target.getAttribute('data-mce-color');
|
||||
if (value) {
|
||||
if (this.lastId) {
|
||||
global$1.DOM.get(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();
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('forecolor', {
|
||||
type: 'colorbutton',
|
||||
tooltip: 'Text color',
|
||||
format: 'forecolor',
|
||||
panel: {
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker(editor, true),
|
||||
onclick: onPanelClick(editor, $_2rfqb7rmjjgwefd9.getForeColorCols(editor))
|
||||
},
|
||||
onclick: onButtonClick(editor)
|
||||
});
|
||||
editor.addButton('backcolor', {
|
||||
type: 'colorbutton',
|
||||
tooltip: 'Background color',
|
||||
format: 'hilitecolor',
|
||||
panel: {
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker(editor, false),
|
||||
onclick: onPanelClick(editor, $_2rfqb7rmjjgwefd9.getBackColorCols(editor))
|
||||
},
|
||||
onclick: onButtonClick(editor)
|
||||
});
|
||||
};
|
||||
var $_8npvswrjjjgwefd5 = { register: register$1 };
|
||||
var renderColorPicker = function (editor, foreColor) {
|
||||
return function () {
|
||||
var cols = foreColor ? Settings.getForeColorCols(editor) : Settings.getBackColorCols(editor);
|
||||
var rows = foreColor ? Settings.getForeColorRows(editor) : Settings.getBackColorRows(editor);
|
||||
var colorMap = foreColor ? Settings.getForeColorMap(editor) : Settings.getBackColorMap(editor);
|
||||
var hasColorPicker = Settings.hasColorPicker(editor);
|
||||
return ColorPickerHtml.getHtml(cols, rows, colorMap, hasColorPicker);
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('forecolor', {
|
||||
type: 'colorbutton',
|
||||
tooltip: 'Text color',
|
||||
format: 'forecolor',
|
||||
panel: {
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker(editor, true),
|
||||
onclick: onPanelClick(editor, Settings.getForeColorCols(editor))
|
||||
},
|
||||
onclick: onButtonClick(editor)
|
||||
});
|
||||
editor.addButton('backcolor', {
|
||||
type: 'colorbutton',
|
||||
tooltip: 'Background color',
|
||||
format: 'hilitecolor',
|
||||
panel: {
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker(editor, false),
|
||||
onclick: onPanelClick(editor, Settings.getBackColorCols(editor))
|
||||
},
|
||||
onclick: onButtonClick(editor)
|
||||
});
|
||||
};
|
||||
var Buttons = { register: register$1 };
|
||||
|
||||
global.add('textcolor', function (editor) {
|
||||
$_g2o2pirhjjgwefd1.register(editor);
|
||||
$_8npvswrjjjgwefd5.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
global.add('textcolor', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
return Plugin;
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=["000000","Black","993300","Burnt orange","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"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=r||e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=["000000","Black","993300","Burnt orange","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"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();
|
||||
|
|
@ -1064,12 +1064,20 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
|||
}
|
||||
}
|
||||
|
||||
// For full height editor.
|
||||
editor.on( 'resizewindow scrollwindow', hide );
|
||||
// For scrollable editor.
|
||||
editor.dom.bind( editor.getWin(), 'resize scroll', hide );
|
||||
editor.dom.bind( editor.getWin(), 'resize', hide );
|
||||
|
||||
if ( editor.inline ) {
|
||||
// Enable `capture` for the event.
|
||||
// This will hide/reposition the toolbar on any scrolling in the document.
|
||||
document.addEventListener( 'scroll', hide, true );
|
||||
} else {
|
||||
editor.dom.bind( editor.getWin(), 'scroll', hide );
|
||||
// For full height iframe editor.
|
||||
editor.on( 'resizewindow scrollwindow', hide );
|
||||
}
|
||||
|
||||
editor.on( 'remove', function() {
|
||||
document.removeEventListener( 'scroll', hide, true );
|
||||
editor.off( 'resizewindow scrollwindow', hide );
|
||||
editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
|
||||
} );
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -347,12 +347,17 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
return serializer.serialize( editor.parser.parse( caption, { forced_root_block: false } ) );
|
||||
}
|
||||
|
||||
function updateImage( imageNode, imageData ) {
|
||||
var classes, className, node, html, parent, wrap, linkNode,
|
||||
function updateImage( $imageNode, imageData ) {
|
||||
var classes, className, node, html, parent, wrap, linkNode, imageNode,
|
||||
captionNode, dd, dl, id, attrs, linkAttrs, width, height, align,
|
||||
$imageNode, srcset, src,
|
||||
dom = editor.dom;
|
||||
|
||||
if ( ! $imageNode || ! $imageNode.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
imageNode = $imageNode[0];
|
||||
classes = tinymce.explode( imageData.extraClasses, ' ' );
|
||||
|
||||
if ( ! classes ) {
|
||||
|
|
@ -389,7 +394,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
dom.setAttribs( imageNode, attrs );
|
||||
|
||||
// Preserve empty alt attributes.
|
||||
editor.$( imageNode ).attr( 'alt', imageData.alt || '' );
|
||||
$imageNode.attr( 'alt', imageData.alt || '' );
|
||||
|
||||
linkAttrs = {
|
||||
href: imageData.linkUrl,
|
||||
|
|
@ -513,7 +518,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
}
|
||||
|
||||
function editImage( img ) {
|
||||
var frame, callback, metadata;
|
||||
var frame, callback, metadata, imageNode;
|
||||
|
||||
if ( typeof wp === 'undefined' || ! wp.media ) {
|
||||
editor.execCommand( 'mceImage' );
|
||||
|
|
@ -522,6 +527,9 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
|
||||
metadata = extractImageData( img );
|
||||
|
||||
// Mark the image node so we can select it later.
|
||||
editor.$( img ).attr( 'data-wp-editing', 1 );
|
||||
|
||||
// Manipulate the metadata by reference that is fed into the PostImage model used in the media modal
|
||||
wp.media.events.trigger( 'editor:image-edit', {
|
||||
editor: editor,
|
||||
|
|
@ -538,9 +546,8 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
wp.media.events.trigger( 'editor:frame-create', { frame: frame } );
|
||||
|
||||
callback = function( imageData ) {
|
||||
editor.focus();
|
||||
editor.undoManager.transact( function() {
|
||||
updateImage( img, imageData );
|
||||
updateImage( imageNode, imageData );
|
||||
} );
|
||||
frame.detach();
|
||||
};
|
||||
|
|
@ -550,6 +557,12 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
frame.on( 'close', function() {
|
||||
editor.focus();
|
||||
frame.detach();
|
||||
|
||||
// `close` fires first...
|
||||
// To be able to update the image node, we need to find it here,
|
||||
// and use it in the callback.
|
||||
imageNode = editor.$( 'img[data-wp-editing]' )
|
||||
imageNode.removeAttr( 'data-wp-editing' );
|
||||
});
|
||||
|
||||
frame.open();
|
||||
|
|
@ -810,7 +823,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
|
||||
editor.on( 'beforeGetContent', function( event ) {
|
||||
if ( event.format !== 'raw' ) {
|
||||
editor.$( 'img[id="__wp-temp-img-id"]' ).attr( 'id', null );
|
||||
editor.$( 'img[id="__wp-temp-img-id"]' ).removeAttr( 'id' );
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
( function( tinymce, wp, settings ) {
|
||||
( function( tinymce ) {
|
||||
tinymce.PluginManager.add( 'wpemoji', function( editor ) {
|
||||
var typing,
|
||||
wp = window.wp,
|
||||
settings = window._wpemojiSettings,
|
||||
env = tinymce.Env,
|
||||
ua = window.navigator.userAgent,
|
||||
isWin = ua.indexOf( 'Windows' ) > -1,
|
||||
|
|
@ -125,4 +127,4 @@
|
|||
}
|
||||
} );
|
||||
} );
|
||||
} )( window.tinymce, window.wp, window._wpemojiSettings );
|
||||
} )( window.tinymce );
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!function(a,b,c){a.PluginManager.add("wpemoji",function(d){function e(a){a.className="emoji",a.setAttribute("data-mce-resize","false"),a.setAttribute("data-mce-placeholder","1"),a.setAttribute("data-wp-emoji","1")}function f(a){var c={"data-mce-resize":"false","data-mce-placeholder":"1","data-wp-emoji":"1"};b.emoji.parse(a,{imgAttr:c})}function g(a){var b,c;a&&window.twemoji&&window.twemoji.test(a.textContent||a.innerText)&&(i.webkit&&(b=d.selection,c=b.getBookmark()),f(a),i.webkit&&b.moveToBookmark(c))}var h,i=a.Env,j=window.navigator.userAgent,k=j.indexOf("Windows")>-1,l=function(){var a=j.match(/Windows NT 6\.(\d)/);return!!(a&&a[1]>1)}();b&&b.emoji&&!c.supports.everything&&(l?d.on("keyup",function(a){231===a.keyCode&&g(d.selection.getNode())}):k||(d.on("keydown keyup",function(a){h="keydown"===a.type}),d.on("input",function(){h||g(d.selection.getNode())})),d.on("setcontent",function(a){var b=d.selection,c=b.getNode();window.twemoji&&window.twemoji.test(c.textContent||c.innerText)&&(f(c),i.ie&&i.ie<9&&a.load&&c&&"BODY"===c.nodeName&&b.collapse(!0))}),d.on("PastePostProcess",function(b){window.twemoji&&a.each(d.dom.$("img.emoji",b.node),function(a){a.alt&&window.twemoji.test(a.alt)&&e(a)})}),d.on("postprocess",function(a){a.content&&(a.content=a.content.replace(/<img[^>]+data-wp-emoji="[^>]+>/g,function(a){var b=a.match(/alt="([^"]+)"/);return b&&b[1]?b[1]:a}))}),d.on("resolvename",function(a){"IMG"===a.target.nodeName&&d.dom.getAttrib(a.target,"data-wp-emoji")&&a.preventDefault()}))})}(window.tinymce,window.wp,window._wpemojiSettings);
|
||||
!function(a){a.PluginManager.add("wpemoji",function(b){function c(a){a.className="emoji",a.setAttribute("data-mce-resize","false"),a.setAttribute("data-mce-placeholder","1"),a.setAttribute("data-wp-emoji","1")}function d(a){var b={"data-mce-resize":"false","data-mce-placeholder":"1","data-wp-emoji":"1"};g.emoji.parse(a,{imgAttr:b})}function e(a){var c,e;a&&window.twemoji&&window.twemoji.test(a.textContent||a.innerText)&&(i.webkit&&(c=b.selection,e=c.getBookmark()),d(a),i.webkit&&c.moveToBookmark(e))}var f,g=window.wp,h=window._wpemojiSettings,i=a.Env,j=window.navigator.userAgent,k=j.indexOf("Windows")>-1,l=function(){var a=j.match(/Windows NT 6\.(\d)/);return!!(a&&a[1]>1)}();g&&g.emoji&&!h.supports.everything&&(l?b.on("keyup",function(a){231===a.keyCode&&e(b.selection.getNode())}):k||(b.on("keydown keyup",function(a){f="keydown"===a.type}),b.on("input",function(){f||e(b.selection.getNode())})),b.on("setcontent",function(a){var c=b.selection,e=c.getNode();window.twemoji&&window.twemoji.test(e.textContent||e.innerText)&&(d(e),i.ie&&i.ie<9&&a.load&&e&&"BODY"===e.nodeName&&c.collapse(!0))}),b.on("PastePostProcess",function(d){window.twemoji&&a.each(b.dom.$("img.emoji",d.node),function(a){a.alt&&window.twemoji.test(a.alt)&&c(a)})}),b.on("postprocess",function(a){a.content&&(a.content=a.content.replace(/<img[^>]+data-wp-emoji="[^>]+>/g,function(a){var b=a.match(/alt="([^"]+)"/);return b&&b[1]?b[1]:a}))}),b.on("resolvename",function(a){"IMG"===a.target.nodeName&&b.dom.getAttrib(a.target,"data-wp-emoji")&&a.preventDefault()}))})}(window.tinymce);
|
||||
|
|
@ -226,15 +226,15 @@
|
|||
linkNode = getSelectedLink();
|
||||
editToolbar.tempHide = false;
|
||||
|
||||
if ( linkNode ) {
|
||||
editor.dom.setAttribs( linkNode, { 'data-wplink-edit': true } );
|
||||
} else {
|
||||
if ( ! linkNode ) {
|
||||
removePlaceholders();
|
||||
editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder' } );
|
||||
|
||||
linkNode = editor.$( 'a[href="_wp_link_placeholder"]' )[0];
|
||||
editor.nodeChanged();
|
||||
}
|
||||
|
||||
editor.dom.setAttribs( linkNode, { 'data-wplink-edit': true } );
|
||||
} );
|
||||
|
||||
editor.addCommand( 'wp_link_apply', function() {
|
||||
|
|
@ -284,8 +284,9 @@
|
|||
} );
|
||||
|
||||
editor.addCommand( 'wp_link_cancel', function() {
|
||||
inputInstance.reset();
|
||||
|
||||
if ( ! editToolbar.tempHide ) {
|
||||
inputInstance.reset();
|
||||
removePlaceholders();
|
||||
}
|
||||
} );
|
||||
|
|
@ -583,24 +584,10 @@
|
|||
var url = inputInstance.getURL() || null,
|
||||
text = inputInstance.getLinkText() || null;
|
||||
|
||||
/*
|
||||
* Accessibility note: moving focus back to the editor confuses
|
||||
* screen readers. They will announce again the Editor ARIA role
|
||||
* `application` and the iframe `title` attribute.
|
||||
*
|
||||
* Unfortunately IE looses the selection when the editor iframe
|
||||
* looses focus, so without returning focus to the editor, the code
|
||||
* in the modal will not be able to get the selection, place the caret
|
||||
* at the same location, etc.
|
||||
*/
|
||||
if ( tinymce.Env.ie ) {
|
||||
editor.focus(); // Needed for IE
|
||||
}
|
||||
window.wpLink.open( editor.id, url, text );
|
||||
|
||||
editToolbar.tempHide = true;
|
||||
window.wpLink.open( editor.id, url, text, linkNode );
|
||||
|
||||
inputInstance.reset();
|
||||
editToolbar.hide();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,13 @@
|
|||
/**
|
||||
* WordPress View plugin.
|
||||
*/
|
||||
( function( tinymce, wp ) {
|
||||
( function( tinymce ) {
|
||||
tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
function noop () {}
|
||||
|
||||
// Set this here as wp-tinymce.js may be loaded too early.
|
||||
var wp = window.wp;
|
||||
|
||||
if ( ! wp || ! wp.mce || ! wp.mce.views ) {
|
||||
return {
|
||||
getView: noop
|
||||
|
|
@ -199,4 +202,4 @@
|
|||
getView: noop
|
||||
};
|
||||
} );
|
||||
} )( window.tinymce, window.wp );
|
||||
} )( window.tinymce );
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!function(a,b){a.PluginManager.add("wpview",function(c){function d(){}function e(a){return c.dom.hasClass(a,"wpview")}function f(a){function b(a,b){return"<p>"+window.decodeURIComponent(b)+"</p>"}return a?a.replace(/<div[^>]+data-wpview-text="([^"]+)"[^>]*>(?:\.|[\s\S]+?wpview-end[^>]+>\s*<\/span>\s*)?<\/div>/g,b).replace(/<p[^>]+data-wpview-marker="([^"]+)"[^>]*>[\s\S]*?<\/p>/g,b):a}return b&&b.mce&&b.mce.views?(c.on("init",function(){var a=window.MutationObserver||window.WebKitMutationObserver;a&&new a(function(){c.fire("wp-body-class-change")}).observe(c.getBody(),{attributes:!0,attributeFilter:["class"]}),c.on("wp-body-class-change",function(){var a=c.getBody().className;c.$('iframe[class="wpview-sandbox"]').each(function(b,c){if(!c.src||'javascript:""'===c.src)try{c.contentWindow.document.body.className=a}catch(d){}})})}),c.on("beforesetcontent",function(a){var d;if(a.selection||b.mce.views.unbind(),a.content){if(!a.load&&(d=c.selection.getNode(),d&&d!==c.getBody()&&/^\s*https?:\/\/\S+\s*$/i.test(a.content))){if(d=c.dom.getParent(d,"p"),!d||!/^[\s\uFEFF\u00A0]*$/.test(c.$(d).text()||""))return;d.innerHTML=""}a.content=b.mce.views.setMarkers(a.content,c)}}),c.on("setcontent",function(){b.mce.views.render()}),c.on("preprocess hide",function(a){c.$("div[data-wpview-text], p[data-wpview-marker]",a.node).each(function(a,b){b.innerHTML="."})},!0),c.on("postprocess",function(a){a.content=f(a.content)}),c.on("beforeaddundo",function(a){a.level.content=f(a.level.content)}),c.on("drop objectselected",function(a){e(a.targetClone)&&(a.targetClone=c.getDoc().createTextNode(window.decodeURIComponent(c.dom.getAttrib(a.targetClone,"data-wpview-text"))))}),c.on("pastepreprocess",function(b){var c=b.content;c&&(c=a.trim(c.replace(/<[^>]+>/g,"")),/^https?:\/\/\S+$/i.test(c)&&(b.content=c))}),c.on("resolvename",function(a){e(a.target)&&(a.name=c.dom.getAttrib(a.target,"data-wpview-type")||"object")}),c.on("click keyup",function(){var a=c.selection.getNode();e(a)&&c.dom.getAttrib(a,"data-mce-selected")&&a.setAttribute("data-mce-selected","2")}),c.addButton("wp_view_edit",{tooltip:"Edit|button",icon:"dashicon dashicons-edit",onclick:function(){var a=c.selection.getNode();e(a)&&b.mce.views.edit(c,a)}}),c.addButton("wp_view_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",onclick:function(){c.fire("cut")}}),c.once("preinit",function(){var a;c.wp&&c.wp._createToolbar&&(a=c.wp._createToolbar(["wp_view_edit","wp_view_remove"]),c.on("wptoolbar",function(b){!b.collapsed&&e(b.element)&&(b.toolbar=a)}))}),c.wp=c.wp||{},c.wp.getView=d,c.wp.setViewCursor=d,{getView:d}):{getView:d}})}(window.tinymce,window.wp);
|
||||
!function(a){a.PluginManager.add("wpview",function(b){function c(){}function d(a){return b.dom.hasClass(a,"wpview")}function e(a){function b(a,b){return"<p>"+window.decodeURIComponent(b)+"</p>"}return a?a.replace(/<div[^>]+data-wpview-text="([^"]+)"[^>]*>(?:\.|[\s\S]+?wpview-end[^>]+>\s*<\/span>\s*)?<\/div>/g,b).replace(/<p[^>]+data-wpview-marker="([^"]+)"[^>]*>[\s\S]*?<\/p>/g,b):a}var f=window.wp;return f&&f.mce&&f.mce.views?(b.on("init",function(){var a=window.MutationObserver||window.WebKitMutationObserver;a&&new a(function(){b.fire("wp-body-class-change")}).observe(b.getBody(),{attributes:!0,attributeFilter:["class"]}),b.on("wp-body-class-change",function(){var a=b.getBody().className;b.$('iframe[class="wpview-sandbox"]').each(function(b,c){if(!c.src||'javascript:""'===c.src)try{c.contentWindow.document.body.className=a}catch(d){}})})}),b.on("beforesetcontent",function(a){var c;if(a.selection||f.mce.views.unbind(),a.content){if(!a.load&&(c=b.selection.getNode(),c&&c!==b.getBody()&&/^\s*https?:\/\/\S+\s*$/i.test(a.content))){if(c=b.dom.getParent(c,"p"),!c||!/^[\s\uFEFF\u00A0]*$/.test(b.$(c).text()||""))return;c.innerHTML=""}a.content=f.mce.views.setMarkers(a.content,b)}}),b.on("setcontent",function(){f.mce.views.render()}),b.on("preprocess hide",function(a){b.$("div[data-wpview-text], p[data-wpview-marker]",a.node).each(function(a,b){b.innerHTML="."})},!0),b.on("postprocess",function(a){a.content=e(a.content)}),b.on("beforeaddundo",function(a){a.level.content=e(a.level.content)}),b.on("drop objectselected",function(a){d(a.targetClone)&&(a.targetClone=b.getDoc().createTextNode(window.decodeURIComponent(b.dom.getAttrib(a.targetClone,"data-wpview-text"))))}),b.on("pastepreprocess",function(b){var c=b.content;c&&(c=a.trim(c.replace(/<[^>]+>/g,"")),/^https?:\/\/\S+$/i.test(c)&&(b.content=c))}),b.on("resolvename",function(a){d(a.target)&&(a.name=b.dom.getAttrib(a.target,"data-wpview-type")||"object")}),b.on("click keyup",function(){var a=b.selection.getNode();d(a)&&b.dom.getAttrib(a,"data-mce-selected")&&a.setAttribute("data-mce-selected","2")}),b.addButton("wp_view_edit",{tooltip:"Edit|button",icon:"dashicon dashicons-edit",onclick:function(){var a=b.selection.getNode();d(a)&&f.mce.views.edit(b,a)}}),b.addButton("wp_view_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",onclick:function(){b.fire("cut")}}),b.once("preinit",function(){var a;b.wp&&b.wp._createToolbar&&(a=b.wp._createToolbar(["wp_view_edit","wp_view_remove"]),b.on("wptoolbar",function(b){!b.collapsed&&d(b.element)&&(b.toolbar=a)}))}),b.wp=b.wp||{},b.wp.getView=c,b.wp.setViewCursor=c,{getView:c}):{getView:c}})}(window.tinymce);
|
||||
Binary file not shown.
|
|
@ -87,6 +87,7 @@
|
|||
<glyph unicode="" glyph-name="reload" d="M889.68 793.68c-93.608 102.216-228.154 166.32-377.68 166.32-282.77 0-512-229.23-512-512h96c0 229.75 186.25 416 416 416 123.020 0 233.542-53.418 309.696-138.306l-149.696-149.694h352v352l-134.32-134.32zM928 448c0-229.75-186.25-416-416-416-123.020 0-233.542 53.418-309.694 138.306l149.694 149.694h-352v-352l134.32 134.32c93.608-102.216 228.154-166.32 377.68-166.32 282.77 0 512 229.23 512 512h-96z" />
|
||||
<glyph unicode="" glyph-name="translate" d="M553.6 304l-118.4 118.4c80 89.6 137.6 195.2 172.8 304h137.6v92.8h-326.4v92.8h-92.8v-92.8h-326.4v-92.8h518.4c-32-89.6-80-176-147.2-249.6-44.8 48-80 99.2-108.8 156.8h-92.8c35.2-76.8 80-147.2 137.6-211.2l-236.8-233.6 67.2-67.2 233.6 233.6 144-144c3.2 0 38.4 92.8 38.4 92.8zM816 540.8h-92.8l-208-560h92.8l51.2 140.8h220.8l51.2-140.8h92.8l-208 560zM691.2 214.4l76.8 201.6 76.8-201.6h-153.6z" />
|
||||
<glyph unicode="" glyph-name="drag" d="M576 896h128v-128h-128v128zM576 640h128v-128h-128v128zM320 640h128v-128h-128v128zM576 384h128v-128h-128v128zM320 384h128v-128h-128v128zM320 128h128v-128h-128v128zM576 128h128v-128h-128v128zM320 896h128v-128h-128v128z" />
|
||||
<glyph unicode="" glyph-name="format-painter" d="M768 746.667v42.667c0 23.467-19.2 42.667-42.667 42.667h-512c-23.467 0-42.667-19.2-42.667-42.667v-170.667c0-23.467 19.2-42.667 42.667-42.667h512c23.467 0 42.667 19.2 42.667 42.667v42.667h42.667v-170.667h-426.667v-384c0-23.467 19.2-42.667 42.667-42.667h85.333c23.467 0 42.667 19.2 42.667 42.667v298.667h341.333v341.333h-128z" />
|
||||
<glyph unicode="" glyph-name="home" d="M1024 369.556l-512 397.426-512-397.428v162.038l512 397.426 512-397.428zM896 384v-384h-256v256h-256v-256h-256v384l384 288z" />
|
||||
<glyph unicode="" glyph-name="books" d="M576.234 670.73l242.712 81.432 203.584-606.784-242.712-81.432zM0 64h256v704h-256v-704zM64 640h128v-64h-128v64zM320 64h256v704h-256v-704zM384 640h128v-64h-128v64z" />
|
||||
<glyph unicode="" glyph-name="upload" d="M839.432 760.57c27.492-27.492 50.554-78.672 55.552-120.57h-318.984v318.984c41.898-4.998 93.076-28.060 120.568-55.552l142.864-142.862zM512 576v384h-368c-44 0-80-36-80-80v-864c0-44 36-80 80-80h672c44 0 80 36 80 80v560h-384zM576 192v-192h-192v192h-160l256 256 256-256h-160z" />
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Binary file not shown.
Binary file not shown.
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
4
wp-includes/js/tinymce/tinymce.min.js
vendored
4
wp-includes/js/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
49
wp-includes/js/tinymce/wp-tinymce.js
Normal file
49
wp-includes/js/tinymce/wp-tinymce.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,38 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Not used in core since 5.1.
|
||||
* This is a back-compat for plugins that may be using this method of loading directly.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
* Set this to error_reporting( -1 ) for debugging.
|
||||
*/
|
||||
error_reporting(0);
|
||||
error_reporting( 0 );
|
||||
|
||||
$basepath = dirname(__FILE__);
|
||||
$basepath = dirname( __FILE__ );
|
||||
|
||||
function get_file($path) {
|
||||
function get_file( $path ) {
|
||||
|
||||
if ( function_exists('realpath') )
|
||||
$path = realpath($path);
|
||||
if ( function_exists( 'realpath' ) ) {
|
||||
$path = realpath( $path );
|
||||
}
|
||||
|
||||
if ( ! $path || ! @is_file($path) )
|
||||
if ( ! $path || ! @is_file( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return @file_get_contents($path);
|
||||
return @file_get_contents( $path );
|
||||
}
|
||||
|
||||
$expires_offset = 31536000; // 1 year
|
||||
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
header('Vary: Accept-Encoding'); // Handle proxies
|
||||
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
|
||||
header("Cache-Control: public, max-age=$expires_offset");
|
||||
header( 'Content-Type: application/javascript; charset=UTF-8' );
|
||||
header( 'Vary: Accept-Encoding' ); // Handle proxies
|
||||
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
|
||||
header( "Cache-Control: public, max-age=$expires_offset" );
|
||||
|
||||
if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
|
||||
&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
|
||||
|
||||
header('Content-Encoding: gzip');
|
||||
if ( isset( $_GET['c'] ) && ( $file = get_file( $basepath . '/wp-tinymce.js' ) ) ) {
|
||||
echo $file;
|
||||
} else {
|
||||
// Back compat. This file shouldn't be used if this condition can occur (as in, if gzip isn't accepted).
|
||||
// Even further back compat.
|
||||
echo get_file( $basepath . '/tinymce.min.js' );
|
||||
echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue