diff --git a/4chan_x.user.js b/4chan_x.user.js index 6db4a40be..dae5ba873 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -133,7 +133,8 @@ hide: 'x', expandImages: 'm', expandAllImages: 'M', - update: 'u' + update: 'u', + UnreadCountTo0: 'r' }, updater: { checkbox: { @@ -822,6 +823,11 @@ $('.postarea form').submit(); } break; + case conf.UnreadCountTo0: + unread.replies.length = 0; + unread.updateTitle(); + Favicon.update(); + break; default: return; } @@ -1031,7 +1037,7 @@ var arr, checked, description, dialog, hiddenNum, hiddenThreads, hidingul, html, input, key, li, link, main, obj, overlay, ul, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4; hiddenThreads = $.getValue("hiddenThreads/" + g.BOARD + "/", {}); hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length; - html = "

"; + html = "

"; dialog = $.el('div', { id: 'options', innerHTML: html @@ -1325,6 +1331,7 @@ if (s = selection.toString()) { selectionID = (_ref = $.x('preceding::input[@type="checkbox"][1]', selection.anchorNode)) != null ? _ref.name : void 0; if (selectionID === id) { + s = s.replace(/\n/g, '\n>'); text += ">" + s + "\n"; } } diff --git a/changelog b/changelog index f81eebade..63e918021 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,8 @@ github - mayhem: - Make updater's settings dynamic + - Multi-line quoting + - New Unread Count reset keybind - fix remember updater's interval settings - fix wrong keybind input in options - fix time preview diff --git a/script.coffee b/script.coffee index ad46d7763..ab8dbce36 100644 --- a/script.coffee +++ b/script.coffee @@ -71,6 +71,7 @@ config = expandImages: 'm' expandAllImages: 'M' update: 'u' + UnreadCountTo0: 'r' updater: checkbox: 'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'] @@ -584,6 +585,10 @@ keybinds = qr.submit.call $ 'form', qr.el else $('.postarea form').submit() + when conf.UnreadCountTo0 + unread.replies.length = 0 + unread.updateTitle() + Favicon.update() else return e.preventDefault() @@ -818,6 +823,7 @@ options = Expand selected image Expand all images Update now + Reset the unread count to 0 @@ -1039,6 +1045,7 @@ qr = if s = selection.toString() selectionID = $.x('preceding::input[@type="checkbox"][1]', selection.anchorNode)?.name if selectionID == id + s = s.replace /\n/g, '\n>' text += ">#{s}\n" ta = $ 'textarea', qr.el