diff --git a/wp-includes/js/tinymce/plugins/wplink/plugin.js b/wp-includes/js/tinymce/plugins/wplink/plugin.js
index e339d7fefb..fcad125f3f 100644
--- a/wp-includes/js/tinymce/plugins/wplink/plugin.js
+++ b/wp-includes/js/tinymce/plugins/wplink/plugin.js
@@ -57,7 +57,7 @@
return (
'
' +
'' +
- '' +
+ '' +
'
'
);
},
@@ -445,5 +445,11 @@
cmd: 'wp_link_apply',
classes: 'widget btn primary'
} );
+
+ return {
+ hideEditToolbar: function() {
+ editToolbar.hide();
+ }
+ };
} );
} )( window.tinymce );
diff --git a/wp-includes/js/tinymce/plugins/wplink/plugin.min.js b/wp-includes/js/tinymce/plugins/wplink/plugin.min.js
index 821468d8b3..76a356b05f 100644
--- a/wp-includes/js/tinymce/plugins/wplink/plugin.min.js
+++ b/wp-includes/js/tinymce/plugins/wplink/plugin.min.js
@@ -1 +1 @@
-!function(a){a.ui.WPLinkPreview=a.ui.Control.extend({url:"#",renderHtml:function(){return'"},setURL:function(b){var c,d;this.url!==b&&(this.url=b,b=window.decodeURIComponent(b),b=b.replace(/^(?:https?:)?\/\/(?:www\.)?/,""),-1!==(c=b.indexOf("?"))&&(b=b.slice(0,c)),-1!==(c=b.indexOf("#"))&&(b=b.slice(0,c)),b=b.replace(/(?:index)?\.html$/,""),"/"===b.charAt(b.length-1)&&(b=b.slice(0,-1)),""===b&&(b=this.url),b.length>40&&-1!==(c=b.indexOf("/"))&&-1!==(d=b.lastIndexOf("/"))&&d!==c&&(c+b.length-d<40&&(d=-(40-(c+1))),b=b.slice(0,c+1)+"\u2026"+b.slice(d)),a.$(this.getEl().firstChild).attr("href",this.url).text(b))}}),a.ui.WPLinkInput=a.ui.Control.extend({renderHtml:function(){return''},setURL:function(a){this.getEl().firstChild.value=a},getURL:function(){return a.trim(this.getEl().firstChild.value)},getLinkText:function(){return a.trim(this.getEl().firstChild.nextSibling.value)},reset:function(){var a=this.getEl().firstChild;a.value="",a.nextSibling.value=""}}),a.PluginManager.add("wplink",function(b){function c(){var a,c,d=b.selection.getNode(),e=b.dom.getParent(d,"a[href]");return e||(c=b.selection.getContent({format:"raw"}),c&&-1!==c.indexOf("")&&(a=c.match(/href="([^">]+)"/),a&&a[1]&&(e=b.$('a[href="'+a[1]+'"]',d)[0]),e&&(b.selection.select(e),b.nodeChanged()))),e}function d(){b.$("a").each(function(a,c){var d=b.$(c);"_wp_link_placeholder"===d.attr("href")?b.dom.remove(c,!0):d.attr("data-wplink-edit")&&d.attr("data-wplink-edit",null)})}function e(a,b){return b&&(a=a.replace(/ data-wplink-edit="true"/g,"")),a.replace(/]*?href="_wp_link_placeholder"[^>]*>([\s\S]+)<\/a>/g,"$1")}var f,g,h,i,j=window.jQuery;b.on("preinit",function(){b.wp&&b.wp._createToolbar&&(f=b.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0),g=b.wp._createToolbar(["wp_link_input","wp_link_apply","wp_link_advanced"],!0),g.on("show",function(){var b=g.find("toolbar")[0];b&&!a.$(document.body).hasClass("modal-open")&&window.setTimeout(function(){b.focus(!0)})}),g.on("hide",function(){g.scrolling||b.execCommand("wp_link_cancel")}))}),b.addCommand("WP_Link",function(){var e=c();return a.Env.ie&&a.Env.ie<10?void("undefined"!=typeof window.wpLink&&window.wpLink.open(b.id)):void(e?b.dom.setAttribs(e,{"data-wplink-edit":!0}):(d(),b.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder"}),a.Env.ie&&(b.windowManager.wplinkBookmark=b.selection.getBookmark())))}),b.addCommand("wp_link_apply",function(){if(!g.scrolling){var d,e,f=c();if(f){if(d=i.getURL(),e=i.getLinkText(),b.focus(),a.isIE&&(b.selection.moveToBookmark(b.windowManager.wplinkBookmark),b.windowManager.wplinkBookmark=null),!d)return void b.dom.remove(f,!0);/^(?:[a-z]+:|#|\?|\.|\/)/.test(d)||(d="http://"+d),b.dom.setAttribs(f,{href:d,"data-wplink-edit":null}),a.trim(f.innerHTML)||b.$(f).text(e||d)}i.reset(),b.nodeChanged()}}),b.addCommand("wp_link_cancel",function(){i.reset(),d(),b.focus(),a.isIE&&(b.selection.moveToBookmark(b.windowManager.wplinkBookmark),b.windowManager.wplinkBookmark=null)}),b.addShortcut("access+a","","WP_Link"),b.addShortcut("meta+k","","WP_Link"),b.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),b.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),b.addMenuItem("link",{icon:"link",text:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),b.on("pastepreprocess",function(c){var d=c.content,e=/^(?:https?:)?\/\/\S+$/i;b.selection.isCollapsed()||e.test(b.selection.getContent())||(d=d.replace(/<[^>]+>/g,""),d=a.trim(d),e.test(d)&&(b.execCommand("mceInsertLink",!1,{href:b.dom.decode(d)}),c.preventDefault()))}),b.on("savecontent",function(a){a.content=e(a.content,!0)}),b.on("BeforeAddUndo",function(a){a.level.content&&(a.level.content=e(a.level.content))}),b.addButton("wp_link_preview",{type:"WPLinkPreview",onPostRender:function(){h=this}}),b.addButton("wp_link_input",{type:"WPLinkInput",onPostRender:function(){var c,d,e,f=this.getEl(),h=f.firstChild;i=this,j&&j.ui&&j.ui.autocomplete&&(c=j(h),c.on("keydown",function(){c.removeAttr("aria-activedescendant")}).autocomplete({source:function(a,b){return e===a.term?void b(d):/^https?:/.test(a.term)||-1!==a.term.indexOf(".")?b():(j.post(window.ajaxurl,{action:"wp-link-ajax",page:1,search:a.term,_ajax_linking_nonce:j("#_ajax_linking_nonce").val()},function(a){d=a,b(a)},"json"),void(e=a.term))},focus:function(a,b){c.attr("aria-activedescendant","mce-wp-autocomplete-"+b.item.ID)},select:function(a,b){return c.val(b.item.permalink),j(f.firstChild.nextSibling).val(b.item.title),!1},open:function(){c.attr("aria-expanded","true"),g.blockHide=!0},close:function(){c.attr("aria-expanded","false"),g.blockHide=!1},minLength:2,position:{my:"left top+2"}}).autocomplete("instance")._renderItem=function(a,b){return j('').append(""+b.title+' '+b.info+"").appendTo(a)},c.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":c.autocomplete("widget").attr("id")}).on("focus",function(){c.autocomplete("search")}).autocomplete("widget").addClass("wplink-autocomplete").attr("role","listbox")),a.$(h).on("keydown",function(a){13===a.keyCode&&b.execCommand("wp_link_apply")})}}),b.on("wptoolbar",function(c){var d,e,j,k=b.dom.getParent(c.element,"a");a.$(document.body).hasClass("modal-open")||k&&(d=b.$(k),e=d.attr("href"),j=d.attr("data-wplink-edit"),"_wp_link_placeholder"===e||j?(j&&!i.getURL()&&i.setURL(e),c.element=k,c.toolbar=g):e&&!d.find("img").length&&(h.setURL(e),c.element=k,c.toolbar=f))}),b.addButton("wp_link_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",cmd:"WP_Link"}),b.addButton("wp_link_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",cmd:"unlink"}),b.addButton("wp_link_advanced",{tooltip:"Advanced",icon:"dashicon dashicons-admin-generic",onclick:function(){if("undefined"!=typeof window.wpLink){var a=i.getURL()||null,c=i.getLinkText()||null;b.focus(),window.wpLink.open(b.id,a,c),i.reset()}}}),b.addButton("wp_link_apply",{tooltip:"Apply",icon:"dashicon dashicons-editor-break",cmd:"wp_link_apply",classes:"widget btn primary"})})}(window.tinymce);
\ No newline at end of file
+!function(a){a.ui.WPLinkPreview=a.ui.Control.extend({url:"#",renderHtml:function(){return'"},setURL:function(b){var c,d;this.url!==b&&(this.url=b,b=window.decodeURIComponent(b),b=b.replace(/^(?:https?:)?\/\/(?:www\.)?/,""),-1!==(c=b.indexOf("?"))&&(b=b.slice(0,c)),-1!==(c=b.indexOf("#"))&&(b=b.slice(0,c)),b=b.replace(/(?:index)?\.html$/,""),"/"===b.charAt(b.length-1)&&(b=b.slice(0,-1)),""===b&&(b=this.url),b.length>40&&-1!==(c=b.indexOf("/"))&&-1!==(d=b.lastIndexOf("/"))&&d!==c&&(c+b.length-d<40&&(d=-(40-(c+1))),b=b.slice(0,c+1)+"\u2026"+b.slice(d)),a.$(this.getEl().firstChild).attr("href",this.url).text(b))}}),a.ui.WPLinkInput=a.ui.Control.extend({renderHtml:function(){return''},setURL:function(a){this.getEl().firstChild.value=a},getURL:function(){return a.trim(this.getEl().firstChild.value)},getLinkText:function(){return a.trim(this.getEl().firstChild.nextSibling.value)},reset:function(){var a=this.getEl().firstChild;a.value="",a.nextSibling.value=""}}),a.PluginManager.add("wplink",function(b){function c(){var a,c,d=b.selection.getNode(),e=b.dom.getParent(d,"a[href]");return e||(c=b.selection.getContent({format:"raw"}),c&&-1!==c.indexOf("")&&(a=c.match(/href="([^">]+)"/),a&&a[1]&&(e=b.$('a[href="'+a[1]+'"]',d)[0]),e&&(b.selection.select(e),b.nodeChanged()))),e}function d(){b.$("a").each(function(a,c){var d=b.$(c);"_wp_link_placeholder"===d.attr("href")?b.dom.remove(c,!0):d.attr("data-wplink-edit")&&d.attr("data-wplink-edit",null)})}function e(a,b){return b&&(a=a.replace(/ data-wplink-edit="true"/g,"")),a.replace(/]*?href="_wp_link_placeholder"[^>]*>([\s\S]+)<\/a>/g,"$1")}var f,g,h,i,j=window.jQuery;return b.on("preinit",function(){b.wp&&b.wp._createToolbar&&(f=b.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0),g=b.wp._createToolbar(["wp_link_input","wp_link_apply","wp_link_advanced"],!0),g.on("show",function(){var b=g.find("toolbar")[0];b&&!a.$(document.body).hasClass("modal-open")&&window.setTimeout(function(){b.focus(!0)})}),g.on("hide",function(){g.scrolling||b.execCommand("wp_link_cancel")}))}),b.addCommand("WP_Link",function(){var e=c();return a.Env.ie&&a.Env.ie<10?void("undefined"!=typeof window.wpLink&&window.wpLink.open(b.id)):void(e?b.dom.setAttribs(e,{"data-wplink-edit":!0}):(d(),b.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder"}),a.Env.ie&&(b.windowManager.wplinkBookmark=b.selection.getBookmark())))}),b.addCommand("wp_link_apply",function(){if(!g.scrolling){var d,e,f=c();if(f){if(d=i.getURL(),e=i.getLinkText(),b.focus(),a.isIE&&(b.selection.moveToBookmark(b.windowManager.wplinkBookmark),b.windowManager.wplinkBookmark=null),!d)return void b.dom.remove(f,!0);/^(?:[a-z]+:|#|\?|\.|\/)/.test(d)||(d="http://"+d),b.dom.setAttribs(f,{href:d,"data-wplink-edit":null}),a.trim(f.innerHTML)||b.$(f).text(e||d)}i.reset(),b.nodeChanged()}}),b.addCommand("wp_link_cancel",function(){i.reset(),d(),b.focus(),a.isIE&&(b.selection.moveToBookmark(b.windowManager.wplinkBookmark),b.windowManager.wplinkBookmark=null)}),b.addShortcut("access+a","","WP_Link"),b.addShortcut("meta+k","","WP_Link"),b.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),b.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),b.addMenuItem("link",{icon:"link",text:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),b.on("pastepreprocess",function(c){var d=c.content,e=/^(?:https?:)?\/\/\S+$/i;b.selection.isCollapsed()||e.test(b.selection.getContent())||(d=d.replace(/<[^>]+>/g,""),d=a.trim(d),e.test(d)&&(b.execCommand("mceInsertLink",!1,{href:b.dom.decode(d)}),c.preventDefault()))}),b.on("savecontent",function(a){a.content=e(a.content,!0)}),b.on("BeforeAddUndo",function(a){a.level.content&&(a.level.content=e(a.level.content))}),b.addButton("wp_link_preview",{type:"WPLinkPreview",onPostRender:function(){h=this}}),b.addButton("wp_link_input",{type:"WPLinkInput",onPostRender:function(){var c,d,e,f=this.getEl(),h=f.firstChild;i=this,j&&j.ui&&j.ui.autocomplete&&(c=j(h),c.on("keydown",function(){c.removeAttr("aria-activedescendant")}).autocomplete({source:function(a,b){return e===a.term?void b(d):/^https?:/.test(a.term)||-1!==a.term.indexOf(".")?b():(j.post(window.ajaxurl,{action:"wp-link-ajax",page:1,search:a.term,_ajax_linking_nonce:j("#_ajax_linking_nonce").val()},function(a){d=a,b(a)},"json"),void(e=a.term))},focus:function(a,b){c.attr("aria-activedescendant","mce-wp-autocomplete-"+b.item.ID)},select:function(a,b){return c.val(b.item.permalink),j(f.firstChild.nextSibling).val(b.item.title),!1},open:function(){c.attr("aria-expanded","true"),g.blockHide=!0},close:function(){c.attr("aria-expanded","false"),g.blockHide=!1},minLength:2,position:{my:"left top+2"}}).autocomplete("instance")._renderItem=function(a,b){return j('').append(""+b.title+' '+b.info+"").appendTo(a)},c.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":c.autocomplete("widget").attr("id")}).on("focus",function(){c.autocomplete("search")}).autocomplete("widget").addClass("wplink-autocomplete").attr("role","listbox")),a.$(h).on("keydown",function(a){13===a.keyCode&&b.execCommand("wp_link_apply")})}}),b.on("wptoolbar",function(c){var d,e,j,k=b.dom.getParent(c.element,"a");a.$(document.body).hasClass("modal-open")||k&&(d=b.$(k),e=d.attr("href"),j=d.attr("data-wplink-edit"),"_wp_link_placeholder"===e||j?(j&&!i.getURL()&&i.setURL(e),c.element=k,c.toolbar=g):e&&!d.find("img").length&&(h.setURL(e),c.element=k,c.toolbar=f))}),b.addButton("wp_link_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",cmd:"WP_Link"}),b.addButton("wp_link_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",cmd:"unlink"}),b.addButton("wp_link_advanced",{tooltip:"Advanced",icon:"dashicon dashicons-admin-generic",onclick:function(){if("undefined"!=typeof window.wpLink){var a=i.getURL()||null,c=i.getLinkText()||null;b.focus(),window.wpLink.open(b.id,a,c),i.reset()}}}),b.addButton("wp_link_apply",{tooltip:"Apply",icon:"dashicon dashicons-editor-break",cmd:"wp_link_apply",classes:"widget btn primary"}),{hideEditToolbar:function(){g.hide()}}})}(window.tinymce);
\ 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 a6bb850997..16bc51b8a1 100644
Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ
diff --git a/wp-includes/js/wplink.js b/wp-includes/js/wplink.js
index d324da6ad9..8e177cf276 100644
--- a/wp-includes/js/wplink.js
+++ b/wp-includes/js/wplink.js
@@ -208,7 +208,9 @@ var wpLink;
// Focus the URL field and highlight its contents.
// If this is moved above the selection changes,
// IE will show a flashing cursor over the dialog.
- inputs.url.focus()[0].select();
+ window.setTimeout( function() {
+ inputs.url.focus()[0].select();
+ }, 100 );
}
correctedURL = inputs.url.val().replace( /^http:\/\//, '' );
@@ -242,8 +244,7 @@ var wpLink;
},
mceRefresh: function( url, text ) {
- var selectedNode = editor.selection.getNode(),
- linkNode = editor.dom.getParent( selectedNode, 'a[href]' ),
+ var linkNode = editor.dom.getParent( editor.selection.getNode(), 'a[href]' ),
onlyText = this.hasSelectedText( linkNode );
if ( linkNode ) {
@@ -272,8 +273,6 @@ var wpLink;
},
close: function() {
- var linkNode;
-
$( document.body ).removeClass( 'modal-open' );
if ( ! wpLink.isMCE() ) {
@@ -284,12 +283,7 @@ var wpLink;
wpLink.range.select();
}
} else {
- linkNode = editor.dom.getParent( editor.selection.getNode(), 'a[href]' );
-
- if ( linkNode && editor.dom.getAttrib( linkNode, 'href' ) === '_wp_link_placeholder' ) {
- editor.dom.remove( linkNode, true );
- }
-
+ editor.plugins.wplink.hideEditToolbar();
editor.focus();
}
diff --git a/wp-includes/js/wplink.min.js b/wp-includes/js/wplink.min.js
index 0f2cddb9a2..2f68f882b1 100644
--- a/wp-includes/js/wplink.min.js
+++ b/wp-includes/js/wplink.min.js
@@ -1 +1 @@
-var wpLink;!function(a){function b(){return c.dom.getParent(c.selection.getNode(),"a")}var c,d,e={},f="ontouchend"in document;wpLink={textarea:"",init:function(){e.wrap=a("#wp-link-wrap"),e.dialog=a("#wp-link"),e.backdrop=a("#wp-link-backdrop"),e.submit=a("#wp-link-submit"),e.close=a("#wp-link-close"),e.text=a("#wp-link-text"),e.url=a("#wp-link-url"),e.openInNewTab=a("#wp-link-target"),a.ui&&a.ui.autocomplete&&wpLink.setAutocomplete(),e.submit.click(function(a){a.preventDefault(),wpLink.update()}),e.close.add(e.backdrop).add("#wp-link-cancel a").click(function(a){a.preventDefault(),wpLink.close()}),e.url.on("paste",function(){setTimeout(wpLink.correctURL,0)})},setAutocomplete:function(){var b,c,d=e.url;d.on("keydown",function(){d.removeAttr("aria-activedescendant")}).autocomplete({source:function(d,e){return c===d.term?void e(b):/^https?:/.test(d.term)||-1!==d.term.indexOf(".")?e():(a.post(window.ajaxurl,{action:"wp-link-ajax",page:1,search:d.term,_ajax_linking_nonce:a("#_ajax_linking_nonce").val()},function(a){b=a,e(a)},"json"),void(c=d.term))},focus:function(a,b){d.attr("aria-activedescendant","mce-wp-autocomplete-"+b.item.ID)},select:function(a,b){return d.val(b.item.permalink),e.wrap.hasClass("has-text-field")&&""===tinymce.trim(e.text.val())&&e.text.val(b.item.title),!1},open:function(){d.attr("aria-expanded","true")},close:function(){d.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2"}}).autocomplete("instance")._renderItem=function(b,c){return a('').append(''+c.title+' '+c.info+"").appendTo(b)},d.attr({"aria-owns":d.autocomplete("widget").attr("id")}).on("focus",function(){d.autocomplete("search")}).autocomplete("widget").addClass("wplink-autocomplete").attr("role","listbox")},correctURL:function(){var b=a.trim(e.url.val());b&&d!==b&&!/^(?:[a-z]+:|#|\?|\.|\/)/.test(b)&&(e.url.val("http://"+b),d=b)},open:function(b,d,f){var g,h=a(document.body);h.addClass("modal-open"),wpLink.range=null,b&&(window.wpActiveEditor=b),window.wpActiveEditor&&(this.textarea=a("#"+window.wpActiveEditor).get(0),"undefined"!=typeof tinymce&&(h.append(e.backdrop,e.wrap),g=tinymce.get(wpActiveEditor),c=g&&!g.isHidden()?g:null,c&&tinymce.isIE&&!c.windowManager.wplinkBookmark&&(c.windowManager.wplinkBookmark=c.selection.getBookmark())),!wpLink.isMCE()&&document.selection&&(this.textarea.focus(),this.range=document.selection.createRange()),e.wrap.show(),e.backdrop.show(),wpLink.refresh(d,f),a(document).trigger("wplink-open",e.wrap))},isMCE:function(){return c&&!c.isHidden()},refresh:function(a,b){var c="";wpLink.isMCE()?wpLink.mceRefresh(a,b):(e.wrap.hasClass("has-text-field")||e.wrap.addClass("has-text-field"),document.selection?c=document.selection.createRange().text||b||"":"undefined"!=typeof this.textarea.selectionStart&&this.textarea.selectionStart!==this.textarea.selectionEnd&&(b=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)||b||""),e.text.val(b),wpLink.setDefaultValues()),f?e.url.focus().blur():e.url.focus()[0].select(),d=e.url.val().replace(/^http:\/\//,"")},hasSelectedText:function(a){var b,d,e,f=c.selection.getContent();if(/]+>[^<]+<\/a>$/.test(f)||-1===f.indexOf("href=")))return!1;if(a){if(d=a.childNodes,0===d.length)return!1;for(e=d.length-1;e>=0;e--)if(b=d[e],3!=b.nodeType&&!tinymce.dom.BookmarkManager.isBookmarkNode(b))return!1}return!0},mceRefresh:function(a,b){var d=c.selection.getNode(),f=c.dom.getParent(d,"a[href]"),g=this.hasSelectedText(f);f?(b=tinymce.trim(f.innerText||f.textContent)||b,a=a||c.dom.getAttrib(f,"href"),"_wp_link_placeholder"===a&&(a=""),e.url.val(a),e.openInNewTab.prop("checked","_blank"===c.dom.getAttrib(f,"target")),e.submit.val(wpLinkL10n.update)):(b=c.selection.getContent({format:"text"})||b,this.setDefaultValues()),g?(e.text.val(b||""),e.wrap.addClass("has-text-field")):(e.text.val(""),e.wrap.removeClass("has-text-field"))},close:function(){var b;a(document.body).removeClass("modal-open"),wpLink.isMCE()?(b=c.dom.getParent(c.selection.getNode(),"a[href]"),b&&"_wp_link_placeholder"===c.dom.getAttrib(b,"href")&&c.dom.remove(b,!0),c.focus()):(wpLink.textarea.focus(),wpLink.range&&(wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select())),e.backdrop.hide(),e.wrap.hide(),d=!1,a(document).trigger("wplink-close",e.wrap)},getAttrs:function(){return wpLink.correctURL(),{href:a.trim(e.url.val()),target:e.openInNewTab.prop("checked")?"_blank":""}},buildHtml:function(a){var b='"},update:function(){wpLink.isMCE()?wpLink.mceUpdate():wpLink.htmlUpdate()},htmlUpdate:function(){var a,b,c,d,f,g,h,i=wpLink.textarea;i&&(a=wpLink.getAttrs(),b=e.text.val(),a.href&&(c=wpLink.buildHtml(a),document.selection&&wpLink.range?(i.focus(),wpLink.range.text=c+(b||wpLink.range.text)+"",wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select(),wpLink.range=null):"undefined"!=typeof i.selectionStart&&(d=i.selectionStart,f=i.selectionEnd,h=b||i.value.substring(d,f),c=c+h+"",g=d+c.length,d!==f||h||(g-=4),i.value=i.value.substring(0,d)+c+i.value.substring(f,i.value.length),i.selectionStart=i.selectionEnd=g),wpLink.close(),i.focus()))},mceUpdate:function(){var a,d,f=wpLink.getAttrs();return c.focus(),tinymce.isIE&&(c.selection.moveToBookmark(c.windowManager.wplinkBookmark),c.windowManager.wplinkBookmark=null),f.href?(a=b(),e.wrap.hasClass("has-text-field")&&(d=e.text.val()||f.href),a?(d&&("innerText"in a?a.innerText=d:a.textContent=d),c.dom.setAttribs(a,f)):d?c.selection.setNode(c.dom.create("a",f,c.dom.encode(d))):c.execCommand("mceInsertLink",!1,f),wpLink.close(),void c.nodeChanged()):void c.execCommand("unlink")},setDefaultValues:function(){var a,b=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,d=/^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}[^ "]*$/i;this.isMCE()?a=c.selection.getContent():document.selection&&wpLink.range?a=wpLink.range.text:"undefined"!=typeof this.textarea.selectionStart&&(a=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)),a&&b.test(a)?e.url.val("mailto:"+a):a&&d.test(a)?e.url.val(a.replace(/&|?38;/gi,"&")):e.url.val(""),e.submit.val(wpLinkL10n.save)}},a(document).ready(wpLink.init)}(jQuery);
\ No newline at end of file
+var wpLink;!function(a){function b(){return c.dom.getParent(c.selection.getNode(),"a")}var c,d,e={},f="ontouchend"in document;wpLink={textarea:"",init:function(){e.wrap=a("#wp-link-wrap"),e.dialog=a("#wp-link"),e.backdrop=a("#wp-link-backdrop"),e.submit=a("#wp-link-submit"),e.close=a("#wp-link-close"),e.text=a("#wp-link-text"),e.url=a("#wp-link-url"),e.openInNewTab=a("#wp-link-target"),a.ui&&a.ui.autocomplete&&wpLink.setAutocomplete(),e.submit.click(function(a){a.preventDefault(),wpLink.update()}),e.close.add(e.backdrop).add("#wp-link-cancel a").click(function(a){a.preventDefault(),wpLink.close()}),e.url.on("paste",function(){setTimeout(wpLink.correctURL,0)})},setAutocomplete:function(){var b,c,d=e.url;d.on("keydown",function(){d.removeAttr("aria-activedescendant")}).autocomplete({source:function(d,e){return c===d.term?void e(b):/^https?:/.test(d.term)||-1!==d.term.indexOf(".")?e():(a.post(window.ajaxurl,{action:"wp-link-ajax",page:1,search:d.term,_ajax_linking_nonce:a("#_ajax_linking_nonce").val()},function(a){b=a,e(a)},"json"),void(c=d.term))},focus:function(a,b){d.attr("aria-activedescendant","mce-wp-autocomplete-"+b.item.ID)},select:function(a,b){return d.val(b.item.permalink),e.wrap.hasClass("has-text-field")&&""===tinymce.trim(e.text.val())&&e.text.val(b.item.title),!1},open:function(){d.attr("aria-expanded","true")},close:function(){d.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2"}}).autocomplete("instance")._renderItem=function(b,c){return a('').append(''+c.title+' '+c.info+"").appendTo(b)},d.attr({"aria-owns":d.autocomplete("widget").attr("id")}).on("focus",function(){d.autocomplete("search")}).autocomplete("widget").addClass("wplink-autocomplete").attr("role","listbox")},correctURL:function(){var b=a.trim(e.url.val());b&&d!==b&&!/^(?:[a-z]+:|#|\?|\.|\/)/.test(b)&&(e.url.val("http://"+b),d=b)},open:function(b,d,f){var g,h=a(document.body);h.addClass("modal-open"),wpLink.range=null,b&&(window.wpActiveEditor=b),window.wpActiveEditor&&(this.textarea=a("#"+window.wpActiveEditor).get(0),"undefined"!=typeof tinymce&&(h.append(e.backdrop,e.wrap),g=tinymce.get(wpActiveEditor),c=g&&!g.isHidden()?g:null,c&&tinymce.isIE&&!c.windowManager.wplinkBookmark&&(c.windowManager.wplinkBookmark=c.selection.getBookmark())),!wpLink.isMCE()&&document.selection&&(this.textarea.focus(),this.range=document.selection.createRange()),e.wrap.show(),e.backdrop.show(),wpLink.refresh(d,f),a(document).trigger("wplink-open",e.wrap))},isMCE:function(){return c&&!c.isHidden()},refresh:function(a,b){var c="";wpLink.isMCE()?wpLink.mceRefresh(a,b):(e.wrap.hasClass("has-text-field")||e.wrap.addClass("has-text-field"),document.selection?c=document.selection.createRange().text||b||"":"undefined"!=typeof this.textarea.selectionStart&&this.textarea.selectionStart!==this.textarea.selectionEnd&&(b=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)||b||""),e.text.val(b),wpLink.setDefaultValues()),f?e.url.focus().blur():window.setTimeout(function(){e.url.focus()[0].select()},100),d=e.url.val().replace(/^http:\/\//,"")},hasSelectedText:function(a){var b,d,e,f=c.selection.getContent();if(/]+>[^<]+<\/a>$/.test(f)||-1===f.indexOf("href=")))return!1;if(a){if(d=a.childNodes,0===d.length)return!1;for(e=d.length-1;e>=0;e--)if(b=d[e],3!=b.nodeType&&!tinymce.dom.BookmarkManager.isBookmarkNode(b))return!1}return!0},mceRefresh:function(a,b){var d=c.dom.getParent(c.selection.getNode(),"a[href]"),f=this.hasSelectedText(d);d?(b=tinymce.trim(d.innerText||d.textContent)||b,a=a||c.dom.getAttrib(d,"href"),"_wp_link_placeholder"===a&&(a=""),e.url.val(a),e.openInNewTab.prop("checked","_blank"===c.dom.getAttrib(d,"target")),e.submit.val(wpLinkL10n.update)):(b=c.selection.getContent({format:"text"})||b,this.setDefaultValues()),f?(e.text.val(b||""),e.wrap.addClass("has-text-field")):(e.text.val(""),e.wrap.removeClass("has-text-field"))},close:function(){a(document.body).removeClass("modal-open"),wpLink.isMCE()?(c.plugins.wplink.hideEditToolbar(),c.focus()):(wpLink.textarea.focus(),wpLink.range&&(wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select())),e.backdrop.hide(),e.wrap.hide(),d=!1,a(document).trigger("wplink-close",e.wrap)},getAttrs:function(){return wpLink.correctURL(),{href:a.trim(e.url.val()),target:e.openInNewTab.prop("checked")?"_blank":""}},buildHtml:function(a){var b='"},update:function(){wpLink.isMCE()?wpLink.mceUpdate():wpLink.htmlUpdate()},htmlUpdate:function(){var a,b,c,d,f,g,h,i=wpLink.textarea;i&&(a=wpLink.getAttrs(),b=e.text.val(),a.href&&(c=wpLink.buildHtml(a),document.selection&&wpLink.range?(i.focus(),wpLink.range.text=c+(b||wpLink.range.text)+"",wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select(),wpLink.range=null):"undefined"!=typeof i.selectionStart&&(d=i.selectionStart,f=i.selectionEnd,h=b||i.value.substring(d,f),c=c+h+"",g=d+c.length,d!==f||h||(g-=4),i.value=i.value.substring(0,d)+c+i.value.substring(f,i.value.length),i.selectionStart=i.selectionEnd=g),wpLink.close(),i.focus()))},mceUpdate:function(){var a,d,f=wpLink.getAttrs();return c.focus(),tinymce.isIE&&(c.selection.moveToBookmark(c.windowManager.wplinkBookmark),c.windowManager.wplinkBookmark=null),f.href?(a=b(),e.wrap.hasClass("has-text-field")&&(d=e.text.val()||f.href),a?(d&&("innerText"in a?a.innerText=d:a.textContent=d),c.dom.setAttribs(a,f)):d?c.selection.setNode(c.dom.create("a",f,c.dom.encode(d))):c.execCommand("mceInsertLink",!1,f),wpLink.close(),void c.nodeChanged()):void c.execCommand("unlink")},setDefaultValues:function(){var a,b=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,d=/^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}[^ "]*$/i;this.isMCE()?a=c.selection.getContent():document.selection&&wpLink.range?a=wpLink.range.text:"undefined"!=typeof this.textarea.selectionStart&&(a=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)),a&&b.test(a)?e.url.val("mailto:"+a):a&&d.test(a)?e.url.val(a.replace(/&|?38;/gi,"&")):e.url.val(""),e.submit.val(wpLinkL10n.save)}},a(document).ready(wpLink.init)}(jQuery);
\ No newline at end of file
diff --git a/wp-includes/version.php b/wp-includes/version.php
index bcab58b2d2..400c3d53f5 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.5-beta1-36702';
+$wp_version = '4.5-beta1-36703';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
@@ -18,7 +18,7 @@ $wp_db_version = 36686;
*
* @global string $tinymce_version
*/
-$tinymce_version = '4304-20160219';
+$tinymce_version = '4304-20160224';
/**
* Holds the required PHP version