hi guys
i have this problem
i have a textarea where i set with ajax the editor and my content.
in my editor i even added a personal button.
the problem is the following:
when i relize the event to reload with ajax the editor and the content i am able to get a new editor, but i cannot use the old configuration and the button i inserted is not visible anymore
can anybody help me?
in the meanwhile thank you !
this is the code loaded with ajax in a textarea
//CLEANING THE INSTANCE WHEN WITH AJAX I SET AGAIN MY DIV if(CKEDITOR.instances["m_sTesto"] != undefined) CKEDITOR.remove(CKEDITOR.instances['m_sTesto']); //FIRST TIME I LOAD THE PAGE => SO I SET MY NEW EDITOR WITH MY CONFIG if( !editorCK) { var editorCK = CKEDITOR.replace( 'm_sTesto'); } //FROM THE SECOND TIME => I SET NEW EDITOR WITH MY OLD CONFIG AND I ADD MY OLD BUTTON else { hInternalLinkButton = editorCK.ui._.items.internalLinkButton; //CKEDITOR.replace( 'm_sTesto', editorCK.config); editorCK = CKEDITOR.replace( 'm_sTesto', editorCK.config); editorCK.ui.addButton( 'internalLinkButton', hInternalLinkButton); } // Listen for the "pluginsLoaded" event, so we are sure that the // "dialog" plugin has been loaded and we are able to do our // customizations. editorCK.on( 'pluginsLoaded', function( ev ){ // If our custom dialog has not been registered, do that now. if ( !CKEDITOR.dialog.exists( 'internalLinkPanel' ) ) { // We need to do the following trick to find out the dialog // definition file URL path. In the real world, you would simply // point to an absolute path directly, like "/mydir/mydialog.js". //var href = document.location.href.split( '/' ); //href.pop(); //href.push( 'api_dialog', 'my_dialog.js' ); //href = href.join( '/' ); // Finally, register the dialog. CKEDITOR.dialog.add( 'internalLinkPanel', '../internalLinkPanel.js' ); } // Register the command used to open the dialog. editorCK.addCommand( 'internalLinkPanelCmd', new CKEDITOR.dialogCommand( 'internalLinkPanel' ) ); // ADDING MY NEW BUTTON editorCK.ui.addButton( 'internalLinkButton', { label: 'Collegamenti interni', command: 'internalLinkPanelCmd', //icon: 'http://gacela.labf.usb.ve/GacelaWiki/attach/Pic/playboy.png' icon: '/manager/_editor/ckeditor_core/images/download.gif' }); });
this is the config
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'en'; // config.uiColor = '#AADC6E'; //Gestione del pulsante 'Cerca sul server' config.filebrowserBrowseUrl = "/da_sviluppo/index.php?bLink='editor html'"; //config.filebrowserUploadUrl = '/da_sviluppo/index.php'; //config.filebrowserImageBrowseUrl = '/da_sviluppo/index.php'; /* config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash', config.filebrowserUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', config.filebrowserImageUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images', config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash' */ config.toolbar = [ ['Source','-','Templates'],['TextColor','BGColor'],['Maximize', 'ShowBlocks'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], '/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Anchor','internalLinkButton','Unlink'], ['Image','Table','HorizontalRule','SpecialChar','PageBreak'] ]; }
Re: how to reload old editor (again and again) with ajax calls?
any suggestions?
nothing?
i trust you