From 4c6cc59a37e13d639f30f4bd076d0c349ac1193d Mon Sep 17 00:00:00 2001 From: Nebs Date: Thu, 25 Sep 2014 18:27:39 -0500 Subject: [PATCH 1/2] Fixes catalog href on a potential /res/ board --- js/catalog-link.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/catalog-link.js b/js/catalog-link.js index 899e6859..5c5d9b13 100644 --- a/js/catalog-link.js +++ b/js/catalog-link.js @@ -16,11 +16,11 @@ function catalog() { var board = $("input[name='board']"); if (board.length>0) { -if (window.location.href.indexOf("/res/")==-1){ //if we are inside a thread -var catalog_url = 'catalog.html'; +if (window.location.pathname.indexOf("/res/")>0){ //if we are inside a thread +var catalog_url = '../catalog.html'; } else { -var catalog_url = '../catalog.html'; +var catalog_url = 'catalog.html'; } var pages = document.getElementsByClassName('pages')[0]; var bottom = document.getElementsByClassName('boardlist bottom')[0] From 35e33f61d444d89a2e5883daa9140b77df06a593 Mon Sep 17 00:00:00 2001 From: Nebs Date: Fri, 26 Sep 2014 00:30:23 -0500 Subject: [PATCH 2/2] Fixed unanimating gifs in the catalog --- js/no-animated-gif.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/no-animated-gif.js b/js/no-animated-gif.js index 7e777d87..45a55f97 100644 --- a/js/no-animated-gif.js +++ b/js/no-animated-gif.js @@ -13,7 +13,10 @@ */ function unanimate_gif(e) { - var c = $(''); + if (active_page === "catalog") + var c = $(''); + else + var c = $(''); $(e).parent().prepend(c); c.attr('width', $(e).width()); c.attr('height',$(e).height()); @@ -32,7 +35,7 @@ function unanimate_gif(e) { } function no_animated_gif() { - var anim_gifs = $('img.post-image[src$=".gif"]'); + var anim_gifs = $('img.post-image[src$=".gif"], img.thread-image[src$=".gif"]'); localStorage.no_animated_gif = true; $('#no-animated-gif>a').text(_('Animate GIFs')); $('#no-animated-gif>input').prop('checked', true); @@ -48,7 +51,7 @@ function animated_gif() { $('#no-animated-gif>input').prop('checked', false); } -if (active_page == 'thread' || active_page == 'index' || active_page == 'ukko') { +if (active_page == 'thread' || active_page == 'index' || active_page == 'ukko' || active_page == 'catalog') { $(function(){ var selector, event; if (window.Options && Options.get_tab('general')) {