Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2343

phpBB Custom Coding • Re: How to enable "Expand code" on 3.3.14 ?

$
0
0
Note: Moved to phpBB Custom Coding

OK, it's not that hard. Both of these files are in the /styles/prosilver/template/ directory.

OPEN: overall_footer.html

FIND:

Code:

<!-- IF S_PLUPLOAD --><!-- INCLUDE plupload.html --><!-- ENDIF -->
BEFORE, ADD:

Code:

<script type="text/javascript">function expandcollapse(a) {var ee = a.parentNode.parentNode.getElementsByTagName('code')[0];if (ee.style.maxHeight == '200px') {ee.style.maxHeight = '2000px';a.innerHTML = 'collapse';}else {ee.style.maxHeight = '200px';a.innerHTML = 'expand';};}</script>
OPEN: bbcode.html

FIND:

Code:

<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" >{L_SELECT_ALL_CODE}</a></p><pre><code><!-- END code_open -->
REPLACE WITH:

Code:

<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" >{L_SELECT_ALL_CODE}</a> | <a href="#" >Expand</a></p><pre><code><!-- END code_open -->
You could get more fancy and replace the hard-coded language with language vars, config vars for the maxHeight var, etc.

Statistics: Posted by Kailey — Thu Jan 09, 2025 2:49 am



Viewing all articles
Browse latest Browse all 2343

Trending Articles