1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Clean way of editing XF's javascript?

Discussion in 'XenForo Development Discussions' started by cedivad, Mar 5, 2014.

  1. cedivad

    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: Mar 5, 2014
  2. EQnoble

    EQnoble Well-Known Member

    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
  3. cclaerhout

    cclaerhout Well-Known Member

    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.
    Miau, Thomas.B, CyberAP and 2 others like this.

Share This Page