Dotclear


Ignore:
Timestamp:
09/09/14 16:30:31 (11 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Each editor (ckeditor, legacy ones) loads its own context when it is active.
Add plugin_id parameter to transmit that context
Remove call of ckeditorExtraPlugins behavior until a good solution is found.
Closes #1983

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcLegacyEditor/js/_post_editor.js

    r2705 r2751  
    11$(function() { 
    22     if ($('#edit-entry').length==0) {return;} 
    3  
    4      // remove editor prefix 
    5      var getPostFormat = function getPostFormat(post_format) { 
    6           return post_format.replace(/[^:]*:/,''); 
    7      }; 
    8      var getPostEditor = function getPostEditor(post_format) { 
    9           return post_format.replace(/:.*/,''); 
    10      }; 
    113 
    124     // Get document format and prepare toolbars 
     
    146     var last_post_format = $(formatField).val(); 
    157     $(formatField).change(function() { 
    16           if (getPostEditor(this.value)!='dcLegacyEditor') { return;} 
     8          if (this.value!='dcLegacyEditor') { return;} 
    179 
    18           var post_format = getPostFormat(this.value); 
     10          var post_format = this.value; 
    1911 
    2012          // Confirm post format change 
     
    3729 
    3830     $('.format_control > *').addClass('hide'); 
    39      $('.format_control:not(.control_no_'+getPostFormat(last_post_format)+') > *').removeClass('hide'); 
     31     $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide'); 
    4032 
    4133     if ($('#comment_content').length>0) { 
     
    6153                    excerpt: excerpt_content, 
    6254                    content: post_content, 
    63                     format: getPostFormat($('#post_format').get(0).value), 
     55                    format: $('#post_format').get(0).value, 
    6456                    lang: $('#post_lang').get(0).value 
    6557               }; 
     
    111103 
    112104          // Load toolbars 
    113           contentTb.switchMode(getPostFormat(formatField.value)); 
    114           excerptTb.switchMode(getPostFormat(formatField.value)); 
     105          contentTb.switchMode(formatField.value); 
     106          excerptTb.switchMode(formatField.value); 
    115107 
    116108          // Check unsaved changes before XHTML conversion 
Note: See TracChangeset for help on using the changeset viewer.

Sites map