how to add a js file to batch.js in confluence 4.2?????

liljoint June 18, 2012

Hi, I have seen a folder where there's too many js files with distinct functions, but in the google chrome developer tool it's loaded only One file, batch.js, inside this there are all the js scripts in include/js folder.

thnx

1 answer

0 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2012

My understanding, and this a guess at best, is that batch.js is compiled (by that I mean compounded, not actually compiled) on the back-end and served up by the confluence web app. It includes more than just the scripts in the JS folder, but lots of JavaScript fragments. There's also a batch.css file that does a similar thing for style properties that are all over the place.

One reason they might do this is because the version of batch.css and batch.js that get transmitted appear to be optimized (whitespace stripped out). So it gives you the opportunity to view the sources of the batch files on the server in un-optimized format, but then saves bandwidth by transferring them as optimized.

I don't think you can insert anything into the batch files without touching server side code (and recompiling the web app. If you want to include a JS file, add a <script> to your Custom HTML in the Administration panel.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events