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

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

(:input jumpbox value="$ScriptUrl/Test/00962" label="Test 00962":) (:input jumpbox value="$ScriptUrl/Test/01295" label="01295":) (:input jumpbox value="$ScriptUrl/Test/01300" label="01300":) (:input jumpbox value="$ScriptUrl/Test/12Over4" label="12Over4":) (:input jumpbox value="$ScriptUrl/Test/2003Titlespaced" label="2003Titlespaced":) (:input jumpbox value="$ScriptUrl/Test/2006-01-01" label="2006-01-01":)

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.21 00.20 MarkupToHTML begin
 3: 00.21 00.20 MarkupToHTML begin
 4: 00.21 00.21 MarkupToHTML end
 5: 00.21 00.21 MarkupToHTML begin
 6: 00.21 00.21 FPLTemplate: Chain begin
 7: 00.21 00.21 FPLTemplate: FPLTemplateLoad
 8: 00.21 00.21 FPLTemplate: FPLTemplateDefaults
 9: 00.21 00.21 FPLTemplate: FPLTemplatePageList
10: 00.21 00.21 MakePageList pre
11: 00.21 00.21 PageListSources begin
12: 00.21 00.21 PageStore::ls begin wiki.d/{$FullName}
13: 00.22 00.21 PageStore::ls merge wiki.d/{$FullName}
14: 00.22 00.21 PageStore::ls end wiki.d/{$FullName}
15: 00.22 00.22 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
16: 00.22 00.22 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
17: 00.22 00.22 PageStore::ls end $FarmD/wikilib.d/{$FullName}
18: 00.23 00.22 PageListSources end count=1128
19: 00.23 00.22 PageListSort pre ret=4 order=name
20: 00.23 00.22 MakePageList items count=1128, filters=
21: 00.23 00.22 MakePageList post count=1128, readc=0
22: 00.23 00.22 PageListSort begin
23: 00.23 00.22 PageListSort sort
24: 00.24 00.23 PageListSort end
25: 00.24 00.23 MakePageList end
26: 00.24 00.23 FPLTemplate: FPLTemplatePmWikiOrg
27: 00.24 00.23 MarkupToHTML begin
28: 00.24 00.23 MarkupToHTML end
29: 00.24 00.23 FPLTemplate: FPLTemplateSliceList
30: 00.24 00.23 FPLTemplate: FPLTemplateFormat
31: 00.24 00.23 MarkupToHTML begin
32: 00.24 00.23 MarkupToHTML end
33: 00.24 00.23 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
34: 00.24 00.23 FPLTemplate: Chain end
35: 00.24 00.23 MarkupToHTML end
36: 00.25 00.24 MarkupToHTML end
37: 00.25 00.25 MarkupToHTML begin
38: 00.26 00.25 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
39: 00.27 00.26 ReadApprovedUrls SiteAdmin.ApprovedUrls end
40: 00.27 00.26 MarkupToHTML end
41: 00.27 00.26 MarkupToHTML begin
42: 00.27 00.27 MarkupToHTML end
43: 00.28 00.27 now
Peak memory: 4,706,112 bytes