|
|
@ -19,17 +19,18 @@ |
|
|
|
function addPaginationLinks(totalResults) { |
|
|
|
function addPaginationLinks(totalResults) { |
|
|
|
var curPage = currentIndex; // check what page the app is on |
|
|
|
var curPage = currentIndex; // check what page the app is on |
|
|
|
var pagesDiv = $("<div id='resultFooter' class='resultFooter'>"); |
|
|
|
var pagesDiv = $("<div id='resultFooter' class='resultFooter'>"); |
|
|
|
for (var i = 0; i < 10; i++) { |
|
|
|
for (var i = 0; i < 8; i++) { |
|
|
|
if (i * limit < totalResults) { |
|
|
|
if (i * limit < totalResults) { |
|
|
|
|
|
|
|
|
|
|
|
var link = $("<a class='pager_button'></a>").attr('href', 'javascript:gotoPage('+i+');').html(i).appendTo(pagesDiv); |
|
|
|
var link = $("<a class='pager_button'></a>").attr('href', 'javascript:gotoPage('+i+');').html(i+1).appendTo(pagesDiv); |
|
|
|
if (curPage == i) { |
|
|
|
if (curPage == i) { |
|
|
|
link.addClass('active'); |
|
|
|
link.addClass('active'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pagesDiv.appendTo($('#searchResult')); |
|
|
|
$("#disc_nav_cont #resultFooter").remove(); |
|
|
|
|
|
|
|
pagesDiv.insertBefore($('#disclaimer')); |
|
|
|
|
|
|
|
|
|
|
|
$(".imgContainer").each(function(){ |
|
|
|
$(".imgContainer").each(function(){ |
|
|
|
this.addEventListener("dragstart", imageDragging, false); |
|
|
|
this.addEventListener("dragstart", imageDragging, false); |
|
|
@ -127,8 +128,10 @@ |
|
|
|
var mode = false; //search or view mode |
|
|
|
var mode = false; //search or view mode |
|
|
|
var hide = false; //hide or no main panel |
|
|
|
var hide = false; //hide or no main panel |
|
|
|
|
|
|
|
|
|
|
|
//basic containers and elements |
|
|
|
//basic containers and elements |
|
|
|
var disclaimer = $("<div id='disclaimer' class='disclaimer'>Recherche de documents audio sur Planète Sankoré<div>").appendTo("body"); |
|
|
|
var disc_nav_cont = $("<div id='disc_nav_cont' class='disc_nav_cont'>").appendTo("body"); |
|
|
|
|
|
|
|
var disclaimer = $("<div id='disclaimer' class='disclaimer'>Recherche de documents audio sur Planète Sankoré<div>").appendTo(disc_nav_cont); |
|
|
|
|
|
|
|
var search = $("<div id='search' class='search'>").appendTo("body"); |
|
|
|
var search = $("<div id='search' class='search'>").appendTo("body"); |
|
|
|
var search = $("<div id='search' class='search'>").appendTo("body"); |
|
|
|
|
|
|
|
|
|
|
|
var togglePages = $("<div id='togglePages' class='togglePages'>").appendTo(search); |
|
|
|
var togglePages = $("<div id='togglePages' class='togglePages'>").appendTo(search); |
|
|
@ -165,7 +168,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
togglePages.click(function(event){ |
|
|
|
/*togglePages.click(function(event){ |
|
|
|
if(mode){ |
|
|
|
if(mode){ |
|
|
|
hide = false; |
|
|
|
hide = false; |
|
|
|
$("#search, #disclaimer").slideDown('slow', function(){ |
|
|
|
$("#search, #disclaimer").slideDown('slow', function(){ |
|
|
@ -181,12 +184,12 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
mode = true; |
|
|
|
mode = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
|
|
searchButton.click(function(){ |
|
|
|
searchButton.click(function(){ |
|
|
|
if(!hide){ |
|
|
|
if(!hide){ |
|
|
|
runSearch(searchInput.val(), 0); |
|
|
|
runSearch(searchInput.val(), 0); |
|
|
|
togglePages.trigger("click"); |
|
|
|
//togglePages.trigger("click"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -204,11 +207,11 @@ |
|
|
|
sankore.sendFileMetadata(createMetaData($(this))); |
|
|
|
sankore.sendFileMetadata(createMetaData($(this))); |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
$(window).resize(function(){ |
|
|
|
/*$(window).resize(function(){ |
|
|
|
disclaimer.width($("body").width()-20); |
|
|
|
disclaimer.width($("body").width()-20); |
|
|
|
search.width($("body").width()-20); |
|
|
|
search.width($("body").width()-20); |
|
|
|
toggleIcon.css("margin-left",(togglePages.width()/2 - 7)); |
|
|
|
toggleIcon.css("margin-left",(togglePages.width()/2 - 7)); |
|
|
|
}) |
|
|
|
})*/ |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|