From da0475667cde2842539c9af1da223378fa9f472b Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Wed, 1 May 2013 13:13:45 -0700 Subject: [PATCH] Add Posting Success Notifications option --- CHANGELOG.md | 1 + builds/4chan-X.js | 11 +++++++---- builds/4chan-X.user.js | 11 +++++++---- builds/crx/script.js | 11 +++++++---- src/General/Config.coffee | 4 ++++ src/Posting/QuickReply.coffee | 7 ++++--- 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b3b78b81..30d1165c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ seaweedchan: - Account for time options in youtube links for embedding - Once again remove /v/ and /vg/ archiving... ;_; - Add paste.installgentoo.com embedding +- Added `Posting Success Notifications` option to make "Post Successful!" and "_____ uploaded" notifications optional ### 1.1.6 - 2013-05-01 seaweedchan: diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 644ea25a1..1a4e281cc 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -190,7 +190,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Cooldown': [true, 'Indicate the remaining time before posting again.'], - 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'], + 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -5787,9 +5788,11 @@ QR.error(err); return; } - h1 = $('h1', tmpDoc); - QR.cleanNotifications(); - QR.notifications.push(new Notification('success', h1.textContent, 5)); + if (Conf['Posting Success Notifications']) { + h1 = $('h1', tmpDoc); + QR.cleanNotifications(); + QR.notifications.push(new Notification('success', h1.textContent, 5)); + } QR.persona.set(post); _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; postID = +postID; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3aa2f66a2..5045fd805 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -191,7 +191,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Cooldown': [true, 'Indicate the remaining time before posting again.'], - 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'], + 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -5808,9 +5809,11 @@ QR.error(err); return; } - h1 = $('h1', tmpDoc); - QR.cleanNotifications(); - QR.notifications.push(new Notification('success', h1.textContent, 5)); + if (Conf['Posting Success Notifications']) { + h1 = $('h1', tmpDoc); + QR.cleanNotifications(); + QR.notifications.push(new Notification('success', h1.textContent, 5)); + } QR.persona.set(post); _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; postID = +postID; diff --git a/builds/crx/script.js b/builds/crx/script.js index 669dd8e90..85ec6ca8b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -172,7 +172,8 @@ 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Cooldown': [true, 'Indicate the remaining time before posting again.'], - 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'] + 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'], + 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -5786,9 +5787,11 @@ QR.error(err); return; } - h1 = $('h1', tmpDoc); - QR.cleanNotifications(); - QR.notifications.push(new Notification('success', h1.textContent, 5)); + if (Conf['Posting Success Notifications']) { + h1 = $('h1', tmpDoc); + QR.cleanNotifications(); + QR.notifications.push(new Notification('success', h1.textContent, 5)); + } QR.persona.set(post); _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; postID = +postID; diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 8e0ecbd30..a2151fee1 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -277,6 +277,10 @@ Config = true 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.' ] + 'Posting Success Notifications': [ + true + 'Show notifications on successful post creation or file uploading.' + ] 'Quote Links': 'Quote Backlinks': [ diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 1c232af50..34ac287ad 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -1102,9 +1102,10 @@ QR = QR.error err return - h1 = $ 'h1', tmpDoc - QR.cleanNotifications() - QR.notifications.push new Notification 'success', h1.textContent, 5 + if Conf['Posting Success Notifications'] + h1 = $ 'h1', tmpDoc + QR.cleanNotifications() + QR.notifications.push new Notification 'success', h1.textContent, 5 QR.persona.set post