diff --git a/wp-includes/js/tinymce/plugins/wpview/plugin.js b/wp-includes/js/tinymce/plugins/wpview/plugin.js
index 30179ad777..48d6a6c205 100644
--- a/wp-includes/js/tinymce/plugins/wpview/plugin.js
+++ b/wp-includes/js/tinymce/plugins/wpview/plugin.js
@@ -119,8 +119,6 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
dom.bind( clipboard, 'beforedeactivate focusin focusout', _stop );
dom.bind( selected, 'beforedeactivate focusin focusout', _stop );
- tinymce.DOM.addClass( editor.getContainer(), 'wpview-selected' );
-
// Make sure that the editor is focused.
// It is possible that the editor is not focused when the mouse event fires
// without focus, the selection will not work properly.
@@ -508,7 +506,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
} else {
setViewCursor( true, view );
}
-
+
} else if ( keyCode === VK.RIGHT ) {
setViewCursor( false, view );
} else if ( keyCode === VK.DOWN ) {
@@ -564,7 +562,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
editor.on( 'focus', function() {
var view;
-
+
focus = true;
editor.dom.addClass( editor.getBody(), 'has-focus' );
@@ -597,10 +595,6 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
dom.removeClass( views, 'wpview-selection-after' );
dom.removeClass( views, 'wpview-cursor-hide' );
- if ( ! selected ) {
- tinymce.DOM.removeClass( editor.getContainer(), 'wpview-selected' );
- }
-
if ( focus ) {
if ( view ) {
if ( className === 'wpview-selection-before' || className === 'wpview-selection-after' && editor.selection.isCollapsed() ) {
@@ -608,8 +602,6 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
deselect();
- tinymce.DOM.addClass( editor.getContainer(), 'wpview-selected' );
-
// Make sure the cursor arrived in the right node.
// This is necessary for Firefox.
if ( lKDN === view.previousSibling ) {
diff --git a/wp-includes/js/tinymce/plugins/wpview/plugin.min.js b/wp-includes/js/tinymce/plugins/wpview/plugin.min.js
index 24fdaf7b0e..e06870a6c5 100644
--- a/wp-includes/js/tinymce/plugins/wpview/plugin.min.js
+++ b/wp-includes/js/tinymce/plugins/wpview/plugin.min.js
@@ -1 +1 @@
-tinymce.PluginManager.add("wpview",function(a){function b(a){for(;a&&a.parentNode;){if(a.className&&-1!==(" "+a.className+" ").indexOf(" wpview-wrap "))return a;a=a.parentNode}return!1}function c(c){return(c=b(c))?window.decodeURIComponent(a.dom.getAttrib(c,"data-wpview-text")||""):""}function d(c,d){return c=b(c),c?(a.dom.setAttrib(c,"data-wpview-text",window.encodeURIComponent(d||"")),!0):!1}function e(a){a.stopPropagation()}function f(b,c){var d=b?"before":"after",e=b?0:1;i(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function g(b,c){var d,e=a.dom;!c&&b.nextSibling&&e.isEmpty(b.nextSibling)&&"P"===b.nextSibling.nodeName?d=b.nextSibling:c&&b.previousSibling&&e.isEmpty(b.previousSibling)&&"P"===b.previousSibling.nodeName?d=b.previousSibling:(d=e.create("p"),p.ie&&p.ie<11||(d.innerHTML='
'),c?b.parentNode.insertBefore(d,b):e.insertAfter(d,b)),i(),a.getBody().focus(),a.selection.setCursorLocation(d,0),a.nodeChanged()}function h(b){var d,f=a.dom;b!==k&&(i(),k=b,f.setAttrib(b,"data-mce-selected",1),d=f.create("div",{"class":"wpview-clipboard",contenteditable:"true"},c(b)),a.dom.select(".wpview-body",b)[0].appendChild(d),f.bind(d,"beforedeactivate focusin focusout",e),f.bind(k,"beforedeactivate focusin focusout",e),tinymce.DOM.addClass(a.getContainer(),"wpview-selected"),a.getBody().focus(),a.selection.select(d,!0),a.nodeChanged())}function i(){var b,c=a.dom;k&&(b=a.dom.select(".wpview-clipboard",k)[0],c.unbind(b),c.remove(b),c.unbind(k,"beforedeactivate focusin focusout click mouseup",e),c.setAttrib(k,"data-mce-selected",null)),k=null}function j(a){return a.replace(/
"+window.decodeURIComponent(b)+"
":""}))}),a.on("keydown",function(c){if(!(c.metaKey||c.ctrlKey||n>=112&&123>=n||k)){var d,e,i,j,l,n=c.keyCode,o=a.dom,p=a.selection,r=p.getNode(),s=b(r);m=r,p.isCollapsed()||(i=p.getRng(),(s=b(i.endContainer))?(j=i.cloneRange(),p.select(s.previousSibling,!0),p.collapse(),l=p.getRng(),j.setEnd(l.endContainer,l.endOffset),p.setRng(j)):(s=b(i.startContainer))&&(j=i.cloneRange(),j.setStart(s.nextSibling,0),p.setRng(j))),s&&((d=o.hasClass(s,"wpview-selection-before"))||(e=o.hasClass(s,"wpview-selection-after")))&&(e&&n===q.UP||d&&n===q.BACKSPACE?(s.previousSibling?b(s.previousSibling)?f(!1,s.previousSibling):o.isEmpty(s.previousSibling)&&n===q.BACKSPACE?o.remove(s.previousSibling):(p.select(s.previousSibling,!0),p.collapse()):f(!0,s),c.preventDefault()):!e||n!==q.DOWN&&n!==q.RIGHT?!d||n!==q.UP&&n!==q.LEFT?d&&n===q.DOWN?(s.nextSibling?b(s.nextSibling)?f(!0,s.nextSibling):p.setCursorLocation(s.nextSibling,0):f(!1,s),c.preventDefault()):e&&n===q.LEFT||d&&n===q.RIGHT?(h(s),c.preventDefault(),c.stopImmediatePropagation()):e&&n===q.BACKSPACE?(o.remove(s),c.preventDefault()):e?g(s):d&&g(s,!0):(s.previousSibling&&(b(s.previousSibling)?f(n===q.UP,s.previousSibling):(p.select(s.previousSibling,!0),p.collapse())),c.preventDefault()):(s.nextSibling&&(b(s.nextSibling)?f(n===q.RIGHT,s.nextSibling):p.setCursorLocation(s.nextSibling,0)),c.preventDefault()),n===q.ENTER&&c.preventDefault())}}),a.on("keydown",function(c){var d,e=a.dom,h=c.keyCode,j=a.selection;if(k){if(c.metaKey||c.ctrlKey||h>=112&&123>=h)return void(!c.metaKey&&!c.ctrlKey||88!==h&&h!==q.BACKSPACE||(88===h?s=k:a.dom.remove(k)));if(d=b(j.getNode()),d!==k)return void i();h===q.LEFT?f(!0,d):h===q.UP?d.previousSibling?b(d.previousSibling)?f(!0,d.previousSibling):(i(),j.select(d.previousSibling,!0),j.collapse()):f(!0,d):h===q.RIGHT?f(!1,d):h===q.DOWN?d.nextSibling?b(d.nextSibling)?f(!1,d.nextSibling):(i(),j.setCursorLocation(d.nextSibling,0)):f(!1,d):h===q.ENTER?g(d):(h===q.DELETE||h===q.BACKSPACE)&&e.remove(k),c.preventDefault()}}),a.on("keydown",function(c){var d,e,g,h=a.selection;c.keyCode===q.BACKSPACE&&(d=h.getNode(),a.dom.isEmpty(d)?(g=b(d.previousSibling))&&(f(!1,g),a.dom.remove(d),c.preventDefault()):(e=h.getRng())&&0===e.startOffset&&0===e.endOffset&&(g=b(d.previousSibling))&&(f(!1,g),c.preventDefault()))}),a.on("keyup",function(){s&&(a.dom.remove(s),s=!1)}),a.on("focus",function(){var c;o=!0,a.dom.addClass(a.getBody(),"has-focus"),t&&(c=b(a.getBody().firstChild))&&f(!0,c),t=!1}),a.on("blur",function(){o=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("nodechange",function(c){var d=a.dom,e=a.dom.select(".wpview-wrap"),g=c.element.className,h=b(c.element),j=m;if(m=!1,clearInterval(l),d.removeClass(e,"wpview-selection-before"),d.removeClass(e,"wpview-selection-after"),d.removeClass(e,"wpview-cursor-hide"),k||tinymce.DOM.removeClass(a.getContainer(),"wpview-selected"),o)if(h)if("wpview-selection-before"===g||"wpview-selection-after"===g&&a.selection.isCollapsed()){if(n=0,i(),tinymce.DOM.addClass(a.getContainer(),"wpview-selected"),j===h.previousSibling)return void f(!0,h);if(j===h.nextSibling)return void f(!1,h);d.addClass(h,g),l=setInterval(function(){d.hasClass(h,"wpview-cursor-hide")?d.removeClass(h,"wpview-cursor-hide"):d.addClass(h,"wpview-cursor-hide")},500)}else"wpview-clipboard"===g||n||(i(),n++,f(!0,h));else i()}),a.on("resolvename",function(c){a.dom.hasClass(c.target,"wpview-wrap")?(c.name=a.dom.getAttrib(c.target,"data-wpview-type")||"wpview",c.stopPropagation()):b(c.target)&&(c.preventDefault(),c.stopPropagation())}),{getViewText:c,setViewText:d}}); \ No newline at end of file +tinymce.PluginManager.add("wpview",function(a){function b(a){for(;a&&a.parentNode;){if(a.className&&-1!==(" "+a.className+" ").indexOf(" wpview-wrap "))return a;a=a.parentNode}return!1}function c(c){return(c=b(c))?window.decodeURIComponent(a.dom.getAttrib(c,"data-wpview-text")||""):""}function d(c,d){return c=b(c),c?(a.dom.setAttrib(c,"data-wpview-text",window.encodeURIComponent(d||"")),!0):!1}function e(a){a.stopPropagation()}function f(b,c){var d=b?"before":"after",e=b?0:1;i(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function g(b,c){var d,e=a.dom;!c&&b.nextSibling&&e.isEmpty(b.nextSibling)&&"P"===b.nextSibling.nodeName?d=b.nextSibling:c&&b.previousSibling&&e.isEmpty(b.previousSibling)&&"P"===b.previousSibling.nodeName?d=b.previousSibling:(d=e.create("p"),p.ie&&p.ie<11||(d.innerHTML='"+window.decodeURIComponent(b)+"
":""}))}),a.on("keydown",function(c){if(!(c.metaKey||c.ctrlKey||n>=112&&123>=n||k)){var d,e,i,j,l,n=c.keyCode,o=a.dom,p=a.selection,r=p.getNode(),s=b(r);m=r,p.isCollapsed()||(i=p.getRng(),(s=b(i.endContainer))?(j=i.cloneRange(),p.select(s.previousSibling,!0),p.collapse(),l=p.getRng(),j.setEnd(l.endContainer,l.endOffset),p.setRng(j)):(s=b(i.startContainer))&&(j=i.cloneRange(),j.setStart(s.nextSibling,0),p.setRng(j))),s&&((d=o.hasClass(s,"wpview-selection-before"))||(e=o.hasClass(s,"wpview-selection-after")))&&(e&&n===q.UP||d&&n===q.BACKSPACE?(s.previousSibling?b(s.previousSibling)?f(!1,s.previousSibling):o.isEmpty(s.previousSibling)&&n===q.BACKSPACE?o.remove(s.previousSibling):(p.select(s.previousSibling,!0),p.collapse()):f(!0,s),c.preventDefault()):!e||n!==q.DOWN&&n!==q.RIGHT?!d||n!==q.UP&&n!==q.LEFT?d&&n===q.DOWN?(s.nextSibling?b(s.nextSibling)?f(!0,s.nextSibling):p.setCursorLocation(s.nextSibling,0):f(!1,s),c.preventDefault()):e&&n===q.LEFT||d&&n===q.RIGHT?(h(s),c.preventDefault(),c.stopImmediatePropagation()):e&&n===q.BACKSPACE?(o.remove(s),c.preventDefault()):e?g(s):d&&g(s,!0):(s.previousSibling&&(b(s.previousSibling)?f(n===q.UP,s.previousSibling):(p.select(s.previousSibling,!0),p.collapse())),c.preventDefault()):(s.nextSibling&&(b(s.nextSibling)?f(n===q.RIGHT,s.nextSibling):p.setCursorLocation(s.nextSibling,0)),c.preventDefault()),n===q.ENTER&&c.preventDefault())}}),a.on("keydown",function(c){var d,e=a.dom,h=c.keyCode,j=a.selection;if(k){if(c.metaKey||c.ctrlKey||h>=112&&123>=h)return void(!c.metaKey&&!c.ctrlKey||88!==h&&h!==q.BACKSPACE||(88===h?s=k:a.dom.remove(k)));if(d=b(j.getNode()),d!==k)return void i();h===q.LEFT?f(!0,d):h===q.UP?d.previousSibling?b(d.previousSibling)?f(!0,d.previousSibling):(i(),j.select(d.previousSibling,!0),j.collapse()):f(!0,d):h===q.RIGHT?f(!1,d):h===q.DOWN?d.nextSibling?b(d.nextSibling)?f(!1,d.nextSibling):(i(),j.setCursorLocation(d.nextSibling,0)):f(!1,d):h===q.ENTER?g(d):(h===q.DELETE||h===q.BACKSPACE)&&e.remove(k),c.preventDefault()}}),a.on("keydown",function(c){var d,e,g,h=a.selection;c.keyCode===q.BACKSPACE&&(d=h.getNode(),a.dom.isEmpty(d)?(g=b(d.previousSibling))&&(f(!1,g),a.dom.remove(d),c.preventDefault()):(e=h.getRng())&&0===e.startOffset&&0===e.endOffset&&(g=b(d.previousSibling))&&(f(!1,g),c.preventDefault()))}),a.on("keyup",function(){s&&(a.dom.remove(s),s=!1)}),a.on("focus",function(){var c;o=!0,a.dom.addClass(a.getBody(),"has-focus"),t&&(c=b(a.getBody().firstChild))&&f(!0,c),t=!1}),a.on("blur",function(){o=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("nodechange",function(c){var d=a.dom,e=a.dom.select(".wpview-wrap"),g=c.element.className,h=b(c.element),j=m;if(m=!1,clearInterval(l),d.removeClass(e,"wpview-selection-before"),d.removeClass(e,"wpview-selection-after"),d.removeClass(e,"wpview-cursor-hide"),o)if(h)if("wpview-selection-before"===g||"wpview-selection-after"===g&&a.selection.isCollapsed()){if(n=0,i(),j===h.previousSibling)return void f(!0,h);if(j===h.nextSibling)return void f(!1,h);d.addClass(h,g),l=setInterval(function(){d.hasClass(h,"wpview-cursor-hide")?d.removeClass(h,"wpview-cursor-hide"):d.addClass(h,"wpview-cursor-hide")},500)}else"wpview-clipboard"===g||n||(i(),n++,f(!0,h));else i()}),a.on("resolvename",function(c){a.dom.hasClass(c.target,"wpview-wrap")?(c.name=a.dom.getAttrib(c.target,"data-wpview-type")||"wpview",c.stopPropagation()):b(c.target)&&(c.preventDefault(),c.stopPropagation())}),{getViewText:c,setViewText:d}}); \ 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 81f87897b7..c82f80ed9f 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ