Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles

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
  #32  
Old 08-12-2010, 06:11 AM
sross sross is offline
 
Join Date: Mar 2004
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is just unreal that vbull would put buttons on a webpage that require double click. I am just stupified. So does this hack work for 4.0.5?
Reply With Quote
  #33  
Old 09-01-2010, 10:19 PM
sross sross is offline
 
Join Date: Mar 2004
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok have been using this mod for a few days and reported to the dev my main issues. Main problem is that the mod has interfered with my postbit "reply" "quick reply" buttons. It has now turned these into reply with quote advanced. I want to reply and reply with quote in the postbit to use the quick reply box but am unsure how to force these buttons to do so. If anyone has an idea please let me know! Thanks
Reply With Quote
  #34  
Old 09-01-2010, 10:45 PM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I mentioned this in the initial post of the thread. I'm not sure how to fix that. The solution could very well be simple, but I just don't have time these days to sit down and check it out.
Reply With Quote
  #35  
Old 09-01-2010, 11:33 PM
sross sross is offline
 
Join Date: Mar 2004
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok,

i found this other option to disable double click

http://www.vbulletin.com/forum/showt...ack-to-vb3-way

it requires no js edits and worked beautifully. I'm not sure if anyone else knows about it so am posting it here for informational purposes. Thanks
Reply With Quote
  #36  
Old 09-23-2010, 03:23 PM
MichaelDance MichaelDance is offline
 
Join Date: Dec 2009
Location: Warwickshire, UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Confused i use 4.0.7 which code looks so different.
Reply With Quote
  #37  
Old 05-16-2011, 07:42 PM
NimhGreatOwl's Avatar
NimhGreatOwl NimhGreatOwl is offline
 
Join Date: May 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just set up vBulletin and this was confusing me badly. I've used vBulletin on other sites for years and thought I had something misconfigured. It seemed like half the time it would go to quick reply and half the time advanced. I don't understand how people would know that it was supposed to behave this way. At least there is a way to disable it.
Reply With Quote
  #38  
Old 05-13-2012, 09:34 AM
Daisyboo Daisyboo is offline
 
Join Date: Jul 2008
Location: Somerset UK
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sross View Post
ok,

i found this other option to disable double click

http://www.vbulletin.com/forum/showt...ack-to-vb3-way

it requires no js edits and worked beautifully. I'm not sure if anyone else knows about it so am posting it here for informational purposes. Thanks
Worked for me too
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:25 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.09752 seconds
  • Memory Usage 2,272KB
  • Queries Executed 22 (?)
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
  • (2)bbcode_code
  • (1)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
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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