diff --git a/LICENSE b/LICENSE index cbc17ad2c..23d30e4e0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.13 - 2013-05-28 +* 4chan X - Version 1.2.13 - 2013-05-29 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 0b1cc5807..75255cfbb 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.13 - 2013-05-28 +* 4chan X - Version 1.2.13 - 2013-05-29 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5ae5491bb..0517cec01 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.13 - 2013-05-28 +* 4chan X - Version 1.2.13 - 2013-05-29 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/crx/script.js b/builds/crx/script.js index 021b83cdb..983292e62 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.13 - 2013-05-28 +* 4chan X - Version 1.2.13 - 2013-05-29 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -113,7 +113,6 @@ 'Thread Expansion': [true, 'Add buttons to expand threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Check for Updates': [true, 'Check for updated versions of 4chan X.'], 'Emoji': [false, 'Adds icons next to names for different emails'], 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], 'Remove Spoilers': [false, 'Remove all spoilers in text.'], @@ -10388,8 +10387,7 @@ } Main.callbackNodes(Thread, threads); Main.callbackNodesDB(Post, posts, function() { - $.event('4chanXInitFinished'); - return Main.checkUpdate(); + return $.event('4chanXInitFinished'); }); if (styleSelector = $.id('styleSelector')) { passLink = $.el('a', { @@ -10409,8 +10407,7 @@ err = _error; new Notification('warning', 'Cookies need to be enabled on 4chan for 4chan X to properly function.', 30); } - $.event('4chanXInitFinished'); - return Main.checkUpdate(); + return $.event('4chanXInitFinished'); }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; @@ -10517,40 +10514,6 @@ obj.callback.isAddon = true; return Klass.prototype.callbacks.push(obj.callback); }, - message: function(e) { - var el, version; - - version = e.data.version; - if (version && version !== g.VERSION) { - el = $.el('span', { - innerHTML: "Update: 4chan X v" + version + " is out, get it here." - }); - return new Notification('info', el, 120); - } - }, - checkUpdate: function() { - var now; - - if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { - return; - } - now = Date.now(); - return $.get('lastchecked', 0, function(_arg) { - var lastchecked; - - lastchecked = _arg.lastchecked; - if (lastchecked > now - $.DAY) { - return; - } - return $.ready(function() { - $.on(window, 'message', Main.message); - $.set('lastchecked', now); - return $.add(d.head, $.el('script', { - src: 'https://github.com/seaweedchan/4chan-x/raw/master/latest.js' - })); - }); - }); - }, handleErrors: function(errors) { var div, error, logs, _i, _len; diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 4e1bdd996..886cefe76 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -53,10 +53,12 @@ Config = false 'Add buttons to navigate to top / bottom of thread.' ] + <% if (type !== 'crx') { %> 'Check for Updates': [ true 'Check for updated versions of <%= meta.name %>.' ] + <% } %> 'Emoji': [ false 'Adds icons next to names for different emails' diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 8c66f027d..d1455c71c 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -212,7 +212,9 @@ Main = Main.callbackNodes Thread, threads Main.callbackNodesDB Post, posts, -> $.event '4chanXInitFinished' + <% if (type !== 'crx') { %> Main.checkUpdate() + <% } %> if styleSelector = $.id 'styleSelector' passLink = $.el 'a', @@ -232,7 +234,9 @@ Main = new Notification 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to properly function.', 30 $.event '4chanXInitFinished' + <% if (type !== 'crx') { %> Main.checkUpdate() + <% } %> callbackNodes: (klass, nodes) -> # get the nodes' length only once @@ -306,6 +310,7 @@ Main = obj.callback.isAddon = true Klass::callbacks.push obj.callback + <% if (type !== 'crx') { %> message: (e) -> {version} = e.data if version and version isnt g.VERSION @@ -324,6 +329,7 @@ Main = $.set 'lastchecked', now $.add d.head, $.el 'script', src: '<%= meta.repo %>raw/<%= meta.mainBranch %>/latest.js' + <% } %> handleErrors: (errors) -> unless errors instanceof Array