2013-12-03 2 views
1

Мне нужно обновить CKEditor 4.0 до 4.3. Все в порядке, за исключением того, что InlineCKeditor не хочет работать с кнопкой «Сохранить». Я получаю ошибку: "Uncaught TypeError: Object Esave has no method 'render' ". Esave переименован в плагин Save http://ckeditor.com/addon/save. Я попытался изменить этот плагин на новейший, переименовал его в esave и использовал его без переименования, но все равно получал такую ​​же ошибку. Что я должен изменить, чтобы снова нажать кнопку Сохранить?CKEditor 4.3 Inline Сохранить кнопку

Это код InlineCKeditor, где ошибка из:

<?php 
Yii::import('ext.widgets.inline.InlineEdit'); 
class InlineCKeditor extends InlineEdit 
{ 
    /** 
    * @var string path for CKeditor init script 
    */ 
    protected $tinyMceInitPath; 

    protected function loadCustomScript() 
    { 
     parent::loadCustomScript(); 
     $this->scriptLogics(); 
     Yii::app()->wysiwyg->getWysiwyg(); 
    }  
    protected function scriptLogics() 
    { 
     $script = "  
     CKEDITOR.config.extraPlugins = 'esave,doNothing';  
     // The 'instanceCreated' event is fired for every editor instance created. 
     CKEDITOR.on('instanceCreated', function(event) { 
      var editor = event.editor, 
       element = editor.element; 

      // Customize editors for headers and tag list. 
      // These editors don't need features like smileys, templates, iframes etc. 

      if ($.inArray('ckeditor',element.$.classList) >= 0) { 
       // Customize the editor configurations on 'configLoaded' event, 
       // which is fired after the configuration file loading and 
       // execution. This makes it possible to change the 
       // configurations before the editor initialization takes place.  
       editor.on('configLoaded', function() {  
        // Remove unnecessary plugins to make the editor simpler. 
        editor.config.removePlugins = 'colorbutton,find,font,' + 
         'forms,iframe,newpage,removeformat,scayt,flash,' + 
         'smiley,stylescombo,templates,wsc, pagebreak'; 

        // Rearrange the layout of the toolbar. 

        editor.config.toolbarGroups = [ 
         { name: 'editing',  groups: [ 'basicstyles', 'links' ] }, 
         { name: 'insert'}, 
         { name: 'undo' }, 
         '/', 
         { name: 'styles'}, 
         { name: 'indents',  groups: ['list', 'align','bidi']}, 
         { name : 'others', items : [ 'Esave' ] } 

        ]; 

       }); 
      }else{ 
       editor.on('configLoaded', function() { 

        editor.config.keystrokes = 
        [ 
         //deleted 
        ]; 

        editor.config.removePlugins = 'a11yhelp,about,basicstyles,bidi,blockquote,' + 
        'clipboard, colorbutton, colordialog,contextmenu,dialog,dialogui,div,elementspath,' + 
        'enterkey,entities,filebrowser,find,flash,floatpanel,font,format,' + 
        'forms,horizontalrule,htmlwriter,iframe,image,indent,justify,link,list,listblock,liststyle,magicline,' + 
        'maximize,menu,menubutton,newpage,panel,panelbutton,pastefromword,pastetext,popup,preview,print,' + 
        'removeformat,resize,richcombo,save,scayt,selectall,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,' + 
        'tab,table,tabletools,templates,wsc,wysiwygarea'; 

        editor.config.toolbarGroups = [{ name : 'others', items : [ 'Esave' ] }]; 
       }); 
      } 
     }); 
     ";  
     Yii::app()->clientScript->registerScript('editor_rules', $script, CClientScript::POS_BEGIN); 
    }  
    protected function getEditableClass() 
    { 
     return 'ckeditor edit_' . static::$innerIncrement; 
    } 
} 

ответ

0

Вы уверены, что это связано как-то с Yii?

О плагинах CKEditor - вы не можете просто переименовать его в config, поэтому проблема в основном здесь.

Смежные вопросы