diff --git a/4chan_x.user.js b/4chan_x.user.js index 674d9978d..cedf0e04b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1362,10 +1362,11 @@ $.bind($('#dummy', qr.el), 'keydown', qr.captchaKeydown); return $.add(d.body, qr.el); }, - message: function(data) { - var duration, fileCount; + message: function(e) { + var data, duration, fileCount; $('iframe[name=iframe]').src = 'about:blank'; fileCount = $('#files', qr.el).childElementCount; + data = e.data; if (data) { data = JSON.parse(data); $.extend($('#error', qr.el), data); @@ -3007,8 +3008,8 @@ if (origin === 'http://sys.4chan.org') { return qr.message(data); } else { - if (data !== VERSION) { - return alert('new version of 4chan x available on github!'); + if (data !== VERSION && confirm('a newer version of 4chan x is available, would you like to install it now?')) { + return window.location = 'https://github.com/aeosynth/4chan-x/raw/stable/4chan_x.user.js'; } } }, diff --git a/changelog b/changelog index dc615e9b2..2d1ded0f6 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,8 @@ master - mayhem do not display inlined quotes within the quote preview fix cross threads quotes in expanded threads or inlined cross quotes +- aeosynth + script auto updating 2.19.3 - mayhem diff --git a/script.coffee b/script.coffee index 423ce9a4d..5329ed9f2 100644 --- a/script.coffee +++ b/script.coffee @@ -1081,10 +1081,11 @@ qr = $.add d.body, qr.el - message: (data) -> + message: (e) -> $('iframe[name=iframe]').src = 'about:blank' fileCount = $('#files', qr.el).childElementCount + {data} = e if data # error message data = JSON.parse data $.extend $('#error', qr.el), data @@ -2357,8 +2358,8 @@ Main = if origin is 'http://sys.4chan.org' qr.message data else - if data isnt VERSION - alert 'new version of 4chan x available on github!' + if data isnt VERSION and confirm 'a newer version of 4chan x is available, would you like to install it now?' + window.location = 'https://github.com/aeosynth/4chan-x/raw/stable/4chan_x.user.js' css: ' /* dialog styling */