FELIX-2226 Support detailed resource "access" by URL instead of request parameters
FELIX-2226 No redirect to .../obr?list=a
FELIX-2228 Encode and decode search query

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@926574 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/obr.js b/webconsole/src/main/resources/res/ui/obr.js
index 2d5bc0a..baf96a9 100644
--- a/webconsole/src/main/resources/res/ui/obr.js
+++ b/webconsole/src/main/resources/res/ui/obr.js
@@ -68,7 +68,7 @@
 }
 
 function showDetails( symbolicname, version ) {
-    window.location.href = window.location.pathname + '?details&symbolicname=' + symbolicname + '&version=' + version;
+    window.location.href = pluginRoot + '/' + symbolicname + '/' + version;
 }
 
 function showVersions( symbolicname ) {
@@ -379,13 +379,13 @@
                         });
     // Required dependencies
     createDetailedTable(tbody, "Dependencies", ["Name", "Version"], res.required, function(p) {
-                            var a = createElement('a', null, { href: (window.location.pathname + '?details&symbolicname=' + p.symbolicname + '&version=' + p.version) });
+                            var a = createElement('a', null, { href: (pluginRoot + '/' + p.symbolicname + '/' + p.version) });
                             a.appendChild(text(p.presentationname ? p.presentationname : p.symbolicname));
                             return [ a, text(p.version) ];
                         });
     // Optional dependencies
     createDetailedTable(tbody, "Optional Dependencies", ["Name", "Version"], res.optional, function(p) {
-                            var a = createElement('a', null, { href: (window.location.pathname + '?details&symbolicname=' + p.symbolicname + '&version=' + p.version) });
+                            var a = createElement('a', null, { href: (pluginRoot + '/' + p.symbolicname + '/' + p.version) });
                             a.appendChild(text(p.presentationname ? p.presentationname : p.symbolicname));
                             return [ a, text(p.version) ];
                         });
@@ -421,7 +421,7 @@
 		for (var i in obrData.repositories ) {
 			renderRepository( obrData.repositories[i] );
 		}
-		if ($.getUrlVar('details')) {
+		if (obrData.details) {
 		    $('#resTable').addClass('ui-helper-hidden');
 		    $('#detailsTable').removeClass('ui-helper-hidden');
 		    for (var i in obrData.resources ) {
@@ -470,7 +470,11 @@
 	resTable = $('#resTable tbody').empty();
 	searchField = $('#searchField');
 	ifStatusOK = $('#ifStatusOK');
-    searchField.val($.getUrlVar('query'));
+	
+	var query = $.getUrlVar('query');
+	if (query) {
+        searchField.val(decodeURIComponent(query));
+    }
 
 	$('#addRepoBtn').click(function(event) {
         event.preventDefault();
@@ -478,7 +482,7 @@
 	});
 	$('#searchBtn').click(function(event) {
         event.preventDefault();
-        window.location.href = window.location.pathname + '?query=' + searchField.val();
+        window.location.href = pluginRoot + '?query=' + encodeURIComponent(searchField.val());
 	});
 	searchField.keypress(function(event) {
         if (event.keyCode == 13) {