2014-03-08 07:47:15 -05:00
|
|
|
$.fn.ready(function() {
|
|
|
|
|
|
|
|
var $listmode = $('#listmode'),
|
|
|
|
$listentries = $("#list-entries"),
|
|
|
|
$bagit = $('#bagit'),
|
|
|
|
$bagitForm = $('#bagit-form');
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
|
|
Menu
|
|
|
|
========================================================================== */
|
2014-02-27 09:11:37 -05:00
|
|
|
|
|
|
|
$("#menu").click(function(){
|
|
|
|
$("#links").toggle();
|
|
|
|
});
|
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
/* ==========================================================================
|
|
|
|
List mode or Table Mode
|
|
|
|
========================================================================== */
|
2014-02-27 09:11:37 -05:00
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
$listmode.click(function(){
|
2014-02-27 09:11:37 -05:00
|
|
|
if ( $.cookie("listmode") == 1 ) {
|
2014-03-08 07:47:15 -05:00
|
|
|
// Cookie
|
2014-02-27 09:11:37 -05:00
|
|
|
$.removeCookie("listmode");
|
2014-03-08 07:47:15 -05:00
|
|
|
|
|
|
|
$listentries.removeClass("listmode");
|
|
|
|
$listmode.removeClass("tablemode");
|
|
|
|
$listmode.addClass("listmode");
|
2014-02-12 15:58:40 -05:00
|
|
|
}
|
2014-02-27 09:11:37 -05:00
|
|
|
else {
|
2014-03-08 07:47:15 -05:00
|
|
|
// Cookie
|
2014-02-27 09:11:37 -05:00
|
|
|
$.cookie("listmode", 1, {expires: 365});
|
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
$listentries.addClass("listmode");
|
|
|
|
$listmode.removeClass("listmode");
|
|
|
|
$listmode.addClass("tablemode");
|
2014-02-27 09:11:37 -05:00
|
|
|
}
|
|
|
|
|
2014-02-12 15:58:40 -05:00
|
|
|
});
|
2014-02-27 09:11:37 -05:00
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
/* ==========================================================================
|
|
|
|
Cookie listmode
|
|
|
|
========================================================================== */
|
|
|
|
|
2014-02-27 09:11:37 -05:00
|
|
|
if ( $.cookie("listmode") == 1 ) {
|
2014-03-08 07:47:15 -05:00
|
|
|
$listentries.addClass("listmode");
|
|
|
|
$listmode.removeClass("listmode");
|
|
|
|
$listmode.addClass("tablemode");
|
2014-02-27 09:11:37 -05:00
|
|
|
}
|
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
/* ==========================================================================
|
|
|
|
bag it link
|
|
|
|
========================================================================== */
|
|
|
|
|
|
|
|
$bagit.click(function(){
|
|
|
|
$bagitForm.toggle();
|
|
|
|
});
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
|
|
Keyboard gestion
|
|
|
|
========================================================================== */
|
|
|
|
|
|
|
|
$(window).keydown(function(e){
|
|
|
|
switch (e.keyCode) {
|
|
|
|
// s letter
|
|
|
|
case 83:
|
|
|
|
$bagitForm.toggle();
|
|
|
|
break;
|
|
|
|
case 27:
|
|
|
|
$bagitForm.hide();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2014-02-27 09:11:37 -05:00
|
|
|
|
2014-03-08 07:47:15 -05:00
|
|
|
});
|