mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-27 17:28:39 +00:00
bagit link + overlay save link + listmode
This commit is contained in:
parent
b3f7b7d200
commit
4744cb0e1d
5 changed files with 107 additions and 24 deletions
|
@ -1,36 +1,75 @@
|
|||
$(document).ready(function() {
|
||||
$.fn.ready(function() {
|
||||
|
||||
var $listmode = $('#listmode'),
|
||||
$listentries = $("#list-entries"),
|
||||
$bagit = $('#bagit'),
|
||||
$bagitForm = $('#bagit-form');
|
||||
|
||||
/* ==========================================================================
|
||||
Menu
|
||||
========================================================================== */
|
||||
|
||||
$("#menu").click(function(){
|
||||
$("#links").toggle();
|
||||
});
|
||||
|
||||
/* ==========================================================================
|
||||
List mode or Table Mode
|
||||
========================================================================== */
|
||||
|
||||
$("#listmode").click(function(){
|
||||
$listmode.click(function(){
|
||||
if ( $.cookie("listmode") == 1 ) {
|
||||
$(".entrie").css("width", "");
|
||||
$(".entrie").css("margin-left", "");
|
||||
|
||||
// Cookie
|
||||
$.removeCookie("listmode");
|
||||
$("#listmode").removeClass("tablemode");
|
||||
$("#listmode").addClass("listmode");
|
||||
|
||||
$listentries.removeClass("listmode");
|
||||
$listmode.removeClass("tablemode");
|
||||
$listmode.addClass("listmode");
|
||||
}
|
||||
else {
|
||||
// Cookie
|
||||
$.cookie("listmode", 1, {expires: 365});
|
||||
|
||||
$(".entrie").css("width", "100%");
|
||||
$(".entrie").css("margin-left", "0");
|
||||
$("#listmode").removeClass("listmode");
|
||||
$("#listmode").addClass("tablemode");
|
||||
$listentries.addClass("listmode");
|
||||
$listmode.removeClass("listmode");
|
||||
$listmode.addClass("tablemode");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/* ==========================================================================
|
||||
Cookie listmode
|
||||
========================================================================== */
|
||||
|
||||
if ( $.cookie("listmode") == 1 ) {
|
||||
$(".entrie").css("width", "100%");
|
||||
$(".entrie").css("margin-left", "0");
|
||||
$("#listmode").removeClass("listmode");
|
||||
$("#listmode").addClass("tablemode");
|
||||
$listentries.addClass("listmode");
|
||||
$listmode.removeClass("listmode");
|
||||
$listmode.addClass("tablemode");
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
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;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue