From edee73463ec8640d7b05877dfd97977a3ed6b616 Mon Sep 17 00:00:00 2001 From: Leonardo Merlin Date: Thu, 10 Sep 2015 06:42:19 -0300 Subject: [PATCH] Lint code --- gulp/images.js | 2 +- gulp/scripts.js | 2 +- gulp/unit-tests.js | 2 +- src/app/components/article-box/article-box.directive.js | 2 +- src/app/components/article-preview/article-preview.directive.js | 2 +- src/app/components/article-service/article.service.js | 26 +++++++++++++------------- src/app/components/auth/auth.service.js | 50 +++++++++++++++++++++++++------------------------- src/app/components/event-list/event-list.directive.js | 4 +--- src/app/components/guid-service/guid.service.js | 2 +- src/app/components/proposal-grid/proposal-grid.directive.js | 2 +- src/app/pages/auth/auth.controller.js | 4 +--- src/app/pages/programas/programa.controller.js | 4 ++-- 12 files changed, 49 insertions(+), 53 deletions(-) diff --git a/gulp/images.js b/gulp/images.js index 8de80e3..3b9040c 100644 --- a/gulp/images.js +++ b/gulp/images.js @@ -10,7 +10,7 @@ var sprity = require('sprity'); gulp.task('sprites', function () { var src = [ path.join(conf.paths.src, '/assets/images/icons/*.png'), - path.join('!' + conf.paths.src, '/assets/images/icons/sprite.png') + path.join('!' + conf.paths.src, '/assets/images/icons/sprite.png') ]; var destCss = path.join(conf.paths.tmp, '/serve/app/'); var destImg = path.join(conf.paths.src, '/assets/images/icons'); diff --git a/gulp/scripts.js b/gulp/scripts.js index 7a3e536..bf43786 100644 --- a/gulp/scripts.js +++ b/gulp/scripts.js @@ -13,5 +13,5 @@ gulp.task('scripts', function () { .pipe($.jshint()) .pipe($.jshint.reporter('jshint-stylish')) .pipe(browserSync.reload({ stream: true })) - .pipe($.size()) + .pipe($.size()); }); diff --git a/gulp/unit-tests.js b/gulp/unit-tests.js index 5e6aa75..b0aa560 100644 --- a/gulp/unit-tests.js +++ b/gulp/unit-tests.js @@ -2,7 +2,7 @@ var path = require('path'); var gulp = require('gulp'); -var conf = require('./conf'); +// var conf = require('./conf'); var karma = require('karma'); diff --git a/src/app/components/article-box/article-box.directive.js b/src/app/components/article-box/article-box.directive.js index 21e89b4..beb3626 100644 --- a/src/app/components/article-box/article-box.directive.js +++ b/src/app/components/article-box/article-box.directive.js @@ -6,7 +6,7 @@ .directive('articleBox', articleBox); /** @ngInject */ - function articleBox($rootScope) { + function articleBox() { /** @ngInject */ function ArticleBoxController($state, PATH, $log) { diff --git a/src/app/components/article-preview/article-preview.directive.js b/src/app/components/article-preview/article-preview.directive.js index 94ad7c1..2943aec 100644 --- a/src/app/components/article-preview/article-preview.directive.js +++ b/src/app/components/article-preview/article-preview.directive.js @@ -6,7 +6,7 @@ .directive('articlePreview', articlePreview); /** @ngInject */ - function articlePreview($rootScope) { + function articlePreview() { /** @ngInject */ function ArticlePreviewController($state, PATH, $log) { diff --git a/src/app/components/article-service/article.service.js b/src/app/components/article-service/article.service.js index 59b4cde..6ea6745 100644 --- a/src/app/components/article-service/article.service.js +++ b/src/app/components/article-service/article.service.js @@ -189,19 +189,19 @@ }); } - function getSubscribers (event_id, params, cbSuccess, cbError) { - var url = service.apiArticles + event_id + '/followers?_=' + new Date().getTime(); - var paramsExtended = angular.extend({ - // 'fields[]': ['id', 'slug', 'title', 'abstract', 'body', 'categories', 'created_at', 'start_date', 'end_date', 'hits'], - 'content_type':'Event' - }, params); - - UtilService.get(url, {params: paramsExtended}).then(function(data){ - cbSuccess(data.articles); - }).catch(function(error){ - cbError(error); - }); - } + // function getSubscribers (event_id, params, cbSuccess, cbError) { + // var url = service.apiArticles + event_id + '/followers?_=' + new Date().getTime(); + // var paramsExtended = angular.extend({ + // // 'fields[]': ['id', 'slug', 'title', 'abstract', 'body', 'categories', 'created_at', 'start_date', 'end_date', 'hits'], + // 'content_type':'Event' + // }, params); + + // UtilService.get(url, {params: paramsExtended}).then(function(data){ + // cbSuccess(data.articles); + // }).catch(function(error){ + // cbError(error); + // }); + // } function subscribeToEvent (event_id, params, cbSuccess, cbError) { diff --git a/src/app/components/auth/auth.service.js b/src/app/components/auth/auth.service.js index 1c32e38..d5bef9f 100644 --- a/src/app/components/auth/auth.service.js +++ b/src/app/components/auth/auth.service.js @@ -17,7 +17,7 @@ var encodedData = ''; encodedData += 'name=' + data.name; encodedData += '&email=' + data.email; - encodedData += '&login=' + data.email.substr(0, data.email.indexOf('@')).toLowerCase().replace(/\W+/g,"").substr(0,25) + "-" + Date.now(); + encodedData += '&login=' + data.email.substr(0, data.email.indexOf('@')).toLowerCase().replace(/\W+/g,'').substr(0,25) + '-' + Date.now(); encodedData += '&email=' + data.email; encodedData += '&password=' + data.password; encodedData += '&password_confirmation=' + data.password_confirmation; @@ -51,10 +51,10 @@ function activate (code) { var url = '/api/v1/activate'; - var data = { - private_token: API.token, - activation_code: code - }; + // var data = { + // private_token: API.token, + // activation_code: code + // }; var encodedData = 'private_token=' + API.token; encodedData += '&activation_code=' + code; @@ -75,11 +75,11 @@ function changePassword (code, newPassword, newPasswordConfirmation){ var url = '/api/v1/new_password'; - var data = { - code: code, - password: newPassword, - password_confirmation: newPasswordConfirmation - }; + // var data = { + // code: code, + // password: newPassword, + // password_confirmation: newPasswordConfirmation + // }; var encodedData = 'code=' + code; encodedData += '&password=' + newPassword; encodedData += '&password_confirmation=' + newPasswordConfirmation; @@ -159,21 +159,21 @@ return (service.isAuthenticated() && authorizedRoles.indexOf(Session.userRole) !== -1); } - function _encodeObj(obj){ - var result = []; - var str = null; - var p = null; - - for (p in obj) { - if (obj.hasOwnProperty(p)) { - // str = encodeURIComponent(p) + '=' + obj[p]; - str = p + '=' + obj[p]; - result.push(str); - } - } - - return result.join('&'); - } + // function _encodeObj(obj){ + // var result = []; + // var str = null; + // var p = null; + + // for (p in obj) { + // if (obj.hasOwnProperty(p)) { + // // str = encodeURIComponent(p) + '=' + obj[p]; + // str = p + '=' + obj[p]; + // result.push(str); + // } + // } + + // return result.join('&'); + // } var service = { register: register, diff --git a/src/app/components/event-list/event-list.directive.js b/src/app/components/event-list/event-list.directive.js index ba73068..0d46cc5 100644 --- a/src/app/components/event-list/event-list.directive.js +++ b/src/app/components/event-list/event-list.directive.js @@ -57,9 +57,8 @@ vm.$log.debug('response', response); }, function(error){ vm.$log.debug('error', error); - }) + }); } - }; var directive = { @@ -75,6 +74,5 @@ }; return directive; - } })(); diff --git a/src/app/components/guid-service/guid.service.js b/src/app/components/guid-service/guid.service.js index 4c65bb5..be38e94 100644 --- a/src/app/components/guid-service/guid.service.js +++ b/src/app/components/guid-service/guid.service.js @@ -17,7 +17,7 @@ } return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - } + }; return service; } diff --git a/src/app/components/proposal-grid/proposal-grid.directive.js b/src/app/components/proposal-grid/proposal-grid.directive.js index fc0effd..c43f3c7 100644 --- a/src/app/components/proposal-grid/proposal-grid.directive.js +++ b/src/app/components/proposal-grid/proposal-grid.directive.js @@ -29,7 +29,7 @@ } ProposalGridController.prototype.init = function() { - var vm = this; + // var vm = this; }; ProposalGridController.prototype.attachListeners = function() { diff --git a/src/app/pages/auth/auth.controller.js b/src/app/pages/auth/auth.controller.js index 3508b17..1aead7d 100644 --- a/src/app/pages/auth/auth.controller.js +++ b/src/app/pages/auth/auth.controller.js @@ -153,7 +153,5 @@ break; } }, vm.delay * 1000); - - } - + }; })(); diff --git a/src/app/pages/programas/programa.controller.js b/src/app/pages/programas/programa.controller.js index 93f8294..d925e85 100644 --- a/src/app/pages/programas/programa.controller.js +++ b/src/app/pages/programas/programa.controller.js @@ -162,12 +162,12 @@ var el = vm.$element.find(rule); el.slideDown(); angular.element('body').animate({scrollTop: el.offset().top}, 'fast'); - } + }; ProgramaPageController.prototype.findAndHide = function(rule) { var vm = this; vm.$element.find(rule).slideUp(); - } + }; ProgramaPageController.prototype.sendProposal = function() { var vm = this; -- libgit2 0.21.2