/* * 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/. */ $("#typecodebtn").on("click", function () { app.dialog.prompt('Enter the recipient\'s code', 'Send Money', function (code) { if (code != "") { app.preloader.show(); callAPI("getprofile", { key: localStorage.getItem("key"), id: code }, function (data) { $("#publicid").val(code); loadSendMoneyPage(); }, function (msg) { app.preloader.hide(); app.dialog.alert(msg, "Error"); }); } }); }); function loadSendMoneyPage() { app.preloader.show(); if ($("#publicid").val() == "0") { app.preloader.hide(); $("#step1").removeClass("display-none"); $("#step2").addClass("display-none"); } else { $("#step1").addClass("display-none"); $("#step2").removeClass("display-none"); callAPI("getprofile", { key: localStorage.getItem("key"), id: $("#publicid").val() }, function (data) { app.preloader.hide(); console.log("Profile", data.profile); $("#person-name").text(data.profile.name); if (data.profile.verified) { $("#verified-badge").removeClass("display-none"); } else { $("#unverified-badge").removeClass("display-none"); } }, function (msg) { app.preloader.hide(); app.dialog.alert(msg, "Error"); }); } } $(".preset-amount-button").click(function () { $($(this).data("target")).val($(this).data("amount")); });