diff options
Diffstat (limited to 'js/poche.js')
-rw-r--r-- | js/poche.js | 31 |
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 | ||
25 | function sort_links(view, sort) { | 25 | function 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 | ||
33 | function 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 | }); | ||