diff --git a/wp-admin/js/customize-widgets.js b/wp-admin/js/customize-widgets.js index eb552ad9fa..a489b6e35f 100644 --- a/wp-admin/js/customize-widgets.js +++ b/wp-admin/js/customize-widgets.js @@ -17,7 +17,7 @@ var WidgetCustomizer = ( function ($) { save_btn_tooltip: '', remove_btn_label: '', remove_btn_tooltip: '', - error: '', + error: '' }, available_widgets: [], // available widgets for instantiating registered_widgets: [], // all widgets registered diff --git a/wp-includes/js/customize-views.js b/wp-includes/js/customize-views.js index 07a73c8067..eb3d4aac1c 100644 --- a/wp-includes/js/customize-views.js +++ b/wp-includes/js/customize-views.js @@ -136,7 +136,7 @@ extendedModel: function() { var c = this.model.get('collection'); return _.extend(this.model.toJSON(), { - type: c.type, + type: c.type }); }, diff --git a/wp-includes/js/plupload/handlers.js b/wp-includes/js/plupload/handlers.js index 2140f0f5df..d6a9958c7e 100644 --- a/wp-includes/js/plupload/handlers.js +++ b/wp-includes/js/plupload/handlers.js @@ -402,9 +402,9 @@ jQuery(document).ready(function($){ uploader_init = function() { var isIE = navigator.userAgent.indexOf('Trident/') != -1 || navigator.userAgent.indexOf('MSIE ') != -1; - // Make sure flash sends cookies (seems in IE it does whitout switching to urlstream mode) - if ( ! isIE && 'flash' === plupload.predictRuntime( wpUploaderInit ) && - ( ! wpUploaderInit.required_features || ! wpUploaderInit.required_features.hasOwnProperty( 'send_binary_string' ) ) ) { + // Make sure flash sends cookies (seems in IE it does whitout switching to urlstream mode) + if ( ! isIE && 'flash' === plupload.predictRuntime( wpUploaderInit ) && + ( ! wpUploaderInit.required_features || ! wpUploaderInit.required_features.hasOwnProperty( 'send_binary_string' ) ) ) { wpUploaderInit.required_features = wpUploaderInit.required_features || {}; wpUploaderInit.required_features.send_binary_string = true; diff --git a/wp-includes/js/plupload/wp-plupload.js b/wp-includes/js/plupload/wp-plupload.js index 1e01e06b1b..baa20b6fd3 100644 --- a/wp-includes/js/plupload/wp-plupload.js +++ b/wp-includes/js/plupload/wp-plupload.js @@ -86,9 +86,9 @@ window.wp = window.wp || {}; return; } - // Make sure flash sends cookies (seems in IE it does without switching to urlstream mode) - if ( ! isIE && 'flash' === plupload.predictRuntime( this.plupload ) && - ( ! this.plupload.required_features || ! this.plupload.required_features.hasOwnProperty( 'send_binary_string' ) ) ) { + // Make sure flash sends cookies (seems in IE it does without switching to urlstream mode) + if ( ! isIE && 'flash' === plupload.predictRuntime( this.plupload ) && + ( ! this.plupload.required_features || ! this.plupload.required_features.hasOwnProperty( 'send_binary_string' ) ) ) { this.plupload.required_features = this.plupload.required_features || {}; this.plupload.required_features.send_binary_string = true; diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js index d7802eb7cc..b43e5beab5 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js @@ -192,7 +192,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) { html = createImageAndLink( imageData, 'html' ); - width = parseInt( imageData.width ); + width = parseInt( imageData.width, 10 ); if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { width += 10; diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js index 626eb3bde1..1ed2cb1cfc 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("wpeditimage",function(a){function b(b){return b.replace(/(?:

)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(b,c,d){var e,f,g,h,i,j,k=tinymce.trim;return e=c.match(/id=['"]([^'"]*)['"] ?/),e&&(c=c.replace(e[0],"")),f=c.match(/align=['"]([^'"]*)['"] ?/),f&&(c=c.replace(f[0],"")),g=c.match(/width=['"]([0-9]*)['"] ?/),g&&(c=c.replace(g[0],"")),d=k(d),i=d.match(/((?:]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),i&&i[2]?(h=k(i[2]),i=k(i[1])):(h=k(c).replace(/caption=['"]/,"").replace(/['"]$/,""),i=d),e=e&&e[1]?e[1]:"",f=f&&f[1]?f[1]:"alignnone",!g&&i&&(g=i.match(/width=['"]([0-9]*)['"]/)),g&&g[1]&&(g=g[1]),g&&h?(j=parseInt(g,10),a.getParam("wpeditimage_html5_captions")||(j+=10),'

'+i+'
'+h+"
"):d})}function c(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c="";return-1===b.indexOf("]+>([\s\S]+?)<\/dd>/i),c&&c[1]?"

"+c[1]+"

":""):(c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c}),0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c)})}function d(b){var c,d,e,f,g=a.dom;return d={attachment_id:!1,url:!1,height:"",width:"",size:"none",caption:"",alt:"",align:"none",link:!1,linkUrl:""},d.url=g.getAttrib(b,"src"),d.alt=g.getAttrib(b,"alt"),d.width=parseInt(g.getAttrib(b,"width"),10),d.height=parseInt(g.getAttrib(b,"height"),10),c=b.className.split(" "),tinymce.each(c,function(a){/^wp-image/.test(a)&&(d.attachment_id=parseInt(a.replace("wp-image-",""),10)),/^align/.test(a)&&(d.align=a.replace("align","")),/^size/.test(a)&&(d.size=a.replace("size-",""))}),e=g.getParents(b,".wp-caption"),e.length&&(e=e[0],c=e.className.split(" "),tinymce.each(c,function(a){/^align/.test(a)&&(d.align=a.replace("align",""))}),f=g.select("dd.wp-caption-dd",e),f.length&&(f=f[0],d.caption=a.serializer.serialize(f).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,""))),b.parentNode&&"A"===b.parentNode.nodeName&&(d.linkUrl=g.getAttrib(b.parentNode,"href")),d}function e(b,c){var d,e,g,h,j,k,l,m;c.caption?(h=f(c,"html"),e=parseInt(c.width),a.getParam("wpeditimage_html5_captions")||(e+=10),d="align"+c.align,h='

'+h+'
'+c.caption+"
",g=a.dom.create("div",{"class":"mceTemp"},h)):g=f(c,"node"),k=b,j=a.dom.getParent(b,".mceTemp"),j?k=j:"A"===b.parentNode.nodeName&&(k=b.parentNode),l=a.dom.uniqueId("wp_"),a.dom.setAttrib(g,"data-wp-replace-id",l),a.dom.replace(g,k),g=a.dom.select('[data-wp-replace-id="'+l+'"]')[0],a.dom.setAttrib(g,"data-wp-replace-id",""),a.nodeChanged(),m="IMG"===g.nodeName?g:a.dom.select("img",g)[0],m&&(a.selection.select(m),i(m))}function f(b,c){var d,e=[];if(c=c?c:"node",b.caption||e.push("align"+b.align),b.attachment_id&&(e.push("wp-image-"+b.attachment_id),b.size&&e.push("size-"+b.size)),d={src:b.url,width:b.width,height:b.height,alt:b.alt},e.length&&(d["class"]=e.join(" ")),b.linkUrl){if("node"===c)return a.dom.create("a",{href:b.linkUrl},a.dom.createHTML("img",d));if("html"===c)return a.dom.createHTML("a",{href:b.linkUrl},a.dom.createHTML("img",d))}else{if("node"===c)return a.dom.create("img",d);if("html"===c)return a.dom.createHTML("img",d)}}function g(b){var c,f;return"undefined"!=typeof wp&&wp.media?(a.undoManager.add(),c=wp.media({frame:"image",state:"image-details",metadata:d(b)}),f=function(d){e(b,d),a.focus(),c.detach()},c.state("image-details").on("update",f),c.state("replace-image").on("replace",f),c.on("close",function(){a.focus(),c.detach()}),void c.open()):void a.execCommand("mceImage")}function h(b){var c;"DIV"===b.nodeName&&a.dom.hasClass(b,"mceTemp")?c=b:("IMG"===b.nodeName||"DT"===b.nodeName||"A"===b.nodeName)&&(c=a.dom.getParent(b,"div.mceTemp")),c?(a.selection.select(c.nextSibling?c.nextSibling:c.previousSibling?c.previousSibling:c.parentNode),a.selection.collapse(!0),a.nodeChanged(),a.dom.remove(c)):a.dom.remove(b)}function i(b){var c,d,e,f,g=a.dom;j(),b&&"IMG"===b.nodeName&&!k(b)&&(g.setAttrib(b,"data-wp-imgselect",1),c=g.getRect(b),d='
',e=g.create("div",{id:"wp-image-toolbar","data-mce-bogus":"1",contenteditable:!1},d),a.getBody().appendChild(e),f=g.getSize(e),g.setStyles(e,{top:c.y,left:c.x+c.w-f.w}))}function j(){var b=a.dom.get("wp-image-toolbar");b&&a.dom.remove(b),a.dom.setAttrib(a.dom.select("img[data-wp-imgselect]"),"data-wp-imgselect",null)}function k(b){var c=a.dom;return c.hasClass(b,"mceItem")||c.getAttrib(b,"data-mce-placeholder")||c.getAttrib(b,"data-mce-object")?!0:!1}return a.on("init",function(){var b=a.dom;a.getParam("wpeditimage_html5_captions")&&b.addClass(a.getBody(),"html5-captions"),a.on("wpLoadImageForm",function(b){if(!a.getParam("wpeditimage_disable_captions")){var c={type:"textbox",flex:1,name:"caption",minHeight:60,multiline:!0,scroll:!0,label:"Image caption"};b.data.splice(b.data.length-1,0,c)}}),a.on("wpNewImageRefresh",function(a){var c,d;(c=b.getParent(a.node,"dl.wp-caption"))&&(c.style.width||(d=parseInt(a.node.clientWidth,10)+10,d=d?d+"px":"50%",b.setStyle(c,"width",d)))}),a.on("wpImageFormSubmit",function(c){var d,e,f,g,h,i=c.imgData.data,j=c.imgData.node,k=c.imgData.caption,l="",m="",n="";return i.id="__wp-temp-img-id",c.imgData.cancel=!0,i.style||(i.style=null),i.src?(k&&(k=k.replace(/\r\n|\r/g,"\n").replace(/<\/?[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),k=k.replace(/(]*>)\s*\n\s*/g,"$1").replace(/\s*\n\s*/g,"
")),j?(h=j.id||null,b.setAttribs(j,i),d=b.getParent(j,"dl.wp-caption"),k?d?(e=b.select("dd.wp-caption-dd",d)[0])&&(e.innerHTML=k):(j.className&&(l=j.className.match(/wp-image-([0-9]+)/),m=j.className.match(/align(left|right|center|none)/)),m?(m=m[0],j.className=j.className.replace(/align(left|right|center|none)/g,"")):m="alignnone",m=' class="wp-caption '+m+'"',l&&(l=' id="attachment_'+l[1]+'"'),n=i.width||j.clientWidth,n&&(n=parseInt(n,10),a.getParam("wpeditimage_html5_captions")||(n+=10),n=' style="width: '+n+'px"'),j.parentNode&&"A"===j.parentNode.nodeName?(g=b.getOuterHTML(j.parentNode),f=j.parentNode):(g=b.getOuterHTML(j),f=j),g="
'+g+'
'+k+"
",(e=b.getParent(j,"p"))?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.remove(f),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):d&&(g=b.getOuterHTML("A"===j.parentNode.nodeName?j.parentNode:j),e=b.create("p",{},g),b.insertAfter(e,d.parentNode),a.selection.select(e),a.nodeChanged(),b.remove(d.parentNode))):(g=b.createHTML("img",i),k?(f=a.selection.getNode(),i.width&&(n=parseInt(i.width,10),a.getParam("wpeditimage_html5_captions")||(n+=10),n=' style="width: '+n+'px"'),g='
'+g+'
'+k+"
",e="P"===f.nodeName?f:b.getParent(f,"p"),e&&"P"===e.nodeName?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):a.selection.setContent(g)),j=b.get("__wp-temp-img-id"),b.setAttrib(j,"id",h),void(c.imgData.node=j)):void(j&&(b.remove((d=b.getParent(j,"div.mceTemp"))?d:"A"===j.parentNode.nodeName?j.parentNode:j),a.nodeChanged()))}),a.on("wpLoadImageData",function(c){var d,e=c.imgData.data,f=c.imgData.node;(d=b.getParent(f,"dl.wp-caption"))&&(d=b.select("dd.wp-caption-dd",d)[0],d&&(e.caption=a.serializer.serialize(d).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,"")))}),b.bind(a.getDoc(),"dragstart",function(c){var d=a.selection.getNode();"IMG"===d.nodeName&&b.getParent(d,".wp-caption")&&c.preventDefault(),j()}),tinymce.Env.ie&&tinymce.Env.ie>10&&(b.bind(a.getBody(),"mscontrolselect",function(c){"IMG"===c.target.nodeName&&b.getParent(c.target,".wp-caption")?a.getBody().focus():"DL"===c.target.nodeName&&b.hasClass(c.target,"wp-caption")&&c.target.focus()}),a.on("click",function(c){"IMG"===c.target.nodeName&&b.getAttrib(c.target,"data-wp-imgselect")&&b.getParent(c.target,"dl.wp-caption")&&a.getBody().focus()}))}),a.on("ObjectResized",function(b){var c,d,e=b.target;"IMG"===e.nodeName&&((c=a.dom.getParent(e,".wp-caption"))&&(d=b.width||a.dom.getAttrib(e,"width"),d&&(d=parseInt(d,10),a.getParam("wpeditimage_html5_captions")||(d+=10),a.dom.setStyle(c,"width",d+"px"))),i(e))}),a.on("BeforeExecCommand",function(b){var c,d,e,f,g=b.command,h=a.dom;if("mceInsertContent"===g){if((c=h.getParent(a.selection.getNode(),"div.mceTemp"))&&(d=h.create("p"),h.insertAfter(d,c),a.selection.setCursorLocation(d,0),a.nodeChanged(),tinymce.Env.ie>8))return setTimeout(function(){a.selection.setCursorLocation(d,0),a.selection.setContent(b.value)},500),!1}else if("JustifyLeft"===g||"JustifyRight"===g||"JustifyCenter"===g){if(c=a.selection.getNode(),f=g.substr(7).toLowerCase(),f="align"+f,j(),e=h.is(c,"dl.wp-caption")?c:h.getParent(c,"dl.wp-caption"))return h.hasClass(e,f)?(h.removeClass(e,f),h.addClass(e,"alignnone")):(e.className=e.className.replace(/align[^ ]+/g,""),h.addClass(e,f)),!1;"IMG"===c.nodeName&&(h.hasClass(c,f)?h.addClass(c,"alignnone"):h.removeClass(c,"alignnone"))}}),a.on("keydown",function(b){var c,d,e,f,g=a.selection,i=a.dom;if(b.keyCode===tinymce.util.VK.ENTER)c=g.getNode(),d=i.getParent(c,"div.mceTemp"),d&&(i.events.cancel(b),tinymce.each(i.select("dt, dd",d),function(a){i.isEmpty(a)&&i.remove(a)}),f=tinymce.Env.ie&&tinymce.Env.ie<11?"":'
',e=i.create("p",null,f),"DD"===c.nodeName?i.insertAfter(e,d):d.parentNode.insertBefore(e,d),a.nodeChanged(),g.setCursorLocation(e,0));else if((b.keyCode===tinymce.util.VK.DELETE||b.keyCode===tinymce.util.VK.BACKSPACE)&&(c=g.getNode(),"DIV"===c.nodeName&&i.hasClass(c,"mceTemp")?d=c:("IMG"===c.nodeName||"DT"===c.nodeName||"A"===c.nodeName)&&(d=i.getParent(c,"div.mceTemp")),d))return i.events.cancel(b),h(c),!1}),a.on("mousedown",function(b){a.dom.getParent(b.target,"#wp-image-toolbar")?tinymce.Env.ie&&b.preventDefault():"IMG"!==b.target.nodeName&&j()}),a.on("mouseup",function(b){var c,d=b.target,e=a.dom;b.button&&b.button>1||("DIV"===d.nodeName&&e.getParent(d,"#wp-image-toolbar")?(c=e.select("img[data-wp-imgselect]")[0],c&&(a.selection.select(c),e.hasClass(d,"remove")?(h(c),j()):e.hasClass(d,"edit")&&g(c))):"IMG"!==d.nodeName||a.dom.getAttrib(d,"data-wp-imgselect")||k(d)?"IMG"!==d.nodeName&&j():i(d))}),a.on("cut",function(){j()}),a.wpSetImgCaption=function(a){return b(a)},a.wpGetImgCaption=function(a){return c(a)},a.on("BeforeSetContent",function(b){b.content=a.wpSetImgCaption(b.content)}),a.on("PostProcess",function(b){b.get&&(b.content=a.wpGetImgCaption(b.content),b.content=b.content.replace(/ data-wp-imgselect="1"/g,""))}),{_do_shcode:b,_get_shcode:c}}); \ No newline at end of file +tinymce.PluginManager.add("wpeditimage",function(a){function b(b){return b.replace(/(?:

)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(b,c,d){var e,f,g,h,i,j,k=tinymce.trim;return e=c.match(/id=['"]([^'"]*)['"] ?/),e&&(c=c.replace(e[0],"")),f=c.match(/align=['"]([^'"]*)['"] ?/),f&&(c=c.replace(f[0],"")),g=c.match(/width=['"]([0-9]*)['"] ?/),g&&(c=c.replace(g[0],"")),d=k(d),i=d.match(/((?:]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),i&&i[2]?(h=k(i[2]),i=k(i[1])):(h=k(c).replace(/caption=['"]/,"").replace(/['"]$/,""),i=d),e=e&&e[1]?e[1]:"",f=f&&f[1]?f[1]:"alignnone",!g&&i&&(g=i.match(/width=['"]([0-9]*)['"]/)),g&&g[1]&&(g=g[1]),g&&h?(j=parseInt(g,10),a.getParam("wpeditimage_html5_captions")||(j+=10),'

"):d})}function c(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c="";return-1===b.indexOf("]+>([\s\S]+?)<\/dd>/i),c&&c[1]?"

"+c[1]+"

":""):(c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c}),0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c)})}function d(b){var c,d,e,f,g=a.dom;return d={attachment_id:!1,url:!1,height:"",width:"",size:"none",caption:"",alt:"",align:"none",link:!1,linkUrl:""},d.url=g.getAttrib(b,"src"),d.alt=g.getAttrib(b,"alt"),d.width=parseInt(g.getAttrib(b,"width"),10),d.height=parseInt(g.getAttrib(b,"height"),10),c=b.className.split(" "),tinymce.each(c,function(a){/^wp-image/.test(a)&&(d.attachment_id=parseInt(a.replace("wp-image-",""),10)),/^align/.test(a)&&(d.align=a.replace("align","")),/^size/.test(a)&&(d.size=a.replace("size-",""))}),e=g.getParents(b,".wp-caption"),e.length&&(e=e[0],c=e.className.split(" "),tinymce.each(c,function(a){/^align/.test(a)&&(d.align=a.replace("align",""))}),f=g.select("dd.wp-caption-dd",e),f.length&&(f=f[0],d.caption=a.serializer.serialize(f).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,""))),b.parentNode&&"A"===b.parentNode.nodeName&&(d.linkUrl=g.getAttrib(b.parentNode,"href")),d}function e(b,c){var d,e,g,h,j,k,l,m;c.caption?(h=f(c,"html"),e=parseInt(c.width,10),a.getParam("wpeditimage_html5_captions")||(e+=10),d="align"+c.align,h='

'+h+'
'+c.caption+"
",g=a.dom.create("div",{"class":"mceTemp"},h)):g=f(c,"node"),k=b,j=a.dom.getParent(b,".mceTemp"),j?k=j:"A"===b.parentNode.nodeName&&(k=b.parentNode),l=a.dom.uniqueId("wp_"),a.dom.setAttrib(g,"data-wp-replace-id",l),a.dom.replace(g,k),g=a.dom.select('[data-wp-replace-id="'+l+'"]')[0],a.dom.setAttrib(g,"data-wp-replace-id",""),a.nodeChanged(),m="IMG"===g.nodeName?g:a.dom.select("img",g)[0],m&&(a.selection.select(m),i(m))}function f(b,c){var d,e=[];if(c=c?c:"node",b.caption||e.push("align"+b.align),b.attachment_id&&(e.push("wp-image-"+b.attachment_id),b.size&&e.push("size-"+b.size)),d={src:b.url,width:b.width,height:b.height,alt:b.alt},e.length&&(d["class"]=e.join(" ")),b.linkUrl){if("node"===c)return a.dom.create("a",{href:b.linkUrl},a.dom.createHTML("img",d));if("html"===c)return a.dom.createHTML("a",{href:b.linkUrl},a.dom.createHTML("img",d))}else{if("node"===c)return a.dom.create("img",d);if("html"===c)return a.dom.createHTML("img",d)}}function g(b){var c,f;return"undefined"!=typeof wp&&wp.media?(a.undoManager.add(),c=wp.media({frame:"image",state:"image-details",metadata:d(b)}),f=function(d){e(b,d),a.focus(),c.detach()},c.state("image-details").on("update",f),c.state("replace-image").on("replace",f),c.on("close",function(){a.focus(),c.detach()}),void c.open()):void a.execCommand("mceImage")}function h(b){var c;"DIV"===b.nodeName&&a.dom.hasClass(b,"mceTemp")?c=b:("IMG"===b.nodeName||"DT"===b.nodeName||"A"===b.nodeName)&&(c=a.dom.getParent(b,"div.mceTemp")),c?(a.selection.select(c.nextSibling?c.nextSibling:c.previousSibling?c.previousSibling:c.parentNode),a.selection.collapse(!0),a.nodeChanged(),a.dom.remove(c)):a.dom.remove(b)}function i(b){var c,d,e,f,g=a.dom;j(),b&&"IMG"===b.nodeName&&!k(b)&&(g.setAttrib(b,"data-wp-imgselect",1),c=g.getRect(b),d='
',e=g.create("div",{id:"wp-image-toolbar","data-mce-bogus":"1",contenteditable:!1},d),a.getBody().appendChild(e),f=g.getSize(e),g.setStyles(e,{top:c.y,left:c.x+c.w-f.w}))}function j(){var b=a.dom.get("wp-image-toolbar");b&&a.dom.remove(b),a.dom.setAttrib(a.dom.select("img[data-wp-imgselect]"),"data-wp-imgselect",null)}function k(b){var c=a.dom;return c.hasClass(b,"mceItem")||c.getAttrib(b,"data-mce-placeholder")||c.getAttrib(b,"data-mce-object")?!0:!1}return a.on("init",function(){var b=a.dom;a.getParam("wpeditimage_html5_captions")&&b.addClass(a.getBody(),"html5-captions"),a.on("wpLoadImageForm",function(b){if(!a.getParam("wpeditimage_disable_captions")){var c={type:"textbox",flex:1,name:"caption",minHeight:60,multiline:!0,scroll:!0,label:"Image caption"};b.data.splice(b.data.length-1,0,c)}}),a.on("wpNewImageRefresh",function(a){var c,d;(c=b.getParent(a.node,"dl.wp-caption"))&&(c.style.width||(d=parseInt(a.node.clientWidth,10)+10,d=d?d+"px":"50%",b.setStyle(c,"width",d)))}),a.on("wpImageFormSubmit",function(c){var d,e,f,g,h,i=c.imgData.data,j=c.imgData.node,k=c.imgData.caption,l="",m="",n="";return i.id="__wp-temp-img-id",c.imgData.cancel=!0,i.style||(i.style=null),i.src?(k&&(k=k.replace(/\r\n|\r/g,"\n").replace(/<\/?[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),k=k.replace(/(]*>)\s*\n\s*/g,"$1").replace(/\s*\n\s*/g,"
")),j?(h=j.id||null,b.setAttribs(j,i),d=b.getParent(j,"dl.wp-caption"),k?d?(e=b.select("dd.wp-caption-dd",d)[0])&&(e.innerHTML=k):(j.className&&(l=j.className.match(/wp-image-([0-9]+)/),m=j.className.match(/align(left|right|center|none)/)),m?(m=m[0],j.className=j.className.replace(/align(left|right|center|none)/g,"")):m="alignnone",m=' class="wp-caption '+m+'"',l&&(l=' id="attachment_'+l[1]+'"'),n=i.width||j.clientWidth,n&&(n=parseInt(n,10),a.getParam("wpeditimage_html5_captions")||(n+=10),n=' style="width: '+n+'px"'),j.parentNode&&"A"===j.parentNode.nodeName?(g=b.getOuterHTML(j.parentNode),f=j.parentNode):(g=b.getOuterHTML(j),f=j),g="
'+g+'
'+k+"
",(e=b.getParent(j,"p"))?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.remove(f),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):d&&(g=b.getOuterHTML("A"===j.parentNode.nodeName?j.parentNode:j),e=b.create("p",{},g),b.insertAfter(e,d.parentNode),a.selection.select(e),a.nodeChanged(),b.remove(d.parentNode))):(g=b.createHTML("img",i),k?(f=a.selection.getNode(),i.width&&(n=parseInt(i.width,10),a.getParam("wpeditimage_html5_captions")||(n+=10),n=' style="width: '+n+'px"'),g='
'+g+'
'+k+"
",e="P"===f.nodeName?f:b.getParent(f,"p"),e&&"P"===e.nodeName?(d=b.create("div",{"class":"mceTemp"},g),b.insertAfter(d,e),a.selection.select(d),a.nodeChanged(),b.isEmpty(e)&&b.remove(e)):a.selection.setContent('
'+g+"
")):a.selection.setContent(g)),j=b.get("__wp-temp-img-id"),b.setAttrib(j,"id",h),void(c.imgData.node=j)):void(j&&(b.remove((d=b.getParent(j,"div.mceTemp"))?d:"A"===j.parentNode.nodeName?j.parentNode:j),a.nodeChanged()))}),a.on("wpLoadImageData",function(c){var d,e=c.imgData.data,f=c.imgData.node;(d=b.getParent(f,"dl.wp-caption"))&&(d=b.select("dd.wp-caption-dd",d)[0],d&&(e.caption=a.serializer.serialize(d).replace(/]*>/g,"$&\n").replace(/^

/,"").replace(/<\/p>$/,"")))}),b.bind(a.getDoc(),"dragstart",function(c){var d=a.selection.getNode();"IMG"===d.nodeName&&b.getParent(d,".wp-caption")&&c.preventDefault(),j()}),tinymce.Env.ie&&tinymce.Env.ie>10&&(b.bind(a.getBody(),"mscontrolselect",function(c){"IMG"===c.target.nodeName&&b.getParent(c.target,".wp-caption")?a.getBody().focus():"DL"===c.target.nodeName&&b.hasClass(c.target,"wp-caption")&&c.target.focus()}),a.on("click",function(c){"IMG"===c.target.nodeName&&b.getAttrib(c.target,"data-wp-imgselect")&&b.getParent(c.target,"dl.wp-caption")&&a.getBody().focus()}))}),a.on("ObjectResized",function(b){var c,d,e=b.target;"IMG"===e.nodeName&&((c=a.dom.getParent(e,".wp-caption"))&&(d=b.width||a.dom.getAttrib(e,"width"),d&&(d=parseInt(d,10),a.getParam("wpeditimage_html5_captions")||(d+=10),a.dom.setStyle(c,"width",d+"px"))),i(e))}),a.on("BeforeExecCommand",function(b){var c,d,e,f,g=b.command,h=a.dom;if("mceInsertContent"===g){if((c=h.getParent(a.selection.getNode(),"div.mceTemp"))&&(d=h.create("p"),h.insertAfter(d,c),a.selection.setCursorLocation(d,0),a.nodeChanged(),tinymce.Env.ie>8))return setTimeout(function(){a.selection.setCursorLocation(d,0),a.selection.setContent(b.value)},500),!1}else if("JustifyLeft"===g||"JustifyRight"===g||"JustifyCenter"===g){if(c=a.selection.getNode(),f=g.substr(7).toLowerCase(),f="align"+f,j(),e=h.is(c,"dl.wp-caption")?c:h.getParent(c,"dl.wp-caption"))return h.hasClass(e,f)?(h.removeClass(e,f),h.addClass(e,"alignnone")):(e.className=e.className.replace(/align[^ ]+/g,""),h.addClass(e,f)),!1;"IMG"===c.nodeName&&(h.hasClass(c,f)?h.addClass(c,"alignnone"):h.removeClass(c,"alignnone"))}}),a.on("keydown",function(b){var c,d,e,f,g=a.selection,i=a.dom;if(b.keyCode===tinymce.util.VK.ENTER)c=g.getNode(),d=i.getParent(c,"div.mceTemp"),d&&(i.events.cancel(b),tinymce.each(i.select("dt, dd",d),function(a){i.isEmpty(a)&&i.remove(a)}),f=tinymce.Env.ie&&tinymce.Env.ie<11?"":'
',e=i.create("p",null,f),"DD"===c.nodeName?i.insertAfter(e,d):d.parentNode.insertBefore(e,d),a.nodeChanged(),g.setCursorLocation(e,0));else if((b.keyCode===tinymce.util.VK.DELETE||b.keyCode===tinymce.util.VK.BACKSPACE)&&(c=g.getNode(),"DIV"===c.nodeName&&i.hasClass(c,"mceTemp")?d=c:("IMG"===c.nodeName||"DT"===c.nodeName||"A"===c.nodeName)&&(d=i.getParent(c,"div.mceTemp")),d))return i.events.cancel(b),h(c),!1}),a.on("mousedown",function(b){a.dom.getParent(b.target,"#wp-image-toolbar")?tinymce.Env.ie&&b.preventDefault():"IMG"!==b.target.nodeName&&j()}),a.on("mouseup",function(b){var c,d=b.target,e=a.dom;b.button&&b.button>1||("DIV"===d.nodeName&&e.getParent(d,"#wp-image-toolbar")?(c=e.select("img[data-wp-imgselect]")[0],c&&(a.selection.select(c),e.hasClass(d,"remove")?(h(c),j()):e.hasClass(d,"edit")&&g(c))):"IMG"!==d.nodeName||a.dom.getAttrib(d,"data-wp-imgselect")||k(d)?"IMG"!==d.nodeName&&j():i(d))}),a.on("cut",function(){j()}),a.wpSetImgCaption=function(a){return b(a)},a.wpGetImgCaption=function(a){return c(a)},a.on("BeforeSetContent",function(b){b.content=a.wpSetImgCaption(b.content)}),a.on("PostProcess",function(b){b.get&&(b.content=a.wpGetImgCaption(b.content),b.content=b.content.replace(/ data-wp-imgselect="1"/g,""))}),{_do_shcode:b,_get_shcode:c}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index ad23bf55a6..4fdb88a467 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ