You are not logged in.
Pages: 1
i have a rather old version of xinha in a project and i cand get it to spit the content from the editor:
some code i use:
<script type="text/javascript">
_editor_url = "../xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "ro"; // And the language we need to use in the editor.
_editor_skin = "silva"; // If you want use skin, add the name here
</script>
<script type="text/javascript" src="../xinha/XinhaCore.js"></script>
<script type="text/javascript" src="../xinha/XinhaConfig.js"></script>
the config.js file
inha_editors=null;
xinha_init=null;
xinha_config=null;
xinha_plugins=null;
xinha_init=xinha_init?xinha_init:function(){
xinha_editors=xinha_editors?xinha_editors:["content","anotherOne"];
xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","ListType","Stylist","Linker","SuperClean","TableOperations"];
if(!Xinha.loadPlugins(xinha_plugins,xinha_init)){
return;
}
xinha_config=xinha_config?xinha_config():new Xinha.Config();
xinha_config.pageStyleSheets=[_editor_url+"examples/full_example.css"];
xinha_config.toolbar =
[
["popupeditor","htmlmode"],
["separator","formatblock","fontsize","bold","italic","underline","strikethrough"],
["separator","forecolor","hilitecolor","textindicator"],
["separator","subscript","superscript"],
["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
["separator","undo","redo","selectall"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
["separator","killword","removeformat","toggleborders","lefttoright", "righttoleft","separator"]
];
xinha_editors=Xinha.makeEditors(xinha_editors,xinha_config,xinha_plugins);
Xinha.startEditors(xinha_editors);
};
Xinha._addEvent(window,"load",xinha_init);
and i want to retrieve the content with:
var editor = Xinha.getEditor("content");
var html = editor.getEditorContent();
The error:
Xinha.getEditor is not a function
any idea what am i doing wrong?
Offline
i have a rather old version of xinha
That will be the problem, as Xinha.getEditor() is a rather new function. You can instad use
var editor = xinha_editors["content"];
var html = editor.getEditorContent();
//if editor.getEditorContent() doesn't exist either, this will do
var html = editor.outwardHtml(editor.getHTML());
Offline
thanks, it worked with
var editor = xinha_editors["content"];
var html = editor.getEditorContent();
Offline
Pages: 1