-
-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #755 from mikeller/added_release_checking
Added checking for latest configurator release and update notification.
- 10.10.0
- 10.10.0-RC4
- 10.10.0-RC3
- 10.10.0-RC2
- 10.10.0-RC1
- 10.9.0
- 10.9.0-RC5
- 10.9.0-RC4
- 10.9.0-RC3
- 10.9.0-RC2
- 10.9.0-RC1
- 10.8.0
- 10.8.0-RC7
- 10.8.0-RC6
- 10.8.0-RC5
- 10.8.0-RC4
- 10.8.0-RC3
- 10.8.0-RC2
- 10.8.0-RC1
- 10.7.2
- 10.7.1
- 10.7.0
- 10.7.0-RC2
- 10.7.0-RC1
- 10.6.0
- 10.6.0-RC2
- 10.6.0-RC1
- 10.5.1
- 10.5.0
- 10.4.1
- 10.4.0
- 10.3.1
- 10.3.0
- 10.2.0
- 10.1.0
- 10.0.0
- 10.0.0-rc4
- 10.0.0-rc3
Showing
9 changed files
with
217 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
'use strict;' | ||
|
||
var ReleaseChecker = function (releaseName, releaseUrl) { | ||
var self = this; | ||
|
||
self._releaseName = releaseName; | ||
self._releaseDataTag = `${self._releaseName}ReleaseData`; | ||
self._releaseLastUpdateTag = `${self._releaseName}ReleaseLastUpdate` | ||
self._releaseUrl = releaseUrl; | ||
|
||
|
||
} | ||
|
||
ReleaseChecker.prototype.loadReleaseData = function (processFunction) { | ||
var self = this; | ||
chrome.storage.local.get([self._releaseLastUpdateTag, self._releaseDataTag], function (result) { | ||
var releaseDataTimestamp = $.now(); | ||
var cacheReleaseData = result[self._releaseDataTag]; | ||
var cachedReleaseLastUpdate = result[self._releaseLastUpdateTag]; | ||
if (!cacheReleaseData || !cachedReleaseLastUpdate || releaseDataTimestamp - cachedReleaseLastUpdate > 3600 * 1000) { | ||
$.get(self._releaseUrl, function (releaseData) { | ||
GUI.log(`Loaded release information for ${self._releaseName} from GitHub.`); | ||
|
||
var data = {}; | ||
data[self._releaseDataTag] = releaseData | ||
data[self._releaseLastUpdateTag] = releaseDataTimestamp | ||
chrome.storage.local.set(data, function () {}); | ||
|
||
self._processReleaseData(releaseData, processFunction); | ||
}).fail(function (data) { | ||
var message = ''; | ||
if (data['responseJSON']) { | ||
message = data['responseJSON'].message; | ||
} | ||
GUI.log(`<b>GitHub query for ${self._releaseName} releases failed, using cached information. Reason: <code>${message}</code></b>`); | ||
|
||
self._processReleaseData(cacheReleaseData, processFunction); | ||
}); | ||
} else { | ||
if (cacheReleaseData) { | ||
GUI.log(`Using cached release information for ${self._releaseName} releases.`); | ||
} | ||
|
||
self._processReleaseData(cacheReleaseData, processFunction); | ||
} | ||
}); | ||
} | ||
|
||
|
||
ReleaseChecker.prototype._processReleaseData = function (releaseData, processFunction) { | ||
if (releaseData) { | ||
processFunction(releaseData); | ||
} else { | ||
GUI.log(`No release information available for ${self._releaseName}.`); | ||
|
||
processFunction(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="notifications"> | ||
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label> | ||
</div> | ||
<div class="permanentExpertMode"> | ||
<label><input type="checkbox" /><span i18n="permanentExpertMode"></span></label> | ||
</div> | ||
<div class="checkForConfiguratorUnstableVersions"> | ||
<label><input type="checkbox" /><span i18n="checkForConfiguratorUnstableVersions"></span></label> | ||
</div> |