From 906cd019c705bc8a4430940afa26534e6b3971df Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 16 Jan 2014 13:32:11 -0300 Subject: [PATCH] fixed syntax javascript warnings --- app/controllers/status.js | 11 +++++------ public/js/app.js | 2 +- public/js/controllers/status.js | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/status.js b/app/controllers/status.js index 7fbc189b..47b1f450 100644 --- a/app/controllers/status.js +++ b/app/controllers/status.js @@ -5,12 +5,11 @@ */ var Status = require('../models/Status'); -var async = require('async'); /** * Status */ -exports.show = function(req, res) { +exports.show = function(req, res, next) { if (! req.query.q) { res.status(400).send('Bad Request'); @@ -19,25 +18,25 @@ exports.show = function(req, res) { var s = req.query.q; var d = Status.new(); - if (s == 'getInfo') { + if (s === 'getInfo') { d.getInfo(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getDifficulty') { + else if (s === 'getDifficulty') { d.getDifficulty(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getTxOutSetInfo') { + else if (s === 'getTxOutSetInfo') { d.getTxOutSetInfo(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getBestBlockHash') { + else if (s === 'getBestBlockHash') { d.getBestBlockHash(function(err) { if (err) next(err); res.jsonp(d); diff --git a/public/js/app.js b/public/js/app.js index 452ca7ce..5f236b92 100755 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,6 +1,6 @@ 'use strict'; -var app = angular.module('mystery', +angular.module('mystery', ['ngAnimate', 'ngCookies', 'ngResource', diff --git a/public/js/controllers/status.js b/public/js/controllers/status.js index b37a5aeb..cc02da9e 100644 --- a/public/js/controllers/status.js +++ b/public/js/controllers/status.js @@ -7,16 +7,16 @@ angular.module('mystery.status').controller('StatusController', ['$scope', '$rou Status.get({ q: q }, function(d) { - if (q == 'getInfo') { + if (q === 'getInfo') { $scope.info = d.info; } - if (q == 'getDifficulty') { + if (q === 'getDifficulty') { $scope.difficulty = d.difficulty; } - if (q == 'getTxOutSetInfo') { + if (q === 'getTxOutSetInfo') { $scope.txoutsetinfo = d.txoutsetinfo; } - if (q == 'getBestBlockHash') { + if (q === 'getBestBlockHash') { $scope.bestblockhash = d.bestblockhash; } });