i180 release checker and changelog action

10.3.x-maintenance
Miguel Angel Mulero Martinez 2017-12-28 11:34:34 +01:00
parent 03533a5880
commit a073bf8a17
3 changed files with 18 additions and 6 deletions

View File

@ -220,6 +220,18 @@
"infoVersions": {
"message" : "Running - OS: <strong>$1</strong>, Chrome: <strong>$2</strong>, Configurator: <strong>$3</strong>"
},
"releaseCheckLoaded": {
"message" : "Loaded release information for $1 from GitHub."
},
"releaseCheckFailed": {
"message" : "<b>GitHub query for $1 releases failed, using cached information. Reason: <code>$2</code></b>"
},
"releaseCheckCached": {
"message" : "Using cached release information for $1 releases."
},
"releaseCheckNoInfo": {
"message" : "No release information available for $1."
},
"tabSwitchConnectionRequired": {
"message": "You need to <strong>connect</strong> before you can view any of the tabs."
},

View File

@ -19,7 +19,7 @@ ReleaseChecker.prototype.loadReleaseData = function (processFunction) {
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.`);
GUI.log(chrome.i18n.getMessage('releaseCheckLoaded',[self._releaseName]));
var data = {};
data[self._releaseDataTag] = releaseData
@ -32,13 +32,13 @@ ReleaseChecker.prototype.loadReleaseData = function (processFunction) {
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>`);
GUI.log(chrome.i18n.getMessage('releaseCheckFailed',[self._releaseName,message]));
self._processReleaseData(cacheReleaseData, processFunction);
});
} else {
if (cacheReleaseData) {
GUI.log(`Using cached release information for ${self._releaseName} releases.`);
GUI.log(chrome.i18n.getMessage('releaseCheckCached',[self._releaseName]));
}
self._processReleaseData(cacheReleaseData, processFunction);
@ -51,7 +51,7 @@ ReleaseChecker.prototype._processReleaseData = function (releaseData, processFun
if (releaseData) {
processFunction(releaseData);
} else {
GUI.log(`No release information available for ${self._releaseName}.`);
GUI.log(chrome.i18n.getMessage('releaseCheckNoInfo',[self._releaseName]));
processFunction();
}

View File

@ -28,7 +28,7 @@ TABS.landing.initialize = function (callback) {
$("#content").addClass('log_open');
state = true;
}
$(this).text(state ? 'Close' : 'Changelog');
$(this).text(state ? chrome.i18n.getMessage('close') : chrome.i18n.getMessage('defaultChangelogAction'));
$(this).data('state2', state);
});