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.

Return to Bookmarklet Recipe

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
browser by dragging a any link to your browser toolbar:

    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:)

Edit

Return to Bookmarklet Recipe

 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.22 00.19 MarkupToHTML begin
 3: 00.22 00.20 MarkupToHTML begin
 4: 00.23 00.20 MarkupToHTML end
 5: 00.23 00.20 MarkupToHTML begin
 6: 00.23 00.21 MarkupToHTML end
 7: 00.23 00.21 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 8: 00.24 00.21 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 9: 00.24 00.22 MarkupToHTML end
10: 00.24 00.22 MarkupToHTML begin
11: 00.26 00.23 MarkupToHTML end
12: 00.26 00.23 MarkupToHTML begin
13: 00.26 00.23 MarkupToHTML end
14: 00.26 00.23 now
Peak memory: 3,741,864 bytes