Changeset 810


Ignore:
Timestamp:
04/10/07 21:35:44 (12 years ago)
Author:
ray
Message:

Ticket #1003 plugin CharCounter?: add config option for maxHTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/CharCounter/char-counter.js

    r677 r810  
    99  this._Words = 0; 
    1010  this._HTML = 0; 
    11   this.maxHTML = 1024; 
    1211  this.onKeyPress = this.__onKeyPress; 
    1312} 
     
    1817  'showWord': true, // show the words count, 
    1918  'showHtml': true, // show the exact html count 
    20   'separator': ' | ' // separator used to join informations 
     19  'separator': ' | ', // separator used to join informations 
     20  'maxHTML' : -1 // -1 for unlimited length, other number for limiting the length of the edited HTML 
    2121}; 
    2222 
    2323CharCounter._pluginInfo = { 
    2424  name          : "CharCounter", 
    25   version       : "1.3", 
     25  version       : "1.31", 
    2626  developer     : "Udo Schmal", 
    2727  developer_url : "http://www.schaffrath-neuemedien.de", 
     
    3737 
    3838 
    39 CharCounter.prototype.onGenerate = function() { 
     39CharCounter.prototype.onGenerateOnce = function() { 
    4040  var self = this; 
    4141  if (this.charCount==null) { 
     
    6666CharCounter.prototype.__onKeyPress= function(ev) { 
    6767  if ((ev.keyCode != 8) && (ev.keyCode !=46)) { // not backspace & delete 
    68     if (this.maxHTML!=-1) { 
     68    if (this.editor.config.CharCounter.maxHTML!=-1) { 
    6969      var contents = this.editor.getHTML(); 
    70       if (contents.length>=this.maxHTML) { 
     70      if (contents.length >= this.editor.config.CharCounter.maxHTML) { 
    7171        HTMLArea._stopEvent(ev); 
    7272        return true; 
Note: See TracChangeset for help on using the changeset viewer.