fix search
This commit is contained in:
0
jquery/fileuploader.js
vendored
Normal file → Executable file
0
jquery/fileuploader.js
vendored
Normal file → Executable file
69
jquery/handler.js
vendored
Normal file → Executable file
69
jquery/handler.js
vendored
Normal file → Executable file
@@ -667,46 +667,19 @@ var databap =
|
||||
databap.getInfo
|
||||
(
|
||||
'search',
|
||||
function(asData)
|
||||
function(asItems)
|
||||
{
|
||||
databap.$main.find('#code_container').empty();
|
||||
databap.setCodeContainer
|
||||
(
|
||||
function()
|
||||
{
|
||||
//display results
|
||||
if(asData.length==0)
|
||||
{
|
||||
databap.$main.find('#code_container').append('Aucun résultat trouvé.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$.each
|
||||
(
|
||||
asData,
|
||||
function(id_code, code_info)
|
||||
{
|
||||
//append container
|
||||
codeBoxId = databap.appendContainer('#code_container', id_code);
|
||||
|
||||
//link
|
||||
$('#'+codeBoxId).click
|
||||
(
|
||||
function()
|
||||
{
|
||||
databap.vars.code = databap.getFirstElemId($(this).attr('id'));
|
||||
databap.switchPage(databap.pages.read_code);
|
||||
}
|
||||
).addClass('clickable');
|
||||
|
||||
//append code to main and refresh id and return tag
|
||||
var idTag = databap.appendCode('#'+codeBoxId, code_info);
|
||||
}
|
||||
);
|
||||
}
|
||||
databap.addSuccessIcon();
|
||||
}
|
||||
);
|
||||
$Container = databap.$main.find('#list_container');
|
||||
$Container.empty();
|
||||
if(asItems.length==0)
|
||||
{
|
||||
$Container.append('Aucun résultat trouvé.');
|
||||
}
|
||||
else
|
||||
{
|
||||
for(iRankId in asItems) databap.appendItem(asItems[iRankId], $Container);
|
||||
}
|
||||
databap.addSuccessIcon();
|
||||
},
|
||||
{keywords:searchWords},
|
||||
'json'
|
||||
@@ -722,6 +695,24 @@ var databap =
|
||||
//else debug('same words');
|
||||
},
|
||||
|
||||
appendItem: function(asItemInfo, $Container)
|
||||
{
|
||||
//Filling up the item line
|
||||
$verHtml = $(databap.consts.versionHtml);
|
||||
$verHtml.find('#description').html(asItemInfo.description);
|
||||
$verHtml.find('#author_name').html(asItemInfo.name);
|
||||
$verHtml.find('#author_company').html(asItemInfo.company);
|
||||
$verHtml.find('#led').html(asItemInfo.led);
|
||||
|
||||
//Link
|
||||
var sItemLink = databap.getExternalLink(asItemInfo.type, asItemInfo.id_item);
|
||||
$verHtml.find('#item_link').attr('href', sItemLink).attr('title', 'Lien vers '+sItemLink);
|
||||
$verHtml = databap.setElemTags($verHtml, asItemInfo.id_item, false, asItemInfo.type);
|
||||
|
||||
//Display
|
||||
$verHtml.hide().appendTo(databap.getMainElem('#list_container')).slideDown('fast');
|
||||
},
|
||||
|
||||
getCodeLink: function(code)
|
||||
{
|
||||
return databap.getExternalLink('code', code);
|
||||
|
||||
0
jquery/jquery-1.4.4.min.js
vendored
Normal file → Executable file
0
jquery/jquery-1.4.4.min.js
vendored
Normal file → Executable file
0
jquery/jquery-1.6.1.min.js
vendored
Normal file → Executable file
0
jquery/jquery-1.6.1.min.js
vendored
Normal file → Executable file
0
jquery/jquery.min.js
vendored
Normal file → Executable file
0
jquery/jquery.min.js
vendored
Normal file → Executable file
0
jquery/resize.js
vendored
Normal file → Executable file
0
jquery/resize.js
vendored
Normal file → Executable file
0
jquery/tinyscrollbar.js
vendored
Normal file → Executable file
0
jquery/tinyscrollbar.js
vendored
Normal file → Executable file
Reference in New Issue
Block a user