diff --git a/scripts/elcode.js b/scripts/elcode.js index d8f704b3..f57cfa77 100755 --- a/scripts/elcode.js +++ b/scripts/elcode.js @@ -11,11 +11,11 @@ function getSelection(text) return ""; } -function replaceSelection(text, newSelection, cursorPos) +function replaceSelection(doc, text, newSelection, cursorPos) { if (browser == 'MSIE') { text.focus(); - sel = document.selection; + sel = doc.selection; rng = sel.createRange(); rng.colapse; is_sel = rng.text.length > 0; @@ -40,7 +40,7 @@ function replaceSelection(text, newSelection, cursorPos) text.selectionEnd = text.selectionStart; } } else - text += newSelection; + text.value += newSelection; } function elcode(text, tag, value) @@ -70,16 +70,16 @@ function elcode1(text, tag, value, selection) pos = tag.length + 2; else pos = tag.length + value.length + 3; - replaceSelection(text, str, pos); + replaceSelection(document, text, str, pos); text.focus(); } -function elcode2(text, tag, value) +function elcode2(doc, text, tag, value) { str = '['+tag+']' + value + '[/'+tag+']'; pos = str.length; - replaceSelection(text, str, pos); + replaceSelection(doc, text, str, pos); text.focus(); } diff --git a/src/elogd.c b/src/elogd.c index d6b67ef0..2408d87b 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -22116,7 +22116,7 @@ void show_uploader_finished(LOGBOOK * lbs) rsprintf(" function update()\n"); rsprintf(" {\n"); rsprintf(" i = opener.document.form1.next_attachment.value;\n"); - rsprintf(" elcode2(opener.document.form1.Text, 'IMG', 'elog:/'+i);\n"); + rsprintf(" elcode2(opener.document, opener.document.form1.Text, 'IMG', 'elog:/'+i);\n"); rsprintf(" opener.document.form1.inlineatt.value = '%s';\n", att); rsprintf(" opener.document.form1.jcmd.value = 'Upload';\n"); rsprintf(" opener.document.form1.submit();\n");