Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[How-To] Disable double click on Reply buttons
cbiweb
Join Date: May 2004
Posts: 238

 

Nova Scotia, Canada
Show Printable Version Email this Page Subscription
cbiweb cbiweb is offline 02-09-2010, 10:00 PM

This article discusses code modifications made directly in the files, and will need to be done each time you upgrade vBulletin. If possible I will write a plugin when I get a chance, and this note and article will become irrelevant.


[How-To] Disable Double-Click On Reply Buttons

A lot of people agree that the new double-click functionality for the "Reply With Quote" and "+ Reply to Thread" buttons is not user friendly, and not a standard behavior for buttons on a web page. The biggest complaint is having to click twice to get to the regular Advanced editor.

It doesn't appear that the developers are going to change this soon, if ever, so until they do I went digging for a solution to bring back the familiar and very user friendly single-click action for these buttons.

Go to your clientscript folder, and open the vbulletin_quick_reply.js file. Look for this section of code:
Code:
function qr_init_buttons(obj)
{
    // intercept post button clicks to use inline form
    var anchors = fetch_tags(obj, 'a');
    for (var i = 0; i < anchors.length; i++)
    {
        // reply button
        if (anchors[i].id && (anchors[i].id.substr(0, 3) == 'qr_' || anchors[i].id.substr(0, 5) == 'qrwq_'))
        {
            YAHOO.util.Event.on(anchors[i], "click", qr_newreply_activate, this);
            //anchors[i].onclick = function(e) { return qr_newreply_activate(this.id.substr(3), false); };
        }
    }

    // set the "+Reply to Thread" buttons onlclick events
    var replytothreadids = ["newreplylink_top", "newreplylink_bottom"];
    YAHOO.util.Event.on(replytothreadids, "click", qr_replytothread_activate, this);
    //YAHOO.util.Event.on(replytothreadids, "dblclick", function(e) { window.location = this.href; }, this);
}
In that section, comment out two of the lines as shown below. All you need to do is add the forward slashes that I've highlighted in red and blue:
Code:
function qr_init_buttons(obj)
{
    // intercept post button clicks to use inline form
    var anchors = fetch_tags(obj, 'a');
    for (var i = 0; i < anchors.length; i++)
    {
        // reply button
        if (anchors[i].id && (anchors[i].id.substr(0, 3) == 'qr_' || anchors[i].id.substr(0, 5) == 'qrwq_'))
        {
            //YAHOO.util.Event.on(anchors[i], "click", qr_newreply_activate, this);
            //anchors[i].onclick = function(e) { return qr_newreply_activate(this.id.substr(3), false); };
        }
    }

    // set the "+Reply to Thread" buttons onlclick events
    var replytothreadids = ["newreplylink_top", "newreplylink_bottom"];
    //YAHOO.util.Event.on(replytothreadids, "click", qr_replytothread_activate, this);
    //YAHOO.util.Event.on(replytothreadids, "dblclick", function(e) { window.location = this.href; }, this);
}
The red commented line reverts the "Reply With Quote" button back to a single click, and takes you directly to the regular Advanced editor with the quoted post included. Note: Commenting out this line will also disable the regular "Reply" button from opening Quick Reply.

The blue commented line reverts the "+ Reply to Thread" buttons back to single click, which takes you directly to the Advanced editor.

One more thing, Multi-quote behavior depends on which line(s) you comment out.


If you ever want to use the default double-click behavior for either button, simply remove the two forward slashes that you added. And remember, until I create the plugin/product, you will need to make this change each time you upgrade your forums.
Reply With Quote
  #12  
Old 02-23-2010, 02:15 AM
boatswife boatswife is offline
 
Join Date: Sep 2004
Location: Kingsland, GA
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cbiweb View Post
The code is there, but if you downloaded the compressed version of the file it looks slightly different. You need to search for these two strings:
Code:
YAHOO.util.Event.on(C[b],"click",qr_newreply_activate,this)
and
Code:
YAHOO.util.Event.on(A,"click",qr_replytothread_activate,this)
Comment them per my first post. Depending what result you want will determine which one(s) you comment out.

I only found out about the compressed version after I wrote the article, or I would've included it then.

I had the compressed version and found this code. I put the // in front of both strings and it didn't do anything. I then put a space before the // in each string and it now works.

I don't have a clue if that's the technical thing to do, but it's working for me.
Reply With Quote
  #13  
Old 02-23-2010, 01:14 PM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BizAdventure View Post
I am curious if you got this working on 4.0.2 - I cannot find that information in that file - I find similarities, but not what is above.

I can paste the code, but it's awfully long.
I just checked the compressed and non-compressed versions of vbulletin_quick_reply.js for 4.0.2, and the same code is still there. Are you sure you checked the correct file? I ask because I spent a few minutes looking for the code in the wrong file myself, lol. But yes, nothing's changed in 4.0.2.

Quote:
Originally Posted by boatswife View Post
I had the compressed version and found this code. I put the // in front of both strings and it didn't do anything. I then put a space before the // in each string and it now works.

I don't have a clue if that's the technical thing to do, but it's working for me.
It does makes sense, now that you bring it up. Never thought to mention that. Glad you figured it out.


Quote:
Originally Posted by Switch3130 View Post
After I made those changes I get errors on the thread page:

missing } in compound statement
[Break on this error] _tbody","hidden");vB_Editor[QR_EditorI...;return false}}var vB_QuickReply=true;
Did you ever get this sorted?
Reply With Quote
  #14  
Old 02-24-2010, 09:43 PM
as7apcool as7apcool is offline
 
Join Date: Feb 2009
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks 4 good work
Reply With Quote
  #15  
Old 02-25-2010, 02:51 AM
DocEldridge DocEldridge is offline
 
Join Date: Feb 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to change both the reply and reply with quote both to a single click?
Reply With Quote
  #16  
Old 02-26-2010, 08:35 AM
Cloughie Cloughie is offline
 
Join Date: Nov 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This worked for me, good job.

Why VB introduced the double click thing is beyond me - its totally non web standard and so confusing for people.
Reply With Quote
  #17  
Old 03-04-2010, 06:18 PM
Peter Caparelli Peter Caparelli is offline
 
Join Date: May 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cloughie, I couldn't agree with you more! Thank You cbiweb!!
Reply With Quote
  #18  
Old 03-05-2010, 11:47 PM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're all very welcome. Glad to help.
Reply With Quote
  #19  
Old 03-06-2010, 08:31 AM
archet1337's Avatar
archet1337 archet1337 is offline
 
Join Date: Sep 2009
Location: Norway
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't even have "YAHOO" in vbulletin_quick_reply.js .. where can I get a file that let me apply this mod?
Reply With Quote
  #20  
Old 03-06-2010, 10:39 AM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're running 4.0.1 or 4.0.2, it is most definitely there. I can't be sure about any of the betas, the RC's or 4.0.0, since I only figured it out in 4.0.1.
Reply With Quote
  #21  
Old 03-06-2010, 10:53 AM
archet1337's Avatar
archet1337 archet1337 is offline
 
Join Date: Sep 2009
Location: Norway
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vbulletin_quick_reply.js says "vBulletin 4.0.2 Patch Level 1"

Am i allowed to post the file here so you can take a look?
Reply With Quote
Reply


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 02:14 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.04998 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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