Jump to content
Emily

Select All Option

Recommended Posts

You should implement a select all feature for snippets (code bb code). Just a simple click option next to code that highlights all in the selection.
[QUOTE]

[SIZE=2]Code: [URL="http://runelocus.com/forums/"]Select All[/URL][/SIZE]

[SIZE=1]public static void main(String args[]) {
System.out.println("Hello world");
}[/SIZE]


[/QUOTE]

You get the idea.


Surprised we don't have this, makes things so much easier :L

Share this post


Link to post
Share on other sites
I believe we did have this, I don't think its around anymore though.

[code] HELLO![/code]

Share this post


Link to post
Share on other sites
D: suggested this long time and even gave tut on how to implement it

Share this post


Link to post
Share on other sites
I think it died with the forum update.

Share this post


Link to post
Share on other sites
[quote name='Joe']D: suggested this long time and even gave tut on how to implement it[/QUOTE]

[quote name='Joe']
1- Open the headinclude template and add in the end :
[php]
<script type="text/javascript">
function selectCode(a)
{
var e = a.parentNode.parentNode.getElementsByTagName('p')[0];
if (window.getSelection)
{
var s = window.getSelection();
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
else
{
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
</script>
[/php]

2- Open the bbcode_code template and replace it with:
[php]
<div class="bbcode_container" >
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase code}: <a href="#" onclick="selectCode(this); return false;" style="font-size:11px">(Click Here to Select All)</a></div>
<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><p>{vb:raw code}</p></pre>
</div>
[/php]

3- Open the bbcode_html template and replace it with:
[php]
<div class="bbcode_container">
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase html_code}: <a href="#" onclick="selectCode(this); return false;" style="font-size:11px">(Click Here to Select All)</a></div>
<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:<vb:if condition="$blockheight<=$vboptions['codemaxlines']">{vb:math {vb:math {vb:raw blockheight}+2}}*{vb:stylevar mid_fontSize}}<vb:else />{vb:math {vb:math {vb:raw blockheight}+1}*{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><p>{vb:raw code}</p></pre>
</div>
[/php]
4- Open the bbcode_php template and replace it with:
[php]
<div class="bbcode_container">
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase php_code}: <a href="#" onclick="selectCode(this); return false;" style="font-size:11px">(Click Here to Select All)</a></div>
<div class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><code><p>{vb:raw code}</p></code></div>
</div>
[/php]
--------------------------------

* If you want to add button instead of text :-
Open the bbcode_code template and find :
[php]
<a href="#" onclick="selectCode(this); return false;" style="font-size:11px">(Click Here to Select All)</a>
[/php]
Then replace it with :
[php]
<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a>
[/php]
Do the same thing in bbcode_html and bbcode_php

Done !!!
[/QUOTE]

Dug, add it now =) Edited by Emily

Share this post


Link to post
Share on other sites
The forum updates took them off. Please bump this thread tomorrow or the day after tomorrow, unable to do it today due to busy saturdaynights (traveling, dj'ing, phone, etc.).

Share this post


Link to post
Share on other sites
[quote name='Ikiliki']The forum updates took them off. Please bump this thread tomorrow or the day after tomorrow, unable to do it today due to busy saturdaynights (traveling, dj'ing, phone, etc.).[/QUOTE]

They've been gone for a while. @[email protected]

Share this post


Link to post
Share on other sites
[QUOTE=Dodge';601224]They've been gone for a while. @[email protected][/QUOTE]

He is extremely busy with 3 parties tonight it can wait till tomoro :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×