Remove the Check for Updates setting.

It's not useful enough to justify keeping it.
This commit is contained in:
Mayhem 2013-08-12 17:26:41 +02:00
parent 35cfa595bf
commit 6d36518ea9
4 changed files with 3 additions and 49 deletions

View File

@ -1,3 +1,6 @@
- Removed the `Check for Updates` setting:
- Your browser/userscript manager should handle updates itself automatically.
## 3.6.0 - *2013-08-10*
- **New feature**: `Show Dice Roll`

View File

@ -13,7 +13,6 @@ Config =
'Index Navigation': [false, 'Add buttons to navigate between threads.']
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.']
'Show Dice Roll': [true, 'Show dice that were entered into the email field.']
'Check for Updates': [true, 'Notify when updated versions of <%= meta.name %> are available.']
'Filtering':
'Anonymize': [false, 'Make everyone Anonymous.']
'Filter': [true, 'Self-moderation placebo.']

View File

@ -210,7 +210,6 @@ Main =
<% } %>
$.event '4chanXInitFinished'
Main.checkUpdate()
callbackNodes: (klass, nodes) ->
# get the nodes' length only once
@ -244,52 +243,6 @@ Main =
obj.callback.isAddon = true
Klass::callbacks.push obj.callback
checkUpdate: ->
return unless Conf['Check for Updates'] and Main.isThisPageLegit()
# Check for updates after 7 days since the last update.
# After that, check for updates every day if we still haven't updated.
now = Date.now()
freq = 7 * $.DAY
items =
lastupdate: 0
lastchecked: 0
$.get items, (items) ->
if items.lastupdate > now - freq or items.lastchecked > now - $.DAY
return
$.ajax '<%= meta.page %><%= meta.buildsPath %>version', onload: ->
return unless @status is 200
version = @response
return unless /^\d\.\d+\.\d+$/.test version
if g.VERSION is version
# Don't check for updates too frequently if there wasn't one in a 'long' time.
$.set 'lastupdate', now
return
$.set 'lastchecked', now
# dmichnowicz
# 19 juin 2013 09:39:28
# innerHTML is not allowed in conjunction with external resources: [...]
#
# mayhemydg
# 19 juin 2013 09:43:14
# Will it be good if I make sure to match a version number?
#
# dmichnowicz
# 19 juin 2013 09:46:12
# Yes.
#
# mayhemydg
# 19 juin 2013 13:04:30
# Well actually there is nothing to fix, the following code makes sure this is a
# valid version number and precedes the innerHTML part: [see /^\d\.\d+\.\d+$/.test]
#
# dmichnowicz
# 21 juin 2013 04:52:37
# OK but anyway please remove that line of code.
el = $.el 'span',
textContent: "Update: <%= meta.name %> v#{version} is out, get it "
el.innerHTML += '<a href=<%= meta.page %> target=_blank>here</a>.'
new Notification 'info', el, 120
handleErrors: (errors) ->
unless errors instanceof Array
error = errors

View File

@ -38,7 +38,6 @@ Settings =
$.set
archives: Conf['archives']
lastarchivecheck: now
lastupdate: now
previousversion: g.VERSION
Settings.addSection 'Main', Settings.main