SeeSaw 1.4
Installation
Install SeeSaw.py where you normally install third-party macros.
1. Out of the box
With the installation above, SeeSaw should be ready to use. jQuery is loaded
into the body of page from its CDN
(see http://jquery.com/download)
while a minimised version of SeeSaw's own JavaScript (seesaw.js) is embedded
there.
If you are new to SeeSaw you can jump straight to Testing.
2. From the filesystem
Alternatively, jQuery and seesaw.js can be loaded from the filesystem. Edit
jqueryjs and seesawjs at the top of the Configuration section in SeeSaw.py to
paths that will cause your web server to load jquery-1.9.1.js and seesaw.js
from the locations where you choose to store those files.
In this case, both jQuery and seesaw.js are loaded into the body of
the page.
3. To the page head
Finally, the type of installation required prior to this release can still be
used, with jQuery and seesaw.js being loaded into the page's head.
From within MoinMoin
In this case, set both jquerys and seesawjs at the top of the
Configuration section in SeeSaw.py to None and configure html_head in your
wiki's wikiconfig.py configuration file as follows:
html_head = '''
<script type="text/javascript" src="<url_prefix_static>/common/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<url_prefix_static>/common/js/seesaw.js"></script>
'''
replacing <url_prefix_static> with the value of url_prefix_static used by
the configuration file, assuming the files have been installed within
MoinMoin's htdocs/common/js directory.
From outside MoinMoin
Alternatively, the files can be loaded from the
filesystem using paths outside the MoinMoin installation, as in installation
type 2 above, e.g.
html_head = '''
<script type="text/javascript" src="/somewhere/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/somewhere/seesaw.js"></script>
'''
Installation Notes
- Page caches may need to be deleted after changing the configuration. For
individual pages it can be done by using Delete Cache from the More Actions
menu. If there are many pages involved it might be best to remove all cache
files, which can be done by using the cleancache option of the moin
command: see your wiki's HelpOnMoinCommand page. To be really sure that a new
configuration is being used, check the source code of pages in your browser.
- If you are upgrading and changing to an installation that isn't type 3, or
switching to one of the others having tried type 3, remember to undo the
modification to html_head in your wikiconfig.py. Depending on your setup, it
may be necessary to restart your server afterwards.
- The settings of jqueryjs and seesawjs in the Configuration section of
SeeSaw.py don't necessarily have to be paired as indicated by the three
descriptions above. For example, jQuery could be loaded from the filesystem
with seesaw.js being embedded in the page. However, jQuery needs to
be loaded first, so the unlikely combination of loading seesaw.js,
but not jQuery, from the head is disallowed, while loading both from the head,
but getting the order wrong, would cause SeeSaw to malfunction.
- If you have any problems with installations 1 and 2, use the third. It has
always worked in the past - after all, until this version it was the only way
of installing SeeSaw.
- 1.9.1 was the version of jQuery current at the time of release. SeeSaw
uses basic jQuery features so is likely to work with older and future versions.
Testing
The following markup should work:
<<SeeSaw()>> <<SeeSaw(type=button, image=arrow)>>
{{{#!wiki seesaw section
This is the section
}}}
It should present a link displaying the word Show and a button containing a
right arrow, which change to Hide and a down arrow when either is clicked,
revealing the section containing the text
This is the section
Clicking either again should cause a return to the initial state.
A set of ready-to-run examples demonstrating all of the features can be
downloaded from SeeSaw's page
at MoinMoin's MacroMarket.
Images in Links and Buttons
Two image sets, each consisting of an image for showing and one for hiding, are
provided as embedded data in the source code for use with the image option.
Further image sets can be added by adding to moreimages in the Configuration
section of SeeSaw.py. The images can be provided as data or as files. The
simplest place to install files would be in htdocs/common within MoinMoin's
installation tree. If providing files, it is necessary to configure
imageprefix. For the case above, the value would be
imageprefix = '<url_prefix_static>/common'
Replace <url_prefix_static> with the value of the variable url_prefix_static in
your wiki's configuration file.
The files can be installed anywhere in the filesystem as long as your web server is
configured appropriately for accessing them.
Anti-jump Solution
Previously page jump could sometimes be seen during the rendering of pages,
i.e. sections to be hidden initially were shown briefly before being
withdrawn. I used to provide a workaround for that situation, which involved
adding CSS to html_head in wikiconfig.py. However, I've now decided, as it does
no harm, to implement the fix unconditionally, taking advantage of the new
installation mechanism to inject the CSS into the page at the point of the
first SeeSaw call. The CSS of earlier releases has been extended following
SeeSaw's applicability to tables as of version 1.3.
Jim Wight
jkwight@gmail.com
April 2013