Changeset 508 for trunk/plugins


Ignore:
Timestamp:
05/01/06 05:00:03 (13 years ago)
Author:
gogo
Message:

Slight addition to the ew filter specification format to allow
specifiying the filterFunction directly in the config rather than
having to load another javascript file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/SuperClean/super-clean.js

    r507 r508  
    102102 
    103103  //avaliable filters (these are built-in filters) 
     104  // You can either use 
     105  //    'filter_name' : "Label/Description String" 
     106  // or 'filter_name' : {label: "Label", checked: true/false, filterFunction: function(html) { ... return html;} } 
     107  // filterFunction in the second format above is optional. 
     108   
    104109  'filters': { 'tidy': HTMLArea._lc('General tidy up and correction of some problems.', 'SuperClean'), 
    105110               'word_clean': HTMLArea._lc('Clean bad HTML from Microsoft Word', 'SuperClean'), 
     
    188193  //load the filter-functions 
    189194  for(var filter in this.editor.config.SuperClean.filters) 
    190   { 
     195  {     
    191196    if(!SuperClean.filterFunctions[filter]) 
    192197    { 
    193       HTMLArea._getback(_editor_url + 'plugins/SuperClean/filters/'+filter+'.js', 
     198      var filtDetail = this.editor.config.SuperClean.filters[filter]; 
     199      if(typeof filtDetail.filterFunction != 'undefined') 
     200      { 
     201        SuperClean.filterFunctions[filter] = filterFunction; 
     202      } 
     203      else 
     204      { 
     205        HTMLArea._getback(_editor_url + 'plugins/SuperClean/filters/'+filter+'.js', 
    194206                      function(func) { 
    195207                        eval('SuperClean.filterFunctions.'+filter+'='+func+';'); 
    196208                        sc.onGenerate(); 
    197209                      }); 
     210      } 
    198211      return; 
    199212    } 
Note: See TracChangeset for help on using the changeset viewer.