View Single Post
Old 01-25-2018, 01:07 PM   #12
psyang
Powerplay Quarterback
 
Join Date: Jan 2010
Exp:
Default

Ok, it looks like you want to add your twitter javascript in the qr_do_ajax_post function inside of vbulletin_quick_reply.js

The file is minimized, but you can try adding the function right after the string

Quote:
fetch_object("qr_submit").blur()
You should add a semi-colon after blur(), so it looks like:

Quote:
fetch_object("qr_submit").blur();myTwitterJavascri ptFunction();
Modifying vbulletin code directly is not good since the next update of vbulletin will wipe your change. One possibility is to add an onBlur event handler to the "Post Quick Reply" button (its id is "qr_submit"). The only issue here is if a user tabs so that the "Post Quick Reply" button is active, then tabs off of it, that will trigger the blur event, which will then run the javascript. Maybe not a big deal. Is it a problem if the javascript function is run more than once on a page?

Note, this will take care of the case when user submits a tweet via Post Quick Reply.

There will be another location for the javascript if the user edits a post. One second...

Last edited by psyang; 01-25-2018 at 01:21 PM. Reason: formatting
psyang is offline   Reply With Quote