From 85dd58d1d20ce0f46883dbce8bb9a5de8a8e10ac Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 01:55:00 -0800 Subject: [PATCH 1/7] $.hidden --- 4chan_x.user.js | 13 +++++++------ script.coffee | 11 ++++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 18ea61cd5..55dfbbe6e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -514,6 +514,9 @@ } size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit]; + }, + hidden: function() { + return d.hidden || d.oHidden || d.mozHidden || d.webkitHidden; } }); @@ -1837,7 +1840,7 @@ if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) { $('[autocomplete]', QR.el).focus(); } - if (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) { + if ($.hidden()) { return alert(el.textContent); } }, @@ -3040,9 +3043,7 @@ return setTimeout(Updater.update, 500); }, visibility: function() { - var state; - state = d.visibilityState || d.oVisibilityState || d.mozVisibilityState || d.webkitVisibilityState; - if (state !== 'visible') { + if ($.hidden()) { return; } Updater.unsuccessfulFetchCount = 0; @@ -3078,7 +3079,7 @@ return Updater.scrollBG = this.checked ? function() { return true; } : function() { - return !(d.hidden || d.oHidden || d.mozHidden || d.webkitHidden); + return !$.hidden(); }; }, load: function() { @@ -3174,7 +3175,7 @@ var i, j; i = +Conf['Interval']; j = Math.min(this.unsuccessfulFetchCount, 9); - if (!(d.hidden || d.oHidden || d.mozHidden || d.webkitHidden)) { + if (!$.hidden()) { j = Math.min(j, 6); } return Math.max(i, [5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]); diff --git a/script.coffee b/script.coffee index 5a49378a0..f098cd9c6 100644 --- a/script.coffee +++ b/script.coffee @@ -396,6 +396,8 @@ $.extend $, # Round to an integer otherwise. Math.round size "#{size} #{['B', 'KB', 'MB', 'GB'][unit]}" + hidden: -> + d.hidden or d.oHidden or d.mozHidden or d.webkitHidden $.cache.requests = {} @@ -1419,7 +1421,7 @@ QR = if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent # Focus the captcha input on captcha error. $('[autocomplete]', QR.el).focus() - alert el.textContent if d.hidden or d.oHidden or d.mozHidden or d.webkitHidden + alert el.textContent if $.hidden() cleanError: -> $('.warning', QR.el).textContent = null @@ -2463,8 +2465,7 @@ Updater = Updater.unsuccessfulFetchCount = 0 setTimeout Updater.update, 500 visibility: -> - state = d.visibilityState or d.oVisibilityState or d.mozVisibilityState or d.webkitVisibilityState - return if state isnt 'visible' + return if $.hidden() # Reset the counter when we focus this tab. Updater.unsuccessfulFetchCount = 0 if Updater.timer.textContent < -Conf['Interval'] @@ -2492,7 +2493,7 @@ Updater = if @checked -> true else - -> !(d.hidden or d.oHidden or d.mozHidden or d.webkitHidden) + -> ! $.hidden() load: -> switch @status when 404 @@ -2570,7 +2571,7 @@ Updater = getInterval: -> i = +Conf['Interval'] j = Math.min @unsuccessfulFetchCount, 9 - unless d.hidden or d.oHidden or d.mozHidden or d.webkitHidden + unless $.hidden() # Don't increase the refresh rate too much on visible tabs. j = Math.min j, 6 Math.max i, [5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j] From 4cd5fd49c1889a9ffb9f6a9a7b5e8a64bc7dea89 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 19:42:28 -0800 Subject: [PATCH 2/7] style: no `.` in 1 sentence descriptions --- 4chan_x.user.js | 34 +++++++++++++++++----------------- script.coffee | 34 +++++++++++++++++----------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 55dfbbe6e..6e14267fa 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -86,8 +86,8 @@ Config = { main: { Enhancing: { - 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'], - 'Catalog Links': [true, 'Turn Navigation links into links to each board\'s catalog.'], + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension'], + 'Catalog Links': [true, 'Turn Navigation links into links to each board\'s catalog'], '404 Redirect': [true, 'Redirect dead threads and images'], 'Keybinds': [true, 'Binds actions to keys'], 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'], @@ -112,14 +112,14 @@ 'Image Hover': [false, 'Show full image on mouseover'], 'Sauce': [true, 'Add sauce to images'], 'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'], - 'Expand From Current': [false, 'Expand images from current position to thread end.'] + 'Expand From Current': [false, 'Expand images from current position to thread end'] }, Menu: { - 'Menu': [true, 'Add a drop-down menu in posts.'], - 'Report Link': [true, 'Add a report link to the menu.'], - 'Delete Link': [true, 'Add post and image deletion links to the menu.'], - 'Download Link': [true, 'Add a download with original filename link to the menu. Chrome-only currently.'], - 'Archive Link': [true, 'Add an archive link to the menu.'] + 'Menu': [true, 'Add a drop-down menu in posts'], + 'Report Link': [true, 'Add a report link to the menu'], + 'Delete Link': [true, 'Add post and image deletion links to the menu'], + 'Download Link': [true, 'Add a download with original filename link to the menu (Chrome only)'], + 'Archive Link': [true, 'Add an archive link to the menu'] }, Monitoring: { 'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'], @@ -132,15 +132,15 @@ 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] }, Posting: { - 'Quick Reply': [true, 'Reply without leaving the page.'], - 'Cooldown': [true, 'Prevent "flood detected" errors.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], - 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'], - 'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board.'], - 'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).'], - 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], - 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], - 'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR.'] + 'Quick Reply': [true, 'Reply without leaving the page'], + 'Cooldown': [true, 'Prevent "flood detected" errors'], + 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting'], + 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting'], + 'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board'], + 'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only)'], + 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting'], + 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting'], + 'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR'] }, Quoting: { 'Quote Backlinks': [true, 'Add quote backlinks'], diff --git a/script.coffee b/script.coffee index f098cd9c6..9c485a45b 100644 --- a/script.coffee +++ b/script.coffee @@ -1,8 +1,8 @@ Config = main: Enhancing: - 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'] - 'Catalog Links': [true, 'Turn Navigation links into links to each board\'s catalog.'] + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension'] + 'Catalog Links': [true, 'Turn Navigation links into links to each board\'s catalog'] '404 Redirect': [true, 'Redirect dead threads and images'] 'Keybinds': [true, 'Binds actions to keys'] 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'] @@ -25,13 +25,13 @@ Config = 'Image Hover': [false, 'Show full image on mouseover'] 'Sauce': [true, 'Add sauce to images'] 'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'] - 'Expand From Current': [false, 'Expand images from current position to thread end.'] + 'Expand From Current': [false, 'Expand images from current position to thread end'] Menu: - 'Menu': [true, 'Add a drop-down menu in posts.'] - 'Report Link': [true, 'Add a report link to the menu.'] - 'Delete Link': [true, 'Add post and image deletion links to the menu.'] - 'Download Link': [true, 'Add a download with original filename link to the menu. Chrome-only currently.'] - 'Archive Link': [true, 'Add an archive link to the menu.'] + 'Menu': [true, 'Add a drop-down menu in posts'] + 'Report Link': [true, 'Add a report link to the menu'] + 'Delete Link': [true, 'Add post and image deletion links to the menu'] + 'Download Link': [true, 'Add a download with original filename link to the menu (Chrome only)'] + 'Archive Link': [true, 'Add an archive link to the menu'] Monitoring: 'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'] 'Unread Count': [true, 'Show unread post count in tab title'] @@ -42,15 +42,15 @@ Config = 'Auto Watch': [true, 'Automatically watch threads that you start'] 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] Posting: - 'Quick Reply': [true, 'Reply without leaving the page.'] - 'Cooldown': [true, 'Prevent "flood detected" errors.'] - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'] - 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'] - 'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board.'] - 'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only).'] - 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'] - 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'] - 'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR.'] + 'Quick Reply': [true, 'Reply without leaving the page'] + 'Cooldown': [true, 'Prevent "flood detected" errors'] + 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting'] + 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting'] + 'Open Reply in New Tab': [false, 'Open replies in a new tab that are made from the main board'] + 'Remember QR size': [false, 'Remember the size of the Quick reply (Firefox only)'] + 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting'] + 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting'] + 'Hide Original Post Form': [true, 'Replace the normal post form with a shortcut to open the QR'] Quoting: 'Quote Backlinks': [true, 'Add quote backlinks'] 'OP Backlinks': [false, 'Add backlinks to the OP'] From e822ca45fafa02d57a91680f875c095de28950a1 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 01:00:55 -0800 Subject: [PATCH 3/7] beep --- 4chan_x.user.js | 9 ++++++++- script.coffee | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 6e14267fa..d02b239c7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -129,7 +129,8 @@ 'Thread Stats': [true, 'Display reply and image count'], 'Thread Watcher': [true, 'Bookmark threads'], 'Auto Watch': [true, 'Automatically watch threads that you start'], - 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] + 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'], + 'Beep': [false, 'Beep, beep, motherfucker'] }, Posting: { 'Quick Reply': [true, 'Reply without leaving the page'], @@ -3034,6 +3035,9 @@ $.on(d, 'QRPostSuccessful', this.cb.post); return $.on(d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', this.cb.visibility); }, + audio: $.el('audio', { + src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA' + }), cb: { post: function() { if (!Conf['Auto Update This']) { @@ -3150,6 +3154,9 @@ Updater.count.className = count ? 'new' : null; } if (count) { + if (Conf['Beep'] && (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) && (Unread.replies.length === 0)) { + Updater.audio.play(); + } Updater.unsuccessfulFetchCount = 0; } else { Updater.unsuccessfulFetchCount++; diff --git a/script.coffee b/script.coffee index 9c485a45b..504de7730 100644 --- a/script.coffee +++ b/script.coffee @@ -41,6 +41,7 @@ Config = 'Thread Watcher': [true, 'Bookmark threads'] 'Auto Watch': [true, 'Automatically watch threads that you start'] 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] + 'Beep': [false, 'Beep, beep, motherfucker'] Posting: 'Quick Reply': [true, 'Reply without leaving the page'] 'Cooldown': [true, 'Prevent "flood detected" errors'] @@ -2459,6 +2460,8 @@ Updater = $.on d, 'QRPostSuccessful', @cb.post $.on d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', @cb.visibility + audio: $.el('audio', src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA') + cb: post: -> return unless Conf['Auto Update This'] @@ -2548,6 +2551,8 @@ Updater = Updater.count.className = if count then 'new' else null if count + if Conf['Beep'] and (d.hidden or d.oHidden or d.mozHidden or d.webkitHidden) and (Unread.replies.length is 0) + Updater.audio.play() Updater.unsuccessfulFetchCount = 0 else Updater.unsuccessfulFetchCount++ From bc8055acb521740fc4230798c785e87704433413 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 01:08:48 -0800 Subject: [PATCH 4/7] admin --- changelog | 2 ++ script.coffee | 2 ++ 2 files changed, 4 insertions(+) diff --git a/changelog b/changelog index 0d7755904..62cd3a000 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- aeosynth + Beep, beep, motherfucker 2.37.1 - noface diff --git a/script.coffee b/script.coffee index 504de7730..a2816f98c 100644 --- a/script.coffee +++ b/script.coffee @@ -2460,6 +2460,8 @@ Updater = $.on d, 'QRPostSuccessful', @cb.post $.on d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', @cb.visibility + # http://freesound.org/people/pierrecartoons1979/sounds/90112/ + # cc-by-nc-3.0 audio: $.el('audio', src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA') cb: From a619f4fd9bc7e716e39eb6a2c4c01d223edf1388 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 01:10:00 -0800 Subject: [PATCH 5/7] block comment --- 4chan_x.user.js | 5 +++++ script.coffee | 2 ++ 2 files changed, 7 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index d02b239c7..082c7754c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3035,6 +3035,11 @@ $.on(d, 'QRPostSuccessful', this.cb.post); return $.on(d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', this.cb.visibility); }, + /* + # http://freesound.org/people/pierrecartoons1979/sounds/90112/ + # cc-by-nc-3.0 + */ + audio: $.el('audio', { src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA' }), diff --git a/script.coffee b/script.coffee index a2816f98c..f6d1a09c8 100644 --- a/script.coffee +++ b/script.coffee @@ -2460,8 +2460,10 @@ Updater = $.on d, 'QRPostSuccessful', @cb.post $.on d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', @cb.visibility + ### # http://freesound.org/people/pierrecartoons1979/sounds/90112/ # cc-by-nc-3.0 + ### audio: $.el('audio', src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA') cb: From 1ad81cecd35d09e43f522d88ddb56229e1a53066 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 31 Dec 2012 19:32:30 -0800 Subject: [PATCH 6/7] better description --- 4chan_x.user.js | 8 ++++---- changelog | 2 +- script.coffee | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 082c7754c..4ca487db0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -130,7 +130,7 @@ 'Thread Watcher': [true, 'Bookmark threads'], 'Auto Watch': [true, 'Automatically watch threads that you start'], 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'], - 'Beep': [false, 'Beep, beep, motherfucker'] + 'Beep': [false, 'Beep on new post to completely read thread'] }, Posting: { 'Quick Reply': [true, 'Reply without leaving the page'], @@ -3036,8 +3036,8 @@ return $.on(d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', this.cb.visibility); }, /* - # http://freesound.org/people/pierrecartoons1979/sounds/90112/ - # cc-by-nc-3.0 + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 */ audio: $.el('audio', { @@ -3159,7 +3159,7 @@ Updater.count.className = count ? 'new' : null; } if (count) { - if (Conf['Beep'] && (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) && (Unread.replies.length === 0)) { + if (Conf['Beep'] && $.hidden() && (Unread.replies.length === 0)) { Updater.audio.play(); } Updater.unsuccessfulFetchCount = 0; diff --git a/changelog b/changelog index 62cd3a000..27004bb5b 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,6 @@ master - aeosynth - Beep, beep, motherfucker + Beep on new post to completely read thread 2.37.1 - noface diff --git a/script.coffee b/script.coffee index f6d1a09c8..7f7549757 100644 --- a/script.coffee +++ b/script.coffee @@ -41,7 +41,7 @@ Config = 'Thread Watcher': [true, 'Bookmark threads'] 'Auto Watch': [true, 'Automatically watch threads that you start'] 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] - 'Beep': [false, 'Beep, beep, motherfucker'] + 'Beep': [false, 'Beep on new post to completely read thread'] Posting: 'Quick Reply': [true, 'Reply without leaving the page'] 'Cooldown': [true, 'Prevent "flood detected" errors'] @@ -2461,8 +2461,8 @@ Updater = $.on d, 'visibilitychange ovisibilitychange mozvisibilitychange webkitvisibilitychange', @cb.visibility ### - # http://freesound.org/people/pierrecartoons1979/sounds/90112/ - # cc-by-nc-3.0 + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 ### audio: $.el('audio', src: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA') @@ -2555,7 +2555,7 @@ Updater = Updater.count.className = if count then 'new' else null if count - if Conf['Beep'] and (d.hidden or d.oHidden or d.mozHidden or d.webkitHidden) and (Unread.replies.length is 0) + if Conf['Beep'] and $.hidden() and (Unread.replies.length is 0) Updater.audio.play() Updater.unsuccessfulFetchCount = 0 else From d95d54ccf69c94f1f2bd0bba6db5f803eaa64831 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 1 Jan 2013 11:09:26 -0800 Subject: [PATCH 7/7] mv beep option from main to updater config --- 4chan_x.user.js | 4 ++-- script.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 4ca487db0..a5ca8b019 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -129,8 +129,7 @@ 'Thread Stats': [true, 'Display reply and image count'], 'Thread Watcher': [true, 'Bookmark threads'], 'Auto Watch': [true, 'Automatically watch threads that you start'], - 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'], - 'Beep': [false, 'Beep on new post to completely read thread'] + 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] }, Posting: { 'Quick Reply': [true, 'Reply without leaving the page'], @@ -201,6 +200,7 @@ }, updater: { checkbox: { + 'Beep': [false, 'Beep on new post to completely read thread'], 'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], 'Scroll BG': [false, 'Scroll background tabs'], 'Verbose': [true, 'Show countdown timer, new post count'], diff --git a/script.coffee b/script.coffee index 7f7549757..3fafa724f 100644 --- a/script.coffee +++ b/script.coffee @@ -41,7 +41,6 @@ Config = 'Thread Watcher': [true, 'Bookmark threads'] 'Auto Watch': [true, 'Automatically watch threads that you start'] 'Auto Watch Reply': [false, 'Automatically watch threads that you reply to'] - 'Beep': [false, 'Beep on new post to completely read thread'] Posting: 'Quick Reply': [true, 'Reply without leaving the page'] 'Cooldown': [true, 'Prevent "flood detected" errors'] @@ -160,6 +159,7 @@ Config = hide: ['x', 'Hide thread'] updater: checkbox: + 'Beep': [false, 'Beep on new post to completely read thread'] 'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'] 'Scroll BG': [false, 'Scroll background tabs'] 'Verbose': [true, 'Show countdown timer, new post count']