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.00 00.00 config end
 2: 00.03 00.02 MarkupToHTML begin
 3: 00.03 00.02 MarkupToHTML begin
 4: 00.04 00.03 MarkupToHTML end
 5: 00.04 00.03 MarkupToHTML begin
 6: 00.04 00.03 FPLTemplate: Chain begin
 7: 00.04 00.03 FPLTemplate: FPLTemplateLoad
 8: 00.04 00.03 FPLTemplate: FPLTemplateDefaults
 9: 00.04 00.03 FPLTemplate: FPLTemplatePageList
10: 00.04 00.03 MakePageList pre
11: 00.04 00.03 PageListSources begin
12: 00.04 00.03 PageStore::ls begin wiki.d/{$FullName}
13: 00.05 00.04 PageStore::ls merge wiki.d/{$FullName}
14: 00.05 00.04 PageStore::ls end wiki.d/{$FullName}
15: 00.05 00.04 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
16: 00.05 00.04 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
17: 00.05 00.04 PageStore::ls end $FarmD/wikilib.d/{$FullName}
18: 00.05 00.04 PageListSources end count=1082
19: 00.05 00.04 PageListSort pre ret=4 order=name
20: 00.05 00.04 MakePageList items count=1082, filters=
21: 00.05 00.05 MakePageList post count=1082, readc=0
22: 00.05 00.05 PageListSort begin
23: 00.05 00.05 PageListSort sort
24: 00.07 00.06 PageListSort end
25: 00.07 00.06 MakePageList end
26: 00.07 00.06 FPLTemplate: FPLTemplatePmWikiOrg
27: 00.07 00.06 MarkupToHTML begin
28: 00.07 00.06 MarkupToHTML end
29: 00.07 00.06 FPLTemplate: FPLTemplateSliceList
30: 00.07 00.06 FPLTemplate: FPLTemplateFormat
31: 00.07 00.07 MarkupToHTML begin
32: 00.07 00.07 MarkupToHTML end
33: 00.07 00.07 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
34: 00.07 00.07 FPLTemplate: Chain end
35: 00.07 00.07 MarkupToHTML end
36: 00.08 00.08 MarkupToHTML end
37: 00.09 00.08 MarkupToHTML begin
38: 00.09 00.09 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
39: 00.10 00.09 ReadApprovedUrls SiteAdmin.ApprovedUrls end
40: 00.10 00.09 MarkupToHTML end
41: 00.10 00.09 MarkupToHTML begin
42: 00.11 00.10 MarkupToHTML end
43: 00.11 00.10 now
Peak memory: 4,058,744 bytes