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

Best practise for merging javascript with xenforo.js?

Discussion in 'XenForo Development Discussions' started by Marcus, Aug 18, 2013.

  1. Marcus

    Marcus Well-Known Member

    Is there a procedure for merging javascript from my addons with xenforo.js in eclipse and minimizing them? Or would I have to do that manually?
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Marcus

    Marcus Well-Known Member

    The tool looks nice. Its funny, forums.digitalpoint.com also merged javascript into its xenforo.js
  4. HWS

    HWS Well-Known Member

    It pays at a high traffic site.
  5. Jeremy

    Jeremy Well-Known Member

    Just because DigitalPoint does it, doesn't mean it's a best practice. It's actually far from a best practice and as Chris said, you should include it when necessary.
    Chris D likes this.
  6. Marcus

    Marcus Well-Known Member

    I want to remove the files needed to display my page. There are already two css files I have to submit. But Mike told me it's best to keep it that way, and I agree with him on the CSS output. So I want to reduce javascript files. Yes, it's true that for returning visitors everything will be cached anyway. But a huge part of my money comes in from users who visit my page, don't like it and click on a banner.

    So I guess there isn't a best practise to combine scripts? Would be so great if there would be a tool inside ZEND / Eclipse.
  7. digitalpoint

    digitalpoint Well-Known Member

    I append our custom JS to xenforo.js with a web server rewrite btw... It's not *actually* merged (so don't need to do it on an upgrade or anything). For some things, there are separate JS files included as needed. The one I append is more universal stuff (like overwriting XenForo JS methods, Google Analytics, etc)
    Jeremy and Marcus like this.
  8. Ketola

    Ketola Member

    My question is somewhat related, so I'll post to this thread.

    I had to make some modifications to xenforo.js for our site (namely to the XenForo.BbCodeImage method to correctly zoom larger images on our centered layout with max-width set). It looks like the minified /js/xenforo/xenforo.js is merged from /js/jquery/jquery.xenforo.rollup.js and /js/xenforo/full/xenforo.js. Is this correct?

    I cannot simply overwrite the BBCodeImage method since it's both defined and registered to img.bbCodeImage elements in xenforo.js.

Share This Page