2015-01-28 13:58:12 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$("#search-form").hide();
|
|
|
|
$("#bagit-form").hide();
|
2015-08-24 20:43:29 +02:00
|
|
|
$("#filter-form").hide();
|
2016-03-08 17:02:34 +01:00
|
|
|
$("#download-form").hide();
|
2015-01-28 13:58:12 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Toggle the "Search" popup in the sidebar
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function toggleSearch() {
|
|
|
|
$("#search-form").toggle();
|
|
|
|
$("#search").toggleClass("current");
|
|
|
|
$("#search").toggleClass("active-current");
|
|
|
|
$("#search-arrow").toggleClass("arrow-down");
|
|
|
|
if ($("#search").hasClass("current")) {
|
|
|
|
$("#content").addClass("opacity03");
|
|
|
|
} else {
|
|
|
|
$("#content").removeClass("opacity03");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-24 20:43:29 +02:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Toggle the "Filter" popup on entries list
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function toggleFilter() {
|
|
|
|
$("#filter-form").toggle();
|
|
|
|
}
|
|
|
|
|
2016-03-08 17:02:34 +01:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Toggle the "Download" popup on entries list
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function toggleDownload() {
|
|
|
|
$("#download-form").toggle();
|
|
|
|
}
|
|
|
|
|
2015-01-28 13:58:12 +01:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Toggle the "Save a Link" popup in the sidebar
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function toggleBagit() {
|
|
|
|
$("#bagit-form").toggle();
|
|
|
|
$("#bagit").toggleClass("current");
|
|
|
|
$("#bagit").toggleClass("active-current");
|
|
|
|
$("#bagit-arrow").toggleClass("arrow-down");
|
|
|
|
if ($("#bagit").hasClass("current")) {
|
|
|
|
$("#content").addClass("opacity03");
|
|
|
|
} else {
|
|
|
|
$("#content").removeClass("opacity03");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Close all #links popups in the sidebar
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function closePopups() {
|
|
|
|
$("#links .messages").hide();
|
|
|
|
$("#links > li > a").removeClass("active-current");
|
|
|
|
$("#links > li > a").removeClass("current");
|
|
|
|
$("[id$=-arrow]").removeClass("arrow-down");
|
|
|
|
$("#content").removeClass("opacity03");
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#search").click(function(){
|
|
|
|
closePopups();
|
|
|
|
toggleSearch();
|
|
|
|
$("#searchfield").focus();
|
|
|
|
});
|
|
|
|
|
2016-03-08 17:02:34 +01:00
|
|
|
$(".filter-btn").click(function(){
|
2015-08-24 20:43:29 +02:00
|
|
|
closePopups();
|
|
|
|
toggleFilter();
|
|
|
|
});
|
|
|
|
|
2016-03-08 17:02:34 +01:00
|
|
|
$(".download-btn").click(function(){
|
|
|
|
closePopups();
|
|
|
|
toggleDownload();
|
|
|
|
});
|
|
|
|
|
2015-01-28 13:58:12 +01:00
|
|
|
$("#bagit").click(function(){
|
|
|
|
closePopups();
|
|
|
|
toggleBagit();
|
|
|
|
$("#plainurl").focus();
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#search-form-close").click(function(){
|
|
|
|
toggleSearch();
|
|
|
|
});
|
|
|
|
|
2015-08-24 20:43:29 +02:00
|
|
|
$("#filter-form-close").click(function(){
|
|
|
|
toggleFilter();
|
|
|
|
});
|
|
|
|
|
2016-03-08 17:02:34 +01:00
|
|
|
$("#download-form-close").click(function(){
|
|
|
|
toggleDownload();
|
|
|
|
});
|
|
|
|
|
2015-01-28 13:58:12 +01:00
|
|
|
$("#bagit-form-close").click(function(){
|
|
|
|
toggleBagit();
|
|
|
|
});
|
|
|
|
});
|