source: trunk/plugins/HtmlEntities/html-entities.js @ 743

Last change on this file since 743 was 743, checked in by ray, 12 years ago

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

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 1.7 KB
Line 
1/*------------------------------------------*\
2HtmlEntities for Xinha
3____________________
4
5Intended to faciliate the use of special characters with ISO 8 bit encodings.
6
7Using the conversion map provided by mharrisonline in ticket #127
8
9If you want to adjust the list, e.g. to except the characters that are available in the used charset,
10edit Entities.js.
11You may save it under a different name using the xinha_config.HtmlEntities.EntitiesFile variable
12
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
18\*------------------------------------------*/
19
20function HtmlEntities(editor) {
21        this.editor = editor;
22}
23
24HtmlEntities._pluginInfo = {
25  name          : "HtmlEntities",
26  version       : "1.0",
27  developer     : "Raimund Meyer",
28  developer_url : "http://rheinauf.de",
29  c_owner       : "Xinha community",
30  sponsor       : "",
31  sponsor_url   : "",
32  license       : "Creative Commons Attribution-ShareAlike License"
33}
34Xinha.Config.prototype.HtmlEntities =
35{
36        Encoding     : 'iso-8859-1',
37        EntitiesFile : _editor_url + "plugins/HtmlEntities/Entities.js"
38}
39HtmlEntities.prototype.onGenerate = function() {
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                }
49    }
50    Xinha._getback(url,callback);
51}
Note: See TracBrowser for help on using the repository browser.