summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-01-15 03:29:47 +0000
committerOlivier Lamy <olamy@apache.org>2014-01-15 03:29:47 +0000
commita2d8a0d1bacc33ddf4e18c477100d57777d38a80 (patch)
treed8f674f184c27233fb1b1a7884880179f3e8c317 /archiva-modules
parent67b236356b877ec65ac5907a17f4637c49e51fdf (diff)
downloadarchiva-a2d8a0d1bacc33ddf4e18c477100d57777d38a80.tar.gz
archiva-a2d8a0d1bacc33ddf4e18c477100d57777d38a80.zip
use typeahead for users filtering
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1558283 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js7
-rw-r--r--[-rwxr-xr-x]archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/jquery.ui.widget-1.9.2.js0
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js58
4 files changed, 16 insertions, 52 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
index d1eda6f41..09c4e26c1 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
@@ -702,5 +702,8 @@ welcome.docref=Documentation reference
welcome.mainsite=Archiva Web site
+version.delete.missing.repoId=You must select a Repository
+
+
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js
index a4f89fec8..7e40fce2c 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js
@@ -1455,7 +1455,7 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
return;
}
var dotEnd=request.term.endsWith(".");
- // org.apache. requets with org.apache
+ // org.apache. request with org.apache
// org.apa request with org before last dot and filter response with startsWith
if (request.term.indexOf(".")>=0){
if (dotEnd){
@@ -1520,12 +1520,15 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
}
return false;
}
- }).data( "autocomplete" )._renderItem = function( ul, item ) {
+ })
+ ._renderItem = function( ul, item ) {
+ $.log("_renderItem");
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( groupId ? "<a>" + item.name.substring(groupId.length+1, item.name.length) + "</a>": "<a>" + item.name + "</a>" )
.appendTo( ul );
};
+
}
/**
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/jquery.ui.widget-1.9.2.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/jquery.ui.widget-1.9.2.js
index 067476d97..067476d97 100755..100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/jquery.ui.widget-1.9.2.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/jquery.ui.widget-1.9.2.js
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
index ecf804be2..2f13804a6 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
@@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-define("redback.users",["jquery","jquery.ui","utils","i18n","jquery.validate","knockout","knockout.simpleGrid","typeahead"],
-function(jquery,jqueryui,utils,i18n,jqueryValidate,ko,koSimpleGrid,typeahead) {
+define("redback.users",["jquery","utils","i18n","jquery.validate","knockout","knockout.simpleGrid","typeahead"],
+function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,typeahead) {
/**
* view model used for users grid
@@ -281,57 +281,15 @@ function(jquery,jqueryui,utils,i18n,jqueryValidate,ko,koSimpleGrid,typeahead) {
}
applyAutocompleteOnHeaderUsers=function(property,usersViewModel){
-
- $("#main-content").find("#users-grid-filter-auto-"+property ).autocomplete({
- minLength: 0,
- source: function(request, response){
- var founds=[];
- $.log("source:"+request.term+",users:"+usersViewModel.users().length)
- $(usersViewModel.users()).each(function(idx,user){
- if(user[property] && user[property]() && user[property]().indexOf(request.term)>=0){
- founds.push(user[property]());
- }
- });
- response(unifyArray(founds,true));
- },
- select: function( event, ui ) {
- $.log("property:"+property+','+ui.item.value);
- var users=[];
- $(usersViewModel.users()).each(function(idx,user){
- if(user[property] && user[property]() && user[property]().indexOf(ui.item.value)>=0){
- users.push(user);
- }
- });
- $.log("property:"+property+','+ui.item.value+",size:"+users.length);
- usersViewModel.users(users);
- return false;
- }
- });
-
- /*
- olamy: doesn't work????
- var values=[];
+ var founds=[];
$(usersViewModel.users()).each(function(idx,user){
- var value=user[property];
- if(value!=null && $.inArray(value, values)<0){
- values.push(value);
+ if(user[property] && user[property]()){
+ founds.push(user[property]());
}
});
- var jid = "#users-grid-filter-auto-"+property;
- $.log("applyAutocompleteOnHeaderUsers:"+values.length+" for " + jid);
-
- var box = $("#main-content").find(jid);
-
- box.typeahead( { local: values } );
- box.bind('typeahead:selected', function(obj, datum, name) {
- var users=[];
- $(usersViewModel.users()).each(function(idx,user){
- if(user[property] && user[property]() && user[property]().indexOf(datum.value)>=0){
- users.push(user);
- }
- });
- usersViewModel.users(users);
- });*/
+ $("#main-content").find("#users-grid-filter-auto-"+property ).typeahead({
+ local: founds
+ });
}
/**