The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[How-To] Disable double click on Reply buttons
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); } 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 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. |
#2
|
|||
|
|||
Awesome work just what I was looking for.
|
#3
|
||||
|
||||
Thank you
|
#4
|
|||
|
|||
Would you mind sending me over the .js file with the updated changes? I tried making the changes and things didn't seem right.
Also when I searched for this "YAHOO.util.Event.on(anchors[i]" in the file to make the changes it wasn't found. What is going on? |
#5
|
|||
|
|||
Quote:
Code:
{YAHOO.util.Event.on(C[b],"click",qr_newreply_activate,this)} Code:
YAHOO.util.Event.on(A,"click",qr_replytothread_activate,this) I only found out about the compressed version after I wrote the article, or I would've included it then. |
#6
|
|||
|
|||
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; |
#7
|
|||
|
|||
That is strange. I've done it with the compressed and non-compressed versions of the file with no problems. Try again because it would be easy to make a mistake with the compressed file, being that it's all mushed together. PM me if you have further problems.
|
#8
|
|||
|
|||
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. |
#9
|
|||
|
|||
Hey Biz, we meet again. As you know, I'm in the middle of reinstalling everything onto a new HD today, so I can't access my vBulletin projects to check on this for 4.0.2. But soon as I'm able, I will.
|
#10
|
|||
|
|||
I will wait patiently, thank you!!!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|