|
|
|
@ -30,12 +30,14 @@ OC.search.showResults=function(results){
|
|
|
|
$(window).click(function(event){
|
|
|
|
$(window).click(function(event){
|
|
|
|
OC.search.hide();
|
|
|
|
OC.search.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
OC.search.lastResults=results;
|
|
|
|
OC.search.showResults(results);
|
|
|
|
OC.search.showResults(results);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
var types=OC.search.catagorizeResults(results);
|
|
|
|
var types=OC.search.catagorizeResults(results);
|
|
|
|
$('#searchresults').show();
|
|
|
|
$('#searchresults').show();
|
|
|
|
$('#searchresults tr.result').remove();
|
|
|
|
$('#searchresults tr.result').remove();
|
|
|
|
|
|
|
|
var index=0;
|
|
|
|
for(var name in types){
|
|
|
|
for(var name in types){
|
|
|
|
var type=types[name];
|
|
|
|
var type=types[name];
|
|
|
|
if(type.length>0){
|
|
|
|
if(type.length>0){
|
|
|
|
@ -46,6 +48,8 @@ OC.search.showResults=function(results){
|
|
|
|
row.find('td.result a').attr('href',type[0].link);
|
|
|
|
row.find('td.result a').attr('href',type[0].link);
|
|
|
|
row.find('td.result div.name').text(type[0].name);
|
|
|
|
row.find('td.result div.name').text(type[0].name);
|
|
|
|
row.find('td.result div.text').text(type[0].text);
|
|
|
|
row.find('td.result div.text').text(type[0].text);
|
|
|
|
|
|
|
|
row.data('index',index);
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here
|
|
|
|
if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here
|
|
|
|
OC.search.customResults[name](row,type[0]);
|
|
|
|
OC.search.customResults[name](row,type[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -57,6 +61,8 @@ OC.search.showResults=function(results){
|
|
|
|
row.find('td.result a').attr('href',type[i].link);
|
|
|
|
row.find('td.result a').attr('href',type[i].link);
|
|
|
|
row.find('td.result div.name').text(type[i].name);
|
|
|
|
row.find('td.result div.name').text(type[i].name);
|
|
|
|
row.find('td.result div.text').text(type[i].text);
|
|
|
|
row.find('td.result div.text').text(type[i].text);
|
|
|
|
|
|
|
|
row.data('index',index);
|
|
|
|
|
|
|
|
index++;
|
|
|
|
if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here
|
|
|
|
if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here
|
|
|
|
OC.search.customResults[name](row,type[i]);
|
|
|
|
OC.search.customResults[name](row,type[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -67,3 +73,11 @@ OC.search.showResults=function(results){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OC.search.showResults.loaded=false;
|
|
|
|
OC.search.showResults.loaded=false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OC.search.renderCurrent=function(){
|
|
|
|
|
|
|
|
if($('#searchresults tr.result')[OC.search.currentResult]){
|
|
|
|
|
|
|
|
var result=$('#searchresults tr.result')[OC.search.currentResult];
|
|
|
|
|
|
|
|
$('#searchresults tr.result').removeClass('current');
|
|
|
|
|
|
|
|
$(result).addClass('current');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|