s/portalurl/syncurl/g

Framework7
Skylar Ittner 7 years ago
parent 2c30fe1b82
commit 96dd892c39

@ -30,7 +30,7 @@ document.addEventListener("deviceready", function () {
* succeeds.
*/
function getuserinfo(callback) {
$.post(localStorage.getItem("portalurl"), {
$.post(localStorage.getItem("syncurl"), {
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
password: localStorage.getItem("password"),

@ -10,7 +10,7 @@
<script>
function loadapps() {
$.post(localStorage.getItem("portalurl"), {
$.post(localStorage.getItem("syncurl"), {
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
action: "listapps"

@ -54,7 +54,7 @@
// Wipe localStorage
localStorage.removeItem("setupcomplete");
localStorage.removeItem("username");
localStorage.removeItem("portalurl");
localStorage.removeItem("syncurl");
localStorage.removeItem("key");
localStorage.clear();
// force-reload app
@ -64,14 +64,6 @@
}, "Are you sure?");
}
/**
* Open Portal in an iframe.
* @returns {undefined}
*/
function openportal() {
openapp("portal", "/mobile/index.php", localStorage.getItem("portalurl").replace("/mobile/index.php", ""), "/static/img/logo.svg", "Portal", false, true);
}
function toggleAnimations() {
if (localStorage.getItem("animations") === null || localStorage.getItem("animations") === "true") {
localStorage.setItem("animations", "false");
@ -94,7 +86,7 @@
function updatepassword() {
navigator.notification.prompt("Re-enter your password.", function (results) {
if (results.buttonIndex == 1) {
$.post(localStorage.getItem("portalurl"), {
$.post(localStorage.getItem("syncurl"), {
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
password: results.input1,

@ -19,7 +19,7 @@
<input type="text" id="key" class="form-control" placeholder="Sync key" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /> <br />
<div class="input-group" style="margin-left: -20px;">
<span class="input-group-addon" id="protocol-select">https://</span>
<input type="text" id="portalurl" class="form-control" placeholder="URL" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
<input type="text" id="syncurl" class="form-control" placeholder="URL" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</div> <br />
<div class="checkbox">
<label>
@ -44,13 +44,13 @@
});
/* Detect if the user typed "http[s]://" into the URL box and correct for it */
$("#portalurl").blur(function () {
if ($('#portalurl').val().toLowerCase().startsWith("https://")) {
$('#portalurl').val($('#portalurl').val().replace(/https\:\/\//ig, ""));
$("#syncurl").blur(function () {
if ($('#syncurl').val().toLowerCase().startsWith("https://")) {
$('#syncurl').val($('#syncurl').val().replace(/https\:\/\//ig, ""));
$('#protocol-select').text("https://");
$('#use-security').prop('checked', true);
} else if ($('#portalurl').val().toLowerCase().startsWith("http://")) {
$('#portalurl').val($('#portalurl').val().replace(/http\:\/\//ig, ""));
} else if ($('#syncurl').val().toLowerCase().startsWith("http://")) {
$('#syncurl').val($('#syncurl').val().replace(/http\:\/\//ig, ""));
$('#protocol-select').text("http://");
$('#use-security').prop('checked', false);
}
@ -79,10 +79,10 @@
});
function manualsetup() {
if ($('#portalurl').val().toLowerCase().startsWith("http")) {
var portal = $('#portalurl').val();
if ($('#syncurl').val().toLowerCase().startsWith("http")) {
var portal = $('#syncurl').val();
} else {
var portal = $('#protocol-select').text() + $('#portalurl').val();
var portal = $('#protocol-select').text() + $('#syncurl').val();
}
var username = $('#username').val();
var key = $('#key').val().replace(/\s+/g, '');
@ -101,7 +101,7 @@
}, function (data) {
if (data.status === 'OK') {
localStorage.setItem("username", username);
localStorage.setItem("portalurl", portal);
localStorage.setItem("syncurl", portal);
localStorage.setItem("key", key);
openscreen("setup2");
} else {

@ -16,7 +16,7 @@
<script>
function savePassword() {
$.post(localStorage.getItem("portalurl"), {
$.post(localStorage.getItem("syncurl"), {
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
password: $('#passbox').val(),

Loading…
Cancel
Save