aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2012-11-06 20:38:48 -0800
committerAdam Soltys <[email protected]>2012-11-06 20:38:48 -0800
commit08f341f692688f077e9080bded2b14fdd5979c1e (patch)
treecf962ed8dd97f96102b1678184076b53a39ad527 /js
parentd407b638bc07ea0c7b05374c64e6d4b48770df86 (diff)
downloadcoinos-server-08f341f692688f077e9080bded2b14fdd5979c1e.tar.gz
coinos-server-08f341f692688f077e9080bded2b14fdd5979c1e.zip
Read parameters from client account
Diffstat (limited to 'js')
-rw-r--r--js/bitcoin_pos.js41
1 files changed, 27 insertions, 14 deletions
diff --git a/js/bitcoin_pos.js b/js/bitcoin_pos.js
index 67acd288..5d8f551b 100644
--- a/js/bitcoin_pos.js
+++ b/js/bitcoin_pos.js
@@ -1,28 +1,26 @@
$(function() {
var websocket = null;
+ var client = getParameterByName('client');
var title = getParameterByName('title');
var address = getParameterByName('address');
var commission = getParameterByName('commission');
var logo = getParameterByName('logo');
var exchange = 0;
- if (address == "")
- address = '1VAnbtCAnYccECnjaMCPnWwt81EHCVgNr'
-
- if (commission == "")
- commission = 3;
-
- if (logo != "")
- $('#logo').attr('src', logo).show();
-
-
- $('#title').html(title);
- $('#address').html(address);
- $('#received').hide();
-
+ setupPage();
setupQR();
setupSocket();
+ if (client != "") {
+ $.getJSON('client.json', { name: client }, function(data) {
+ title = data.title;
+ address = data.address;
+ commission = data.commission;
+ logo = data.logo;
+ setupPage();
+ });
+ }
+
$('#amount').keyup(updateTotal);
$('#amount').focus();
$('#amount').focus(function() {
@@ -76,6 +74,21 @@ $(function() {
setTimeout(fetchExchangeRate, 900000);
}
+ function setupPage() {
+ if (address == "")
+ address = '1VAnbtCAnYccECnjaMCPnWwt81EHCVgNr'
+
+ if (commission == "")
+ commission = 3;
+
+ if (logo != "")
+ $('#logo').attr('src', logo).show();
+ else
+ $('#title').html(title);
+
+ $('#address').html(address);
+ $('#received').hide();
+ }
function setupSocket() {
setTimeout(setupSocket, 10000);