1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-23 08:43:02 +02:00

[ticket/8228] Fix whitespaces before code in Firefox

Based on the "[code] enhancements" modification by TerraFrost

PHPBB3-8228
This commit is contained in:
Oliver Schramm
2013-07-24 12:41:40 +02:00
parent f0516b7d2a
commit 0dcf24acc1
5 changed files with 9 additions and 8 deletions

View File

@@ -12,8 +12,8 @@
<!-- BEGIN quote_open --><blockquote class="uncited"><div><!-- END quote_open -->
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close -->
<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><pre><!-- END code_open -->
<!-- BEGIN code_close --></pre></dd></dl><!-- END code_close -->
<!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close -->

View File

@@ -187,7 +187,7 @@ function displayBlocks(c, e, t) {
function selectCode(a) {
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
var e = a.parentNode.parentNode.getElementsByTagName('PRE')[0];
var s, r;
// Not IE and IE9+
@@ -205,7 +205,8 @@ function selectCode(a) {
}
r = document.createRange();
r.selectNodeContents(e);
r.setStart(e.firstChild, 0);
r.setEnd(e.lastChild, e.lastChild.textContent.length);
s.removeAllRanges();
s.addRange(r);
}