Add Xinha editor
[booki.git] / site_media / xinha / plugins / HtmlEntities / HtmlEntities.js
blobf27b23752a9014c5fea09268e0847972341aba82
1 /*------------------------------------------*\
2 HtmlEntities for Xinha
3 ____________________
5 Intended to faciliate the use of special characters with ISO 8 bit encodings.
7 Using the conversion map provided by mharrisonline in ticket #127
9 If you want to adjust the list, e.g. to except the characters that are available in the used charset,
10 edit Entities.js.
11 You may save it under a different name using the xinha_config.HtmlEntities.EntitiesFile variable
13 ISO-8859-1 preset is default, set
15 xinha_config.HtmlEntities.Encoding = null;
17 if you want all special characters to be converted or want to load a custom file
18 \*------------------------------------------*/
20 function HtmlEntities(editor) {
21 this.editor = editor;
24 HtmlEntities._pluginInfo = {
25 name : "HtmlEntities",
26 version : "1.0",
27 developer : "Raimund Meyer",
28 developer_url : "http://x-webservice.net",
29 c_owner : "Xinha community",
30 sponsor : "",
31 sponsor_url : "",
32 license : "Creative Commons Attribution-ShareAlike License"
34 Xinha.Config.prototype.HtmlEntities =
36 Encoding : 'iso-8859-1',
37 EntitiesFile : Xinha.getPluginDir("HtmlEntities") + "/Entities.js"
39 HtmlEntities.prototype.onGenerate = function() {
40 var e = this.editor;
41 var url = (e.config.HtmlEntities.Encoding) ? Xinha.getPluginDir("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)
47 specialReplacements[i] = replacements[i];
50 Xinha._getback(url,callback);