2018-04-21 22:22:13 +02:00
|
|
|
/**
|
|
|
|
* Formats a date.
|
|
|
|
* @param {date} date - toggle decorations
|
|
|
|
* @param {params} params -
|
|
|
|
*/
|
|
|
|
function formatDate( date, params ) {
|
|
|
|
var options = {
|
|
|
|
weekday: "short",
|
|
|
|
year: "numeric",
|
|
|
|
month: "long",
|
|
|
|
day: "numeric",
|
|
|
|
hour: "2-digit",
|
|
|
|
minute: "2-digit",
|
|
|
|
timeZone: "UTC",
|
|
|
|
timeZoneName: "short",
|
|
|
|
};
|
|
|
|
|
|
|
|
options = [options, params].reduce(function (r, o) {
|
|
|
|
Object.keys(o).forEach(function (k) { r[k] = o[k]; });
|
|
|
|
return r;
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
|
|
|
|
return new Date( date ).toLocaleString( 'en-US', options );
|
|
|
|
}
|
2018-04-28 15:17:36 +02:00
|
|
|
|
|
|
|
function isNumeric(n) {
|
|
|
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
2018-07-18 16:51:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function showSeedPage() {
|
|
|
|
// Shows `Settings->Seed & keys`. Prompts a password dialog.
|
|
|
|
passwordDialog.onAcceptedCallback = function() {
|
|
|
|
if(walletPassword === passwordDialog.password){
|
|
|
|
if(currentWallet.seedLanguage == "") {
|
|
|
|
console.log("No seed language set. Using English as default");
|
|
|
|
currentWallet.setSeedLanguage("English");
|
|
|
|
}
|
|
|
|
// Load keys page
|
|
|
|
middlePanel.state = "Keys"
|
|
|
|
} else {
|
|
|
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
|
|
|
informationPopup.text = qsTr("Wrong password");
|
|
|
|
informationPopup.open()
|
|
|
|
informationPopup.onCloseCallback = function() {
|
|
|
|
passwordDialog.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
passwordDialog.onRejectedCallback = function() {
|
|
|
|
appWindow.showPageRequest("Settings");
|
|
|
|
}
|
|
|
|
passwordDialog.open();
|
|
|
|
if(isMobile) hideMenu();
|
|
|
|
updateBalance();
|
2018-04-28 15:17:36 +02:00
|
|
|
}
|