mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed inline image insertion in Internet Explorer
SVN revision: 1701
This commit is contained in:
parent
5747ba18fe
commit
bd8cd32e80
@ -11,11 +11,11 @@ function getSelection(text)
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceSelection(text, newSelection, cursorPos)
|
function replaceSelection(doc, text, newSelection, cursorPos)
|
||||||
{
|
{
|
||||||
if (browser == 'MSIE') {
|
if (browser == 'MSIE') {
|
||||||
text.focus();
|
text.focus();
|
||||||
sel = document.selection;
|
sel = doc.selection;
|
||||||
rng = sel.createRange();
|
rng = sel.createRange();
|
||||||
rng.colapse;
|
rng.colapse;
|
||||||
is_sel = rng.text.length > 0;
|
is_sel = rng.text.length > 0;
|
||||||
@ -40,7 +40,7 @@ function replaceSelection(text, newSelection, cursorPos)
|
|||||||
text.selectionEnd = text.selectionStart;
|
text.selectionEnd = text.selectionStart;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
text += newSelection;
|
text.value += newSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
function elcode(text, tag, value)
|
function elcode(text, tag, value)
|
||||||
@ -70,16 +70,16 @@ function elcode1(text, tag, value, selection)
|
|||||||
pos = tag.length + 2;
|
pos = tag.length + 2;
|
||||||
else
|
else
|
||||||
pos = tag.length + value.length + 3;
|
pos = tag.length + value.length + 3;
|
||||||
replaceSelection(text, str, pos);
|
replaceSelection(document, text, str, pos);
|
||||||
text.focus();
|
text.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function elcode2(text, tag, value)
|
function elcode2(doc, text, tag, value)
|
||||||
{
|
{
|
||||||
str = '['+tag+']' + value + '[/'+tag+']';
|
str = '['+tag+']' + value + '[/'+tag+']';
|
||||||
|
|
||||||
pos = str.length;
|
pos = str.length;
|
||||||
replaceSelection(text, str, pos);
|
replaceSelection(doc, text, str, pos);
|
||||||
text.focus();
|
text.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22116,7 +22116,7 @@ void show_uploader_finished(LOGBOOK * lbs)
|
|||||||
rsprintf(" function update()\n");
|
rsprintf(" function update()\n");
|
||||||
rsprintf(" {\n");
|
rsprintf(" {\n");
|
||||||
rsprintf(" i = opener.document.form1.next_attachment.value;\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.inlineatt.value = '%s';\n", att);
|
||||||
rsprintf(" opener.document.form1.jcmd.value = 'Upload';\n");
|
rsprintf(" opener.document.form1.jcmd.value = 'Upload';\n");
|
||||||
rsprintf(" opener.document.form1.submit();\n");
|
rsprintf(" opener.document.form1.submit();\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user