aboutsummaryrefslogtreecommitdiffstats
path: root/public/js/index.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-08-08 11:33:43 -0700
committerAdam Soltys <[email protected]>2014-08-08 11:33:43 -0700
commit2cc86381a6f79cd729048b34a72b70562a7b0ace (patch)
treec42dda997719ce544a4dea2bf15937d293ebfd59 /public/js/index.js
parent3082e274b70a93fdac8a9a63934252ed914fe406 (diff)
parent6d5c3a56067b96bb5d97cca4a80bacbf78395b2c (diff)
downloadcoinos-server-2cc86381a6f79cd729048b34a72b70562a7b0ace.tar.gz
coinos-server-2cc86381a6f79cd729048b34a72b70562a7b0ace.zip
Merge branch 'code_reorg'
Diffstat (limited to 'public/js/index.js')
-rw-r--r--public/js/index.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/public/js/index.js b/public/js/index.js
deleted file mode 100644
index 7b799c1e..00000000
--- a/public/js/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-(function() {
- var fetchExchangeRate, g;
-
- g = typeof exports !== "undefined" && exports !== null ? exports : this;
-
- $(function() {
- fetchExchangeRate('ask');
- fetchExchangeRate('bid');
- $('#username').blur(function() {
- return $.get("/" + ($(this).val()) + "/exists", {
- username: $(this).val()
- }, function(data) {
- if (data === "true") {
- $('#username').prev().css('color', 'red').html('Username (taken)');
- return g.preventSubmit = true;
- } else {
- $('#username').prev().css('color', 'black').html('Username');
- return g.preventSubmit = false;
- }
- });
- });
- return $('#signup').submit(function() {
- if (g.preventSubmit) {
- return false;
- }
- return true;
- });
- });
-
- fetchExchangeRate = function(type) {
- var commission;
- commission = 0.015;
- if (type === 'bid') {
- commission *= -1;
- }
- return $.ajax({
- url: "/ticker?symbol=virtexCAD&type=" + type + "&amount=100",
- success: function(exchange) {
- if (exchange == null) {
- exchange = '??';
- }
- exchange = exchange - exchange * commission;
- return $("#" + type).html(exchange.toFixed(2));
- },
- error: function() {
- return $("#" + type).html('??');
- }
- });
- };
-
-}).call(this);