Advertisement
Guest User

Untitled

a guest
Aug 25th, 2014
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var last_element_id = 'my-widget-visual-editor-' + index_trash,
  2.     tinyMCEexecCommandAdd = 'mceAddControl';
  3.            
  4.                 if ( window.tinyMCE.majorVersion >= 4 ) {
  5.                     tinyMCEexecCommandAdd = 'mceAddEditor';
  6.                 }
  7.  
  8. window.tinyMCEPreInit.mceInit[ last_element_id ] = _.extend({}, tinyMCEPreInit.mceInit.content );
  9.  
  10.                         if ( _.isUndefined( tinyMCEPreInit.qtInit[ last_element_id ] ) ) {
  11.                             window.tinyMCEPreInit.qtInit[ last_element_id ] = _.extend( {}, tinyMCEPreInit.qtInit.replycontent, { id: last_element_id } );
  12.                         }
  13.                        
  14.                         QTags.instances[0] = false;
  15.                         quicktags( window.tinyMCEPreInit.qtInit[ last_element_id ] );
  16.                        
  17.                         window.switchEditors.go( last_element_id, 'tmce' );
  18.  
  19.                         window.tinyMCE.execCommand( tinyMCEexecCommandAdd, false, last_element_id );
  20.                        
  21.                         setTimeout( function() {
  22.                             var textarea = $( '#' + last_element_id );
  23.                             if ( textarea.is( ':visible' ) ) {
  24.                                 textarea.val( textarea_editor.val() );
  25.                             } else {
  26.                                 tinyMCE.activeEditor.setContent( textarea_editor.val() );
  27.                             }
  28.  
  29.                             $( '#iframe-text-editor-loading' ).fadeOut( 'fast' );
  30.                         }, 500 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement