Permalink
Browse files

Item13898: fix jumpbox

  • Loading branch information...
1 parent 3519e0f commit a5a1b02e6e240ddc989b8c0567ae89c21875f6af MichaelDaum committed with gac410 Jan 6, 2016
@@ -63,7 +63,7 @@ loads the =topic= section of this topic, which expands to the topic list.
"^%URLPARAM{"term" default="does not exist"}%.*"
type="regex"
scope="topic"
- format="<nop>%URLPARAM{"format" encode="safe,quote" default="{\\"label\\":\\"$topic\\", \\"value\\":\\"$topic\\"}"}%"
+ format="<nop>%URLPARAM{"format" encode="safe,quote" default="{\\"label\\":\\"$topic\\", \\"value\\":\\"$web.$topic\\"}"}%"
separator=","
limit="%URLPARAM{"limit" default="10"}%"
nonoise="on"
@@ -141,8 +141,8 @@ Jump to specific topics.
%STARTSECTION{"jumpbox"}%<!-- jumpbox -->
<input type="text" class="foswikiInputField jqJumpBox {%IF{
"$GLOBAL = 'on'"
- then="global: true, baseweb:'all, -%TRASHWEB%', format:'&quot;$web.$topic&quot;'"
- else="global: false, baseweb:'%BASEWEB%', format:'&quot;$topic&quot;'"
+ then="global: true, baseweb:'all, -%TRASHWEB%'"
+ else="global: false, baseweb:'%BASEWEB%'"
}%}" name="topic" %IF{"defined PLACEHOLDER" then="placeholder=\"%PLACEHOLDER%\""}% autocomplete="off" size="60" />
%ADDTOZONE{"script"
tag="jumpbox::js"
@@ -160,9 +160,14 @@ jQuery(function($){
var $this = $(this),
opts = $.extend({}, $this.metadata());
$this.autocomplete({
- source: foswiki.getScriptUrl('view', foswiki.getPreference('SYSTEMWEB'), 'JQueryAjaxHelper') + "?section=topic;skin=text;contenttype=application/json;baseweb="+opts.baseweb,
+ source: foswiki.getScriptUrl('view', foswiki.getPreference('SYSTEMWEB'), 'JQueryAjaxHelper', {
+ section: 'topic',
+ skin: 'text',
+ contenttype: 'application/json',
+ baseweb: opts.baseweb,
+ }),
select: function(event, ui) {
- window.location.href=foswiki.getScriptUrl('view', (opts.global?'':opts.baseweb+''), ui.item.value);
+ window.location.href = foswiki.getScriptUrl('view', undefined, ui.item.value));
}
});
});
@@ -291,7 +296,12 @@ or later).
<script type=\"text/javascript\">
jQuery(function($){
$(\"#%ID%\").click(function() {
- $.get(foswiki.getScriptUrl('view', foswiki.getPreference('SYSTEMWEB'), 'JQueryAjaxHelper', '?section=query;source=%SOURCE%;query=%QUERY%;skin=text'),
+ $.get(foswiki.getScriptUrl('view', foswiki.getPreference('SYSTEMWEB'), 'JQueryAjaxHelper', {
+ section: 'query',
+ source: '%SOURCE%',
+ query: '%QUERY%',
+ skin: 'text'
+ }),
function(data) {
// This is the function that will be executed when the
// data is fetched
@@ -172,6 +172,11 @@ var foswiki = foswiki || {
url += scriptUrlPaths[script];
}
+ if (typeof(topic) !== 'undefined' && topic.match(/^(.*)(?:\.|\/)(.*?)$/) ) {
+ web = RegExp.$1;
+ topic = RegExp.$2;
+ }
+
if (typeof(web) !== 'undefined') {
url += "/"+web;
}

0 comments on commit a5a1b02

Please sign in to comment.