From 16dbaa1e13527598c86b5749c123ec66ff0eb870 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 27 May 2022 13:41:14 +0000 Subject: [PATCH] updated taskbar.php with the extended search feature --- codepot/src/codepot/views/taskbar.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/views/taskbar.php b/codepot/src/codepot/views/taskbar.php index 3d1d2ec3..6af64f94 100644 --- a/codepot/src/codepot/views/taskbar.php +++ b/codepot/src/codepot/views/taskbar.php @@ -86,8 +86,6 @@ function show_taskbar ($con, $login) } print ''; // boxb - - print ''; } ?> @@ -249,6 +247,13 @@ var TaskbarApp = (function () success: function(data, textStatus, jqXHR) { this.project_find_ajax = null; + if (data instanceof Array) + { + // the project id doesn't contains a slash. use a slash as a differentiator + data.splice(0, 0, {id: '/files', value: '', label: 'find in files'}); + data.splice(1, 0, {id: '/issues', value: '', label: 'find in issues'}); + data.splice(2, 0, {id: '/wikis', value: '', label: 'find in wikis'}); + } response (data); // call the bacllback function for autocompletion }, error: function(jqXHR, textStatus, errorThrown) @@ -310,7 +315,14 @@ var TaskbarApp = (function () }, select: function(event, ui) { - $(location).attr ('href', codepot_merge_path("", "/project/home/" + ui.item.id)); + if (ui.item.id == '/wikis' || ui.item.id == '/issues' || ui.item.id == '/files') + { + $(location).attr ('href', codepot_merge_path("", "/site/search" + ui.item.id + '/' + codepot_ascii_to_hex(this.value))); + } + else + { + $(location).attr ('href', codepot_merge_path("", "/project/home/" + ui.item.id)); + } //ui.item.value , ui.item.id , this.value } });