mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@7944 201d5d3c-b55e-5fd7-737f-ddc643e51545
41 lines
1.5 KiB
JavaScript
41 lines
1.5 KiB
JavaScript
function editorStartTextarea(editor_sequence, content_key, primary_key) {
|
|
var obj = xGetElementById('editor_'+editor_sequence);
|
|
var use_html = xGetElementById('htm_'+editor_sequence).value;
|
|
obj.form.setAttribute('editor_sequence', editor_sequence);
|
|
|
|
obj.style.width = '99%';
|
|
|
|
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;
|
|
if(use_html) {
|
|
content = content.replace(/<br([^>]*)>/ig,"\n");
|
|
if(use_html!='br') {
|
|
content = content.replace(/</g, "<");
|
|
content = content.replace(/>/g, ">");
|
|
content = content.replace(/"/g, '"');
|
|
content = content.replace(/&/g, "&");
|
|
}
|
|
}
|
|
obj.value = content;
|
|
}
|
|
|
|
function editorGetContentTextarea(editor_sequence) {
|
|
var obj = xGetElementById('editor_'+editor_sequence);
|
|
var use_html = xGetElementById('htm_'+editor_sequence).value;
|
|
var content = obj.value.trim();
|
|
if(use_html) {
|
|
if(use_html!='br') {
|
|
content = content.replace(/&/g, "&");
|
|
content = content.replace(/</g, "<");
|
|
content = content.replace(/>/g, ">");
|
|
content = content.replace(/\"/g, """);
|
|
}
|
|
content = content.replace(/(\r\n|\n)/g, "<br />");
|
|
}
|
|
return content;
|
|
}
|
|
|