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