2020-08-21 13:59:43 +00:00
if ( window . location . host == "banglejs.com" ) {
document . getElementById ( "apploaderlinks" ) . innerHTML =
'This is the official Bangle.js App Loader - you can also try the <a href="https://espruino.github.io/BangleApps/">Development Version</a> for the most recent apps.' ;
} else if ( window . location . host == "espruino.github.io" ) {
document . title += " [Development]" ;
document . getElementById ( "apploaderlinks" ) . innerHTML =
'This is the development Bangle.js App Loader - you can also try the <a href="https://banglejs.com/apps/">Official Version</a> for stable apps.' ;
} else {
document . title += " [Unofficial]" ;
document . getElementById ( "apploaderlinks" ) . innerHTML =
'This is not the official Bangle.js App Loader - you can try the <a href="https://banglejs.com/apps/">Official Version</a> here.' ;
}
2021-07-09 16:43:21 +00:00
var RECOMMENDED _VERSION = "2v09" ;
2020-10-21 13:48:30 +00:00
// could check http://www.espruino.com/json/BANGLEJS.json for this
2020-08-21 13:59:43 +00:00
( function ( ) {
let username = "espruino" ;
let githubMatch = window . location . href . match ( /\/(\w+)\.github\.io/ ) ;
if ( githubMatch ) username = githubMatch [ 1 ] ;
2020-10-21 13:48:30 +00:00
Const . APP _SOURCECODE _URL = ` https://github.com/ ${ username } /BangleApps/tree/master/apps ` ;
2020-08-21 13:59:43 +00:00
} ) ( ) ;
2020-10-21 13:48:30 +00:00
function onFoundDeviceInfo ( deviceId , deviceVersion ) {
2021-06-30 12:24:58 +00:00
if ( deviceId != "BANGLEJS" && deviceId != "BANGLEJS2" ) {
2020-10-21 13:48:30 +00:00
showToast ( ` You're using ${ deviceId } , not a Bangle.js. Did you want <a href="https://espruino.com/apps">espruino.com/apps</a> instead? ` , "warning" , 20000 ) ;
} else if ( versionLess ( deviceVersion , RECOMMENDED _VERSION ) ) {
showToast ( ` You're using an old Bangle.js firmware ( ${ deviceVersion } ). You can <a href="https://www.espruino.com/Bangle.js#firmware-updates" target="_blank">update with the instructions here</a> ` , "warning" , 20000 ) ;
}
2021-06-30 12:24:58 +00:00
if ( deviceId == "BANGLEJS" ) {
Const . MESSAGE _RELOAD = 'Hold BTN3\nto reload' ;
}
if ( deviceId == "BANGLEJS2" ) {
2021-06-30 15:22:49 +00:00
Const . MESSAGE _RELOAD = 'Hold button\nto reload' ;
2021-06-30 12:24:58 +00:00
}
2020-10-21 13:48:30 +00:00
}