diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 74c71fca79..3c1e39fca6 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -446,5 +446,30 @@ phpbb.add_ajax_callback('alt_text', function() { el.text(alt_text); }); +/** + * This callback is based on the alt_text callback. + * + * It replaces the current text with the text in the alt-text data attribute, + * and replaces the text in the attribute with the current text so that the + * process can be repeated. + * Additionally it replaces the icon of the link and changes the link itself. + */ +phpbb.add_ajax_callback('toggle_subscribe', function() { + var el = $(this), + alt_text; + + phpbb.ajax_callbacks['alt_text'].call(this); + + if (el.attr('href').indexOf('unwatch') !== -1) + { + el.attr('href', el.attr('href').replace('unwatch', 'watch')); + el.parent().attr('class', 'icon-subscribe'); + } + else + { + el.attr('href', el.attr('href').replace('watch', 'unwatch')); + el.parent().attr('class', 'icon-unsubscribe'); + } +}); })(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 2cb721073f..972d90305e 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -8,8 +8,8 @@