Merge pull request #77 from Zaphkiel/master

Misc js fixes
This commit is contained in:
Marcin Łabanowski 2014-09-26 13:09:26 +02:00
commit 9b3c6ab537
2 changed files with 9 additions and 6 deletions

View File

@ -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]

View File

@ -13,6 +13,9 @@
*/
function unanimate_gif(e) {
if (active_page === "catalog")
var c = $('<canvas class="thread-image"></canvas>');
else
var c = $('<canvas class="post-image"></canvas>');
$(e).parent().prepend(c);
c.attr('width', $(e).width());
@ -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')) {