Changeset 743


Ignore:
Timestamp:
02/16/07 12:41:21 (12 years ago)
Author:
ray
Message:

HtmlEntities? plugin set ISO-8859-1 preset as default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/HtmlEntities/html-entities.js

    r722 r743  
    1111You may save it under a different name using the xinha_config.HtmlEntities.EntitiesFile variable 
    1212 
    13 ISO-8859-1 preset is included, load it by 
    14  xinha_config.HtmlEntities.EntitiesFile = _editor_url + "plugins/HtmlEntities/iso-8859-1.js";  
     13ISO-8859-1 preset is default, set 
     14   
     15  xinha_config.HtmlEntities.Encoding = null; 
     16 
     17if you want all special characters to be converted or want to load a custom file  
    1518\*------------------------------------------*/ 
    1619 
     
    2932  license       : "Creative Commons Attribution-ShareAlike License" 
    3033} 
    31 HTMLArea.Config.prototype.HtmlEntities = 
     34Xinha.Config.prototype.HtmlEntities = 
    3235{ 
     36        Encoding     : 'iso-8859-1', 
    3337        EntitiesFile : _editor_url + "plugins/HtmlEntities/Entities.js" 
    3438} 
    3539HtmlEntities.prototype.onGenerate = function() { 
    36     eval("var e = "+ HTMLArea._geturlcontent(this.editor.config.HtmlEntities.EntitiesFile)); 
    37     var specialReplacements = this.editor.config.specialReplacements; 
    38     for (var i in e) 
    39     { 
    40         specialReplacements[i] = e[i];   
     40    var e = this.editor; 
     41    var url = (e.config.HtmlEntities.Encoding) ?  _editor_url + "plugins/HtmlEntities/"+e.config.HtmlEntities.Encoding+".js" : e.config.HtmlEntities.EntitiesFile; 
     42    var callback = function (getback) { 
     43        var specialReplacements = e.config.specialReplacements; 
     44        eval("var replacements =" + getback); 
     45        for (var i in  replacements) 
     46                { 
     47                        specialReplacements[i] =  replacements[i];       
     48                } 
    4149    } 
     50    Xinha._getback(url,callback); 
    4251} 
Note: See TracChangeset for help on using the changeset viewer.