mirror of
https://github.com/apache/archiva.git
synced 2025-02-22 18:31:43 +00:00
cleanup a bit
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1545152 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6c614acbce
commit
2ab42c23ca
@ -880,17 +880,18 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
|
||||
};
|
||||
|
||||
drawQuickSearchAutocomplete=function(selector){
|
||||
|
||||
$( selector ? selector : "#quick-search-autocomplete" ).typeahead(
|
||||
var box = $( selector ? selector : "#quick-search-autocomplete" );
|
||||
box.typeahead(
|
||||
{
|
||||
name: 'quick-search-result',
|
||||
remote: 'restServices/archivaServices/searchService/quickSearch?queryString=%QUERY',
|
||||
valueKey: 'artifactId',
|
||||
maxParallelRequests:1,
|
||||
limit: 50
|
||||
}
|
||||
);
|
||||
|
||||
$( selector ? selector : "#quick-search-autocomplete" ).bind('typeahead:selected', function(obj, datum, name) {
|
||||
box.bind('typeahead:selected', function(obj, datum, name) {
|
||||
window.sammyArchivaApplication.setLocation("#quicksearch~" + datum.artifactId);
|
||||
});
|
||||
};
|
||||
|
@ -1419,6 +1419,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno
|
||||
if (selectedRepo){
|
||||
url+="?repositoryId="+encodeURIComponent(selectedRepo);
|
||||
}
|
||||
|
||||
$( "#main-content").find("#browse-autocomplete" ).autocomplete({
|
||||
minLength: 2,
|
||||
source: function(request, response){
|
||||
@ -2017,12 +2018,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","select2","knockout","kno
|
||||
});
|
||||
|
||||
var box = $( "#main-content").find("#search-filter-auto-"+property );
|
||||
box.typeahead(
|
||||
{
|
||||
local: values,
|
||||
maxParallelRequests:2
|
||||
}
|
||||
);
|
||||
box.typeahead( { local: values } );
|
||||
|
||||
box.bind('typeahead:selected', function(obj, datum, name) {
|
||||
var artifacts=[];
|
||||
|
@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
define("redback.users",["jquery","utils","i18n","jquery.validate","knockout","knockout.simpleGrid"],
|
||||
function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
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
|
||||
@ -47,11 +47,15 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
filter: true
|
||||
}
|
||||
],
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
gridUpdateCallBack: function(){
|
||||
$.log("gridUpdateCallBack users result");
|
||||
applyAutocompleteOnHeaders(self);
|
||||
}
|
||||
});
|
||||
clearFilters=function(){
|
||||
self.users(self.originalUsers());
|
||||
applyAutocompleteOnHeaders(self);
|
||||
|
||||
};
|
||||
filterLocked=function(){
|
||||
var founds=[];
|
||||
@ -61,7 +65,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
});
|
||||
self.users(founds);
|
||||
applyAutocompleteOnHeaders(self);
|
||||
}
|
||||
filterNonLocked=function(){
|
||||
var founds=[];
|
||||
@ -71,7 +74,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
});
|
||||
self.users(founds);
|
||||
applyAutocompleteOnHeaders(self);
|
||||
}
|
||||
|
||||
filterPasswordChangeRequired=function(){
|
||||
@ -82,7 +84,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
});
|
||||
self.users(founds);
|
||||
applyAutocompleteOnHeaders(self);
|
||||
}
|
||||
filterPasswordChangeNotRequired=function(){
|
||||
var founds=[];
|
||||
@ -92,7 +93,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
});
|
||||
self.users(founds);
|
||||
applyAutocompleteOnHeaders(self);
|
||||
}
|
||||
|
||||
|
||||
@ -281,6 +281,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
|
||||
applyAutocompleteOnHeader=function(property,usersViewModel){
|
||||
|
||||
$("#main-content").find("#users-grid-filter-auto-"+property ).autocomplete({
|
||||
minLength: 0,
|
||||
source: function(request, response){
|
||||
@ -306,6 +307,31 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
olamy: doesn't work????
|
||||
var values=[];
|
||||
$(usersViewModel.users()).each(function(idx,user){
|
||||
var value=user[property];
|
||||
if(value!=null && $.inArray(value, values)<0){
|
||||
values.push(value);
|
||||
}
|
||||
});
|
||||
var jid = "#users-grid-filter-auto-"+property;
|
||||
$.log("applyAutocompleteOnHeader:"+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);
|
||||
});*/
|
||||
}
|
||||
|
||||
/**
|
||||
@ -341,7 +367,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) {
|
||||
}
|
||||
})
|
||||
mainContent.find("#users-view-tabs-content #users-view").addClass("active");
|
||||
applyAutocompleteOnHeaders(usersViewModel);
|
||||
mainContent.find("#usersTable").find('.dropdown-toggle').dropdown();
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ <h3>${$value.name}</h3>
|
||||
{{each(i, columnDefinition) columns}}
|
||||
<th>
|
||||
{{if columnDefinition.filter }}
|
||||
<input type="text" class="form-search input-medium" id="users-grid-filter-auto-${columnDefinition.rowText}"
|
||||
<input type="text" class="input-medium" id="users-grid-filter-auto-${columnDefinition.rowText}"
|
||||
placeholder="${$.i18n.prop('users.grid.filter')}"/>
|
||||
{{/if}}
|
||||
</th>
|
||||
|
Loading…
x
Reference in New Issue
Block a user