2014-04-08 15:58:44 -04:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$("#search-form").hide();
|
2014-11-02 11:15:36 -05:00
|
|
|
$("#bagit-form").hide();
|
2014-04-08 15:58:44 -04:00
|
|
|
|
2014-11-02 11:15:36 -05:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Toggle the "Search" popup in the sidebar
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
function toggleSearch() {
|
2014-04-08 15:58:44 -04:00
|
|
|
$("#search-form").toggle();
|
|
|
|
$("#search").toggleClass("current");
|
2014-11-02 11:15:36 -05:00
|
|
|
$("#search").toggleClass("active-current");
|
2014-04-08 15:58:44 -04:00
|
|
|
$("#search-arrow").toggleClass("arrow-down");
|
2014-11-02 11:15:36 -05:00
|
|
|
if ($("#search").hasClass("current")) {
|
|
|
|
$("#content").addClass("opacity03");
|
|
|
|
} else {
|
|
|
|
$("#content").removeClass("opacity03");
|
|
|
|
}
|
2014-04-08 15:58:44 -04:00
|
|
|
}
|
|
|
|
|
2014-11-02 11:15:36 -05: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");
|
2014-10-15 10:47:38 -04:00
|
|
|
}
|
2014-11-02 11:15:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// 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();
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#bagit").click(function(){
|
|
|
|
closePopups();
|
|
|
|
toggleBagit();
|
|
|
|
$("#plainurl").focus();
|
2014-04-08 15:58:44 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
$("#search-form-close").click(function(){
|
2014-11-02 11:15:36 -05:00
|
|
|
toggleSearch();
|
2014-04-08 15:58:44 -04:00
|
|
|
});
|
|
|
|
|
2014-11-02 11:15:36 -05:00
|
|
|
$("#bagit-form-close").click(function(){
|
|
|
|
toggleBagit();
|
|
|
|
});
|
|
|
|
|
|
|
|
// $("#").click(function(){
|
|
|
|
// toggleSearch();
|
|
|
|
// });
|
|
|
|
|
2014-04-08 15:58:44 -04:00
|
|
|
|
2014-11-02 11:15:36 -05:00
|
|
|
});
|