From e8b530a78369fffff024f1d26696605c3f1130c2 Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 31 Jan 2015 23:30:59 -0800 Subject: [PATCH] Shift-click to hide threads in catalog --- js/catalog.js | 12 ++++++++++-- templates/themes/catalog/catalog.html | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/catalog.js b/js/catalog.js index 801c86bc..38382096 100644 --- a/js/catalog.js +++ b/js/catalog.js @@ -1,5 +1,4 @@ if (active_page == 'catalog') $(function(){ - if (localStorage.catalog !== undefined) { var catalog = JSON.parse(localStorage.catalog); } else { @@ -15,8 +14,18 @@ if (active_page == 'catalog') $(function(){ $('a[href$="/'+k+'.html"]').parents('.mix').remove(); }); } + } else { + hidden_data = {}; } + $(document).on('click', '.mix', function(e) { + if (e.shiftKey) { + hidden_data[board_name][$(this).data('id')] = Math.round(Date.now() / 1000); + $(this).remove(); + localStorage.hiddenthreads = JSON.stringify(hidden_data); + } + }); + $("#sort_by").change(function(){ var value = this.value; $('#Grid').mixItUp('sort', value); @@ -46,5 +55,4 @@ if (active_page == 'catalog') $(function(){ if (catalog.image_size !== undefined) { $('#image_size').val(catalog.image_size).trigger('change'); } - }); diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 6aa577a1..2ca66089 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -37,6 +37,7 @@ data-reply="{{ post.reply_count }}" data-bump="{{ post.bump }}" data-time="{{ post.time }}" + data-id="{{ post.id }}" >