From 3a3092e8f0f210f3b0b0df3e023a86c58c958cb6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 16 Oct 2015 01:45:53 -0400 Subject: Set max width of logo image --- public/css/calculator.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public') diff --git a/public/css/calculator.less b/public/css/calculator.less index 72e98976..279503be 100644 --- a/public/css/calculator.less +++ b/public/css/calculator.less @@ -40,7 +40,7 @@ div#calculator { p#address { padding-top: 10px; } #title { display: none; } #title a { color: #000; text-decoration: none; } - #logo { display: none; padding: 10px 0; margin-bottom: 10px; max-height: 250px; } + #logo { display: none; padding: 10px 0; margin-bottom: 10px; max-height: 250px; max-width: 440px; } #error { margin-top: 10px; } } -- cgit v1.2.3 From 8c510e7cb4ae2e69eed09d2ce9eb4b1ff1efbc7d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 16 Oct 2015 01:50:13 -0400 Subject: Floathouse logo --- public/assets/img/floathouse.png | Bin 0 -> 33851 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/assets/img/floathouse.png (limited to 'public') diff --git a/public/assets/img/floathouse.png b/public/assets/img/floathouse.png new file mode 100644 index 00000000..4da664e3 Binary files /dev/null and b/public/assets/img/floathouse.png differ -- cgit v1.2.3 From f76160f6dffaffbd189776eb39e67e4e96ba2f0b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 14 Sep 2015 22:06:15 -0700 Subject: Set logo width to 100% --- public/css/calculator.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public') diff --git a/public/css/calculator.less b/public/css/calculator.less index 279503be..bf2de93e 100644 --- a/public/css/calculator.less +++ b/public/css/calculator.less @@ -40,7 +40,7 @@ div#calculator { p#address { padding-top: 10px; } #title { display: none; } #title a { color: #000; text-decoration: none; } - #logo { display: none; padding: 10px 0; margin-bottom: 10px; max-height: 250px; max-width: 440px; } + #logo { display: none; padding: 10px 0; margin-bottom: 10px; max-height: 250px; width: 100%; } #error { margin-top: 10px; } } -- cgit v1.2.3 From ae10d9f202fb1feb4715614f7be435f0e3997eb3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 15 Oct 2015 22:44:40 -0700 Subject: Make QR code smaller --- public/js/calculator.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public') diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index d173403c..cc2dcece 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -105,7 +105,7 @@ updateTotal = -> $('#total').html(total.toString()) $('#qr').html('') - new QRCode('qr', text: "bitcoin:#{g.user.address}?amount=#{g.amount_requested.toString()}", width: 320, height: 320) + new QRCode('qr', text: "bitcoin:#{g.user.address}?amount=#{g.amount_requested.toString()}", width: 280, height: 280) listen = -> setTimeout(listen, 10000) -- cgit v1.2.3 From c1cd55151fdea2bd80e27a6a9dfc905a243dd379 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Nov 2015 13:25:35 -0800 Subject: Fetch remote image files and store locally --- .gitignore | 2 +- public/assets/img/logos/yummyyards.png | Bin 0 -> 22968 bytes public/js/calculator.coffee | 4 +++- routes/users.js | 17 +++++++++++++++-- src/routes/users.coffee | 10 ++++++++++ 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 public/assets/img/logos/yummyyards.png (limited to 'public') diff --git a/.gitignore b/.gitignore index 2391f700..ca800b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -public/bitcoins.pdf node_modules builtAssets database.json @@ -9,3 +8,4 @@ src/config.coffee config.js passenger* tmp +public/img/assets/logos diff --git a/public/assets/img/logos/yummyyards.png b/public/assets/img/logos/yummyyards.png new file mode 100644 index 00000000..e8f59c9f Binary files /dev/null and b/public/assets/img/logos/yummyyards.png differ diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index cc2dcece..cc45cae5 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -59,7 +59,9 @@ setup = -> $('#title').html("#{g.user.title}").show() if g.user.logo - $('#logo').attr('src', g.user.logo).show() + ext = g.user.logo.substr(g.user.logo.length - 3) + src = "/assets/img/logos/#{g.user.username}.#{ext}" + $('#logo').attr('src', src).show() getAddress() diff --git a/routes/users.js b/routes/users.js index c5e0f0ee..28b89797 100644 --- a/routes/users.js +++ b/routes/users.js @@ -1,5 +1,5 @@ (function() { - var bcrypt, config, db; + var bcrypt, config, db, fs, request; db = require("../redis"); @@ -7,6 +7,10 @@ bcrypt = require('bcrypt'); + fs = require('fs'); + + request = require('request'); + module.exports = function(sessions) { return { exists: function(req, res) { @@ -34,7 +38,7 @@ }, show: function(req, res) { return db.hgetall("user:" + req.params.user, function(err, obj) { - var options; + var ext, options, path; if (obj) { options = { user: req.params.user, @@ -50,6 +54,15 @@ if (req.query.verified != null) { options.verified = true; } + if (obj.logo.length > 3) { + ext = obj.logo.substr(obj.logo.length - 3); + path = "public/assets/img/logos/" + obj.username + "." + ext; + fs.lstat(path, function(err, stats) { + if ((ext === 'jpg' || ext === 'png' || ext === 'gif') && (err || !stats.isFile())) { + return request("" + obj.logo).pipe(fs.createWriteStream(path)); + } + }); + } res.render('users/show', options); return delete req.session.verified; } else { diff --git a/src/routes/users.coffee b/src/routes/users.coffee index d3ecabaf..b1e4fd9a 100644 --- a/src/routes/users.coffee +++ b/src/routes/users.coffee @@ -1,6 +1,8 @@ db = require("../redis") config = require("../config") bcrypt = require('bcrypt') +fs = require('fs') +request = require('request') module.exports = (sessions) -> exists: (req, res) -> @@ -33,6 +35,14 @@ module.exports = (sessions) -> if req.query.verified? options.verified = true + if obj.logo.length > 3 + ext = obj.logo.substr(obj.logo.length - 3) + path = "public/assets/img/logos/#{obj.username}.#{ext}" + fs.lstat(path, (err, stats) -> + if ext in ['jpg', 'png', 'gif'] and (err or not stats.isFile()) + request("#{obj.logo}").pipe(fs.createWriteStream(path)) + ) + res.render('users/show', options) delete req.session.verified else -- cgit v1.2.3 From cfed6f916ea7d63821385db338daecc4a2bda4c2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Nov 2015 14:59:37 -0800 Subject: New payment received sound --- public/js/calculator.coffee | 5 +---- public/success.wav | Bin 0 -> 57388 bytes views/users/show.html | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 public/success.wav (limited to 'public') diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index cc45cae5..4d6b0013 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -116,17 +116,14 @@ listen = -> g.blockchain = new WebSocket("wss://ws.blockchain.info/inv") g.blockchain.onopen = -> - $('#connection').fadeIn().removeClass('glyphicon-exclamation-sign').addClass('glyphicon-signal') clear(SOCKET_FAIL) g.blockchain.send('{"op":"addr_sub", "addr":"' + g.user.address + '"}') g.blockchain.onerror = -> - $('#connection').addClass('glyphicon-exclamation-sign').removeClass('glyphicon-signal') g.blockchain = null fail(SOCKET_FAIL) g.blockchain.onclose = -> - $('#connection').addClass('glyphicon-exclamation-sign').removeClass('glyphicon-signal') g.blockchain = null fail(SOCKET_FAIL) listen() @@ -151,7 +148,7 @@ logTransaction = (txid, amount) -> $('#amount').blur() $('#payment').hide() $('#received').fadeIn('slow') - $('#chaching')[0].play() + $('#success')[0].play() g.user.index++ $.post("/#{g.user.username}/transactions", diff --git a/public/success.wav b/public/success.wav new file mode 100644 index 00000000..50547d2b Binary files /dev/null and b/public/success.wav differ diff --git a/views/users/show.html b/views/users/show.html index 5b8314a3..f37afad4 100644 --- a/views/users/show.html +++ b/views/users/show.html @@ -44,6 +44,6 @@ Your email has been verified. Thank you! -