textarea 에디터 스킨 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3553 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-21 09:20:41 +00:00
parent a2855cd75f
commit 805b50e5b5
7 changed files with 61 additions and 4 deletions

View file

@ -0,0 +1,22 @@
function editorStartTextarea(editor_sequence, content_key, primary_key) {
var obj = xGetElementById('editor_'+editor_sequence);
obj.form.setAttribute('editor_sequence', editor_sequence);
xWidth(obj,xWidth(obj.parentNode)-20);
editorRelKeys[editor_sequence] = new Array();
editorRelKeys[editor_sequence]["primary"] = obj.form[primary_key];
editorRelKeys[editor_sequence]["content"] = obj.form[content_key];
editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea;
var content = obj.form[content_key].value;
content = content.replace(/<br([^>]+)>/ig,"");
obj.value = content;
}
function editorGetContentTextarea(editor_sequence) {
var obj = xGetElementById('editor_'+editor_sequence);
var content = obj.value.trim();
content = content.replace(/(\r\n|\n)/g, "<br />$1");
return content;
}