diff --git a/public/home/search.js b/public/home/search.js index 6980ee359..3f3137f03 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -35,8 +35,8 @@ var itemType={ var sortBy={ "11":"updated_unix.keyword", "12":"num_watches", - "13":"num_stars.keyword", - "14":"num_forks.keyword", + "13":"num_stars", + "14":"num_forks", "21":"updated_unix.keyword", "31":"created_unix.keyword", "32":"name.keyword", @@ -79,7 +79,7 @@ function initPageInfo(){ } function searchItem(type,sortType){ - console.log("enter here 2."); + console.log("enter item 2."); currentSearchKeyword = document.getElementById("keyword_input").value; if(!isEmpty(currentSearchKeyword)){ initPageInfo(); @@ -113,8 +113,16 @@ function search(){ } } -function searchLabel(){ - +function searchLabel(tableName,keyword,sortBy="",ascending=false){ + console.log("enter label search."); + currentSearchKeyword = keyword; + initPageInfo(); + currentSearchTableName = tableName; + currentSearchSortBy = sortBy; + currentSearchAscending = ascending; + OnlySearchLabel =true; + + page(currentPage); } function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy="",OnlySearchLabel=false){ @@ -459,8 +467,8 @@ function displayRepoResult(page,jsonResult,onlyReturnNum,keyword){ html += "