= 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 = '''
''' % {'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)
== Add borders to seesaw blocks ==
When you have large chunks of seesaw'd markup, adding a faint outline to the block can make it a little easier to identify. This could be done by editing the `common.css` of all your themes, but it's tedious and error prone, and also doesn't get kept as you add more themes.
Instead, let's add it to the seesaw code itself.
1. Create the container directory for your CSS file, it probably doesn't exist yet. Adjust the path to suit your system {{{
mkdir /home/moin/moin-1.9.3/MoinMoin/web/static/htdocs/seesaw/css
}}}
1. Add `seesaw.css` to the directory you just created: {{{
div.seesaw {
border: 1px silver dotted;
}
}}}
1. Edit `moin-1.9.3/wiki/wikiconfig.py` to include the new CSS, it goes in the edit you made for JS in the original setup {{{#!diff
--- OLDwikiconfig.py 2012-02-13 13:09:32.243905389 +1100
+++ wikiconfig.py 2012-02-13 13:12:08.991916014 +1100
@@ -178,5 +178,6 @@
html_head = '''
+
''' % {'url_prefix_static':url_prefix_static}
}}}
1. Restart the app process if not running in CGI mode (to reload the updated `wikiconfig.py`)
== 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'(.*)<<(.*)>>(.*)')
}}}