From d46e27993306248d0966c0663215040b39e6e1be Mon Sep 17 00:00:00 2001 From: n1474335 Date: Mon, 24 Jul 2017 16:38:38 +0000 Subject: [PATCH] Added link to 'Last build' notice showing commits since last release --- src/web/App.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/web/App.js b/src/web/App.js index cc4b424c..ec0ed578 100755 --- a/src/web/App.js +++ b/src/web/App.js @@ -524,15 +524,24 @@ App.prototype.resetLayout = function() { App.prototype.setCompileMessage = function() { // Display time since last build and compile message let now = new Date(), - timeSinceCompile = Utils.fuzzyTime(now.getTime() - window.compileTime), - compileInfo = "Last build: " + - timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1) + " ago"; + timeSinceCompile = Utils.fuzzyTime(now.getTime() - window.compileTime); + + // Calculate previous version to compare to + let prev = PKG_VERSION.split(".").map(n => { + return parseInt(n, 10); + }); + if (prev[2] > 0) prev[2]--; + else if (prev[1] > 0) prev[1]--; + else prev[0]--; + + const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`; + + let compileInfo = `Last build: ${timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1)} ago`; if (window.compileMessage !== "") { compileInfo += " - " + window.compileMessage; } - compileInfo += ""; document.getElementById("notice").innerHTML = compileInfo; };