1/*==== live cryptocurrency calculator =====*/ 2var ember = []; 3var usdInput = document.getElementById('amtUSD'); 4var btcInput = document.getElementById('amtBTC'); 5 6ember.btcPrice = 6549.995; 7ember.socket = io.connect('https://socket.coincap.io'); 8ember.socket.on('trades', function(data) { 9 var amt = document.getElementById('amtUSD'); 10 if (data.coin == 'BTC') { 11 ember.amtUSD = usdInput.value; 12 ember.amtBTC = btcInput.value; 13 ember.usdCalc = ember.amtBTC * data.msg.price; 14 if(data.msg.price > amt.value) { 15 $(amt).addClass('increment'); 16 } else { 17 $(amt).addClass('decrement'); 18 } 19 $('#amtUSD').attr('value', ember.usdCalc); 20 setTimeout(function () { 21 $(amt).removeClass('increment decrement'); 22 }, 700); 23 } 24}); 25 26$('#amtBTC').bind('change paste keyup', function() { 27 ember.usdCalc = $(this).val() * ember.btcPrice; 28 $('#amtUSD').attr('value', ember.usdCalc); 29});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.