= Seesaw plugin for moin =

http://seesaw.ncl.ac.uk/1.9/SeeSaw

== Configuration ==

 1. Images go in `/home/moin/moin-1.9.3/MoinMoin/web/static/htdocs/seesaw/img`
 1. `seesaw.js` and `jquery*.js` go in `/home/moin/moin-1.9.3/MoinMoin/web/static/htdocs/seesaw/js`
 1. Then edit `moin-1.9.3/wiki/wikiconfig.py` to include the necessary JS {{{#!python
# near the top
from MoinMoin.config import multiconfig, url_prefix_static
...

# at the bottom:
    html_head = '''
<script type="text/javascript" src="%(url_prefix_static)s/seesaw/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="%(url_prefix_static)s/seesaw/js/seesaw.js"></script>
''' % {'url_prefix_static':url_prefix_static}
}}}
 1. Configure Seesaw itself for the paths, `moin-1.9.3/wiki/data/plugin/macro/SeeSaw.py` {{{
#--- Configuration ----------------------------------------
from MoinMoin.config import url_prefix_static
img_prefix = url_prefix_static.rstrip("/") + "/seesaw/img"
}}}
 1. Restart the app process if not running in CGI mode (to reload the changed python files)


== Customisation ==

This makes the common desired use-case more concise to use when writing moin syntax, and tweaks the visual styling a little so that inline linkage (ie. hyperlinks as you're used to them on the internets) is neat and identifiable.

{{{#!diff
--- SeeSaw.py	2011-01-23 23:11:59.000000000 +1100
+++ /home/moin/moin-1.9.3/wiki/data/plugin/macro/SeeSaw.py	2011-11-14 14:35:39.659539842 +1100
@@ -224,7 +224,9 @@
 # Change this to the relative location of the images
 #
 # img_prefix="/moin_static18x/common"
-img_prefix="/img"
+#img_prefix="/img"
+from MoinMoin.config import url_prefix_static
+img_prefix = url_prefix_static.rstrip("/") + "/seesaw/img"
 #
 # Optionally change this (to extend the list of image sets)
 #
@@ -247,15 +249,15 @@
         else:
             return wikiutil.escape(x)
 
-    parser = wikiutil.ParameterParser('%(section)s%(toshow)s%(tohide)s%(show)b%(bg)s%(inline)s%(image)s%(speed)s%(seesaw)b%(addclass)s%(type)s%(effect)s')
+    parser = wikiutil.ParameterParser('%(section)s%(linktext)s%(toshow)s%(tohide)s%(show)b%(bg)s%(inline)s%(image)s%(speed)s%(seesaw)b%(addclass)s%(type)s%(effect)s')
     (count,dict) = parser.parse_parameters(args)
-    (section,toshow,tohide,show,bg,inline,image,speed,seesaw,addclass,type,effect) = (dict[x] for x in ('section','toshow','tohide','show','bg','inline','image','speed', 'seesaw','addclass','type','effect'))
+    (section,linktext,toshow,tohide,show,bg,inline,image,speed,seesaw,addclass,type,effect) = (dict[x] for x in ('section','linktext','toshow','tohide','show','bg','inline','image','speed', 'seesaw','addclass','type','effect'))
 
     if section is None:
         section = 'section'
 
     if speed is None:
-        speed = 0
+        speed = 100
     try:
         speed = int(speed)
     except:
@@ -269,13 +271,17 @@
     if show is None:
         show = False
 
-    if tohide is None and toshow is None:
-        if inline is None:
-            toshow = 'Show'; tohide = 'Hide'
-        else:
-            toshow = u'»»';  tohide = u'««'
-    elif tohide is None and toshow is not None:
-            tohide = toshow
+    if linktext is not None:
+        toshow = u'»%s' % linktext;
+        tohide = u'»%s' % linktext;
+    else:
+        if tohide is None and toshow is None:
+            if inline is None:
+                toshow = 'Show'; tohide = 'Hide'
+            else:
+                toshow = u'»»';  tohide = u'««'
+        elif tohide is None and toshow is not None:
+                tohide = toshow
     showpart = 'showpart'; showstyle = '''style="display:inline"'''
     hidepart = 'hidepart'; hidestyle = '''style="display:none"'''
     if show:
@@ -290,7 +296,7 @@
         openaction = closeaction = 'button'
 
     if effect is None or (effect != 'slide' and effect != 'fade'):
-        effect = 'show'
+        effect = 'slide'
     effect = "'%s'" % effect
 
     regex = re.compile(r'(.*)<<(.*)>>(.*)')
}}}