1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-09 19:26:53 +02:00

[ticket/8228] Fix still existing problems with code in firefox

A user of a board mentioned that there are still some problems
in firefox if php-highlighting is on. So I used a snippet which
they worked on for weeks. Link to the snippet (in german):
http://www.ongray-design.de/forum/viewtopic.php?t=541

PHPBB3-8228
This commit is contained in:
Oliver Schramm
2013-07-30 18:00:47 +02:00
parent 0dcf24acc1
commit 95c603d545
6 changed files with 13 additions and 14 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><pre><!-- END code_open --> <!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><code><!-- END code_open -->
<!-- BEGIN code_close --></pre></dd></dl><!-- END code_close --> <!-- BEGIN code_close --></code></div><!-- 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('PRE')[0]; var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
var s, r; var s, r;
// Not IE and IE9+ // Not IE and IE9+
@ -205,8 +205,7 @@ function selectCode(a) {
} }
r = document.createRange(); r = document.createRange();
r.setStart(e.firstChild, 0); r.selectNodeContents(e);
r.setEnd(e.lastChild, e.lastChild.textContent.length);
s.removeAllRanges(); s.removeAllRanges();
s.addRange(r); s.addRange(r);
} }

View File

@ -422,7 +422,7 @@
margin-left: 0; margin-left: 0;
} }
.rtl blockquote dl.codebox { .rtl blockquote .codebox {
margin-right: 0; margin-right: 0;
} }

View File

@ -470,16 +470,16 @@ blockquote blockquote blockquote {
} }
/* Code block */ /* Code block */
dl.codebox { .codebox {
background-color: #FFFFFF; background-color: #FFFFFF;
border-color: #C9D2D8; border-color: #C9D2D8;
} }
dl.codebox dt { .codebox p {
border-bottom-color: #CCCCCC; border-bottom-color: #CCCCCC;
} }
dl.codebox pre { .codebox code {
color: #2E8B57; color: #2E8B57;
} }

View File

@ -472,13 +472,13 @@ blockquote.uncited {
} }
/* Code block */ /* Code block */
dl.codebox { .codebox {
padding: 3px; padding: 3px;
border: 1px solid transparent; border: 1px solid transparent;
font-size: 1em; font-size: 1em;
} }
dl.codebox dt { .codebox p {
text-transform: uppercase; text-transform: uppercase;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
margin-bottom: 3px; margin-bottom: 3px;
@ -487,11 +487,11 @@ dl.codebox dt {
display: block; display: block;
} }
blockquote dl.codebox { blockquote .codebox {
margin-left: 0; margin-left: 0;
} }
dl.codebox pre { .codebox code {
/* Also see tweaks.css */ /* Also see tweaks.css */
overflow: auto; overflow: auto;
display: block; display: block;

View File

@ -136,4 +136,4 @@ div.spacer { clear: both; }
/* Accessibility tweaks: Mozilla.org */ /* Accessibility tweaks: Mozilla.org */
.skip_link { display: none; } .skip_link { display: none; }
dl.codebox dt { display: none; } .codebox p { display: none; }