Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
"select all" feature for BB Code : CODE/HTML/PHP Details »»
"select all" feature for BB Code : CODE/HTML/PHP
Version: 1.00, by BCP Hung BCP Hung is offline
Developer Last Online: Jan 2019 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.x.x Rating:
Released: 06-09-2011 Last Update: Never Installs: 26
Template Edits
Code Changes Translations  
No support by the author.

About this modification :
This mods template allows you added to the BB Code CODE / HTML / PHP function selects all the content in it with a simple button.
Install :
  1. Insert javascript code into headinclude template
    AdminCP -> Styles & Templates -> Style Manager -> Edit Templates -> headinclude
    Copy and paste following js code to bottom of headinclude template :
    HTML Code:
    <script type="text/javascript">
        function selectAll(a)
        {
            var e  = a.parentNode.parentNode.getElementsByTagName('code')[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>
  2. Insert new code to bbcode template
    ... -> Edit Templates -> BB Code Layout Templates -> bbcode_code
    Find :
    Code:
    {vb:rawphrase code}:
    
    ...and...
    
    {vb:raw code}
    Change :
    Code:
    {vb:rawphrase code}:&nbsp;<input type="button" value="{vb:rawphrase select_code}" onclick="selectAll(this); return false;">
    
    ...and...
    
    <code>{vb:raw code}</code>
  3. Insert new code to bbcode_html template (same bbcode_code)
    ... -> Edit Templates -> BB Code Layout Templates -> bbcode_html
    Find :
    Code:
    {vb:rawphrase html_code}:
    
    ...and...
    
    {vb:raw code}
    Change :
    Code:
    {vb:rawphrase html_code}:&nbsp;<input type="button" value="{vb:rawphrase select_code}" onclick="selectAll(this); return false;">
    
    ...and...
    
    <code>{vb:raw code}</code>
  4. Insert new code to bbcode_php template (same bbcode_code)
    ... -> Edit Templates -> BB Code Layout Templates -> bbcode_php
    Find :
    Code:
    {vb:rawphrase php_code}:
    Change :
    Code:
    {vb:rawphrase php_code}:&nbsp;<input type="button" value="{vb:rawphrase select_code}" onclick="selectAll(this); return false;">
  5. (Optional) Add new phrase : If you don't want to do this step, please look at "Notes" !
    AdminCP -> Languages & Phrases -> Phrase Manager -> [Add New Phrase]
    • Phrase Type : GLOBAL
    • Product : vBulletin
    • Varname : select_code
    • Text : select all
Notes :
If you don't want to create new phrase (step 5), you can search for : {vb:rawphrase select_code} and replace with select all
Next version : add new feature "copy to clipboard".

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
bulwinkl, john7911, Muhammad Rahman, ramesh_umk3

Comments
  #2  
Old 06-10-2011, 11:07 AM
nitra1000's Avatar
nitra1000 nitra1000 is offline
 
Join Date: Dec 2009
Location: uk
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good job, tagged for later
Reply With Quote
  #3  
Old 06-10-2011, 03:26 PM
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Location: Vietnam
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

New update : fix bug : same phrase with CKEditor phrase in vBulletin 4.1.4.

Thank you,
Getamped 1404.
Reply With Quote
  #4  
Old 06-11-2011, 02:34 AM
nacaruncr nacaruncr is offline
 
Join Date: Nov 2010
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working fine in 4.1.3

Thanks men

tagged + installed + MOTM + 5 stars
Reply With Quote
  #5  
Old 06-11-2011, 03:04 AM
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Location: Vietnam
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nacaruncr View Post
working fine in 4.1.3

Thanks men

tagged + installed + MOTM + 5 stars
Thanks for feedback !

You will be like next version with "copy to clipboard" feature. But, some bugs with flash file must be fix !
Reply With Quote
  #6  
Old 06-12-2011, 12:13 AM
nacaruncr nacaruncr is offline
 
Join Date: Nov 2010
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I'll wait it .. thanks so much.
Reply With Quote
  #7  
Old 06-13-2011, 05:29 AM
Twikitero Twikitero is offline
 
Join Date: Aug 2010
Location: LONDON
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much, works perfectly 100%.
A major modification, pending the copy to clipboard very necessary for my forum

Thanks again

Marked as installed
Reply With Quote
  #8  
Old 06-13-2011, 06:40 AM
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Location: Vietnam
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Twikitero View Post
A major modification, pending the copy to clipboard very necessary for my forum
Yes, I know that. I'm having a lot of project, I will way back with this modification soon !

Thanks for used,
Getamped 1404.
Reply With Quote
  #9  
Old 07-03-2011, 04:42 PM
Twikitero Twikitero is offline
 
Join Date: Aug 2010
Location: LONDON
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you.

Just please do not forget the copy to clipboard.

I love your modifications.

regards
Reply With Quote
  #10  
Old 07-03-2011, 05:46 PM
BCP Hung BCP Hung is offline
 
Join Date: May 2011
Location: Vietnam
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Twikitero View Post
Thank you.

Just please do not forget the copy to clipboard.

I love your modifications.

regards
Sorry, I really busy now, my free time very poor.

I need more time to update.

Thanks,
Getamped 1404.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06020 seconds
  • Memory Usage 2,319KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete