From eaef338dce2fc8ad926b291f72a84556afe13a59 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 26 Jan 2014 18:57:22 +0100 Subject: [PATCH] watch.js + hide-threads.js integration; fixes vichan-devel#40 --- js/watch.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/watch.js b/js/watch.js index 64437f47..d8a1dcae 100644 --- a/js/watch.js +++ b/js/watch.js @@ -11,6 +11,7 @@ * $config['additional_javascript'][] = 'js/mobile-style.js'; * //$config['additional_javascript'][] = 'js/titlebar-notifications.js'; * //$config['additional_javascript'][] = 'js/auto-reload.js'; + * //$config['additional_javascript'][] = 'js/hide-threads.js'; * //$config['additional_javascript'][] = 'js/compact-boardlist.js'; * $config['additional_javascript'][] = 'js/watch.js'; * @@ -265,10 +266,26 @@ $(function(){ var new_threads = 0; + var hidden_data = {}; + if (localStorage.hiddenthreads) { + hidden_data = JSON.parse(localStorage.hiddenthreads); + } + for (var i in json) { for (var j in json[i].threads) { var thread = json[i].threads[j]; + if (hidden_data[board]) { // hide threads integration + var cont = false; + for (var k in hidden_data[board]) { + if (parseInt(k) == thread.no) { + cont = true; + break; + } + } + if (cont) continue; + } + if (thread.last_modified > storage()[board].watched / 1000) { last_thread = thread.no;