]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - tpl/js/poche.js
b4eac11c17f0d1488c6590c3853cc416bd59e227
1 function toggle_favorite(element
, id
) {
2 $(element
).toggleClass('fav-off');
4 url: "index.php?action=toggle_fav",
9 function toggle_archive(element
, id
, view_article
) {
10 $(element
).toggleClass('archive-off');
12 url: "index.php?action=toggle_archive",
15 var obj
= $('#entry-'+id
);
17 // on vient de la vue de l'article, donc pas de gestion de grille
18 if (view_article
!= 1) {
19 $('#content').masonry('remove',obj
);
20 $('#content').masonry('reloadItems');
21 $('#content').masonry('reload');
25 function sort_links(view
, sort
) {
26 $.get('index.php', { view: view
, sort: sort
}, function(data
) {
27 $('#content').html(data
);
32 // ---------- Swith light or dark view
33 function setActiveStyleSheet(title
) {
35 for(i
=0; (a
= document
.getElementsByTagName("link")[i
]); i
++) {
36 if(a
.getAttribute("rel").indexOf("style") != -1 && a
.getAttribute("title")) {
38 if(a
.getAttribute("title") == title
) a
.disabled
= false;
42 $('#themeswitch').click(function() {
44 if ($('body').hasClass('light-style')) {
45 setActiveStyleSheet('dark-style');
46 $('body').addClass('dark-style');
47 $('body').removeClass('light-style');
48 $('#themeswitch').text('light');
50 } else if ($('body').hasClass('dark-style')) {
51 setActiveStyleSheet('light-style');
52 $('body').addClass('light-style');
53 $('body').removeClass('dark-style');
54 $('#themeswitch').text('dark');