|
|
|
@ -61,8 +61,28 @@ function createAccount() {
|
|
|
|
|
var username = $("#username").val();
|
|
|
|
|
var password = $("#password").val();
|
|
|
|
|
|
|
|
|
|
app.preloader.show();
|
|
|
|
|
if (username.length < 1) {
|
|
|
|
|
app.dialog.alert("Enter a username.", "Error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (password.length < SETTINGS["min_password_length"]) {
|
|
|
|
|
app.dialog.alert("Password must be at least " + SETTINGS["min_password_length"] + " characters long.", "Error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.dialog.create({
|
|
|
|
|
text: "I agree to the terms of service and privacy policy.",
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: "No",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
restartApplication();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Yes",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
app.preloader.show();
|
|
|
|
|
callAPI("signup", {
|
|
|
|
|
username: username,
|
|
|
|
|
password: password,
|
|
|
|
@ -75,3 +95,13 @@ function createAccount() {
|
|
|
|
|
app.dialog.alert(msg, "Error");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Show",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
openBrowser(SETTINGS["terms_of_service_url"]);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}).open();
|
|
|
|
|
}
|