diff --git a/js/thread-watcher.js b/js/thread-watcher.js index 960aa59f..c31a6e74 100644 --- a/js/thread-watcher.js +++ b/js/thread-watcher.js @@ -79,8 +79,8 @@ watchlist.add = function(sel) { } else { postCount = $(sel).parents('.op').siblings('.post').length+1; } - //Grab the reply link. - var threadLink = $(sel).siblings('a:contains("['+_('Reply')+']")').attr('href'); + //Grab the reply link.; + var threadLink = $(sel).siblings('a:not(.watchThread)').last().attr('href'); //Figure out the thread name. If anon, use the thread id. if ($(sel).parent().find('.subject').length) { threadName = $(sel).parent().find('.subject').text().substring(0,20); diff --git a/templates/index.html b/templates/index.html index 41e4867d..d4c56707 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,10 +4,12 @@ diff --git a/templates/main.js b/templates/main.js index 7e3b2dc1..c2a6f6c0 100644 --- a/templates/main.js +++ b/templates/main.js @@ -115,7 +115,10 @@ var styles = { {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', {% endraw %}{% endfor %}{% raw %} }; -var board_name = false; + +if (typeof board_name === 'undefined') { + var board_name = false; +} function changeStyle(styleName, link) { {% endraw %} @@ -159,13 +162,7 @@ function changeStyle(styleName, link) { {% endraw %} {% if config.stylesheets_board %} - {# This is such an unacceptable mess. There needs to be an easier way. #} - {# Needs fix for slugify #} - var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }})/); {% raw %} - if (matches) { - board_name = matches[1]; - } if (!localStorage.board_stylesheets) { localStorage.board_stylesheets = '{}'; diff --git a/templates/page.html b/templates/page.html index 3522702f..816bb72b 100644 --- a/templates/page.html +++ b/templates/page.html @@ -3,7 +3,7 @@
{% include 'header.html' %}