|
|
|
@@ -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 += " <div class=\"ui tags\">"; |
|
|
|
if(!isEmpty(recordMap["topics"]) && recordMap["topics"] !="null"){ |
|
|
|
for(var j = 0; j < recordMap["topics"].length;j++){ |
|
|
|
//function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy){ |
|
|
|
html +=" <a href=\"javascript:doSearch('repository','" + recordMap["topics"][j] + "',1,15,false,'updated_unix.keyword',true);\"><div class=\"ui small label topic\">"+ recordMap["topics"][j] + "</div></a>"; |
|
|
|
//function searchLabel(tableName,keyword,sortBy="",ascending=false) |
|
|
|
html +=" <a href=\"javascript:searchLabel('repository','" + recordMap["topics"][j] + "','updated_unix.keyword',false);\"><div class=\"ui small label topic\">"+ recordMap["topics"][j] + "</div></a>"; |
|
|
|
} |
|
|
|
} |
|
|
|
html +=" </div>"; |
|
|
|
@@ -631,4 +639,14 @@ function page(current){ |
|
|
|
goPage(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document.onreadystatechange = function() { |
|
|
|
if (document.readyState === "complete") { |
|
|
|
var keyword = $('#keyword_input').val(); |
|
|
|
if(!isEmpty(keyword)){ |
|
|
|
search(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |