JumpBox


(:input jumpbox ... :)

This page demonstrates a simple jumpbox:

(:input jumpbox value=JumpBox:)
(:input jumpbox value=Test:)
(:input jumpbox value=Cookbook:)

(:input jumpbox value=Toyama:)
(:input jumpbox value=Gyokusendo:)
(:input jumpbox value=Suwada:)
(:input jumpbox value=Maruto:)
(:input jumpbox value=Kaneko:)

Or, from a pagelist:

(:if false:)
[[#jumpbox]]
(:input jumpbox value="{=$PageUrl}" label="{=$Title}":)
[[#jumpboxend]]
(:ifend:)

(:pagelist group=Test fmt=#jumpbox count=6:)

The local customization used to enable (:input jumpbox ...:):

<?php if (!defined('PmWiki')) exit();

$InputTags['jumpbox'] = array(
  'name' => 'n',
  ':html' =>
    "<form action='{$PageUrl}' method='get'>
     <select onchange='window.location.href=this.options[this.selectedIndex].value'
       \$InputSelectArgs>\$InputSelectOptions</select>
     <input type='submit' value='$[Jump to page]' /></form>");

Markup('input-jumpbox', '<split',
  '/\\(:input\\s+jumpbox\\s.*?:\\)(?:\\s*\\(:input\\s+jumpbox\\s.*?:\\))*/ei',
  "InputSelect(\$pagename, 'jumpbox', PSS('$0'))");

With minor modifications this local customization may also provide a hidden submit button as Option Menu recipe did (Dfaure):

<?php if (!defined('PmWiki')) exit();

$FmtPV['$_UniqId_'] = '($GLOBALS["_UniqId_"] = uniqid("id"))';
$FmtPV['$_PrevId_'] = '$GLOBALS["_UniqId_"]';

$InputTags['jumpbox'] = array(
  'name' => 'n',
  ':html' =>
    "<form action='{$PageUrl}' method='get'>
     <select onchange='window.location.href=this.options[this.selectedIndex].value'
       \$InputSelectArgs class='inputbox' >\$InputSelectOptions</select>
     <input id='{\$_UniqId_}' type='submit' value='$[Jump to page]' class='inputbutton' />
     <script type='text/javascript'><!--
document.getElementById('{\$_PrevId_}').style.display = 'none';
//--></script></form>");

Markup('input-jumpbox', '<split',
  '/\\(:input\\s+jumpbox\\s.*?:\\)(?:\\s*\\(:input\\s+jumpbox\\s.*?:\\))*/ei',
  "InputSelect(\$pagename, 'jumpbox', PSS('$0'))");
 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.22 00.21 MarkupToHTML begin
 3: 00.22 00.22 MarkupToHTML begin
 4: 00.23 00.23 MarkupToHTML end
 5: 00.23 00.23 MarkupToHTML begin
 6: 00.23 00.23 FPLTemplate: Chain begin
 7: 00.23 00.23 FPLTemplate: FPLTemplateLoad
 8: 00.23 00.23 FPLTemplate: FPLTemplateDefaults
 9: 00.23 00.23 FPLTemplate: FPLTemplatePageList
10: 00.23 00.23 MakePageList pre
11: 00.23 00.23 PageListSources begin
12: 00.24 00.23 PageStore::ls begin wiki.d/{$FullName}
13: 00.24 00.23 PageStore::ls merge wiki.d/{$FullName}
14: 00.25 00.24 PageStore::ls end wiki.d/{$FullName}
15: 00.25 00.24 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
16: 00.25 00.24 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
17: 00.25 00.24 PageStore::ls end $FarmD/wikilib.d/{$FullName}
18: 00.25 00.24 PageListSources end count=1134
19: 00.25 00.24 PageListSort pre ret=4 order=name
20: 00.25 00.24 MakePageList items count=1134, filters=
21: 00.25 00.24 MakePageList post count=1134, readc=0
22: 00.25 00.24 PageListSort begin
23: 00.25 00.24 PageListSort sort
24: 00.26 00.25 PageListSort end
25: 00.26 00.25 MakePageList end
26: 00.26 00.25 FPLTemplate: FPLTemplatePmWikiOrg
27: 00.26 00.25 MarkupToHTML begin
28: 00.26 00.25 MarkupToHTML end
29: 00.26 00.25 FPLTemplate: FPLTemplateSliceList
30: 00.26 00.25 FPLTemplate: FPLTemplateFormat
31: 00.26 00.25 MarkupToHTML begin
32: 00.26 00.25 MarkupToHTML end
33: 00.26 00.25 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
34: 00.26 00.25 FPLTemplate: Chain end
35: 00.26 00.25 MarkupToHTML end
36: 00.27 00.26 MarkupToHTML end
37: 00.28 00.26 MarkupToHTML begin
38: 00.28 00.27 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
39: 00.29 00.28 ReadApprovedUrls SiteAdmin.ApprovedUrls end
40: 00.29 00.28 MarkupToHTML end
41: 00.29 00.28 MarkupToHTML begin
42: 00.30 00.29 MarkupToHTML end
43: 00.30 00.29 now
Peak memory: 4,643,160 bytes