Clean way of editing XF's javascript?

cedivad

Active member
For example, i would like to trigger an event when the quickreply box is first enabled (it's opaque by default when you load the thread). Just jquery on select?

I really hate the idea of editing XF's source javascript. (do we even have an unpacked version of it, btw?).
 
Last edited:
Depending on what you are doing and how it works you probably don't even have to edit any core files to achieve your ends.

If you are dead set on editing the core js... enable debug and go to

options -> debug options :

Use Uncompressed JavaScript
 
For example, i would like to trigger an event when the quickreply box is first enabled (it's opaque by default when you load the thread). Just jquery on select?

I really hate the idea of editing XF's source javascript. (do we even have an unpacked version of it, btw?).
Load your custom JS in the header (after the XenForo JS file). Save in a variable the XenForo function you want to extend/override. Once it has been saved, override the function (use the same name), do your modifications, use your backup variable (which can be a function in JS) to call the previous function. You can see some examples here or here.
 
Back
Top Bottom