diff --git a/gulpfile.js b/gulpfile.js index dc411da8..9d2a0627 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp') var gutil = require('gulp-util') var jshint = require('gulp-jshint') var jsonlint = require('gulp-jsonlint') +var standard = require('gulp-standard') var webpack = require('webpack') var ngAnnotatePlugin = require('ng-annotate-webpack-plugin') var webpackConfig = require('./webpack.config').webpack @@ -46,6 +47,15 @@ gulp.task('jscs', function () { .pipe(jscs()) }); +gulp.task('standard', function () { + // Check res/app for now + return gulp.src(['res/app/**/*.js', '!**/*-spec.js']) + .pipe(standard()) + .pipe(standard.reporter('default', { + breakOnError: true + })) +}) + gulp.task('lint', ['jshint', 'jsonlint']) gulp.task('test', ['lint', 'run:checkversion']) diff --git a/package.json b/package.json index ffd14192..c7101f2a 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "gulp-jsonlint": "^1.0.2", "gulp-protractor": "^1.0.0", "gulp-run": "^1.6.10", + "gulp-standard": "^4.5.3", "gulp-util": "^3.0.4", "html-loader": "^0.3.0", "imports-loader": "^0.6.3", diff --git a/res/app/app.js b/res/app/app.js index c3bff2a6..088d16bd 100644 --- a/res/app/app.js +++ b/res/app/app.js @@ -20,7 +20,7 @@ require.ensure([], function (require) { require('stf/standalone').name ]) .config(function ($routeProvider, $locationProvider) { - $locationProvider.hashPrefix('!'); + $locationProvider.hashPrefix('!') $routeProvider .otherwise({ redirectTo: '/devices' diff --git a/res/app/control-panes/control-panes-controller.js b/res/app/control-panes/control-panes-controller.js index 28593fab..faf503da 100644 --- a/res/app/control-panes/control-panes-controller.js +++ b/res/app/control-panes/control-panes-controller.js @@ -1,5 +1,5 @@ module.exports = - function ControlPanesController($scope, $http, gettext, $routeParams, + function ControlPanesController ($scope, $http, gettext, $routeParams, $timeout, $location, DeviceService, GroupService, ControlService, StorageService, FatalMessageService, SettingsService) { @@ -39,7 +39,6 @@ module.exports = } ].concat(angular.copy(sharedTabs)) - $scope.belowTabs = [ { title: gettext('Logs'), @@ -53,7 +52,7 @@ module.exports = $scope.control = null // TODO: Move this out to Ctrl.resolve - function getDevice(serial) { + function getDevice (serial) { DeviceService.get(serial, $scope) .then(function (device) { return GroupService.invite(device) @@ -63,7 +62,7 @@ module.exports = $scope.control = ControlService.create(device, device.channel) // TODO: Change title, flickers too much on Chrome - //$rootScope.pageTitle = device.name + // $rootScope.pageTitle = device.name SettingsService.set('lastUsedDevice', serial) diff --git a/res/app/control-panes/control-panes-hotkeys-controller.js b/res/app/control-panes/control-panes-hotkeys-controller.js index 5925d9dd..08c99b54 100644 --- a/res/app/control-panes/control-panes-hotkeys-controller.js +++ b/res/app/control-panes/control-panes-hotkeys-controller.js @@ -10,12 +10,12 @@ module.exports = }, nextDevice: function () { console.log('next') -// console.log('$scope.groupTracker.devices', $scope.groupTracker.devices) - //console.log('$scope.groupTracker.devices', $scope.groupDevices) + // console.log('$scope.groupTracker.devices', $scope.groupTracker.devices) + // console.log('$scope.groupTracker.devices', $scope.groupDevices) - //groupDevice in $scope.groupTracker.devices - //groupDevice.serial === device.serial - //$location.path('/control/' + device.serial) + // groupDevice in $scope.groupTracker.devices + // groupDevice.serial === device.serial + // $location.path('/control/' + device.serial) }, deviceList: function () { $location.path('/devices/') @@ -75,7 +75,7 @@ module.exports = $scope.control.back() }, toggleDevice: function () { - //$scope.controlScreen.show = !$scope.controlScreen.show + // $scope.controlScreen.show = !$scope.controlScreen.show }, togglePlatform: function () { if ($rootScope.platform === 'web') { @@ -90,26 +90,26 @@ module.exports = } ScopedHotkeysService($scope, [ - //['shift+up', gettext('Previous Device'), actions.previousDevice], - //['shift+down', gettext('Next Device'), actions.nextDevice], + // ['shift+up', gettext('Previous Device'), actions.previousDevice], + // ['shift+down', gettext('Next Device'), actions.nextDevice], ['command+shift+d', gettext('Go to Device List'), actions.deviceList], ['shift+space', gettext('Selects Next IME'), actions.switchCharset], ['command+left', gettext('Rotate Left'), actions.rotateLeft], ['command+right', gettext('Rotate Right'), actions.rotateRight], - //['command+1', gettext('Scale 100%'), actions.scale], - //['command+2', gettext('Scale 75%'), actions.scale], - //['command+3', gettext('Scale 50%'), actions.scale], + // ['command+1', gettext('Scale 100%'), actions.scale], + // ['command+2', gettext('Scale 75%'), actions.scale], + // ['command+3', gettext('Scale 50%'), actions.scale], - //['shift+l', gettext('Focus URL bar'), actions.focusUrlBar], - //['shift+s', gettext('Take Screenshot'), actions.takeScreenShot], + // ['shift+l', gettext('Focus URL bar'), actions.focusUrlBar], + // ['shift+s', gettext('Take Screenshot'), actions.takeScreenShot], ['command+shift+m', gettext('Press Menu button'), actions.pressMenu], ['command+shift+h', gettext('Press Home button'), actions.pressHome], ['command+shift+b', gettext('Press Back button'), actions.pressBack], - //['shift+i', gettext('Show/Hide device'), actions.toggleDevice], + // ['shift+i', gettext('Show/Hide device'), actions.toggleDevice], ['shift+w', gettext('Toggle Web/Native'), actions.togglePlatform, false] ]) }