Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

There are a lot of fine Lightboxes 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 You Confluence, in on of 2 waysYour Confluence to utilize:

 

Advarsel

First, All of the stuff below is quite generic and samples only, refer to the documentation.

 

Filesystem based

In this case, the light box is placed in the filesystem, either under the Confluence installation, or somewhere else and linked in.

Under Confluence

Second, all the files are considered "foreign" (including symbolic links) during an upgrade and must be reimplemented.

Info

Some lightboxes:

 

prettyPhoto (Best, and actually free (tommel op) - does not support slide on iOS ) 

FloatBox (Best, not free for commercial sites)

Flare (Not free)

Slimbox2 (Free, not good on mobile devices)

OrangeBox (Free)

FancyBox

LightView (Free)

See more at http://www.tripwiremagazine.com/2013/06/jquery-lightbox-plugins.html

Install below Confluence

Download the Javascript files/Framework Download the lightbox zip, upload it to the server and place the files under the install:

Kodeblok
cd /opt/confluence/confluence
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:

Info

This requires support for Linking in Tomcat. the server.xml file has to be changed adding the allowedLinked parameter:

 

<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true" allowLinking="true">

 

Create the filestructure:

Kodeblok
cd /data
mkdir confluence-ext-libs
mkdir mylightbox
cd mylightbox
mv ~/mylightbox.zip .

unzip mylightbox.zip

Link under Confluence (only needed once)

Kodeblok
ln -s /data/confluence-ext-libs  /opt/confluence/confluence/confluence-ext-libs

 

The Common Part

Now these can be referenced as /opt/confluence/confluence id in the server root, so in Custom HTML (header part) add:

Kodeblok
<!-- MyLignboxMyLightbox -->
<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>

 

 

 

Somewhere else

 

Confluence page based

Some lighboxes requires to be initiated (the Jquery reference $ is AJS.$ for Confluence):

Kodeblok
<script type="text/javascript" charset="utf-8">
  AJS.$(document).ready(function(){
    AjS.$("a[rel^='mylightbox']").mylightbox();
  });
</script>

...