From 7dd9a728e56209e1299b057e047cdd72d63ab1a7 Mon Sep 17 00:00:00 2001 From: Mugiwara Date: Wed, 2 Mar 2016 21:17:15 +0100 Subject: [PATCH 1/2] Updated bbcode.js In PM, if you have some message with the [ code ] tag, it will break all the [ spoilers ] tags and they won't open when clicking on "Show spoiler" This problem is because of the first line of the function I deleted If the code find any 'pre.bbcode_code_body', it breaks the whole code, messing spoiler and youtube tags --- html/files/js/bbcode.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/html/files/js/bbcode.js b/html/files/js/bbcode.js index 4988ab9..9a3973d 100644 --- a/html/files/js/bbcode.js +++ b/html/files/js/bbcode.js @@ -1,9 +1,5 @@ $(function() { - $('pre.bbcode_code_body').each(function(i, e) {hljs.highlightBlock(e)}); - - $('body').on('click', '.bbcode_spoiler_head', function(e) { - e.preventDefault(); - + $('body').on('click', '.bbcode_spoiler_head', function() { $(this).toggleClass('active'); }); @@ -20,4 +16,4 @@ $(function() { } $(window).resize(resizeVideos).resize(); -}); \ No newline at end of file +}); From 6ffc481129429c47e0d7fe46ff8d84efb415e87e Mon Sep 17 00:00:00 2001 From: Mugiwara Date: Sat, 5 Mar 2016 21:15:46 +0100 Subject: [PATCH 2/2] Update bbcode.js --- html/files/js/bbcode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/files/js/bbcode.js b/html/files/js/bbcode.js index 9a3973d..f262c05 100644 --- a/html/files/js/bbcode.js +++ b/html/files/js/bbcode.js @@ -1,5 +1,8 @@ $(function() { - $('body').on('click', '.bbcode_spoiler_head', function() { + + $('body').on('click', '.bbcode_spoiler_head', function(e) { + e.preventDefault(); + $(this).toggleClass('active'); });