Add Posting Success Notifications option

This commit is contained in:
Jordan Bates 2013-05-01 13:13:45 -07:00
parent 596129425b
commit da0475667c
6 changed files with 30 additions and 15 deletions

View File

@ -3,6 +3,7 @@ seaweedchan:
- Account for time options in youtube links for embedding - Account for time options in youtube links for embedding
- Once again remove /v/ and /vg/ archiving... ;_; - Once again remove /v/ and /vg/ archiving... ;_;
- Add paste.installgentoo.com embedding - Add paste.installgentoo.com embedding
- Added `Posting Success Notifications` option to make "Post Successful!" and "_____ uploaded" notifications optional
### 1.1.6 - 2013-05-01 ### 1.1.6 - 2013-05-01
seaweedchan: seaweedchan:

View File

@ -190,7 +190,8 @@
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'], '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 Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -5787,9 +5788,11 @@
QR.error(err); QR.error(err);
return; return;
} }
h1 = $('h1', tmpDoc); if (Conf['Posting Success Notifications']) {
QR.cleanNotifications(); h1 = $('h1', tmpDoc);
QR.notifications.push(new Notification('success', h1.textContent, 5)); QR.cleanNotifications();
QR.notifications.push(new Notification('success', h1.textContent, 5));
}
QR.persona.set(post); QR.persona.set(post);
_ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
postID = +postID; postID = +postID;

View File

@ -191,7 +191,8 @@
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'], '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 Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -5808,9 +5809,11 @@
QR.error(err); QR.error(err);
return; return;
} }
h1 = $('h1', tmpDoc); if (Conf['Posting Success Notifications']) {
QR.cleanNotifications(); h1 = $('h1', tmpDoc);
QR.notifications.push(new Notification('success', h1.textContent, 5)); QR.cleanNotifications();
QR.notifications.push(new Notification('success', h1.textContent, 5));
}
QR.persona.set(post); QR.persona.set(post);
_ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
postID = +postID; postID = +postID;

View File

@ -172,7 +172,8 @@
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'], 'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'], '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 Links': {
'Quote Backlinks': [true, 'Add quote backlinks.'], 'Quote Backlinks': [true, 'Add quote backlinks.'],
@ -5786,9 +5787,11 @@
QR.error(err); QR.error(err);
return; return;
} }
h1 = $('h1', tmpDoc); if (Conf['Posting Success Notifications']) {
QR.cleanNotifications(); h1 = $('h1', tmpDoc);
QR.notifications.push(new Notification('success', h1.textContent, 5)); QR.cleanNotifications();
QR.notifications.push(new Notification('success', h1.textContent, 5));
}
QR.persona.set(post); QR.persona.set(post);
_ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2]; _ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
postID = +postID; postID = +postID;

View File

@ -277,6 +277,10 @@ Config =
true true
'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.' '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 Links':
'Quote Backlinks': [ 'Quote Backlinks': [

View File

@ -1102,9 +1102,10 @@ QR =
QR.error err QR.error err
return return
h1 = $ 'h1', tmpDoc if Conf['Posting Success Notifications']
QR.cleanNotifications() h1 = $ 'h1', tmpDoc
QR.notifications.push new Notification 'success', h1.textContent, 5 QR.cleanNotifications()
QR.notifications.push new Notification 'success', h1.textContent, 5
QR.persona.set post QR.persona.set post