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/dcCKEditor/_post_config.php

    r2738 r2751  
    3131               } 
    3232          } 
    33            
     33 
    3434          return url; 
    3535     }; 
    3636 
    37      /* Retrieve editor name from URL */ 
    38      $.getEditorName = function getEditorName(url) { 
    39           return url.replace(/.*editor=([^&]*)(&.*)?/,'$1'); 
     37     /* Retrieve editor from popup */ 
     38    $.active_editor = null; 
     39     $.getEditorName = function getEditorName() { 
     40          return $.active_editor; 
    4041     } 
    4142})(jQuery); 
     
    4950     CKEDITOR.config.skin = 'dotclear,'+dotclear.dcckeditor_plugin_url+'/js/ckeditor-skins/dotclear/'; 
    5051 
    51 <?php if (!empty($dcckeditor_cancollapse_button)):?>     
     52<?php if (!empty($dcckeditor_cancollapse_button)):?> 
    5253     CKEDITOR.config.toolbarCanCollapse = true; 
    5354<?php endif;?> 
    54       
    55      CKEDITOR.plugins.addExternal('entrylink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/entrylink/');    
     55 
     56     CKEDITOR.plugins.addExternal('entrylink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/entrylink/'); 
    5657     CKEDITOR.plugins.addExternal('dclink',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/dclink/'); 
    5758     CKEDITOR.plugins.addExternal('media',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/media/'); 
     
    7576          extraPlugins: '<?php echo $defautExtraPlugins;?>', 
    7677 
    77           <?php if (!empty($dcckeditor_format_select)):?>                   
     78          <?php if (!empty($dcckeditor_format_select)):?> 
    7879          // format tags 
    7980          format_tags: 'p;h1;h2;h3;h4;h5;h6;pre;address', 
     
    102103<?php endif;?> 
    103104                         'Bold','Italic','Underline','Strike','Subscript','Superscript','Code','Blockquote', 
    104                           
     105 
    105106<?php if (!empty($dcckeditor_list_buttons)):?> 
    106107                         'NumberedList', 'BulletedList', 
     
    135136                ,'TextColor' 
    136137<?php endif;?> 
    137                     ]  
     138                    ] 
    138139               }, 
    139140               <?php // add extra buttons comming from dotclear plugins 
     
    156157               $('#cke_post_excerpt').addClass('hide'); 
    157158          } 
    158            
     159 
    159160          $('#excerpt-area label').click(function() { 
    160161               $('#cke_post_excerpt').toggleClass('hide',$('#post_excerpt').hasClass('hide')); 
    161162          }); 
    162163     }); 
     164 
     165     // @TODO: find a better way to retrieve active editor 
     166     for (var id in CKEDITOR.instances) { 
     167          CKEDITOR.instances[id].on('focus', function(e) { 
     168               $.active_editor = e.editor.name; 
     169          }); 
     170     } 
    163171}); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map