File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -524,15 +524,24 @@ App.prototype.resetLayout = function() {
524
524
App . prototype . setCompileMessage = function ( ) {
525
525
// Display time since last build and compile message
526
526
let now = new Date ( ) ,
527
- timeSinceCompile = Utils . fuzzyTime ( now . getTime ( ) - window . compileTime ) ,
528
- compileInfo = "<span style=\"font-weight: normal\">Last build: " +
529
- timeSinceCompile . substr ( 0 , 1 ) . toUpperCase ( ) + timeSinceCompile . substr ( 1 ) + " ago" ;
527
+ timeSinceCompile = Utils . fuzzyTime ( now . getTime ( ) - window . compileTime ) ;
528
+
529
+ // Calculate previous version to compare to
530
+ let prev = PKG_VERSION . split ( "." ) . map ( n => {
531
+ return parseInt ( n , 10 ) ;
532
+ } ) ;
533
+ if ( prev [ 2 ] > 0 ) prev [ 2 ] -- ;
534
+ else if ( prev [ 1 ] > 0 ) prev [ 1 ] -- ;
535
+ else prev [ 0 ] -- ;
536
+
537
+ const compareURL = `https://github.com/gchq/CyberChef/compare/v${ prev . join ( "." ) } ...v${ PKG_VERSION } ` ;
538
+
539
+ let compileInfo = `<a href='${ compareURL } '>Last build: ${ timeSinceCompile . substr ( 0 , 1 ) . toUpperCase ( ) + timeSinceCompile . substr ( 1 ) } ago</a>` ;
530
540
531
541
if ( window . compileMessage !== "" ) {
532
542
compileInfo += " - " + window . compileMessage ;
533
543
}
534
544
535
- compileInfo += "</span>" ;
536
545
document . getElementById ( "notice" ) . innerHTML = compileInfo ;
537
546
} ;
538
547
You can’t perform that action at this time.
0 commit comments