1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-16 20:39:49 +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_open --><blockquote class="uncited"><div><!-- END quote_open -->
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close --> <!-- 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_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 --></code></dd></dl><!-- END code_close --> <!-- BEGIN code_close --></pre></dd></dl><!-- END code_close -->
<!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open --> <!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close --> <!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close -->

View File

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

View File

@ -479,7 +479,7 @@ dl.codebox dt {
border-bottom-color: #CCCCCC; border-bottom-color: #CCCCCC;
} }
dl.codebox code { dl.codebox pre {
color: #2E8B57; color: #2E8B57;
} }

View File

@ -491,7 +491,7 @@ blockquote dl.codebox {
margin-left: 0; margin-left: 0;
} }
dl.codebox code { dl.codebox pre {
/* Also see tweaks.css */ /* Also see tweaks.css */
overflow: auto; overflow: auto;
display: block; display: block;

View File

@ -21,11 +21,11 @@
<!-- END quote_close --> <!-- END quote_close -->
<!-- BEGIN code_open --> <!-- BEGIN code_open -->
<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><div class="codecontent"> <div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><pre class="codecontent">
<!-- END code_open --> <!-- END code_open -->
<!-- BEGIN code_close --> <!-- BEGIN code_close -->
</div> </pre>
<!-- END code_close --> <!-- END code_close -->
<!-- BEGIN inline_attachment_open --> <!-- BEGIN inline_attachment_open -->