2014-03-08 13:47:15 +01:00
|
|
|
$.fn.ready(function() {
|
|
|
|
|
|
|
|
var $listmode = $('#listmode'),
|
2014-03-27 17:21:30 +01:00
|
|
|
$listentries = $("#list-entries");
|
2014-03-08 13:47:15 +01:00
|
|
|
|
|
|
|
/* ==========================================================================
|
|
|
|
Menu
|
|
|
|
========================================================================== */
|
2014-02-27 15:11:37 +01:00
|
|
|
|
|
|
|
$("#menu").click(function(){
|
|
|
|
$("#links").toggle();
|
|
|
|
});
|
|
|
|
|
2014-03-08 13:47:15 +01:00
|
|
|
/* ==========================================================================
|
|
|
|
List mode or Table Mode
|
|
|
|
========================================================================== */
|
2014-02-27 15:11:37 +01:00
|
|
|
|
2014-03-08 13:47:15 +01:00
|
|
|
$listmode.click(function(){
|
2014-02-27 15:11:37 +01:00
|
|
|
if ( $.cookie("listmode") == 1 ) {
|
2014-03-08 13:47:15 +01:00
|
|
|
// Cookie
|
2014-02-27 15:11:37 +01:00
|
|
|
$.removeCookie("listmode");
|
2014-03-08 13:47:15 +01:00
|
|
|
|
|
|
|
$listentries.removeClass("listmode");
|
|
|
|
$listmode.removeClass("tablemode");
|
|
|
|
$listmode.addClass("listmode");
|
2014-02-12 21:58:40 +01:00
|
|
|
}
|
2014-02-27 15:11:37 +01:00
|
|
|
else {
|
2014-03-08 13:47:15 +01:00
|
|
|
// Cookie
|
2014-02-27 15:11:37 +01:00
|
|
|
$.cookie("listmode", 1, {expires: 365});
|
|
|
|
|
2014-03-08 13:47:15 +01:00
|
|
|
$listentries.addClass("listmode");
|
|
|
|
$listmode.removeClass("listmode");
|
|
|
|
$listmode.addClass("tablemode");
|
2014-02-27 15:11:37 +01:00
|
|
|
}
|
|
|
|
|
2014-02-12 21:58:40 +01:00
|
|
|
});
|
2014-02-27 15:11:37 +01:00
|
|
|
|
2014-03-08 13:47:15 +01:00
|
|
|
/* ==========================================================================
|
|
|
|
Cookie listmode
|
|
|
|
========================================================================== */
|
|
|
|
|
2014-02-27 15:11:37 +01:00
|
|
|
if ( $.cookie("listmode") == 1 ) {
|
2014-03-08 13:47:15 +01:00
|
|
|
$listentries.addClass("listmode");
|
|
|
|
$listmode.removeClass("listmode");
|
|
|
|
$listmode.addClass("tablemode");
|
2014-02-27 15:11:37 +01:00
|
|
|
}
|
|
|
|
|
2014-03-12 12:00:37 +01:00
|
|
|
});
|