mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
TinyMCE: update to 4.3.10, changelog: https://github.com/tinymce/tinymce/blob/master/changelog.txt. Fixes #36545 for trunk.
Built from https://develop.svn.wordpress.org/trunk@37242 git-svn-id: http://core.svn.wordpress.org/trunk@37208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dea5e27d14
commit
7e5dcdb1aa
@ -104,7 +104,7 @@ tinymce.PluginManager.add('fullscreen', function(editor) {
|
||||
}
|
||||
|
||||
editor.on('init', function() {
|
||||
editor.addShortcut('Meta+Alt+F', '', toggleFullscreen);
|
||||
editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen);
|
||||
});
|
||||
|
||||
editor.on('remove', function() {
|
||||
|
@ -1 +1 @@
|
||||
tinymce.PluginManager.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 c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Meta+Alt+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}})});
|
||||
tinymce.PluginManager.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 c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}})});
|
@ -19,7 +19,8 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
{regex: /youtube.com\/embed\/([a-z0-9\-_]+)/i, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
|
||||
{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', allowfullscreen: true},
|
||||
{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&byline=0", allowfullscreen: true},
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false}
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false},
|
||||
{regex: /dailymotion\.com\/video\/([^_]+)/, type: 'iframe', w: 480, h: 270, url: '//www.dailymotion.com/embed/video/$1', allowFullscreen: true}
|
||||
];
|
||||
|
||||
var embedChange = (tinymce.Env.ie && tinymce.Env.ie <= 8) ? 'onChange' : 'onInput';
|
||||
|
File diff suppressed because one or more lines are too long
@ -818,6 +818,10 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
draggingInternally = e.type == 'dragstart';
|
||||
});
|
||||
|
||||
function isPlainTextFileUrl(content) {
|
||||
return content['text/plain'].indexOf('file://') === 0;
|
||||
}
|
||||
|
||||
editor.on('drop', function(e) {
|
||||
var dropContent, rng;
|
||||
|
||||
@ -829,7 +833,7 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
|
||||
dropContent = getDataTransferItems(e.dataTransfer);
|
||||
|
||||
if (!hasHtmlOrText(dropContent) && pasteImageData(e, rng)) {
|
||||
if ((!hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && pasteImageData(e, rng)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -839,20 +843,23 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
if (content) {
|
||||
e.preventDefault();
|
||||
|
||||
editor.undoManager.transact(function() {
|
||||
if (dropContent['mce-internal']) {
|
||||
editor.execCommand('Delete');
|
||||
}
|
||||
// FF 45 doesn't paint a caret when dragging in text in due to focus call by execCommand
|
||||
Delay.setEditorTimeout(editor, function() {
|
||||
editor.undoManager.transact(function() {
|
||||
if (dropContent['mce-internal']) {
|
||||
editor.execCommand('Delete');
|
||||
}
|
||||
|
||||
editor.selection.setRng(rng);
|
||||
editor.selection.setRng(rng);
|
||||
|
||||
content = Utils.trimHtml(content);
|
||||
content = Utils.trimHtml(content);
|
||||
|
||||
if (!dropContent['text/html']) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
if (!dropContent['text/html']) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1670,7 +1677,7 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
});
|
||||
|
||||
// Block all drag/drop events
|
||||
if (editor.paste_block_drop) {
|
||||
if (editor.settings.paste_block_drop) {
|
||||
editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
File diff suppressed because one or more lines are too long
@ -14,8 +14,14 @@
|
||||
tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
var cols, rows;
|
||||
|
||||
rows = editor.settings.textcolor_rows || 5;
|
||||
cols = editor.settings.textcolor_cols || 8;
|
||||
rows = {
|
||||
forecolor: editor.settings.forecolor_rows || editor.settings.textcolor_rows || 5,
|
||||
backcolor: editor.settings.backcolor_rows || editor.settings.textcolor_rows || 5
|
||||
};
|
||||
cols = {
|
||||
forecolor: editor.settings.forecolor_cols || editor.settings.textcolor_rows || 5,
|
||||
backcolor: editor.settings.backcolor_cols || editor.settings.textcolor_cols || 8
|
||||
};
|
||||
|
||||
function getCurrentColor(format) {
|
||||
var color;
|
||||
@ -31,10 +37,10 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
return color;
|
||||
}
|
||||
|
||||
function mapColors() {
|
||||
function mapColors(type) {
|
||||
var i, colors = [], colorMap;
|
||||
|
||||
colorMap = editor.settings.textcolor_map || [
|
||||
colorMap = [
|
||||
"000000", "Black",
|
||||
"993300", "Burnt orange",
|
||||
"333300", "Dark olive",
|
||||
@ -76,6 +82,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
"CC99FF", "Plum"
|
||||
];
|
||||
|
||||
colorMap = editor.settings.textcolor_map || colorMap;
|
||||
colorMap = editor.settings[type + '_map'] || colorMap;
|
||||
|
||||
for (i = 0; i < colorMap.length; i += 2) {
|
||||
colors.push({
|
||||
text: colorMap[i + 1],
|
||||
@ -87,7 +96,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
}
|
||||
|
||||
function renderColorPicker() {
|
||||
var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0;
|
||||
var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0, type;
|
||||
|
||||
type = ctrl.settings.origin;
|
||||
|
||||
function getColorCellHtml(color, title) {
|
||||
var isNoColor = color == 'transparent';
|
||||
@ -106,7 +117,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
);
|
||||
}
|
||||
|
||||
colors = mapColors();
|
||||
colors = mapColors(type);
|
||||
colors.push({
|
||||
text: tinymce.translate("No color"),
|
||||
color: "transparent"
|
||||
@ -115,11 +126,11 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
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++) {
|
||||
for (y = 0; y < rows[type]; y++) {
|
||||
html += '<tr>';
|
||||
|
||||
for (x = 0; x < cols; x++) {
|
||||
i = y * cols + x;
|
||||
for (x = 0; x < cols[type]; x++) {
|
||||
i = y * cols[type] + x;
|
||||
|
||||
if (i > last) {
|
||||
html += '<td></td>';
|
||||
@ -135,7 +146,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
if (editor.settings.color_picker_callback) {
|
||||
html += (
|
||||
'<tr>' +
|
||||
'<td colspan="' + cols + '" class="mce-custom-color-btn">' +
|
||||
'<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>' +
|
||||
@ -146,7 +157,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
for (x = 0; x < cols; x++) {
|
||||
for (x = 0; x < cols[type]; x++) {
|
||||
html += getColorCellHtml('', 'Custom color');
|
||||
}
|
||||
|
||||
@ -175,7 +186,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
}
|
||||
|
||||
function onPanelClick(e) {
|
||||
var buttonCtrl = this.parent(), value;
|
||||
var buttonCtrl = this.parent(), value, type;
|
||||
|
||||
type = buttonCtrl.settings.origin;
|
||||
|
||||
function selectColor(value) {
|
||||
buttonCtrl.hidePanel();
|
||||
@ -214,8 +227,8 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
|
||||
// Shift colors to the right
|
||||
// TODO: Might need to be the left on RTL
|
||||
if (i == cols) {
|
||||
for (i = 0; i < cols - 1; i++) {
|
||||
if (i == cols[type]) {
|
||||
for (i = 0; i < cols[type] - 1; i++) {
|
||||
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
|
||||
}
|
||||
}
|
||||
@ -259,6 +272,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
tooltip: 'Text color',
|
||||
format: 'forecolor',
|
||||
panel: {
|
||||
origin: 'forecolor',
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker,
|
||||
@ -272,6 +286,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
tooltip: 'Background color',
|
||||
format: 'hilitecolor',
|
||||
panel: {
|
||||
origin: 'backcolor',
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker,
|
||||
|
@ -1 +1 @@
|
||||
tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["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"],b=0;b<c.length;b+=2)d.push({text:c[b+1],color:"#"+c[b]});return d}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+n+"-"+o++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"×":"")+"</div></td>"}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;j>k;k++){for(f+="<tr>",h=0;i>h;h++)l=k*i+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+n+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+n+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;i>h;h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i)for(e=0;i-1>e;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});
|
||||
tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(b){var c,d,e=[];for(d=["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"],d=a.settings.textcolor_map||d,d=a.settings[b+"_map"]||d,c=0;c<d.length;c+=2)e.push({text:d[c+1],color:"#"+d[c]});return e}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+o+"-"+p++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"×":"")+"</div></td>"}var d,e,f,g,h,k,l,m,n=this,o=n._id,p=0;for(m=n.settings.origin,d=c(m),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;k<j[m];k++){for(f+="<tr>",h=0;h<i[m];h++)l=k*i[m]+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i[m]+'" class="mce-custom-color-btn"><div id="'+o+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+o+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;h<i[m];h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){l.hidePanel(),l.color(a),e(l.settings.format,a)}function g(){l.hidePanel(),l.resetColor(),f(l.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k,l=this.parent();k=l.settings.origin,tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(l.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=l.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i[k])for(e=0;e<i[k]-1;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(l.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&l.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j={forecolor:a.settings.forecolor_rows||a.settings.textcolor_rows||5,backcolor:a.settings.backcolor_rows||a.settings.textcolor_rows||5},i={forecolor:a.settings.forecolor_cols||a.settings.textcolor_rows||5,backcolor:a.settings.backcolor_cols||a.settings.textcolor_cols||8},a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{origin:"forecolor",role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{origin:"backcolor",role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -391,6 +391,53 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
});
|
||||
}
|
||||
|
||||
function togglePositionClass(panel, relPos, predicate) {
|
||||
relPos = relPos ? relPos.substr(0, 2) : '';
|
||||
|
||||
each({
|
||||
t: 'down',
|
||||
b: 'up'
|
||||
}, function(cls, pos) {
|
||||
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(0, 1)));
|
||||
});
|
||||
|
||||
each({
|
||||
l: 'left',
|
||||
r: 'right'
|
||||
}, function(cls, pos) {
|
||||
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(1, 1)));
|
||||
});
|
||||
}
|
||||
|
||||
function toClientRect(geomRect) {
|
||||
return {
|
||||
left: geomRect.x,
|
||||
top: geomRect.y,
|
||||
width: geomRect.w,
|
||||
height: geomRect.h,
|
||||
right: geomRect.x + geomRect.w,
|
||||
bottom: geomRect.y + geomRect.h
|
||||
};
|
||||
}
|
||||
|
||||
function userConstrain(x, y, elementRect, contentAreaRect, panelRect) {
|
||||
panelRect = toClientRect({x: x, y: y, w: panelRect.w, h: panelRect.h});
|
||||
|
||||
if (settings.inline_toolbar_position_handler) {
|
||||
panelRect = settings.inline_toolbar_position_handler({
|
||||
elementRect: toClientRect(elementRect),
|
||||
contentAreaRect: toClientRect(contentAreaRect),
|
||||
panelRect: panelRect
|
||||
});
|
||||
}
|
||||
|
||||
return panelRect;
|
||||
}
|
||||
|
||||
function movePanelTo(panel, pos) {
|
||||
panel.moveTo(pos.left, pos.top);
|
||||
}
|
||||
|
||||
function reposition(match) {
|
||||
var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions;
|
||||
|
||||
@ -404,7 +451,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
}
|
||||
|
||||
testPositions = [
|
||||
'tc-bc', 'bc-tc',
|
||||
'bc-tc', 'tc-bc',
|
||||
'tl-bl', 'bl-tl',
|
||||
'tr-br', 'br-tr'
|
||||
];
|
||||
@ -431,39 +478,36 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
}
|
||||
|
||||
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, testPositions);
|
||||
elementRect = Rect.clamp(elementRect, contentAreaRect);
|
||||
|
||||
if (relPos) {
|
||||
each(testPositions.concat('inside'), function(pos) {
|
||||
panel.classes.toggle('tinymce-inline-' + pos, pos == relPos);
|
||||
});
|
||||
|
||||
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
||||
panel.moveTo(relRect.x, relRect.y);
|
||||
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
||||
} else {
|
||||
each(testPositions, function(pos) {
|
||||
panel.classes.toggle('tinymce-inline-' + pos, false);
|
||||
});
|
||||
|
||||
panel.classes.toggle('tinymce-inline-inside', true);
|
||||
// Allow overflow below the editor to avoid placing toolbars ontop of tables
|
||||
contentAreaRect.h += 40;
|
||||
|
||||
elementRect = Rect.intersect(contentAreaRect, elementRect);
|
||||
|
||||
if (elementRect) {
|
||||
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, [
|
||||
'tc-tc', 'tl-tl', 'tr-tr'
|
||||
'bc-tc', 'bl-tl', 'br-tr'
|
||||
]);
|
||||
|
||||
if (relPos) {
|
||||
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
||||
panel.moveTo(relRect.x, relRect.y);
|
||||
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
||||
} else {
|
||||
panel.moveTo(elementRect.x, elementRect.y);
|
||||
movePanelTo(panel, userConstrain(elementRect.x, elementRect.y, elementRect, contentAreaRect, panelRect));
|
||||
}
|
||||
} else {
|
||||
panel.hide();
|
||||
}
|
||||
}
|
||||
|
||||
togglePositionClass(panel, relPos, function(pos1, pos2) {
|
||||
return (!elementRect || elementRect.w > 40) && pos1 === pos2;
|
||||
});
|
||||
|
||||
//drawRect(contentAreaRect, 'blue');
|
||||
//drawRect(elementRect, 'red');
|
||||
//drawRect(panelRect, 'green');
|
||||
@ -503,8 +547,9 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
|
||||
panel = Factory.create({
|
||||
type: 'floatpanel',
|
||||
role: 'application',
|
||||
classes: 'tinymce tinymce-inline',
|
||||
role: 'dialog',
|
||||
classes: 'tinymce tinymce-inline arrow',
|
||||
ariaLabel: 'Inline toolbar',
|
||||
layout: 'flex',
|
||||
direction: 'column',
|
||||
align: 'stretch',
|
||||
@ -512,7 +557,10 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
autofix: true,
|
||||
fixed: true,
|
||||
border: 1,
|
||||
items: createToolbar(match.toolbar.items)
|
||||
items: createToolbar(match.toolbar.items),
|
||||
oncancel: function() {
|
||||
editor.focus();
|
||||
}
|
||||
});
|
||||
|
||||
match.toolbar.panel = panel;
|
||||
@ -587,6 +635,13 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
|
||||
editor.contextToolbars = {};
|
||||
});
|
||||
|
||||
editor.shortcuts.add('ctrl+alt+e > ctrl+alt+p', '', function() {
|
||||
var match = findFrontMostMatch(editor.selection.getNode());
|
||||
if (match && match.toolbar.panel) {
|
||||
match.toolbar.panel.items()[0].focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function fireSkinLoaded(editor) {
|
||||
|
File diff suppressed because one or more lines are too long
4
wp-includes/js/tinymce/tiny_mce_popup.js
vendored
4
wp-includes/js/tinymce/tiny_mce_popup.js
vendored
@ -107,7 +107,7 @@ var tinyMCEPopup = {
|
||||
* Returns a window argument/parameter by name.
|
||||
*
|
||||
* @method getWindowArg
|
||||
* @param {String} name Name of the window argument to retrive.
|
||||
* @param {String} name Name of the window argument to retrieve.
|
||||
* @param {String} defaultValue Optional default value to return.
|
||||
* @return {String} Argument value or default value if it wasn't found.
|
||||
*/
|
||||
@ -121,7 +121,7 @@ var tinyMCEPopup = {
|
||||
* Returns a editor parameter/config option value.
|
||||
*
|
||||
* @method getParam
|
||||
* @param {String} name Name of the editor config option to retrive.
|
||||
* @param {String} name Name of the editor config option to retrieve.
|
||||
* @param {String} defaultValue Optional default value to return.
|
||||
* @return {String} Parameter value or default value if it wasn't found.
|
||||
*/
|
||||
|
26
wp-includes/js/tinymce/tinymce.min.js
vendored
26
wp-includes/js/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-alpha-37241';
|
||||
$wp_version = '4.6-alpha-37242';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
@ -18,7 +18,7 @@ $wp_db_version = 36686;
|
||||
*
|
||||
* @global string $tinymce_version
|
||||
*/
|
||||
$tinymce_version = '4308-20160323';
|
||||
$tinymce_version = '4310-20160418';
|
||||
|
||||
/**
|
||||
* Holds the required PHP version
|
||||
|
Loading…
Reference in New Issue
Block a user