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


All times are GMT. The time now is 04:23 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.01160 seconds
  • Memory Usage 1,758KB
  • 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
  • (9)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete