Merge branch 'lepipele-dev-lepi'

This commit is contained in:
nicolas.dorier
2017-10-27 17:37:55 +09:00
11 changed files with 12962 additions and 881 deletions

View File

@@ -10,11 +10,12 @@ using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Encodings.Web;
namespace BTCPayServer
{
public static class Extensions
{
public static class Extensions
{
public static string WithTrailingSlash(this string str)
{
if(str.EndsWith("/"))
@@ -54,5 +55,13 @@ namespace BTCPayServer
var res = JsonConvert.SerializeObject(o, Formatting.None, jsonSettings);
return res;
}
public static HtmlString ToSrvModel(this object o)
{
var encodedJson = JavaScriptEncoder.Default.Encode(o.ToJson());
return new HtmlString("var srvModel = JSON.parse('" + encodedJson + "');");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -20,8 +20,8 @@
<!-- Custom fonts for this template -->
@*<link href="~/vendor/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>*@
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>*@
<!-- Plugin CSS -->
<link href="~/vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
@@ -29,6 +29,9 @@
<!-- Custom styles for this template -->
<link href="~/css/creative.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="~/css/site.css" rel="stylesheet" />
</head>
<body id="page-top">
@@ -63,13 +66,11 @@
</li>
<li class="nav-item">
<a asp-area="" asp-controller="Account" asp- asp-action="Logout" title="Manage" class="nav-link js-scroll-trigger">Log out</a>
</li>
}
</li>}
else
{
<li class="nav-item"><a asp-area="" asp-controller="Account" asp-action="Register" class="nav-link js-scroll-trigger">Register</a></li>
<li class="nav-item"><a asp-area="" asp-controller="Account" asp-action="Login" class="nav-link js-scroll-trigger">Log in</a></li>
}
<li class="nav-item"><a asp-area="" asp-controller="Account" asp-action="Login" class="nav-link js-scroll-trigger">Log in</a></li>}
</ul>
</div>
@@ -77,9 +78,9 @@
</nav>
@RenderBody()
@*<footer class="footer bg-dark" style="position:absolute;width:100%;bottom:0;">
<div class="container" style="text-align:right;font-size:10px;"><span>@env.ToString()</span></div>
</footer>*@
<footer class="bg-dark">
<div class="container text-right"><span>@env.ToString()</span></div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="~/vendor/jquery/jquery.min.js"></script>

View File

@@ -5,30 +5,33 @@
*/
body,
html {
width: 100%;
height: 100%; }
width: 100%;
}
body {
font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif; }
font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif;
}
hr {
max-width: 50px;
border-width: 3px;
border-color: #329F80;
max-width: 50px;
border-width: 3px;
border-color: #329F80;
}
hr.light {
border-color: white; }
hr.light {
border-color: white;
}
a {
color: #329F80;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
color: #329F80;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
a:focus, a:hover {
color: #0F3723;
}
a:focus, a:hover {
color: #0F3723;
}
h1,
h2,
@@ -36,243 +39,337 @@ h3,
h4,
h5,
h6 {
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; }
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
p {
font-size: 16px;
line-height: 1.5;
margin-bottom: 20px; }
font-size: 16px;
line-height: 1.5;
margin-bottom: 20px;
}
.bg-primary {
background-color: #0F3B21 !important; }
background-color: #0F3B21 !important;
}
.bg-dark {
color: white;
background-color: #0F3723 !important;
color: white;
background-color: #0F3723 !important;
}
.text-faded {
color: rgba(255, 255, 255, 0.7); }
color: rgba(255, 255, 255, 0.7);
}
section {
padding: 100px 0; }
padding: 100px 0;
}
.section-heading {
margin-top: 0; }
margin-top: 0;
}
::-moz-selection {
color: white;
background: #222222;
text-shadow: none; }
color: white;
background: #222222;
text-shadow: none;
}
::selection {
color: white;
background: #222222;
text-shadow: none; }
color: white;
background: #222222;
text-shadow: none;
}
img::selection {
color: white;
background: transparent; }
color: white;
background: transparent;
}
img::-moz-selection {
color: white;
background: transparent; }
color: white;
background: transparent;
}
body {
-webkit-tap-highlight-color: #222222; }
-webkit-tap-highlight-color: #222222;
}
#mainNav {
border-color: rgba(34, 34, 34, 0.05);
background-color: #0F3723;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
#mainNav .navbar-brand {
font-weight: 700;
text-transform: uppercase;
color: #0F3B21;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; }
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: #0F3B21; }
#mainNav .navbar-toggle {
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
color: #222222; }
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus,
#mainNav .navbar-nav > li.nav-item > a.nav-link {
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
color: white; }
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover {
color: white; }
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active {
color: white !important;
background-color: transparent; }
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active:hover {
background-color: transparent; }
@media (min-width: 992px) {
#mainNav {
border-color: rgba(255, 255, 255, 0.3);
background-color: transparent; }
#mainNav .navbar-brand {
color: rgba(255, 255, 255, 0.7); }
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: white; }
#mainNav .navbar-nav > li.nav-item > a.nav-link,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus {
color: white; }
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover {
color: white; }
#mainNav.navbar-shrink {
border-color: rgba(34, 34, 34, 0.05);
background-color: #0F3723;
}
#mainNav.navbar-shrink .navbar-brand {
font-size: 16px;
color: #0F3B21; }
#mainNav.navbar-shrink .navbar-brand:focus, #mainNav.navbar-shrink .navbar-brand:hover {
color: #0F3B21; }
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus {
color: white; }
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus:hover {
} }
header.masthead {
position: relative;
width: 100%;
min-height: auto;
text-align: center;
color: white;
background-image: url("../img/bg.png");
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; }
header.masthead .header-content {
position: relative;
width: 100%;
padding: 150px 15px 100px;
text-align: center; }
header.masthead .header-content .header-content-inner h1 {
font-size: 30px;
font-weight: 700;
margin-top: 0;
margin-bottom: 0;
text-transform: uppercase; }
header.masthead .header-content .header-content-inner hr {
margin: 30px auto; }
header.masthead .header-content .header-content-inner p {
font-size: 16px;
font-weight: 300;
margin-bottom: 50px;
color: rgba(255, 255, 255, 0.7); }
@media (min-width: 768px) {
header.masthead {
height: 70%;
min-height: 600px; }
header.masthead .header-content {
position: absolute;
top: 50%;
padding: 0 50px;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%); }
header.masthead .header-content .header-content-inner {
max-width: 1000px;
margin-right: auto;
margin-left: auto; }
header.masthead .header-content .header-content-inner h1 {
font-size: 50px; }
header.masthead .header-content .header-content-inner p {
font-size: 18px;
max-width: 80%;
margin-right: auto;
margin-left: auto; } }
.service-box {
max-width: 400px;
margin: 50px auto 0; }
.service-box h3 {
color: #0F3B21;
}
@media (min-width: 992px) {
.service-box {
margin: 20px auto 0; } }
.service-box p {
margin-bottom: 0; }
.portfolio-box {
position: relative;
display: block;
max-width: 650px;
margin: 0 auto; }
.portfolio-box .portfolio-box-caption {
position: absolute;
bottom: 0;
display: block;
width: 100%;
height: 100%;
text-align: center;
opacity: 0;
color: white;
background: rgba(240, 95, 64, 0.9);
border-color: rgba(34, 34, 34, 0.05);
background-color: #0F3723;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s; }
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content {
position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);
text-align: center; }
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category,
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
padding: 0 15px;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; }
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 14px;
font-weight: 600;
text-transform: uppercase; }
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 18px; }
.portfolio-box:hover .portfolio-box-caption {
opacity: 1; }
.portfolio-box:focus {
outline: none; }
@media (min-width: 768px) {
transition: all 0.2s;
}
#mainNav .navbar-brand {
font-weight: 700;
text-transform: uppercase;
color: #0F3B21;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: #0F3B21;
}
#mainNav .navbar-toggle {
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
color: #222222;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus,
#mainNav .navbar-nav > li.nav-item > a.nav-link {
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
color: white;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover {
color: white;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active {
color: white !important;
background-color: transparent;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus.active:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active:hover {
background-color: transparent;
}
@media (min-width: 992px) {
#mainNav {
border-color: rgba(255, 255, 255, 0.3);
background-color: transparent;
}
#mainNav .navbar-brand {
color: rgba(255, 255, 255, 0.7);
}
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
color: white;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus {
color: white;
}
#mainNav .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover {
color: white;
}
#mainNav.navbar-shrink {
border-color: rgba(34, 34, 34, 0.05);
background-color: #0F3723;
}
#mainNav.navbar-shrink .navbar-brand {
font-size: 16px;
color: #0F3B21;
}
#mainNav.navbar-shrink .navbar-brand:focus, #mainNav.navbar-shrink .navbar-brand:hover {
color: #0F3B21;
}
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus {
color: white;
}
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav.navbar-shrink .navbar-nav > li.nav-item > a.nav-link:focus:hover {
}
}
header.masthead {
position: relative;
width: 100%;
min-height: auto;
text-align: center;
color: white;
background-image: url("../img/bg.png");
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
header.masthead .header-content {
position: relative;
width: 100%;
padding: 150px 15px 100px;
text-align: center;
}
header.masthead .header-content .header-content-inner h1 {
font-size: 30px;
font-weight: 700;
margin-top: 0;
margin-bottom: 0;
text-transform: uppercase;
}
header.masthead .header-content .header-content-inner hr {
margin: 30px auto;
}
header.masthead .header-content .header-content-inner p {
font-size: 16px;
font-weight: 300;
margin-bottom: 50px;
color: rgba(255, 255, 255, 0.7);
}
@media (min-width: 768px) {
header.masthead {
height: 70%;
min-height: 600px;
}
header.masthead .header-content {
position: absolute;
top: 50%;
padding: 0 50px;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
header.masthead .header-content .header-content-inner {
max-width: 1000px;
margin-right: auto;
margin-left: auto;
}
header.masthead .header-content .header-content-inner h1 {
font-size: 50px;
}
header.masthead .header-content .header-content-inner p {
font-size: 18px;
max-width: 80%;
margin-right: auto;
margin-left: auto;
}
}
.service-box {
max-width: 400px;
margin: 50px auto 0;
}
.service-box h3 {
color: #0F3B21;
}
@media (min-width: 992px) {
.service-box {
margin: 20px auto 0;
}
}
.service-box p {
margin-bottom: 0;
}
.portfolio-box {
position: relative;
display: block;
max-width: 650px;
margin: 0 auto;
}
.portfolio-box .portfolio-box-caption {
position: absolute;
bottom: 0;
display: block;
width: 100%;
height: 100%;
text-align: center;
opacity: 0;
color: white;
background: rgba(240, 95, 64, 0.9);
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content {
position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);
text-align: center;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category,
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
padding: 0 15px;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 14px;
font-weight: 600;
text-transform: uppercase;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 18px;
}
.portfolio-box:hover .portfolio-box-caption {
opacity: 1;
}
.portfolio-box:focus {
outline: none;
}
@media (min-width: 768px) {
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category {
font-size: 16px; }
font-size: 16px;
}
.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name {
font-size: 22px; } }
font-size: 22px;
}
}
.call-to-action {
padding: 50px 0; }
.call-to-action h2 {
margin: 0 auto 20px; }
padding: 50px 0;
}
.call-to-action h2 {
margin: 0 auto 20px;
}
.text-primary {
color: #0F3B21 !important; }
color: #0F3B21 !important;
}
.no-gutter > [class*='col-'] {
padding-right: 0;
padding-left: 0; }
padding-right: 0;
padding-left: 0;
}
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus {
color: #fff;
background-color: #0F3723;
color: #fff;
background-color: #0F3723;
}
/*.btn-default {

View File

@@ -1,8 +1,4 @@
body {
padding-top: 0px;
padding-bottom: 20px;
}

/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
@@ -21,11 +17,6 @@
width: 100%;
}
/* QR code generator */
#qrCode {
margin: 15px;
}
/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
/* Hide captions */
@@ -33,3 +24,22 @@
display: none;
}
}
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 18px !important;
}
footer {
position: absolute;
left: 0;
bottom: 0;
height: 18px;
font-size: 14px;
width: 100%;
overflow: hidden;
}

View File

@@ -13,22 +13,16 @@
*/
// Setup Base variables from the API
//var btcAddress = "1Dut19quHiJrXEwfmig4hB8RyLss5aTRTC",
// btcDue = "0.2254", //must be a string
// customerEmail = "", // Place holder
// maxTime = 60 * 15 - 1, // Can be calculted server-side, or fixed
// isArchieved = false, // Preferably Bool
// display = $(".timer-row__time-left"), // Timer container
// isPaid = false, // Tx listener
// merchantRefLink = "https://merchant.link"; // Merchant link to redect the user
// merchantName = "Merchant Name",
// merchantDesc = "Item description or Invoice description",
// btcRate = "4500",
// btcAmount = "0.22";
// itemAmount = 1,
// txFees = "0.0054";
// TODO: Vue controller... complete migrate to it for binding, animations can stay in jQuery
var checkoutCtrl = new Vue({
el: '#checkoutCtrl',
components: {
qrcode: VueQr
},
data: {
srvModel: srvModel
}
})
var display = $(".timer-row__time-left"); // Timer container
@@ -49,8 +43,6 @@ function hideEmailForm() {
$("[role=document]").removeClass("enter-purchaser-email");
$("#emailAddressView").removeClass("active");
$("placeholder-refundEmail").html(srvModel.customerEmail);
// to generate a QR-Code : $(<selector>).qrcode("1Dut19quHiJrXEwfmig4hB8RyLss5aTRTC");
$('.qr-codes').qrcode(srvModel.btcAddress);
// Remove Email mode
$(".modal-dialog").removeClass("enter-purchaser-email");
@@ -93,10 +85,6 @@ function emailForm() {
})
}
// Copy Tab Info
$("#copy .manual__step-two__instructions span").html("To complete your payment, please send " + srvModel.btcDue + " BTC to the address below.");
/* =============== Even listeners =============== */
// Email
@@ -155,16 +143,11 @@ $("#copy-tab").click(function () {
// Should connect using webhook ?
// If notification received
var oldStat = srvModel.status;
onDataCallback(srvModel);
function onDataCallback(jsonData) {
var newStatus = jsonData.status;
if (oldStat != newStatus) {
oldStat = newStatus;
window.parent.postMessage({ "invoiceId": srvModel.invoiceId, "status": newStatus }, "*");
}
if (newStatus == "complete" ||
newStatus == "confirmed" ||
newStatus == "paid") {
@@ -199,6 +182,13 @@ function onDataCallback(jsonData) {
$(".modal-dialog").addClass("expired");
$("#expired").addClass("active");
}
if (checkoutCtrl.srvModel.status != newStatus) {
window.parent.postMessage({ "invoiceId": srvModel.invoiceId, "status": newStatus }, "*");
}
// updating ui
checkoutCtrl.srvModel = jsonData;
}
var watcher = setInterval(function () {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10517
BTCPayServer/wwwroot/js/vue.js Normal file

File diff suppressed because it is too large Load Diff