From e86f9d0f920226885b585f65f2f175bd2953c3c6 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 16 Mar 2016 04:28:44 -0700 Subject: [PATCH 1/4] PruneReplies -> ReplyPruning. --- src/General/Config.coffee | 2 +- src/General/Main.coffee | 2 +- ...runeReplies.coffee => ReplyPruning.coffee} | 46 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) rename src/Monitoring/{PruneReplies.coffee => ReplyPruning.coffee} (52%) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index fa8f09aa6..43a1047bc 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -1013,6 +1013,6 @@ Config = customCooldown: 0 customCooldownEnabled: true - pruneReplies: + replyPruning: 'Prune Replies': false 'Max Replies': 1000 diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 7c891c09a..3d532912b 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -446,7 +446,7 @@ Main = ['Keybinds', Keybinds] ['Banner', Banner] ['Flash Features', Flash] - ['Prune Replies', PruneReplies] + ['Reply Pruning', ReplyPruning] <% if (tests_enabled) { %> ['Build Test', BuildTest] <% } %> diff --git a/src/Monitoring/PruneReplies.coffee b/src/Monitoring/ReplyPruning.coffee similarity index 52% rename from src/Monitoring/PruneReplies.coffee rename to src/Monitoring/ReplyPruning.coffee index eaf5ac490..a427122b4 100644 --- a/src/Monitoring/PruneReplies.coffee +++ b/src/Monitoring/ReplyPruning.coffee @@ -1,4 +1,4 @@ -PruneReplies = +ReplyPruning = init: -> return unless g.VIEW is 'thread' and not Conf['Quote Threading'] @@ -21,7 +21,7 @@ PruneReplies = order: 190 Thread.callbacks.push - name: 'Prune Replies' + name: 'Reply Pruning' cb: @node position: 0 @@ -29,44 +29,44 @@ PruneReplies = total: 0 node: -> - PruneReplies.thread = @ - PruneReplies.total = @posts.keys.length - 1 - $.on PruneReplies.inputs.enabled, 'change', PruneReplies.setEnabled - $.on PruneReplies.inputs.enabled, 'change', PruneReplies.update + ReplyPruning.thread = @ + ReplyPruning.total = @posts.keys.length - 1 + $.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.setEnabled + $.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.update if Conf['Prune Replies'] - PruneReplies.setEnabled() - PruneReplies.update() + ReplyPruning.setEnabled() + ReplyPruning.update() setEnabled: -> - PruneReplies.container or= $.frag() + ReplyPruning.container or= $.frag() onOff = if Conf['Prune Replies'] then $.on else $.off - onOff PruneReplies.inputs.replies, 'change', PruneReplies.update - onOff d, 'ThreadUpdate', PruneReplies.update + onOff ReplyPruning.inputs.replies, 'change', ReplyPruning.update + onOff d, 'ThreadUpdate', ReplyPruning.update update: (e) -> if e and e.type is 'ThreadUpdate' and not e.detail[404] - PruneReplies.total += e.detail.newPosts.length + ReplyPruning.total += e.detail.newPosts.length hidden2 = if Conf['Prune Replies'] - Math.max(PruneReplies.total - +Conf["Max Replies"], 0) + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) else 0 - {posts, OP} = PruneReplies.thread + {posts, OP} = ReplyPruning.thread - if PruneReplies.hidden < hidden2 - while PruneReplies.hidden < hidden2 and PruneReplies.position < posts.keys.length - post = posts[posts.keys[PruneReplies.position++]] + if ReplyPruning.hidden < hidden2 + while ReplyPruning.hidden < hidden2 and ReplyPruning.position < posts.keys.length + post = posts[posts.keys[ReplyPruning.position++]] if post.isReply and not post.isFetchedQuote - $.add PruneReplies.container, post.nodes.root - PruneReplies.hidden++ + $.add ReplyPruning.container, post.nodes.root + ReplyPruning.hidden++ - else if PruneReplies.hidden > hidden2 + else if ReplyPruning.hidden > hidden2 frag = $.frag() - while PruneReplies.hidden > hidden2 and PruneReplies.position > 0 - post = posts[posts.keys[--PruneReplies.position]] + while ReplyPruning.hidden > hidden2 and ReplyPruning.position > 0 + post = posts[posts.keys[--ReplyPruning.position]] if post.isReply and not post.isFetchedQuote $.prepend frag, post.nodes.root - PruneReplies.hidden-- + ReplyPruning.hidden-- $.after OP.nodes.root, frag $.event 'PostsInserted' From 26ae24b1b0e6b1f252525ffbc98ef6cb5fd239f1 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 19 Mar 2016 21:37:47 -0700 Subject: [PATCH 2/4] Fix error when 'Catalog Links' is turned on and board list edited without reloading. --- src/Miscellaneous/CatalogLinks.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index c9489a831..9033842c3 100644 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -47,7 +47,7 @@ CatalogLinks = # Set links on load or custom board list change. # Called by Header when both board lists (header and footer) are ready. initBoardList: -> - return unless Conf['Catalog Links'] + return unless CatalogLinks.el CatalogLinks.set Conf['Header catalog links'] toggle: -> From 943a7ef31b01a6458e966c797cb84e961af41d4e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 27 Mar 2016 22:36:21 -0700 Subject: [PATCH 3/4] Fix missing period. --- src/General/Config.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 43a1047bc..11e5d350c 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -574,7 +574,7 @@ Config = ] 'Quote Threading': [ false - 'Thread conversations' + 'Thread conversations.' ] imageExpansion: From 2be615551860a5d0a021e6be01bdb71da04118ff Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 29 Mar 2016 12:10:03 -0700 Subject: [PATCH 4/4] Fix second (e.g. closing) literal tag not being converted properly. --- src/classes/Fetcher.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Fetcher.coffee b/src/classes/Fetcher.coffee index 3866122e3..764655e8d 100644 --- a/src/classes/Fetcher.coffee +++ b/src/classes/Fetcher.coffee @@ -129,7 +129,7 @@ class Fetcher @archiveTags[text] else greentext = text[0] is '>' - text = text.replace /(\[\/?[a-z]+):lit(\])/, '$1$2' + text = text.replace /(\[\/?[a-z]+):lit(\])/g, '$1$2' text = for text2, j in text.split /(>>(?:>\/[a-z\d]+\/)?\d+)/g <%= html('?{j % 2}{${text2}}{${text2}}') %> text = <%= html('?{greentext}{@{text}}{@{text}}') %>