From 6e72bc4ec568f1a1d9c402ca790a272085591fe4 Mon Sep 17 00:00:00 2001 From: Ella Iseulde Van Dorpe <*@iseulde.com> Date: Tue, 17 May 2016 18:49:30 +0000 Subject: [PATCH] TinyMCE: use new non-editable implementation Use TinyMCE's implementation of `contenteditable="false"` for views. First pass. See #36434. Built from https://develop.svn.wordpress.org/trunk@37446 git-svn-id: http://core.svn.wordpress.org/trunk@37414 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/mce-view.js | 89 +- wp-includes/js/mce-view.min.js | 2 +- .../js/tinymce/plugins/wpview/plugin.js | 852 +++--------------- .../js/tinymce/plugins/wpview/plugin.min.js | 2 +- .../js/tinymce/skins/wordpress/wp-content.css | 103 +-- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 168435 -> 166665 bytes wp-includes/version.php | 2 +- 7 files changed, 195 insertions(+), 855 deletions(-) diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index b532cb97a5..d2c29f7e88 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -327,9 +327,9 @@ this.replaceMarkers(); if ( content ) { - this.setContent( content, function( editor, node, contentNode ) { + this.setContent( content, function( editor, node ) { $( node ).data( 'rendered', true ); - this.bindNode.call( this, editor, node, contentNode ); + this.bindNode.call( this, editor, node ); }, force ? null : false ); } else { this.setLoader(); @@ -351,8 +351,8 @@ * Runs before their content is removed from the DOM. */ unbind: function() { - this.getNodes( function( editor, node, contentNode ) { - this.unbindNode.call( this, editor, node, contentNode ); + this.getNodes( function( editor, node ) { + this.unbindNode.call( this, editor, node ); $( node ).trigger( 'wp-mce-view-unbind' ); }, true ); }, @@ -394,7 +394,7 @@ return rendered ? data : ! data; } ) .each( function() { - callback.call( self, editor, this, $( this ).find( '.wpview-content' ).get( 0 ) ); + callback.call( self, editor, this ); } ); } ); }, @@ -421,8 +421,7 @@ */ replaceMarkers: function() { this.getMarkers( function( editor, node ) { - var selected = node === editor.selection.getNode(), - $viewNode; + var $viewNode; if ( ! this.loader && $( node ).text() !== this.text ) { editor.dom.setAttrib( node, 'data-wpview-marker', null ); @@ -430,20 +429,10 @@ } $viewNode = editor.$( - '
\u00a0
' + - '\u00a0
' + - '