Browse Source

Finish money sending feature (close #1)

master
Skylar Ittner 3 years ago
parent
commit
33ed283a97
  1. 14
      www/img/bigcheck.svg
  2. 27
      www/js/sendmoney.js
  3. 40
      www/pages/moneysent.html
  4. 37
      www/pages/sendmoney.html
  5. 23
      www/routes.js

14
www/img/bigcheck.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="256" height="256" version="1.1" viewBox="0 0 67.733 67.733" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0 -229.27)">
<g transform="translate(-2.1594 -2.3301)">
<circle cx="36.026" cy="265.46" r="25.346" fill="none" stroke="#fff" stroke-width="2.1167"/>
<g transform="matrix(.92594 0 0 .92594 15.724 23.148)" fill="#fff">
<g transform="translate(0 -10.583)" fill="#fff">
<rect transform="rotate(-45)" x="-186.61" y="215.33" width="50.291" height="2.286"/>
<rect transform="matrix(-.70711 -.70711 -.70711 .70711 0 0)" x="-217.62" y="184.32" width="18.288" height="2.286"/>
</g>
</g>
</g>
</g>
</svg>

27
www/js/sendmoney.js

@ -23,6 +23,29 @@ $("#typecodebtn").on("click", function () {
});
});
function sendMoney(id, amount, name) {
if (id == "0") {
return;
}
if (amount <= 0) {
app.dialog.alert("Please specify an amount.", "Error");
} else if (amount > 999.99) {
app.dialog.alert("Please specify an amount less than $999.99.", "Error");
}
app.preloader.show();
callAPI("sendmoney", {
key: localStorage.getItem("key"),
to: id,
amount: amount
}, function (data) {
app.preloader.hide();
router.navigate("/moneysent/" + (amount * 1.0).toFixed(2) + "/" + name);
}, function (msg) {
app.preloader.hide();
app.dialog.alert(msg, "Error");
});
}
function loadSendMoneyPage() {
app.preloader.show();
if ($("#publicid").val() == "0") {
@ -53,4 +76,8 @@ function loadSendMoneyPage() {
$(".preset-amount-button").click(function () {
$($(this).data("target")).val($(this).data("amount"));
});
$("#sendbtn").click(function () {
sendMoney($("#publicid").val(), $("#amount-box").val(), $("#person-name").text());
});

40
www/pages/moneysent.html

@ -0,0 +1,40 @@
<!-- 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/. -->
<div class="page" data-name="moneysent">
<div class="navbar">
<div class="navbar-inner">
<div class="left">
<a href="#" class="link icon-only back">
<i class="icon icon-back"></i>
</a>
</div>
<div class="title">Money Sent</div>
</div>
</div>
<div class="page-content">
<div class="block">
<div class="row justify-content-center">
<div class="col-100 tablet-50 desktop-25">
<div class="card bg-color-green">
<div class="card-content card-content-padding text-align-center text-color-white color-theme-white">
<img style="max-height: 150px;" src="img/bigcheck.svg" alt="Checkmark"/>
<h3>You sent ${{this.$route.params.amount}} to {{this.$route.params.name}}</h3>
<a class="button button-outline" href="/home">Close</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

37
www/pages/sendmoney.html

@ -40,23 +40,7 @@
<div id="step2" class="display-none">
<div class="row justify-content-center">
<div class="col-100 tablet-50 desktop-25">
<div class="card">
<div class="card-content card-content-padding">
<h3><i class="fas fa-user"></i> <span id="person-name"></span></h3>
<div>
<a id="verified-badge-container" class="link popup-open" href="#" data-popup="#verification-popup">
<span id="verified-badge" class="display-none">
<i class="fas fa-check-circle text-color-green"></i> &nbsp; Verified
</span>
<span id="unverified-badge" class="display-none">
<i class="fas fa-question-circle text-color-blue"></i> &nbsp; Unverified
</span>
</a>
</div>
</div>
</div>
</div>
<div class="col-100 tablet-50 desktop-25">
<div class="card">
<div class="card-content card-content-padding">
@ -79,6 +63,25 @@
</div>
</div>
</div>
<div class="col-100 tablet-50 desktop-25">
<div class="card">
<div class="card-content card-content-padding">
<h3><i class="fas fa-user"></i> <span id="person-name"></span></h3>
<div>
<a id="verified-badge-container" class="link popup-open" href="#" data-popup="#verification-popup">
<span id="verified-badge" class="display-none">
<i class="fas fa-check-circle text-color-green"></i> &nbsp; Verified
</span>
<span id="unverified-badge" class="display-none">
<i class="fas fa-question-circle text-color-blue"></i> &nbsp; Unverified
</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

23
www/routes.js

@ -43,6 +43,11 @@ var routes = [
}
}
},
{
path: '/moneysent/:amount/:name',
templateUrl: './pages/moneysent.html',
name: 'moneysent'
},
{
path: '/settings',
name: 'prefs',
@ -62,26 +67,18 @@ var routes = [
settings: [{
setting: "userinfo",
title: '<i class="fa fa-user"></i> <span id="username">' + username + '</span>',
text: '<i class="fa fa-server"></i> Server: <span id="url">' + serverurl + '</span>',
text: '',
onclick: ""
},
{
setting: "account",
title: "Sign in to a different account",
title: "Sign out",
onclick: "router.navigate('/setup/0')"
},
{
setting: "editor",
title: "Use alternative editor",
text: "Turn on if you're having issues editing notes.",
toggle: true,
checked: localStorage.getItem("alternateeditor") == "true",
onclick: ""
},
{
setting: "versions",
title: "NotePost app v1.2.0",
text: "Copyright &copy; 2018-2019 Netsyms Technologies. License: <span style=\"text-decoration: underline;\" onclick=\"openBrowser('https://source.netsyms.com/Apps/NotePostApp?pk_campaign=NotePostApp');\">Mozilla Public License 2.0</span>.",
title: "Helping Helena app v1.0.0",
text: "Copyright &copy; 2018-2019 Netsyms Technologies. License: <span style=\"text-decoration: underline;\" onclick=\"openBrowser('https://source.netsyms.com/Netsyms/HelpingHelenaApp?pk_campaign=HelpingHelenaApp');\">Mozilla Public License 2.0</span>.",
onclick: ""
},
{
@ -94,7 +91,7 @@ var routes = [
setting: "privacy",
title: "Privacy Policy",
text: "",
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=NotePostApp')"
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=HelpingHelenaApp')"
}]
}
});

Loading…
Cancel
Save