1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Adding standard since its quite similar to the current style and removes the maintenance burden, while also making it easier to follow for contributors.

Over the time replace JSHint.
This commit is contained in:
Gunther Brunner 2015-07-28 16:26:50 +09:00
parent 361bf9caea
commit 142866838c
5 changed files with 29 additions and 19 deletions

View file

@ -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'])

View file

@ -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",

View file

@ -20,7 +20,7 @@ require.ensure([], function (require) {
require('stf/standalone').name
])
.config(function ($routeProvider, $locationProvider) {
$locationProvider.hashPrefix('!');
$locationProvider.hashPrefix('!')
$routeProvider
.otherwise({
redirectTo: '/devices'

View file

@ -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)

View file

@ -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]
])
}