From b2d1ac11f47f41cd72f23e8320493efdb13e95cd Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 23 May 2014 23:58:56 -0700 Subject: [PATCH 1/4] fix jsMath loading error --- src/Miscellaneous/Fourchan.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 290c16265..8bbd79b72 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -21,7 +21,7 @@ Fourchan = if (jsMath.loaded) { // process one post jsMath.ProcessBeforeShowing(e.detail); - } else { + } else if (jsMath.Autoload.checked) { // load jsMath and process whole document jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]); jsMath.Autoload.LoadJsMath(); From 2c2407a72705db25a276262fdb4716e2c28e0544 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 May 2014 00:03:26 -0700 Subject: [PATCH 2/4] fix missed responseType: 'json' --- src/General/Get.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/General/Get.coffee b/src/General/Get.coffee index 00d295606..07c52214d 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -131,6 +131,7 @@ Get = $.cache url, -> Get.archivedPost @, boardID, postID, root, context , + responseType: 'json' withCredentials: url.archive.withCredentials else $.addClass root, 'warning' From 6b838f79923f1e5483470c13ab972d80d0973b85 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 May 2014 00:25:24 -0700 Subject: [PATCH 3/4] fix failure of jsMath to load in cross-thread quotes --- src/Miscellaneous/Fourchan.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 8bbd79b72..f0309359b 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -40,7 +40,7 @@ Fourchan = $.off window, 'prettyprint:cb', apply return math: -> - return if @isClone or !$ '.math', @nodes.comment + return if (@isClone and doc.contains @origin.nodes.root) or !$ '.math', @nodes.comment $.event 'jsmath', @nodes.post, window parseThread: (threadID, offset, limit) -> # Fix /sci/ From 6a1706f5b693e1ef499814593e4ed96301acbb67 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 May 2014 01:15:21 -0700 Subject: [PATCH 4/4] check that jsMath and jsMath.Autoload exist --- src/Miscellaneous/Fourchan.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index f0309359b..7d36e8b93 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -18,10 +18,11 @@ Fourchan = # https://github.com/MayhemYDG/4chan-x/issues/645#issuecomment-13704562 $.globalEval ''' window.addEventListener('jsmath', function(e) { + if (!jsMath) return; if (jsMath.loaded) { // process one post jsMath.ProcessBeforeShowing(e.detail); - } else if (jsMath.Autoload.checked) { + } else if (jsMath.Autoload && jsMath.Autoload.checked) { // load jsMath and process whole document jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]); jsMath.Autoload.LoadJsMath();