TinyMCE: improve adding of custom UI to the MCE Factory.

Props iseulde.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40587


git-svn-id: http://core.svn.wordpress.org/trunk@40457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-05-09 01:40:46 +00:00
parent cc9d3cfbb3
commit ec622956c8
6 changed files with 8 additions and 22 deletions

View File

@ -682,7 +682,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
mceIframe = document.getElementById( editor.id + '_ifr' ),
mceToolbar,
mceStatusbar,
namesAdded,
wpStatusbar;
if ( container ) {
@ -700,7 +699,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
buttonGroup;
each( buttons, function( item ) {
var itemName, ui, name;
var itemName;
function bindSelectorChanged() {
var selection = editor.selection;
@ -768,19 +767,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
buttonGroup = null;
} else {
// Add the new WP* types to the factory
if ( ! namesAdded ) {
ui = tinymce.ui;
for ( name in ui ) {
if ( name.toLowerCase().indexOf( 'wp' ) === 0 ) {
Factory.add( name, ui[name] );
}
}
namesAdded = true;
}
if ( ! buttonGroup ) {
buttonGroup = {
type: 'buttongroup',

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
( function( tinymce ) {
tinymce.ui.WPLinkPreview = tinymce.ui.Control.extend( {
tinymce.ui.Factory.add( 'WPLinkPreview', tinymce.ui.Control.extend( {
url: '#',
renderHtml: function() {
return (
@ -50,9 +50,9 @@
tinymce.$( this.getEl().firstChild ).attr( 'href', this.url ).text( url );
}
}
} );
} ) );
tinymce.ui.WPLinkInput = tinymce.ui.Control.extend( {
tinymce.ui.Factory.add( 'WPLinkInput', tinymce.ui.Control.extend( {
renderHtml: function() {
return (
'<div id="' + this._id + '" class="wp-link-input">' +
@ -82,7 +82,7 @@
urlInput.value = '';
urlInput.nextSibling.value = '';
}
} );
} ) );
tinymce.PluginManager.add( 'wplink', function( editor ) {
var toolbar;

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40586';
$wp_version = '4.8-alpha-40587';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.