-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 18.08.2012 15:18, schrieb Sam Halliday:
> 3. add an "action=history" link to the bottom of all wiki pages, right
> beside the "edit" button.
>
> 4. hide all buttons at the bottom of a wiki page (except "edit" and
> "history"), and show them instead when "action=edit". I want to keep the
> "reading" experience as clean as possible and I feel "attach file",
> "rename", "delete version" and "delete page" are all edit commands.
> 
> (Actually, if someone can help me with point 3 then point 4 will involve
> doing the same thing when "action=edit" but with a few extra parameters
> added into the calls. I'd also need to know how to detect when
> "action=edit".)
> 

Look at existing plugin code, how this is done there. This is how I
approach these kind of tasks myself. As a pointer you could have a look
at TagsPlugin: tractags.wiki.WikiTagInterface adds some content to each
wiki page, depending on action. As easy as there's an input field
inserted next to the comment field by method '_wiki_edit' you could
insert a button (input type="button") too. The key here is an
appropriate XPATH selector and some Genshi builder code (the tag()
function from genshi.builder).

Hinding buttons could be done by an implementation of the
ITemplateStreamFilter [1] (see the same script file of TagsPlugin for an
example). But this time you'll need another XPATH selector to match the
buttons and remove them (see Genshi documentation [1]) for details.

Sincerely,

Steffen Hoffmann

[1] http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints
[2] http://genshi.edgewall.org/wiki/ApiDocs/genshi.filters.transform
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAvn9AACgkQ31DJeiZFuHe/rACgp/2yvOAAmWFpghsXz5ZMUoMu
0CEAn1h7zmQI/JGzlIg/ywqDrVvhmS8f
=08Zg
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to