2017-12-16 13:36:56 -07:00
|
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
2017-06-29 04:01:49 -06:00
|
|
|
<br />
|
|
|
|
<div class="panel panel-blue">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">Setup</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<p>Almost done!
|
|
|
|
<br /><br />
|
|
|
|
Please enter your password, then press Finish.
|
|
|
|
</p>
|
|
|
|
<input type="password" id="passbox" class="form-control" placeholder="Password" style="display: block;" />
|
|
|
|
<br />
|
|
|
|
<div class="btn btn-primary" onclick="savePassword()"><i class="fa fa-check"></i> Finish</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function savePassword() {
|
2018-03-27 16:05:13 -06:00
|
|
|
$.post(setupsyncurl, {
|
|
|
|
username: setupusername,
|
|
|
|
key: setupsynckey,
|
2017-06-29 04:01:49 -06:00
|
|
|
password: $('#passbox').val(),
|
|
|
|
action: "check_password"
|
|
|
|
}, function (data) {
|
|
|
|
if (data.status === 'OK') {
|
2018-03-27 16:05:13 -06:00
|
|
|
setuppassword = $('#passbox').val();
|
|
|
|
var accid = addaccount(setupusername, setuppassword, setupsyncurl, setupsynckey);
|
|
|
|
switchaccount(accid);
|
|
|
|
localStorage.setItem("firstrun", "1");
|
|
|
|
navigator.notification.alert("Account connected!", null, "Success", 'Continue');
|
|
|
|
restartApplication();
|
2017-06-29 04:01:49 -06:00
|
|
|
} else {
|
|
|
|
navigator.notification.alert(data.msg, null, "Error", 'Dismiss');
|
|
|
|
}
|
|
|
|
}, "json").fail(function () {
|
|
|
|
navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss');
|
|
|
|
});
|
|
|
|
}
|
2017-12-21 00:34:05 -07:00
|
|
|
|
2017-12-18 01:36:02 -07:00
|
|
|
setnavbar("setup");
|
2017-06-29 04:01:49 -06:00
|
|
|
</script>
|