TinyMCE: update to 4.1.6+. Adds support for cache-busting when auto-loading JS and CSS. Change the tests to run in /build. Changelog: https://github.com/tinymce/tinymce/blob/master/changelog.txt.

Fixes #30079

git-svn-id: https://develop.svn.wordpress.org/trunk@29994 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-10-23 02:07:15 +00:00
parent cc41c59286
commit a454872630
44 changed files with 569 additions and 302 deletions

View File

@ -489,6 +489,7 @@ final class _WP_Editors {
'entities' => '38,amp,60,lt,62,gt',
'entity_encoding' => 'raw',
'keep_styles' => false,
'cache_suffix' => 'wp-mce-' . $GLOBALS['tinymce_version'],
// Limit the preview styles in the menu/toolbar
'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
tinymce.PluginManager.add("colorpicker",function(e){function n(n,a){function i(e){var n=new tinymce.util.Color(e),a=n.toRgb();l.fromJSON({r:a.r,g:a.g,b:a.b,hex:n.toHex().substr(1)}),t(n.toHex())}function t(e){l.find("#preview")[0].getEl().style.background=e}var l=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:a,onchange:function(){var e=this.rgb();l&&(l.find("#r").value(e.r),l.find("#g").value(e.g),l.find("#b").value(e.b),l.find("#hex").value(this.value().substr(1)),t(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,a=l.find("colorpicker")[0];return e=this.name(),n=this.value(),"hex"==e?(n="#"+n,i(n),void a.value(n)):(n={r:l.find("#r").value(),g:l.find("#g").value(),b:l.find("#b").value()},a.value(n),void i(n))}},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(){n("#"+this.toJSON().hex)}});i(a)}e.settings.color_picker_callback||(e.settings.color_picker_callback=n)});
tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)});

View File

@ -1 +1 @@
tinymce.PluginManager.add("directionality",function(t){function e(e){var i,n=t.dom,r=t.selection.getSelectedBlocks();r.length&&(i=n.getAttrib(r[0],"dir"),tinymce.each(r,function(t){n.getParent(t.parentNode,"*[dir='"+e+"']",n.getRoot())||(i!=e?n.setAttrib(t,"dir",e):n.setAttrib(t,"dir",null))}),t.nodeChanged())}function i(t){var e=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(i){e.push(i+"[dir="+t+"]")}),e.join(",")}t.addCommand("mceDirectionLTR",function(){e("ltr")}),t.addCommand("mceDirectionRTL",function(){e("rtl")}),t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:i("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:i("rtl")})});
tinymce.PluginManager.add("directionality",function(a){function b(b){var c,d=a.dom,e=a.selection.getSelectedBlocks();e.length&&(c=d.getAttrib(e[0],"dir"),tinymce.each(e,function(a){d.getParent(a.parentNode,"*[dir='"+b+"']",d.getRoot())||(c!=b?d.setAttrib(a,"dir",b):d.setAttrib(a,"dir",null))}),a.nodeChanged())}function c(a){var b=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(c){b.push(c+"[dir="+a+"]")}),b.join(",")}a.addCommand("mceDirectionLTR",function(){b("ltr")}),a.addCommand("mceDirectionRTL",function(){b("rtl")}),a.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:c("ltr")}),a.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:c("rtl")})});

View File

@ -1 +1 @@
tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,l=i.body;return l.offsetWidth&&(e=l.offsetWidth,t=l.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){d.setStyle(a,"height",t().h-(h.clientHeight-a.clientHeight))}var u,h,a,f,m=document.body,g=document.documentElement;s=!s,h=e.getContainer(),u=h.style,a=e.getContentAreaContainer().firstChild,f=a.style,s?(i=f.width,l=f.height,f.width=f.height="100%",c=u.width,o=u.height,u.width=u.height="",d.addClass(m,"mce-fullscreen"),d.addClass(g,"mce-fullscreen"),d.addClass(h,"mce-fullscreen"),d.bind(window,"resize",n),n(),r=n):(f.width=i,f.height=l,c&&(u.width=c),o&&(u.height=o),d.removeClass(m,"mce-fullscreen"),d.removeClass(g,"mce-fullscreen"),d.removeClass(h,"mce-fullscreen"),d.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:s})}var i,l,r,c,o,s=!1,d=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&d.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return s}})});
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(){function c(){j.setStyle(m,"height",b().h-(l.clientHeight-m.clientHeight))}var k,l,m,n,o=document.body,p=document.documentElement;i=!i,l=a.getContainer(),k=l.style,m=a.getContentAreaContainer().firstChild,n=m.style,i?(d=n.width,e=n.height,n.width=n.height="100%",g=k.width,h=k.height,k.width=k.height="",j.addClass(o,"mce-fullscreen"),j.addClass(p,"mce-fullscreen"),j.addClass(l,"mce-fullscreen"),j.bind(window,"resize",c),c(),f=c):(n.width=d,n.height=e,g&&(k.width=g),h&&(k.height=h),j.removeClass(o,"mce-fullscreen"),j.removeClass(p,"mce-fullscreen"),j.removeClass(l,"mce-fullscreen"),j.unbind(window,"resize",f)),a.fire("FullscreenStateChanged",{state:i})}var d,e,f,g,h,i=!1,j=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Ctrl+Alt+F","",c)}),a.on("remove",function(){f&&j.unbind(window,"resize",f)}),a.addCommand("mceFullScreen",c),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return i}})});

View File

@ -1 +1 @@
tinymce.PluginManager.add("hr",function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")}),n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});

View File

@ -738,7 +738,12 @@ tinymce.PluginManager.add('lists', function(editor) {
editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState('DL'));
editor.on('keydown', function(e) {
if (e.keyCode == 9 && editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
// Check for tab but not ctrl/cmd+tab since it switches browser tabs
if (e.keyCode != 9 || tinymce.util.VK.metaKeyPressed(e)) {
return;
}
if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
e.preventDefault();
if (e.shiftKey) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -345,15 +345,63 @@ define("tinymce/pasteplugin/Clipboard", [
}
}
/**
* Returns the rect of the current caret if the caret is in an empty block before a
* BR we insert a temporary invisible character that we get the rect this way we always get a proper rect.
*
* TODO: This might be useful in core.
*/
function getCaretRect(rng) {
var rects, textNode, node, container = rng.startContainer;
rects = rng.getClientRects();
if (rects.length) {
return rects[0];
}
if (!rng.collapsed || container.nodeType != 1) {
return;
}
node = container.childNodes[lastRng.startOffset];
// Skip empty whitespace nodes
while (node && node.nodeType == 3 && !node.data.length) {
node = node.nextSibling;
}
if (!node) {
return;
}
// Check if the location is |<br>
// TODO: Might need to expand this to say |<table>
if (node.tagName == 'BR') {
textNode = dom.doc.createTextNode('\uFEFF');
node.parentNode.insertBefore(textNode, node);
rng = dom.createRng();
rng.setStartBefore(textNode);
rng.setEndAfter(textNode);
rects = rng.getClientRects();
dom.remove(textNode);
}
if (rects.length) {
return rects[0];
}
}
// Calculate top cordinate this is needed to avoid scrolling to top of document
// We want the paste bin to be as close to the caret as possible to avoid scrolling
if (lastRng.getClientRects) {
var rects = lastRng.getClientRects();
var rect = getCaretRect(lastRng);
if (rects.length) {
if (rect) {
// Client rects gets us closes to the actual
// caret location in for example a wrapped paragraph block
top = scrollTop + (rects[0].top - dom.getPos(body).y);
top = scrollTop + (rect.top - dom.getPos(body).y);
} else {
top = scrollTop;
@ -531,12 +579,12 @@ define("tinymce/pasteplugin/Clipboard", [
}
/**
* Chrome on Andoid doesn't support proper clipboard access so we have no choice but to allow the browser default behavior.
* Chrome on Android doesn't support proper clipboard access so we have no choice but to allow the browser default behavior.
*
* @param {Event} e Paste event object to check if it contains any data.
* @return {Boolean} true/false if the clipboard is empty or not.
*/
function isBrokenAndoidClipboardEvent(e) {
function isBrokenAndroidClipboardEvent(e) {
var clipboardData = e.clipboardData;
return navigator.userAgent.indexOf('Android') != -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
@ -630,7 +678,7 @@ define("tinymce/pasteplugin/Clipboard", [
keyboardPastePlainTextState = false;
if (e.isDefaultPrevented() || isBrokenAndoidClipboardEvent(e)) {
if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
removePasteBin();
return;
}
@ -984,10 +1032,22 @@ define("tinymce/pasteplugin/WordFilter", [
trimListStart(paragraphNode, /^\u00a0+/);
}
var paragraphs = node.getAll('p');
// Build a list of all root level elements before we start
// altering them in the loop below.
var elements = [], child = node.firstChild;
while (typeof child !== 'undefined' && child !== null) {
elements.push(child);
for (var i = 0; i < paragraphs.length; i++) {
node = paragraphs[i];
child = child.walk();
if (child !== null) {
while (typeof child !== 'undefined' && child.parent !== node) {
child = child.walk();
}
}
}
for (var i = 0; i < elements.length; i++) {
node = elements[i];
if (node.name == 'p' && node.firstChild) {
// Find first text node in paragraph
@ -1002,7 +1062,7 @@ define("tinymce/pasteplugin/WordFilter", [
// Detect ordered lists 1., a. or ixv.
if (isNumericList(nodeText)) {
// Parse OL start number
var matches = /([0-9])\./.exec(nodeText);
var matches = /([0-9]+)\./.exec(nodeText);
var start = 1;
if (matches) {
start = parseInt(matches[1], 10);
@ -1018,6 +1078,13 @@ define("tinymce/pasteplugin/WordFilter", [
continue;
}
currentListNode = null;
} else {
// If the root level element isn't a p tag which can be
// processed by convertParagraphToLi, it interrupts the
// lists, causing a new list to start instead of having
// elements from the next list inserted above this tag.
prevListNode = currentListNode;
currentListNode = null;
}
}
@ -1152,8 +1219,11 @@ define("tinymce/pasteplugin/WordFilter", [
var validElements = settings.paste_word_valid_elements;
if (!validElements) {
validElements = '-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,' +
'-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,del';
validElements = (
'-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
'-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' +
'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'
);
}
// Setup strict schema

File diff suppressed because one or more lines are too long

View File

@ -35,12 +35,8 @@ tinymce.PluginManager.add('tabfocus', function(editor) {
e.style.visibility != "hidden" && canSelectRecursive(e.parentNode));
}
function canSelectInOldIe(el) {
return el.tabIndex || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
}
function canSelect(el) {
return ((!canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && tinymce.get(e.id) && el.tabIndex != -1 && canSelectRecursive(el);
}
each(el, function(e, i) {
@ -115,7 +111,6 @@ tinymce.PluginManager.add('tabfocus', function(editor) {
editor.on('keyup', tabCancel);
// Add later so other plugins can preventDefault()
if (tinymce.Env.gecko) {
editor.on('keypress keydown', tabHandler);
} else {

View File

@ -1 +1 @@
tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(b){function c(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&c(a.parentNode)}function f(a){return a.tabIndex||"INPUT"==a.nodeName||"TEXTAREA"==a.nodeName}function i(a){return!f(a)&&"-1"!=a.getAttribute("tabindex")&&c(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),b>0){for(j=g+1;j<h.length;j++)if(i(h[j]))return h[j]}else for(j=g-1;j>=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})});
tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j<h.length;j++)if(i(h[j]))return h[j]}else for(j=g-1;j>=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})});

View File

@ -1 +1 @@
tinymce.PluginManager.add("textcolor",function(t){function e(e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"==e?"color":"background-color"])&&(o=r)}),o}function o(){var e,o,r=[];for(o=t.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"],e=0;e<o.length;e+=2)r.push({text:o[e+1],color:"#"+o[e]});return r}function r(){function e(t,e){var o="transparent"==t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+m+"-"+F++ +'" data-mce-color="'+(t?t:"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+tinymce.translate(e)+'">'+(o?"&#215;":"")+"</div></td>"}var r,l,a,n,c,d,u,g=this,m=g._id,F=0;for(r=o(),r.push({text:tinymce.translate("No color"),color:"transparent"}),a='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',n=r.length-1,d=0;s>d;d++){for(a+="<tr>",c=0;i>c;c++)u=d*i+c,u>n?a+="<td></td>":(l=r[u],a+=e(l.color,l.text));a+="</tr>"}if(t.settings.color_picker_callback){for(a+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+m+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+m+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",a+="<tr>",c=0;i>c;c++)a+=e("","Custom color");a+="</tr>"}return a+="</tbody></table>"}function l(e,o){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()}function a(e){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}function n(o){function r(t){s.hidePanel(),s.color(t),l(s.settings.format,t)}function n(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)}var c,s=this.parent();if(tinymce.DOM.getParent(o.target,".mce-custom-color-btn")&&(s.hidePanel(),t.settings.color_picker_callback.call(t,function(t){var e,o,l,a=s.panel.getEl().getElementsByTagName("table")[0];for(e=tinymce.map(a.rows[a.rows.length-1].childNodes,function(t){return t.firstChild}),l=0;l<e.length&&(o=e[l],o.getAttribute("data-mce-color"));l++);if(l==i)for(l=0;i-1>l;l++)n(e[l],e[l+1].getAttribute("data-mce-color"));n(o,t),r(t)},e(s.settings.format))),c=o.target.getAttribute("data-mce-color")){if(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),o.target.setAttribute("aria-selected",!0),this.lastId=o.target.id,"transparent"==c)return a(s.settings.format),void s.hidePanel();r(c)}else null!==c&&s.hidePanel()}function c(){var t=this;t._color&&l(t.settings.format,t._color)}var i,s;s=t.settings.textcolor_rows||5,i=t.settings.textcolor_cols||8,t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c})});
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?"&#215;":"")+"</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.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()}function f(b){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()}function g(c){function d(a){j.hidePanel(),j.color(a),e(j.settings.format,a)}function g(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var h,j=this.parent();if(tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(j.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=j.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++)g(b[e],b[e+1].getAttribute("data-mce-color"));g(c,a),d(a)},b(j.settings.format))),h=c.target.getAttribute("data-mce-color")){if(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==h)return f(j.settings.format),void j.hidePanel();d(h)}else null!==h&&j.hidePanel()}function h(){var a=this;a._color&&e(a.settings.format,a._color)}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})});

View File

@ -339,19 +339,21 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
// should create a new function for generating the caption markup
html = '<dl ' + id + 'class="' + className +'" style="width: '+ width +'px">' +
'<dt class="wp-caption-dt">' + dom.getOuterHTML( node ) + '</dt><dd class="wp-caption-dd">'+ imageData.caption +'</dd></dl>';
'<dt class="wp-caption-dt"></dt><dd class="wp-caption-dd">'+ imageData.caption +'</dd></dl>';
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
if ( parent = dom.getParent( node, 'p' ) ) {
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
parent.parentNode.insertBefore( wrap, parent );
dom.remove( node );
if ( dom.isEmpty( parent ) ) {
dom.remove( parent );
}
} else {
dom.setOuterHTML( node, '<div class="mceTemp">' + html + '</div>' );
node.parentNode.insertBefore( wrap, node );
}
editor.$( wrap ).find( 'dt.wp-caption-dt' ).append( node );
}
} else if ( captionNode ) {
// Remove the caption wrapper and place the image in new paragraph
@ -734,31 +736,27 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}
if ( imgNode.parentNode && imgNode.parentNode.nodeName === 'A' ) {
html = dom.getOuterHTML( imgNode.parentNode );
node = imgNode.parentNode;
} else {
html = dom.getOuterHTML( imgNode );
node = imgNode;
}
html = '<dl ' + captionId + captionAlign + captionWidth + '>' +
'<dt class="wp-caption-dt">'+ html +'</dt><dd class="wp-caption-dd">'+ caption +'</dd></dl>';
'<dt class="wp-caption-dt"></dt><dd class="wp-caption-dd">'+ caption +'</dd></dl>';
if ( parent = dom.getParent( imgNode, 'p' ) ) {
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
dom.insertAfter( wrap, parent );
editor.selection.select( wrap );
editor.nodeChanged();
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
// Delete the old image node
dom.remove( node );
if ( parent = dom.getParent( node, 'p' ) ) {
parent.parentNode.insertBefore( wrap, parent );
if ( dom.isEmpty( parent ) ) {
dom.remove( parent );
}
} else {
editor.selection.setContent( '<div class="mceTemp">' + html + '</div>' );
node.parentNode.insertBefore( wrap, node );
}
editor.$( wrap ).find( 'dt.wp-caption-dt' ).append( node );
}
} else {
if ( wrap ) {

View File

@ -1 +1 @@
.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}

View File

@ -1 +1 @@
body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}
body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
// 4.1.4 (2014-08-22)
// 4.1.6 (2014-10-22)
/**
* Compiled inline version. (Library mode)
@ -2689,6 +2689,144 @@ if ( !assert(function( div ) {
return Sizzle;
});
// Included from: js/tinymce/classes/Env.js
/**
* Env.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* This class contains various environment constants like browser versions etc.
* Normally you don't want to sniff specific browser versions but sometimes you have
* to when it's impossible to feature detect. So use this with care.
*
* @class tinymce.Env
* @static
*/
define("tinymce/Env", [], function() {
var nav = navigator, userAgent = nav.userAgent;
var opera, webkit, ie, ie11, gecko, mac, iDevice;
opera = window.opera && window.opera.buildNumber;
webkit = /WebKit/.test(userAgent);
ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
ie = ie || ie11;
gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
mac = userAgent.indexOf('Mac') != -1;
iDevice = /(iPad|iPhone)/.test(userAgent);
// Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
// says it has contentEditable support but there is no visible caret.
var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
return {
/**
* Constant that is true if the browser is Opera.
*
* @property opera
* @type Boolean
* @final
*/
opera: opera,
/**
* Constant that is true if the browser is WebKit (Safari/Chrome).
*
* @property webKit
* @type Boolean
* @final
*/
webkit: webkit,
/**
* Constant that is more than zero if the browser is IE.
*
* @property ie
* @type Boolean
* @final
*/
ie: ie,
/**
* Constant that is true if the browser is Gecko.
*
* @property gecko
* @type Boolean
* @final
*/
gecko: gecko,
/**
* Constant that is true if the os is Mac OS.
*
* @property mac
* @type Boolean
* @final
*/
mac: mac,
/**
* Constant that is true if the os is iOS.
*
* @property iOS
* @type Boolean
* @final
*/
iOS: iDevice,
/**
* Constant that is true if the browser supports editing.
*
* @property contentEditable
* @type Boolean
* @final
*/
contentEditable: contentEditable,
/**
* Transparent image data url.
*
* @property transparentSrc
* @type Boolean
* @final
*/
transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
/**
* Returns true/false if the browser can or can't place the caret after a inline block like an image.
*
* @property noCaretAfter
* @type Boolean
* @final
*/
caretAfter: ie != 8,
/**
* Constant that is true if the browser supports native DOM Ranges. IE 9+.
*
* @property range
* @type Boolean
*/
range: window.getSelection && "Range" in window,
/**
* Returns the IE document mode for non IE browsers this will fake IE 10.
*
* @property documentMode
* @type Number
*/
documentMode: ie ? (document.documentMode || 7) : 10
};
});
// Included from: js/tinymce/classes/util/Tools.js
/**
@ -2707,7 +2845,9 @@ return Sizzle;
*
* @class tinymce.util.Tools
*/
define("tinymce/util/Tools", [], function() {
define("tinymce/util/Tools", [
"tinymce/Env"
], function(Env) {
/**
* Removes whitespace from the beginning and end of a string.
*
@ -3179,6 +3319,16 @@ define("tinymce/util/Tools", [], function() {
return map(s.split(d || ','), trim);
}
function _addCacheSuffix(url) {
var cacheSuffix = Env.cacheSuffix;
if (cacheSuffix) {
url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
}
return url;
}
return {
trim: trim,
isArray: isArray,
@ -3194,145 +3344,8 @@ define("tinymce/util/Tools", [], function() {
walk: walk,
createNS: createNS,
resolve: resolve,
explode: explode
};
});
// Included from: js/tinymce/classes/Env.js
/**
* Env.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* This class contains various environment constants like browser versions etc.
* Normally you don't want to sniff specific browser versions but sometimes you have
* to when it's impossible to feature detect. So use this with care.
*
* @class tinymce.Env
* @static
*/
define("tinymce/Env", [], function() {
var nav = navigator, userAgent = nav.userAgent;
var opera, webkit, ie, ie11, gecko, mac, iDevice;
opera = window.opera && window.opera.buildNumber;
webkit = /WebKit/.test(userAgent);
ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false;
ie = ie || ie11;
gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
mac = userAgent.indexOf('Mac') != -1;
iDevice = /(iPad|iPhone)/.test(userAgent);
// Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
// says it has contentEditable support but there is no visible caret.
var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
return {
/**
* Constant that is true if the browser is Opera.
*
* @property opera
* @type Boolean
* @final
*/
opera: opera,
/**
* Constant that is true if the browser is WebKit (Safari/Chrome).
*
* @property webKit
* @type Boolean
* @final
*/
webkit: webkit,
/**
* Constant that is more than zero if the browser is IE.
*
* @property ie
* @type Boolean
* @final
*/
ie: ie,
/**
* Constant that is true if the browser is Gecko.
*
* @property gecko
* @type Boolean
* @final
*/
gecko: gecko,
/**
* Constant that is true if the os is Mac OS.
*
* @property mac
* @type Boolean
* @final
*/
mac: mac,
/**
* Constant that is true if the os is iOS.
*
* @property iOS
* @type Boolean
* @final
*/
iOS: iDevice,
/**
* Constant that is true if the browser supports editing.
*
* @property contentEditable
* @type Boolean
* @final
*/
contentEditable: contentEditable,
/**
* Transparent image data url.
*
* @property transparentSrc
* @type Boolean
* @final
*/
transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
/**
* Returns true/false if the browser can or can't place the caret after a inline block like an image.
*
* @property noCaretAfter
* @type Boolean
* @final
*/
caretAfter: ie != 8,
/**
* Constant that is true if the browser supports native DOM Ranges. IE 9+.
*
* @property range
* @type Boolean
*/
range: window.getSelection && "Range" in window,
/**
* Returns the IE document mode for non IE browsers this will fake IE 10.
*
* @property documentMode
* @type Number
*/
documentMode: ie ? (document.documentMode || 7) : 10
explode: explode,
_addCacheSuffix: _addCacheSuffix
};
});
@ -6428,7 +6441,9 @@ define("tinymce/html/Entities", [
* @class tinymce.dom.StyleSheetLoader
* @private
*/
define("tinymce/dom/StyleSheetLoader", [], function() {
define("tinymce/dom/StyleSheetLoader", [
"tinymce/util/Tools"
], function(Tools) {
"use strict";
return function(document, settings) {
@ -6525,6 +6540,8 @@ define("tinymce/dom/StyleSheetLoader", [], function() {
}, waitForGeckoLinkLoaded);
}
url = Tools._addCacheSuffix(url);
if (!loadedStates[url]) {
state = {
passed: [],
@ -7288,7 +7305,11 @@ define("tinymce/dom/DOMUtils", [
* tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'});
*/
setStyles: function(elm, styles) {
this.$$(elm).css(styles);
elm = this.$$(elm).css(styles);
if (this.settings.update_styles) {
elm.attr('data-mce-style', null);
}
},
/**
@ -7557,6 +7578,8 @@ define("tinymce/dom/DOMUtils", [
each(url.split(','), function(url) {
var link;
url = Tools._addCacheSuffix(url);
if (self.files[url]) {
return;
}
@ -8017,7 +8040,7 @@ define("tinymce/dom/DOMUtils", [
node = node.firstChild;
if (node) {
walker = new TreeWalker(node, node.parentNode);
elements = elements || self.schema ? self.schema.getNonEmptyElements() : null;
elements = elements || (self.schema ? self.schema.getNonEmptyElements() : null);
do {
type = node.nodeType;
@ -8521,7 +8544,7 @@ define("tinymce/dom/ScriptLoader", [
elm = document.createElement('script');
elm.id = id;
elm.type = 'text/javascript';
elm.src = url;
elm.src = Tools._addCacheSuffix(url);
// Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
if ("onreadystatechange" in elm) {
@ -12135,7 +12158,13 @@ define("tinymce/html/DomParser", [
// Leave nodes that have a name like <a name="name">
if (!node.attributes.map.name && !node.attributes.map.id) {
tempNode = node.parent;
node.unwrap();
if (blockElements[node.name]) {
node.empty().remove();
} else {
node.unwrap();
}
node = tempNode;
return;
}
@ -15245,6 +15274,10 @@ define("tinymce/dom/Selection", [
setRng: function(rng, forward) {
var self = this, sel;
if (!rng) {
return;
}
// Is IE specific range
if (rng.select) {
try {
@ -16187,6 +16220,20 @@ define("tinymce/Formatter", [
}
}
/**
* Unregister a specific format by name.
*
* @method unregister
* @param {String} name Name of the format for example "bold".
*/
function unregister(name) {
if (name && formats[name]) {
delete formats[name];
}
return formats;
}
function getTextDecoration(node) {
var decoration;
@ -17084,6 +17131,7 @@ define("tinymce/Formatter", [
extend(this, {
get: get,
register: register,
unregister: unregister,
apply: apply,
remove: remove,
toggle: toggle,
@ -17968,12 +18016,12 @@ define("tinymce/Formatter", [
child.deleteData(0, 1);
// Fix for bug #6976
if (rng.startContainer == child) {
rng.startOffset--;
if (rng.startContainer == child && rng.startOffset > 0) {
rng.setStart(child, rng.startOffset - 1);
}
if (rng.endContainer == child) {
rng.endOffset--;
if (rng.endContainer == child && rng.endOffset > 0) {
rng.setEnd(child, rng.endOffset - 1);
}
}
@ -21969,6 +22017,10 @@ define("tinymce/ui/DomUtils", [
return DOMUtils.DOM.setStyle(elm, name, value);
},
getRuntimeStyle: function(elm, name) {
return DOMUtils.DOM.getStyle(elm, name, true);
},
on: function(target, name, callback, scope) {
return DOMUtils.DOM.bind(target, name, callback, scope);
},
@ -24869,7 +24921,7 @@ define("tinymce/ui/Movable", [
x = pos.x;
y = pos.y;
if (ctrl._fixed) {
if (ctrl._fixed && DomUtils.getRuntimeStyle(document.body, 'position') == 'static') {
x -= viewport.x;
y -= viewport.y;
}
@ -25258,6 +25310,46 @@ define("tinymce/ui/FloatPanel", [
}
}
function addRemove(add, ctrl) {
var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
if (add) {
zOrder.push(ctrl);
} else {
i = zOrder.length;
while (i--) {
if (zOrder[i] === ctrl) {
zOrder.splice(i, 1);
}
}
}
if (zOrder.length) {
for (i = 0; i < zOrder.length; i++) {
if (zOrder[i].modal) {
zIndex++;
topModal = zOrder[i];
}
zOrder[i].getEl().style.zIndex = zIndex;
zOrder[i].zIndex = zIndex;
zIndex++;
}
}
var modalBlockEl = document.getElementById(ctrl.classPrefix + 'modal-block');
if (topModal) {
DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
} else if (modalBlockEl) {
modalBlockEl.parentNode.removeChild(modalBlockEl);
hasModal = false;
}
FloatPanel.currentZIndex = zIndex;
}
var FloatPanel = Panel.extend({
Mixins: [Movable, Resizable],
@ -25271,34 +25363,6 @@ define("tinymce/ui/FloatPanel", [
init: function(settings) {
var self = this;
function reorder() {
var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal;
if (zOrder.length) {
for (i = 0; i < zOrder.length; i++) {
if (zOrder[i].modal) {
zIndex++;
topModal = zOrder[i];
}
zOrder[i].getEl().style.zIndex = zIndex;
zOrder[i].zIndex = zIndex;
zIndex++;
}
}
var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block');
if (topModal) {
DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1);
} else if (modalBlockEl) {
modalBlockEl.parentNode.removeChild(modalBlockEl);
hasModal = false;
}
FloatPanel.currentZIndex = zIndex;
}
self._super(settings);
self._eventsRoot = self;
@ -25338,22 +25402,7 @@ define("tinymce/ui/FloatPanel", [
hasModal = true;
}
zOrder.push(self);
reorder();
}
});
self.on('close hide', function(e) {
if (e.control == self) {
var i = zOrder.length;
while (i--) {
if (zOrder[i] === self) {
zOrder.splice(i, 1);
}
}
reorder();
addRemove(true, self);
}
});
@ -25424,6 +25473,8 @@ define("tinymce/ui/FloatPanel", [
*/
hide: function() {
removeVisiblePanel(this);
addRemove(false, this);
return this._super();
},
@ -25445,9 +25496,12 @@ define("tinymce/ui/FloatPanel", [
close: function() {
var self = this;
self.fire('close');
if (!self.fire('close').isDefaultPrevented()) {
self.remove();
addRemove(false, self);
}
return self.remove();
return self;
},
/**
@ -26226,7 +26280,9 @@ define("tinymce/WindowManager", [
}
}
editor.focus();
if (!windows.length) {
editor.focus();
}
});
// Handle data
@ -26247,7 +26303,9 @@ define("tinymce/WindowManager", [
win.params = params || {};
// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
editor.nodeChanged();
if (windows.length === 1) {
editor.nodeChanged();
}
return win.renderTo().reflow();
};
@ -26737,12 +26795,7 @@ define("tinymce/util/Quirks", [
* This selects the whole body so that backspace/delete logic will delete everything
*/
function selectAll() {
editor.on('keydown', function(e) {
if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {
e.preventDefault();
editor.execCommand('SelectAll');
}
});
editor.shortcuts.add('ctrl+a', null, 'SelectAll');
}
/**
@ -26764,10 +26817,17 @@ define("tinymce/util/Quirks", [
});
// Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event
dom.bind(editor.getDoc(), 'mousedown', function(e) {
// Needs to be both down/up due to weird rendering bug on Chrome Windows
dom.bind(editor.getDoc(), 'mousedown mouseup', function(e) {
if (e.target == editor.getDoc().documentElement) {
editor.getBody().focus();
selection.setRng(selection.getRng());
if (e.type == 'mousedown') {
// Edge case for mousedown, drag select and mousedown again within selection on Chrome Windows to render caret
selection.placeCaretAt(e.clientX, e.clientY);
} else {
selection.setRng(selection.getRng());
}
}
});
}
@ -27491,6 +27551,7 @@ define("tinymce/util/Quirks", [
// you bind touch events so we need to do this manually
// TODO: Expand to the closest word? Touble tap still works.
editor.selection.placeCaretAt(endTouch.clientX, endTouch.clientY);
editor.nodeChanged();
}
});
});
@ -27962,7 +28023,7 @@ define("tinymce/Shortcuts", [
var self = this, shortcuts = {};
editor.on('keyup keypress keydown', function(e) {
if (e.altKey || e.ctrlKey || e.metaKey) {
if ((e.altKey || e.ctrlKey || e.metaKey) && !e.isDefaultPrevented()) {
each(shortcuts, function(shortcut) {
var ctrlKey = Env.mac ? e.metaKey : e.ctrlKey;
@ -28307,6 +28368,10 @@ define("tinymce/Editor", [
self.editorManager = editorManager;
self.inline = settings.inline;
if (settings.cache_suffix) {
Env.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
}
// Call setup
editorManager.fire('SetupEditor', self);
self.execCallback('setup', self);
@ -28673,7 +28738,11 @@ define("tinymce/Editor", [
// Load the CSS by injecting them into the HTML this will reduce "flicker"
for (i = 0; i < self.contentCSS.length; i++) {
var cssUrl = self.contentCSS[i];
self.iframeHTML += '<link type="text/css" rel="stylesheet" href="' + cssUrl + '" />';
self.iframeHTML += (
'<link type="text/css" ' +
'rel="stylesheet" ' +
'href="' + Tools._addCacheSuffix(cssUrl) + '" />'
);
self.loadedCSS[cssUrl] = true;
}
@ -30667,7 +30736,7 @@ define("tinymce/EditorManager", [
* @property minorVersion
* @type String
*/
minorVersion: '1.4',
minorVersion: '1.6',
/**
* Release date of TinyMCE build.
@ -30675,7 +30744,7 @@ define("tinymce/EditorManager", [
* @property releaseDate
* @type String
*/
releaseDate: '2014-08-22',
releaseDate: '2014-10-22',
/**
* Collection of editor instances.
@ -36043,14 +36112,30 @@ define("tinymce/ui/MenuButton", [
*/
renderHtml: function() {
var self = this, id = self._id, prefix = self.classPrefix;
var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
var icon = self.settings.icon, image;
image = self.settings.image;
if (image) {
icon = 'none';
// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}
image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}
icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button');
return (
'<div id="' + id + '" class="' + self.classes() + '" tabindex="-1" aria-labelledby="' + id + '">' +
'<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' +
(icon ? '<i class="' + icon + '"></i>' : '') +
(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
'<span>' + (self._text ? (icon ? '\u00a0' : '') + self.encode(self._text) : '') + '</span>' +
' <i class="' + prefix + 'caret"></i>' +
'</button>' +
@ -36962,13 +37047,29 @@ define("tinymce/ui/SplitButton", [
* @return {String} HTML representing the control.
*/
renderHtml: function() {
var self = this, id = self._id, prefix = self.classPrefix;
var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
var self = this, id = self._id, prefix = self.classPrefix, image;
var icon = self.settings.icon;
image = self.settings.image;
if (image) {
icon = 'none';
// Support for [high dpi, low dpi] image sources
if (typeof image != "string") {
image = window.getSelection ? image[0] : image[1];
}
image = ' style="background-image: url(\'' + image + '\')"';
} else {
image = '';
}
icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
return (
'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
'<button type="button" hidefocus="1" tabindex="-1">' +
(icon ? '<i class="' + icon + '"></i>' : '') +
(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
(self._text ? (icon ? ' ' : '') + self._text : '') +
'</button>' +
'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
@ -37519,5 +37620,5 @@ define("tinymce/ui/Throbber", [
};
});
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/util/Tools","tinymce/Env","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/NodeChange","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/fmt/Preview","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
})(this);
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/Env","tinymce/util/Tools","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
})(this);

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ $wp_db_version = 29630;
*
* @global string $tinymce_version
*/
$tinymce_version = '4104-20140822';
$tinymce_version = '4106-20141022';
/**
* Holds the required PHP version

View File

@ -20,11 +20,18 @@
<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1");</script>
<script src="js/qunit/qunit.js"></script>
<script src="../../../src/wp-includes/js/tinymce/tinymce.min.js"></script>
<script src="../../../build/wp-includes/js/tinymce/tinymce.min.js"></script>
<!--<script src="../js/tinymce/classes/jquery.tinymce.js"></script> -->
<script src="js/utils.js"></script>
<script src="js/init.js"></script>
<script>
var wpPlugins = 'charmap colorpicker hr lists media paste tabfocus textcolor ' +
'fullscreen wordpress wpautoresize wpeditimage wpgallery wplink wpdialogs wpview';
getUserSetting = setUserSetting = function() {}
</script>
<!-- tinymce.dom.* -->
<script src="tinymce/dom/DomQuery.js"></script>
<script src="tinymce/dom/DOMUtils.js"></script>

View File

@ -16,7 +16,7 @@ module("tinymce.plugins.Lists", {
tinymce.init({
selector: '#elm1',
plugins: "lists",
plugins: wpPlugins,
add_unload_trigger: false,
skin: false,
indent: false,
@ -38,7 +38,7 @@ module("tinymce.plugins.Lists", {
inline: true,
add_unload_trigger: false,
skin: false,
plugins: "lists",
plugins: wpPlugins,
disable_nodechange: true,
init_instance_callback: function(ed) {
window.inlineEditor = ed;

View File

@ -6,7 +6,7 @@ module("tinymce.plugins.Media", {
selector: "textarea",
add_unload_trigger: false,
skin: false,
plugins: 'media',
plugins: wpPlugins,
document_base_url: '/tinymce/tinymce/trunk/tests/',
media_scripts: [
{filter: 'http://media1.tinymce.com'},
@ -161,4 +161,4 @@ test("XSS content", function() {
testXss('<video><img src="x" onload="alert(1)"></video>', '<p><video width="300" height=\"150\"></video></p>');
testXss('<video><img src="x"></video>', '<p><video width="300" height="150"><img src="x" /></video></p>');
testXss('<video><!--[if IE]><img src="x"><![endif]--></video>', '<p><video width="300" height="150"><!-- [if IE]><img src="x"><![endif]--></video></p>');
});
});

View File

@ -7,7 +7,8 @@ module("tinymce.plugins.Paste", {
add_unload_trigger: false,
skin: false,
indent: false,
plugins: 'paste',
plugins: wpPlugins,
wp_paste_filters: false,
setup: function(ed) {
ed.on('NodeChange', false);
},
@ -51,7 +52,7 @@ test("Paste styled text content", function() {
editor.selection.setRng(rng);
editor.execCommand('mceInsertClipboardContent', false, {content: '<strong><em><span style="color: red;">TEST</span></em></strong>'});
equal(editor.getContent(), '<p>1<strong><em><span style="color: red;">TEST</span></em></strong>4</p>');
equal(editor.getContent(), '<p>1<strong><em><span style="color: red;">TEST</span></em></strong>4</p>'); // Changed in WordPress
});
test("Paste paragraph in paragraph", function() {
@ -128,6 +129,18 @@ test("Paste Word fake list before BR", function() {
equal(editor.getContent(), '<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li><li>Item 4</li><li>Item 5</li><li>Item 6</li></ul><p><br />a</p>');
});
test("Paste Word fake lists interrupted by header", function() {
var rng = editor.dom.createRng();
editor.setContent('<p>1234</p>');
rng.setStart(editor.getBody().firstChild.firstChild, 0);
rng.setEnd(editor.getBody().firstChild.firstChild, 4);
editor.selection.setRng(rng);
editor.execCommand('mceInsertClipboardContent', false, {content: '<p class=MsoListParagraphCxSpFirst style=\'text-indent:-.25in;mso-list:l0 level1 lfo1\'><![if !supportLists]><span style=\'font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol\'><span style=\'mso-list:Ignore\'>·<span style=\'font:7.0pt "Times New Roman"\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>List before heading A<o:p></o:p></p> <p class=MsoListParagraphCxSpLast style=\'text-indent:-.25in;mso-list:l0 level1 lfo1\'><![if !supportLists]><span style=\'font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol\'><span style=\'mso-list:Ignore\'>·<span style=\'font:7.0pt "Times New Roman"\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>List before heading B<o:p></o:p></p> <h1>heading<o:p></o:p></h1> <p class=MsoListParagraphCxSpFirst style=\'text-indent:-.25in;mso-list:l0 level1 lfo1\'><![if !supportLists]><span style=\'font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol\'><span style=\'mso-list:Ignore\'>·<span style=\'font:7.0pt "Times New Roman"\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>List after heading A<o:p></o:p></p> <p class=MsoListParagraphCxSpLast style=\'text-indent:-.25in;mso-list:l0 level1 lfo1\'><![if !supportLists]><span style=\'font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family: Symbol\'><span style=\'mso-list:Ignore\'>·<span style=\'font:7.0pt "Times New Roman"\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>List after heading B<o:p></o:p></p>'});
equal(editor.getContent(), '<ul><li>List before heading A</li><li>List before heading B</li></ul><h1>heading</h1><ul><li>List after heading A</li><li>List after heading B</li></ul>');
});
test("Paste list like paragraph and list", function() {
editor.setContent('');
@ -262,7 +275,7 @@ test("Paste Word retain bold/italic styles to elements", function() {
)
});
equal(editor.getContent(), '<p><strong>bold</strong><em>italic</em><strong><em>bold + italic</em></strong><strong><span style="color: red;">bold + color</span></strong></p>');
equal(editor.getContent(), '<p><b>bold</b><i>italic</i><b><i>bold + italic</i></b><b><span style="color: red;">bold + color</span></b></p>');
});
test('paste track changes comment', function() {
@ -279,7 +292,7 @@ test('paste track changes comment', function() {
equal(editor.getContent(), '<p>1</p>');
});
test('paste nested (UL) word list', function() {
editor.setContent('');
@ -334,7 +347,7 @@ test('paste nested (OL) word list', function() {
"<![if !supportLists]><span style='mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin'><span style='mso-list:Ignore'>" +
"<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>i.<span style='font:7.0pt \"Times New Roman\"'>" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></span><![endif]>c</p>"
)
@ -356,6 +369,22 @@ test('paste nested (OL) word list', function() {
);
});
test("Paste list start index", function() {
editor.settings.paste_merge_formats = true;
editor.setContent('');
editor.execCommand('mceInsertClipboardContent', false, {
content: (
'<p class=MsoListParagraphCxSpMiddle style="text-indent:-18.0pt;mso-list:l0 level1 lfo1">' +
'<![if !supportLists]><span style="mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;' +
'mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin"><span style="mso-list:Ignore">10.' +
'<span style="font:7.0pt Times>&nbsp;&nbsp;</span></span></span><![endif]>J<o:p></o:p></p>'
)
});
equal(editor.getContent(), '<ol start="10"><li>J</li></ol>');
})
test("Paste paste_merge_formats: true", function() {
editor.settings.paste_merge_formats = true;
@ -634,7 +663,7 @@ if (tinymce.Env.webkit) {
editor.execCommand('mceInsertClipboardContent', false, {content: '<span class="c" style="color:red; text-indent: 10px" title="t">Test</span>'});
equal(editor.getContent(), '<p><span class="c" title="t">Test</span></p>');
});
test('paste webkit remove runtime styles (background-color)', function() {
editor.settings.paste_webkit_styles = 'background-color';
editor.setContent('');
@ -652,8 +681,8 @@ if (tinymce.Env.webkit) {
test('paste webkit remove runtime styles (font-family)', function() {
editor.settings.paste_webkit_styles = 'font-family';
editor.setContent('');
editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="font-family:serif; text-indent: 10px">Test</span>'});
equal(editor.getContent(), '<p><span style="font-family: serif;">Test</span></p>');
editor.execCommand('mceInsertClipboardContent', false, {content: '<span style="font-family: Arial, Helvetica; text-indent: 10px">Test</span>'});
equal(editor.getContent(), '<p><span style="font-family: Arial, Helvetica;">Test</span></p>');
});
test('paste webkit remove runtime styles font-family allowed but not specified', function() {
@ -729,4 +758,4 @@ if (tinymce.Env.webkit) {
equal(editor.getContent(), '<p style="color: #ff0000;">abc</p>');
});
}
}

View File

@ -5,6 +5,7 @@ module("tinymce.Editor", {
tinymce.init({
selector: "#elm1",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
skin: false,
@ -26,6 +27,7 @@ module("tinymce.Editor", {
tinymce.init({
selector: "#elm2",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
skin: false,
@ -307,6 +309,7 @@ asyncTest('remove editor', function() {
tinymce.init({
selector: "#elmx",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
skin: false,

View File

@ -4,6 +4,7 @@ module("tinymce.EditorCommands", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
indent: false,
@ -250,7 +251,7 @@ test('mceInsertContent - forced root block', function() {
editor.getBody().innerHTML = '';
editor.execCommand('mceInsertContent', false, 'test<b>123</b><!-- a -->');
// Opera adds an extra paragraph since it adds a BR at the end of the contents pass though this for now since it's an minority browser
equal(editor.getContent().replace(/<p>\u00a0<\/p>/g, ''), '<p>test<strong>123</strong></p><!-- a -->');
equal(editor.getContent().replace(/<p>\u00a0<\/p>/g, ''), '<p>test<b>123</b></p><!-- a -->'); // WordPress doesn't convert <b> to <strong>
});
test('mceInsertContent - mixed inline content inside td', function() {
@ -260,7 +261,7 @@ test('mceInsertContent - mixed inline content inside td', function() {
editor.getBody().innerHTML = '<table><tr><td>X</td></tr></table>';
Utils.setSelection('td', 0, 'td', 0);
editor.execCommand('mceInsertContent', false, 'test<b>123</b><!-- a -->');
equal(editor.getContent(), '<table><tbody><tr><td>test<strong>123</strong><!-- a -->X</td></tr></tbody></table>');
equal(editor.getContent(), '<table><tbody><tr><td>test<b>123</b><!-- a -->X</td></tr></tbody></table>'); // WordPress doesn't convert <b> to <strong>
});
test('mceInsertContent - invalid insertion with spans on page', function(){

View File

@ -4,6 +4,7 @@ module("tinymce.EditorManager", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
skin: false,

View File

@ -4,6 +4,7 @@ module("tinymce.EnterKey", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
indent: false,

View File

@ -5,6 +5,7 @@ module("tinymce.ForceBlocks", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
indent: false,
skin: false,

View File

@ -5,6 +5,7 @@ module("tinymce.Formatter - Apply", {
tinymce.init({
selector: "#elm1",
plugins: wpPlugins,
external_plugins: { noneditable: '../../../../tests/qunit/editor/external-plugins/noneditable/plugin.min.js' }, // WP
add_unload_trigger: false,
skin: false,
@ -28,6 +29,7 @@ module("tinymce.Formatter - Apply", {
tinymce.init({
selector: "#elm2",
plugins: wpPlugins,
inline: true,
add_unload_trigger: false,
skin: false,
@ -1614,4 +1616,4 @@ test('Bug #6518 - Apply div blocks to inline editor paragraph', function() {
});
inlineEditor.formatter.apply('format');
equal(inlineEditor.getContent(), '<div>a</div><p>b</p>');
});
});

View File

@ -5,6 +5,7 @@ module("tinymce.Formatter - Check", {
tinymce.init({
selector: "#elm1",
plugins: wpPlugins,
add_unload_trigger: false,
extended_valid_elements: 'b,i,span[style|contenteditable]',
skin: false,
@ -23,6 +24,7 @@ module("tinymce.Formatter - Check", {
tinymce.init({
selector: "#elm2",
plugins: wpPlugins,
inline: true,
add_unload_trigger: false,
indent: false,

View File

@ -5,6 +5,7 @@ module("tinymce.Formatter - Remove", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
external_plugins: { noneditable: '../../../../tests/qunit/editor/external-plugins/noneditable/plugin.min.js' }, // WP
indent: false,
add_unload_trigger: false,

View File

@ -4,6 +4,7 @@ module("tinymce.Shortcuts", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
indent: false,

View File

@ -4,6 +4,7 @@ module("tinymce.UndoManager", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
skin: false,
init_instance_callback: function(ed) {
@ -316,4 +317,4 @@ test('BeforeAddUndo event', function() {
equal(Utils.cleanHtml(lastEvt.level.content), "<p>c</p>");
equal(lastEvt.originalEvent.data, 1);
ok(!addUndoEvt, "Event level produced when it should be blocked");
});
});

View File

@ -629,6 +629,18 @@
DOM.remove('test');
});
test('isEmpty with list of elements considered non-empty', function() {
var elm = DOM.create('p', null, '<img>');
equal(false, DOM.isEmpty(elm, {img: true}));
});
test('isEmpty with list of elements considered non-empty without schema', function() {
var domWithoutSchema = new tinymce.dom.DOMUtils(document, {keep_values: true});
var elm = domWithoutSchema.create('p', null, '<img>');
equal(false, domWithoutSchema.isEmpty(elm, {img: true}));
});
test('isEmpty on P with BR in EM', function() {
var elm = DOM.create('p', null, '<em><br></em>');
ok(DOM.isEmpty(elm, 'No children'));

View File

@ -4,6 +4,7 @@ module("tinymce.dom.Selection", {
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
skin: false,
forced_root_block: '',
@ -962,3 +963,19 @@ test('selectorChanged', function() {
equal(newArgs.parents.length, 1);
});
test('setRng', function() {
var rng = editor.dom.createRng();
editor.setContent('<p>x</p>');
rng.setStart(editor.$('p')[0].firstChild, 0);
rng.setEnd(editor.$('p')[0].firstChild, 1);
editor.selection.setRng(rng);
editor.selection.setRng(null);
rng = editor.selection.getRng(true);
equal(rng.startContainer.nodeName, '#text');
equal(rng.startOffset, 0);
equal(rng.endContainer.nodeName, '#text');
equal(rng.endOffset, 1);
});

View File

@ -10,6 +10,7 @@ module("tinymce.dom.TridentSelection", {
tinymce.init({
selector: "textarea",
elements: "elm1",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
skin: false,

View File

@ -306,7 +306,7 @@
parser = new tinymce.html.DomParser({}, new tinymce.html.Schema({valid_elements: 'span,a[name],img'}));
root = parser.parse('<span></span><a name="anchor"></a>');
equal(serializer.serialize(root), '<span></span><a name="anchor"></a>', 'Leave a with name attribute');
parser = new tinymce.html.DomParser({}, new tinymce.html.Schema({valid_elements: 'span,a[href],img[src]'}));
root = parser.parse('<span></span><a href="#"><img src="about:blank" /></a>');
equal(serializer.serialize(root), '<span></span><a href="#"><img src="about:blank" /></a>', 'Leave elements with img in it');
@ -501,5 +501,20 @@
root = parser.parse('<p class="classA classB classC"><strong class="classA classB classC">a</strong></p>');
equal(serializer.serialize(root), '<p class="classA classB"><strong class="classA classB">a</strong></p>');
});
})();
test('Remove empty list blocks', function() {
var parser, root, schema = new tinymce.html.Schema();
parser = new tinymce.html.DomParser({}, schema);
root = parser.parse('<ul><li></li></ul><ul><li> </li></ul>');
equal(serializer.serialize(root), '');
});
test('Preserve space in inline span', function() {
var parser, root, schema = new tinymce.html.Schema();
parser = new tinymce.html.DomParser({}, schema);
root = parser.parse('a<span> </span>b');
equal(serializer.serialize(root), 'a b');
});
})();

View File

@ -4,6 +4,7 @@ module( 'tinymce.html.Obsolete', {
tinymce.init({
selector: 'textarea',
plugins: wpPlugins,
add_unload_trigger : false,
skin: false,
indent : false,

View File

@ -166,9 +166,9 @@ test('getBoolAttrs', function() {
"CONTROLS": {}, "LOOP": {}, "AUTOPLAY": {}, "SELECTED": {}, "READONLY": {}, "NOWRAP": {},
"NOSHADE": {}, "NORESIZE": {}, "NOHREF": {}, "MULTIPLE": {}, "ISMAP": {}, "DISABLED": {}, "DEFER": {},
"DECLARE": {}, "COMPACT": {}, "CHECKED": {},
"controls": {}, "loop": {}, "autoplay": {}, "selected": {}, "readonly": {}, "nowrap": {},
"noshade": {}, "noresize": {}, "nohref": {}, "multiple": {}, "ismap": {}, "disabled": {}, "defer": {},
"declare": {}, "compact": {}, "checked": {}
"allowfullscreen": {}, "controls": {}, "loop": {}, "autoplay": {}, "selected": {}, "readonly": {}, "mozallowfullscreen": {},
"nowrap": {}, "noshade": {}, "noresize": {}, "nohref": {}, "multiple": {}, "ismap": {}, "disabled": {}, "defer": {},
"declare": {}, "compact": {}, "checked": {}, "webkitallowfullscreen": {}
});
});

View File

@ -5,6 +5,7 @@ module("tinymce.utils.Quirks_WebKit", {
tinymce.init({
selector: "textarea",
elements: "elm1",
plugins: wpPlugins,
add_unload_trigger: false,
skin: false,
indent: false,