aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/poche.js
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2013-04-21 10:53:22 -0700
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2013-04-21 10:53:22 -0700
commit37c6ed4e7a75238504a28d6be5fbaad475689526 (patch)
tree69bfdf8ddbc09467be830274f434190b42979aa1 /js/poche.js
parentff4d8c8c1efca0759330906419cb5f36de86d156 (diff)
parentf0070a15e4725255dad967bde76155a39d189631 (diff)
downloadwallabag-37c6ed4e7a75238504a28d6be5fbaad475689526.tar.gz
wallabag-37c6ed4e7a75238504a28d6be5fbaad475689526.tar.zst
wallabag-37c6ed4e7a75238504a28d6be5fbaad475689526.zip
Merge pull request #67 from inthepoche/dev
tag 0.2
Diffstat (limited to 'js/poche.js')
-rw-r--r--js/poche.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/js/poche.js b/js/poche.js
index 6bc3c188..97d9911d 100644
--- a/js/poche.js
+++ b/js/poche.js
@@ -23,8 +23,35 @@ function toggle_archive(element, id, view_article) {
23} 23}
24 24
25function sort_links(view, sort) { 25function sort_links(view, sort) {
26 //$('#content').load('index.php', { view: view, sort: sort, full_head: 'no' } );
27 $.get('index.php', { view: view, sort: sort, full_head: 'no' }, function(data) { 26 $.get('index.php', { view: view, sort: sort, full_head: 'no' }, function(data) {
28 $('#content').html(data); 27 $('#content').html(data);
29 }); 28 });
30} \ No newline at end of file 29}
30
31
32// ---------- Swith light or dark view
33function setActiveStyleSheet(title) {
34 var i, a, main;
35 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
36 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
37 a.disabled = true;
38 if(a.getAttribute("title") == title) a.disabled = false;
39 }
40 }
41}
42$('#themeswitch').click(function() {
43 // we want the dark
44 if ($('body').hasClass('light-style')) {
45 setActiveStyleSheet('dark-style');
46 $('body').addClass('dark-style');
47 $('body').removeClass('light-style');
48 $('#themeswitch').text('light');
49 // we want the 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');
55 }
56 return false;
57});