Skip to content

Commit

Permalink
Merge pull request #234 from WordPress/try/tinymce-single/contentedit…
Browse files Browse the repository at this point in the history
…able-false

Use TinyMCE nightly for contenteditable false fixes
  • Loading branch information
ellatrix authored Mar 10, 2017
2 parents f9fce4d + ec1e651 commit 233adef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions shared/tinymce/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
( function( tinymce ) {
tinymce.ui.svgbutton = tinymce.ui.Button.extend( {
tinymce.ui.Factory.add( 'svgbutton', tinymce.ui.Button.extend( {
renderHtml: function() {
var id = this._id;
var prefix = this.classPrefix;
Expand Down Expand Up @@ -53,7 +53,7 @@
active: function( isActive ) {
this.$( this.getEl() ).toggleClass( 'is-active', isActive );
}
} );
} ) );

tinymce.PluginManager.add( 'toolbar', function( editor ) {
var each = tinymce.each;
Expand Down
8 changes: 4 additions & 4 deletions shared/tinymce/wplink.js
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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">' +
Expand Down Expand Up @@ -82,7 +82,7 @@
urlInput.value = '';
urlInput.nextSibling.value = '';
}
} );
} ) );

tinymce.PluginManager.add( 'wplink', function( editor ) {
var toolbar;
Expand Down
2 changes: 1 addition & 1 deletion tinymce-single/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2>NASA discovers system of seven Earth-sized planets</h2>

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.5.5/tinymce.min.js"></script>
<script src="https://fiddle.azurewebsites.net/tinymce/nightly/tinymce.min.js"></script>

<script src="blocks.js"></script>
<script src="blocks/core/image/register.js"></script>
Expand Down
7 changes: 4 additions & 3 deletions tinymce-single/tinymce/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@
function createInsertToolbar() {
var insert = editor.wp._createToolbar( [ 'add' ] );

insert.$el.addClass( 'block-toolbar insert-toolbar' );
insert.$el.addClass( 'block-toolbar' );
insert.$el.addClass( 'insert-toolbar' );

insert.reposition = function ( settings ) {
settings = settings || {};
Expand Down Expand Up @@ -242,13 +243,13 @@
return insert;
}

window.tinymce.ui.WPInsertSeparator = tinymce.ui.Control.extend( {
tinymce.ui.Factory.add( 'WPInsertSeparator', tinymce.ui.Control.extend( {
renderHtml: function() {
return (
'<div id="' + this._id + '" class="insert-separator">' + this.settings.text + '</div>'
);
}
} );
} ) );

function createInsertMenu() {
var insertMenu = editor.wp._createToolbar( ( function() {
Expand Down

0 comments on commit 233adef

Please sign in to comment.