2015-05-18 15:36:24 +02:00
|
|
|
var BD = {};
|
|
|
|
|
2015-05-19 11:03:53 +02:00
|
|
|
BD.Private = {};
|
|
|
|
BD.Private.sendData = function(url, data) {
|
2015-05-18 15:36:24 +02:00
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.open("POST", url, true);
|
|
|
|
xhr.setRequestHeader("Content-type", "application/json;charset=UTF-8");
|
|
|
|
xhr.send(JSON.stringify(data));
|
2015-05-19 11:03:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BD.Event = {};
|
|
|
|
|
|
|
|
BD.Event.ArrowClicked = function() {};
|
|
|
|
BD.Event.ArrowClicked.prototype.send = function() {
|
|
|
|
var url = "/arrow-clicked";
|
|
|
|
var data = {arrow_id: this.arrow_id};
|
|
|
|
BD.Private.sendData(url, data);
|
|
|
|
}
|
2015-05-18 15:36:24 +02:00
|
|
|
|
2015-05-19 11:03:53 +02:00
|
|
|
BD.Event.CoinClicked = function() {};
|
|
|
|
BD.Event.CoinClicked.prototype.send = function() {
|
|
|
|
var url = "/coin-clicked";
|
|
|
|
var data = {coin_id: this.coin_id};
|
|
|
|
BD.Private.sendData(url, data);
|
|
|
|
}
|
2015-05-18 15:36:24 +02:00
|
|
|
|