aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-10-07 18:58:01 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-10-07 18:58:01 +0000
commit492130702094f548c2202fcf9c73f5e51031764a (patch)
tree18d243b88e5986d18370e6a39156033114afdf13 /phpBB
parentb379772198759c4b93da1544fe815e8d687eb642 (diff)
downloadforums-492130702094f548c2202fcf9c73f5e51031764a.tar
forums-492130702094f548c2202fcf9c73f5e51031764a.tar.gz
forums-492130702094f548c2202fcf9c73f5e51031764a.tar.bz2
forums-492130702094f548c2202fcf9c73f5e51031764a.tar.xz
forums-492130702094f548c2202fcf9c73f5e51031764a.zip
cross browser compatibility
git-svn-id: file:///svn/phpbb/trunk@4537 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/styles/subSilver/template/posting_topic_review.html40
1 files changed, 24 insertions, 16 deletions
diff --git a/phpBB/styles/subSilver/template/posting_topic_review.html b/phpBB/styles/subSilver/template/posting_topic_review.html
index ad361a2e98..5b4e38d0a6 100644
--- a/phpBB/styles/subSilver/template/posting_topic_review.html
+++ b/phpBB/styles/subSilver/template/posting_topic_review.html
@@ -7,41 +7,49 @@
<tr>
<td class="row1"><div style="overflow: auto; width: 100%; height: 300px; border: 1px;">
-<script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script>
-
<script language="JavaScript" type="text/javascript">
<!--
-var parent_form_name = 'post';
-var parent_text_name = 'message';
-
function insert_quote(text) {
- if (window.parent.document.forms[parent_form_name].elements[parent_text_name].createTextRange && window.parent.document.forms[parent_form_name].elements[parent_text_name].caretPos)
+ if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos)
{
- var caretPos = window.parent.document.forms[parent_form_name].elements[parent_text_name].caretPos;
+ var caretPos = document.forms[form_name].elements[text_name].caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
- window.parent.document.forms[parent_form_name].elements[parent_text_name].focus();
+ document.forms[form_name].elements[text_name].focus();
} else {
- window.parent.document.forms[parent_form_name].elements[parent_text_name].value += text;
- window.parent.document.forms[parent_form_name].elements[parent_text_name].focus();
+ document.forms[form_name].elements[text_name].value += text;
+ document.forms[form_name].elements[text_name].focus();
}
}
function addquote(post_id, username) {
- var text_name = 'message_' + post_id;
-
+ var message_name = 'message_' + post_id;
+ var theSelection = '';
+
+ // Get text selection - not only the post content :(
if ((clientVer >= 4) && is_ie && is_win)
{
- theSelection = document.selection.createRange().text; // Get text selection - does not consider the div only!
+ theSelection = document.selection.createRange().text;
+ }
+ else if (window.getSelection)
+ {
+ theSelection = window.getSelection();
}
- if (!theSelection)
+ if (theSelection == '')
{
- eval("theSelection = document.all." + text_name + ".innerText;");
+ if (document.all)
+ {
+ eval("theSelection = document.all." + message_name + ".innerText;");
+ }
+ else
+ {
+ eval("theSelection = document.getElementById('" + message_name + "').firstChild.nodeValue;");
+ }
}
- if (theSelection)
+ if (theSelection != '')
{
insert_quote('[quote="' + username + '"]' + theSelection + '[/quote]');
}