aboutsummaryrefslogtreecommitdiffstats
path: root/public/js/setup.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2015-11-28 23:57:34 -0800
committerAdam Soltys <[email protected]>2015-11-30 21:10:59 -0800
commit41f8c6831bb91c0b0be1219b1566e59e48673465 (patch)
tree39626cf1a8fe7b8d73f750ccaf433bfa8c425d6b /public/js/setup.js
parentf2bff842cbe16c18923b905f70ed168096648727 (diff)
downloadcoinos-server-41f8c6831bb91c0b0be1219b1566e59e48673465.tar.gz
coinos-server-41f8c6831bb91c0b0be1219b1566e59e48673465.zip
Use bower, grunt and browserify instead of connect-assets
Diffstat (limited to 'public/js/setup.js')
-rw-r--r--public/js/setup.js75
1 files changed, 75 insertions, 0 deletions
diff --git a/public/js/setup.js b/public/js/setup.js
new file mode 100644
index 00000000..a8f296f8
--- /dev/null
+++ b/public/js/setup.js
@@ -0,0 +1,75 @@
+;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
+(function() {
+ var g;
+
+ g = typeof exports !== "undefined" && exports !== null ? exports : this;
+
+ g.proceed = false;
+
+ $(function() {
+ var units;
+ $('#encryption-password').pwstrength({
+ showVerdicts: false
+ });
+ $.getJSON("/js/rates.json", function(data) {
+ var currencies, user;
+ currencies = Object.keys(data);
+ currencies = currencies.sort();
+ currencies.pop();
+ $.each(currencies, function(i, v) {
+ return $('#currency').append("<option value='" + v + "'>" + v + "</option>");
+ });
+ $("#currency option[value='CAD']").attr('selected', 'selected');
+ $('#currency').change(function() {
+ var symbol, symbols;
+ $('#symbol option').remove();
+ symbol = $(this).val();
+ if (!symbol) {
+ return;
+ }
+ symbols = Object.keys(data[symbol]);
+ $.each(symbols, function(i, v) {
+ if (v === 'localbitcoins') {
+ return;
+ }
+ return $('#symbol').append("<option value='" + v + "'>" + v + "</option>");
+ });
+ switch ($(this).val()) {
+ case 'CAD':
+ return $("#symbol option[value='quadrigacx']").attr('selected', 'selected');
+ case 'USD':
+ return $("#symbol option[value='bitstamp']").attr('selected', 'selected');
+ }
+ });
+ user = $('#username').val();
+ return $.getJSON("/" + user + ".json", function(data) {
+ $('#email').val(data.email);
+ $('#title').val(data.title);
+ $('#logo').val(data.logo);
+ $('#address').val(data.address);
+ $("#symbol option[value='" + data.symbol + "']").attr('selected', 'selected');
+ $('#commission').val(data.commission);
+ $('#unit').val(data.unit);
+ $('#currency').change();
+ $('#setup').fadeIn();
+ return $('#title').focus();
+ });
+ });
+ units = ['BTC', 'mBTC', '&micro;BTC', 'bits', 'satoshis'];
+ $.each(units, function(i, v) {
+ return $('#unit').append("<option value='" + v + "'>" + v + "</option>");
+ });
+ return $('#setup').submit(function() {
+ $('#setup .form-control').blur();
+ if ($('#setup .has-error').length > 0) {
+ $('#setup .has-error').effect('shake', 500);
+ return false;
+ }
+ });
+ });
+
+}).call(this);
+
+
+},{}]},{},[1])
+; \ No newline at end of file