Skip to content

Commit

Permalink
set_local/f
Browse files Browse the repository at this point in the history
  • Loading branch information
inozemtsev-roman committed Aug 24, 2018
1 parent 53476cb commit 038b6ba
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions assets/css/local.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.waves-address, .waves-amount{
.local-address, .local-amount{
display: block;
text-align: center;
margin: 0 !important;
}
.waves-label{
.local-label{
display: block;
text-align: center;
font-size: 80%;
Expand All @@ -13,18 +13,18 @@
display:block;
margin-top: 1em;
}
.waves-logo{
.local-logo{
margin: 0 auto;
}
.waves-container{
.local-container{
text-align: center;
}
.waves-description{
.local-description{
font-size: 80%;
text-align: center;
}

#waves-qr-code{
#local-qr-code{
display: block;
width: 208px;
height: 208px;
Expand All @@ -39,4 +39,4 @@
}
.small{
font-size: 80%;
}
}
42 changes: 21 additions & 21 deletions assets/js/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
var allow_button_click = false;
var countdown = 0;

var waves = {
var local = {
reset: function () {

},
init: function () {
$.initialize("#waves-form", function() {
$("#waves-qr-code").qrcode( {

$.initialize("#local-form", function() {
$("#local-qr-code").qrcode( {
width: 200,
height: 200,
text: $("#waves-qr-code").data('contents')
text: $("#local-qr-code").data('contents')
}
);

Expand All @@ -27,12 +27,12 @@
},300);
return false;
});
countdown = $('.waves-countdown').data('minutes') * 60 * 1000;

countdown = $('.local-countdown').data('minutes') * 60 * 1000;

// ignore button presses while waiting
$('#place_order').on( 'click',function () {
if($( '#waves-form' ).is(':visible') && allow_button_click == false){
if($( '#local-form' ).is(':visible') && allow_button_click == false){
return false;
}
});
Expand All @@ -43,12 +43,12 @@
checkForPayment: function(){
check_count++;
$.ajax({
url: waves_vars.wc_ajax_url,
url: local_vars.wc_ajax_url,
type: 'POST',
dataType: 'json',
data: {
action: 'check_waves_payment',
nonce: waves_vars.nonce
action: 'check_local_payment',
nonce: local_vars.nonce
}
}).done(function (res) {
console.log("Match: " + res);
Expand All @@ -59,33 +59,33 @@
return;
}
setTimeout(function() {
waves.checkForPayment();
local.checkForPayment();
}, 3000);
});
},
}

waves.init();
local.init();

setTimeout(function() {
waves.checkForPayment();
local.checkForPayment();
}, 3000);

setInterval(function(){
countdown -= 1000;

var minutes = Math.floor(countdown / (60 * 1000));
var seconds = Math.floor((countdown - (minutes * 60 * 1000)) / 1000);
var seconds = Math.floor((countdown - (minutes * 60 * 1000)) / 1000);

if (countdown <= 0) {
if($( '#waves-form' ).is(':visible')){
if($( '#local-form' ).is(':visible')){
$( 'body' ).trigger( 'update_checkout' );
}
} else {
$('.waves-countdown').html(minutes + ":" + (seconds < 10 ? 0 : '') + seconds);
$('.local-countdown').html(minutes + ":" + (seconds < 10 ? 0 : '') + seconds);
}

}, 1000);
}, 1000);


})( jQuery );
})( jQuery );

0 comments on commit 038b6ba

Please sign in to comment.