/* * 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/. */ function loadProfilePage() { app.preloader.show(); callAPI("getprofile", { key: localStorage.getItem("key"), }, function (data) { $("#name").val(data.profile.name); $("#bio").val(data.profile.bio); app.input.resizeTextarea($("#bio")); app.preloader.hide(); }, function (msg) { app.preloader.hide(); app.dialog.alert(msg, "Error loading profile"); }); } function saveProfile() { app.preloader.show(); callAPI("setprofile", { key: localStorage.getItem("key"), name: $("#name").val(), bio: $("#bio").val() }, function (data) { app.preloader.hide(); app.toast.create({ text: " Profile updated!", closeTimeout: 2000 }).open(); }, function (msg) { app.preloader.hide(); app.dialog.alert(msg, "Error saving profile"); }); }