Installing Javascript libraries or frameworks in Confluence
There are a lot of fine Javascript files (libraries/frameworks) - both for plain Javascript and for jquery on the market, both free and commercials, but they all need to be loaded (installed) into Your Confluence to utilize:
Install below Confluence
Download the Javascript files/Framework zip, upload it to the server and place the files under the install:
mkdir mylightbox
cd mylightbox
mv ~/mylightbox.zip .
unzip mylightbox.zip
Somewhere else in the filesystem with symbolic linking
Along the way, I have given up having individual symbolic links pr. library/framework, so now I place all under "confluence-ext-libs"
Download the Javascript files/Framework zip, upload it to the server and place the files under the install:
Create the filestructure:
mkdir confluence-ext-libs
mkdir mylightbox
cd mylightbox
mv ~/mylightbox.zip .
unzip mylightbox.zip
Link under Confluence (only needed once)
The Common Part
Now these can be referenced as /opt/confluence/confluence in the server root, so in Custom HTML (header part) add:
<link rel="stylesheet" href="/confluence-ext-libs/mylightbox/css/mylightbox.css" type="text/css" media="screen" charset="utf-8" />
<script src="/confluence-ext-libs/mylightbox/js/jquery.mylightbox.js" type="text/javascript" charset="utf-8"></script>
Some lighboxes requires to be initiated (the Jquery reference $ is AJS.$ for Confluence):
AJS.$(document).ready(function(){
AjS.$("a[rel^='mylightbox']").mylightbox();
});
</script>