[How-To] Disable double click on Reply buttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbiweb
    Senior Member
    • Apr 2004
    • 2658
    • 4.1.x

    [vB4] [How-To] Disable double click on Reply buttons

    I just posted this at vb.org and waiting for it to be approved. But here it is for those who don't go there, or won't, or don't know how (haha).




    ==============================================================
    This post 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
    post 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_'))
            {
                [FONT=Verdana][COLOR=Red][B]//[/B][/COLOR][/FONT]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"];
        [FONT=Verdana][COLOR=Blue][B]//[/B][/COLOR][/FONT]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.
    Last edited by cbiweb; Wed 10 Feb '10, 4:46pm. Reason: Corrected a mistake
    ~ Life isn't always fair, but you can be. ~
  • sross
    Senior Member
    • Mar 2004
    • 660

    #2
    Great stuff, thanks!

    Comment

    • punchbowl
      Senior Member
      • Nov 2006
      • 3903
      • 4.0.x

      #3
      VERY useful! In my tests, this is the very first thing that users notice and complain about.

      Comment

      • RobbieZ
        Senior Member
        • Jun 2008
        • 137

        #4
        This does not work anymore, due to the re-write of the javascript!
        Last edited by RobbieZ; Mon 13 Sep '10, 8:42am.

        Comment

        • bailz66
          New Member
          • Apr 2010
          • 2

          #5
          I just updated to 4.07 and this still works for me

          Its just annoying that you have to re-edit it again.

          Would be good if there was a product for this and i believe there may be some style changes that can be used but thats not really a suitable method for me at this stage

          Comment

          • dilbert
            Senior Member
            • Oct 2004
            • 887

            #6
            Originally posted by RobbieZ
            This does not work anymore, due to the re-write of the javascript!
            True, but I made this simple edit to the same file and it works now, not sure if it's the proper way to do this, but having to double click was really silly.

            clientscript/vbulletin_quick_reply.js
            Search for:
            Code:
            YAHOO.util.Event.on(A,"click",qr_replytothread_activate,this);
            Change to:
            Code:
            /*YAHOO.util.Event.on(A,"click",qr_replytothread_activate,this);*/
            Cliff
            PathLabTalk
            Square Wheels Cycling

            Comment

            • Chazz Layne
              New Member
              • Jun 2003
              • 20
              • 4.1.x

              #7
              That method isn't working either now. It does fix the single-line reply boxes though (on Mac) and restore them to the intended size.

              It'd be nice if Jelsoft would stop trying to force-feed us counter-intuitive, unwanted features.
              ChazzLayne.com | KF7FEN | Flickr | Facebook

              Comment

              • Packetcrypt
                New Member
                • Sep 2011
                • 9
                • 4.1.x

                #8
                Any updates on this.. Just upgraded the forum and everyone hates this double click feature

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...