| @@ -52,17 +52,24 @@ var currentSearchTableName =""; | |||
| var currentSearchKeyword=""; | |||
| var currentSearchSortBy=""; | |||
| var OnlySearchLabel=false; | |||
| var startIndex =1; | |||
| var endIndex = 5; | |||
| function initPageInfo(){ | |||
| currentPage = 1; | |||
| startIndex =1; | |||
| endIndex = 5; | |||
| } | |||
| function searchItem(type,sortType){ | |||
| console.log("enter here 2."); | |||
| currentSearchKeyword = document.getElementById("keyword_input").value; | |||
| if(!isEmpty(currentSearchKeyword)){ | |||
| currentPage = 1; | |||
| initPageInfo(); | |||
| currentSearchTableName = itemType[type]; | |||
| currentSearchSortBy = sortBy[sortType]; | |||
| OnlySearchLabel =false; | |||
| page(currentPage); | |||
| //doSearch(itemType[type],currentSearchKeyword,currentPage,pageSize,false,sortBy[sortType]); | |||
| } | |||
| } | |||
| @@ -71,19 +78,18 @@ function searchItem(type,sortType){ | |||
| function search(){ | |||
| console.log("enter here 1."); | |||
| currentSearchKeyword = document.getElementById("keyword_input").value; | |||
| currentPage = 1; | |||
| initPageInfo(); | |||
| if(!isEmpty(currentSearchKeyword)){ | |||
| currentSearchTableName = "repository"; | |||
| currentSearchSortBy = sortBy[11]; | |||
| OnlySearchLabel =false; | |||
| page(currentPage); | |||
| //doSearch("repository",keyword,page,pageSize,false,sortBy[11]); | |||
| doSearch("issue",currentSearchKeyword,currentPage,pageSize,true,""); | |||
| doSearch("user",currentSearchKeyword,currentPage,pageSize,true,""); | |||
| doSearch("org",currentSearchKeyword,currentPage,pageSize,true,""); | |||
| doSearch("dataset",currentSearchKeyword,currentPage,pageSize,true,""); | |||
| doSearch("pr",currentSearchKeyword,currentPage,pageSize,true,""); | |||
| doSearch("issue",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("user",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("org",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("dataset",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("pr",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| } | |||
| @@ -520,15 +526,15 @@ function page(current){ | |||
| function nextPage(){ | |||
| currentPage = currentPage+1; | |||
| console.log("current=" + currentPage); | |||
| console.log("currentPage=" + currentPage); | |||
| page(currentPage); | |||
| } | |||
| function prePage(){ | |||
| console.log("current=" + currentPage); | |||
| if(current > 1){ | |||
| console.log("currentPage=" + currentPage); | |||
| if(currentPage > 1){ | |||
| currentPage = currentPage-1; | |||
| console.log("current=" + (currentPage)); | |||
| console.log("currentPage=" + (currentPage)); | |||
| page(currentPage); | |||
| } | |||
| } | |||