!Bookmarklet Examples
This recipe is secure because it only allows authors to reference bookmarklets which are predefined in your config.php or farmconfig.php file.
There are 2 examples here.
This code is customized for PMWiki actions.
# This is config.php code using InterMap links: # allow PMWiki action bookmarklet links $LinkFunctions['action:'] = 'LinkIMap'; $IMap['action:'] = '$1'; $IMapLinkFmt['action:'] = "<a href='javascript:location.href+=\"?action=\$LinkUrl\"'>\$LinkText</a>";
Here are all the PMWiki actions. You can add/install any to your \\ browser by dragging a any link to your browser toolbar: [[action:browse|View]] [[action:edit|Edit]] [[action:diff|History]] [[action:upload|Upload]] [[action:crypt|Crypt]] [[action:print|Print]] [[action:search|Search]] [[action:source|Source]] [[action:login|Login]] [[action:logout|Logout]] [[action:rss|RSS]] [[action:atom|Atom]] [[action:rdf|RDF]] [[action:dc|DC]] [[action:refcount|RefCount]] [[action:ruleset|Ruleset]] [[action:phpinfo|PHPInfo]] [[action:diag|Diag]] [[action:attr|Attributes]] |
Here are all the PMWiki actions. You can add/install any to your View? Edit? History? Upload? Crypt? Print? Search? Source? Login? Logout? RSS? Atom? RDF? DC? RefCount? Ruleset? PHPInfo? Diag? Attributes? |
This code is customized for a single bookmarklet link.
# This is config.php code using Markup alone: # create custom bookmarklet link Markup('pmwikiedit', 'directives', '/\\(:pmwikiedit:\\)/', Keep("<a href='javascript:location.href+=\"?action=edit\"'>Edit</a>"));
(:pmwikiedit:) |
(:pmwikiedit:) |
This program is free software.
You can redistribute it and/or modify it under
the terms of the GNU General Public License as
published by the Free Software Foundation
http://www.fsf.org either version 2 of the
License, or (at your option) any later version.
Copyright 2007