vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Show Thread Enhancements - One Touch Select ALL: CODE, PHP, HTMML (https://vborg.vbsupport.ru/showthread.php?t=172255)

ry215 03-05-2008 10:00 PM

One Touch Select ALL: CODE, PHP, HTMML
 
This is small hack used Script selectCode.

Install:
1. Open Temp: headinclude
Add below:
PHP Code:

<script type="text/javascript">
function 
selectCode(a)
{
   var 
a.parentNode.parentNode.getElementsByTagName('PRE')[0];
   if (
window.getSelection)
   {
      var 
window.getSelection();
       if (
s.setBaseAndExtent)
      {
         
s.setBaseAndExtent(e0ee.innerText.length 1);
      }
      else
      {
         var 
document.createRange();
         
r.selectNodeContents(e);
         
s.removeAllRanges();
         
s.addRange(r);
      }
   }
   else if (
document.getSelection)
   {
      var 
document.getSelection();
      var 
document.createRange();
      
r.selectNodeContents(e);
      
s.removeAllRanges();
      
s.addRange(r);
   }
   else if (
document.selection)
   {
      var 
document.body.createTextRange();
      
r.moveToElementText(e);
      
r.select();
   }
}
</
script


2. Open bbcode_code:
find:
PHP Code:

$vbphrase[code]: 

Add below:
PHP Code:

<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a

3. Open bbcode_html:
find:
PHP Code:

$vbphrase[html_code]: 

Add below:
PHP Code:

<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a

4. Open bbcode_php:
find:
PHP Code:

$vbphrase[php_code]: 

Add below:
PHP Code:

<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a

Next find:
PHP Code:

$code 

Replace with:
PHP Code:

<pre>$code</pre

That?s all. ;)

Hope u like! :D

codershark 03-06-2008 03:05 PM

Nice Job !

Feckie (Roger) 03-06-2008 04:34 PM

could this be done with select all and copy

ry215 03-06-2008 04:37 PM

Quote:

Originally Posted by Feckie (Roger) (Post 1458607)
could this be done with select all and copy

I will update soon. Thanks for use. :)

Syria BoY 03-06-2008 04:52 PM

Thanks :)

kaptanblack 03-06-2008 05:11 PM

Nice mod thanks ry215

I will test of this

codershark 03-06-2008 05:22 PM

will be very nice when you can "copy" integrate too.

SEOvB 03-07-2008 01:21 AM

Instead of having the javascript in the headinclude template, why not move it to SHOWTHREAD template if this is the only place this is being used.

having it on headinclude will make it load for every page, when its not neccassary

Extreme24 03-07-2008 02:09 AM

Quote:

Originally Posted by codershark (Post 1458639)
will be very nice when you can "copy" integrate too.

Wow... uhmm... Right Click -> Copy?

People seem lazy now adays...

codershark 03-07-2008 05:00 AM

Yes Right Click -> Copy :D

valdet 03-07-2008 04:40 PM

Quote:

Originally Posted by codershark (Post 1459061)
Yes Right Click -> Copy :D

CTRL+C is even better.. :D

codershark 03-07-2008 04:43 PM

yes I only need the CTRL+C but it will be nice when he can include it

Triky 03-12-2008 08:07 AM

I think I will install this one.
Thanks.

Gosef 03-26-2008 11:04 AM

Nice Job !
Thanks

Dev.Sun 05-21-2008 11:15 AM

thanks.

rskg4 06-22-2008 10:40 AM

Thanks for the code

There's one problem I found with this, it doesn't work with multiple code boxes in the same thread. Any idea how to fix that?

Boofo 06-22-2008 11:44 AM

This only works on IE right? You can do the same thing with one small js line wrapped around the pre tags.

rskg4 06-22-2008 11:51 AM

Quote:

Originally Posted by Boofo (Post 1555977)
This only works on IE right? You can do the same thing with one small js line wrapped around the pre tags.


I'm using the select all button in firefox.

I should rephrase my original post, as I did more testing. The code works for multiple code boxes in the same thread...but not for posts with more than 1 code box.

Boofo 06-22-2008 12:08 PM

That is where wrapping works, but only for IE so far.

ry215 08-07-2008 10:42 AM

I tested in FF and IE, it both worked. And, it also work with threads which have multiple code boxes :D

djrapid.com 10-04-2008 12:05 AM

This is great

IIAnDoII 02-28-2009 10:04 AM

Thanks and nice mod

ragtek 02-28-2009 10:27 AM

Is it also possible to copy the code to the clipboard?

The4um 03-03-2009 03:25 AM

works very well

dandanch 03-13-2009 04:44 AM

It doesn't work with multiple code boxes in the same thread.does any one have a fix for that ? :confused:

Pessimist 08-01-2009 10:42 AM

I would make so for PHP (this fixed spaces issue):
4. ...
Find:
PHP Code:

        <code style="white-space:nowrap">
                <!-- 
php buffer start -->$code<!-- php buffer end -->
        </
code

Replace with:
PHP Code:

        <pre style="margin: 0px;"><code style="white-space:nowrap"><!-- php buffer start -->$code<!-- php buffer end --></code></pre


itsheinz 09-24-2009 02:43 PM

great one im using it now:)

RedHacker 09-29-2009 10:32 PM

ry215 can create and one button with deselect all....?

ravenfaust 12-13-2009 04:03 PM

can you get this to work in 3.8 please?

RedHacker 12-15-2009 06:39 AM

Quote:

Originally Posted by ravenfaust (Post 1929988)
can you get this to work in 3.8 please?

It is work fine for 3.8.1 Version....

ravenfaust 12-26-2009 05:23 PM

working in 3.8.4 :D

ravenfaust 12-27-2009 05:42 PM

anyway to make this a text link instead of button?

RedHacker 01-10-2010 11:35 AM

Can update to the vBulletin 4....?

muratcan25 01-22-2010 01:59 PM

Thank you

snakedevil 06-03-2010 12:22 PM

Quote:

Originally Posted by RedHacker (Post 1951862)
Can update to the vBulletin 4....?

I need to :)

lubbie 09-01-2010 09:13 AM

If any is interested in PM me. i´ve got the update. Hope its ok for vborg and the coder. If not please tell me

almohd 03-05-2011 02:43 PM

this is very nice. can I add button to select and copy codes?

shadow12 06-28-2011 10:04 AM

very good thanks

dvdfanatic 07-11-2011 09:12 AM

thank you.

Modify, images use

Quote:

<input type="image" src="http://www.xyz..." value="Select All" width="160" height="55,5" board="0" />


All times are GMT. The time now is 07:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01301 seconds
  • Memory Usage 1,807KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete