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

Location:
plugins/dcLegacyEditor/js
Files:
2 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 
  • plugins/dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js

    r2614 r2751  
    55jsToolBar.prototype.elements.link.open_url = 'popup_link.php'; 
    66 
    7 jsToolBar.prototype.elements.link.popup = function (args) { 
     7jsToolBar.prototype.elements.link.popup = function(args) { 
    88     window.the_toolbar = this; 
    99     args = args || ''; 
     
    155155     fn: {}, 
    156156     fncall: {}, 
    157      open_url: 'media.php?popup=1', 
     157     open_url: 'media.php?popup=1&plugin_id=dcLegacyEditor', 
    158158     data: {}, 
    159159     popup: function() { 
     
    355355     title: 'Link to an entry', 
    356356     fn: {}, 
    357      open_url: 'popup_posts.php', 
     357     open_url: 'popup_posts.php?plugin_id=dcLegacyEditor', 
    358358     data: {}, 
    359359     popup: function() { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map