Fix all res/ files with ESLint rules with 0 errors.

This commit is contained in:
Gunther Brunner
2016-01-19 23:08:33 +09:00
parent 1006564ae7
commit a3f815c118
258 changed files with 1634 additions and 1634 deletions

View File

@@ -1,78 +1,78 @@
module.exports = angular.module('stf.device-status', [])
.filter('statusNameAction', function (gettext) {
return function (text) {
.filter('statusNameAction', function(gettext) {
return function(text) {
return {
'absent': gettext('Disconnected'),
'present': gettext('Connected'),
'offline': gettext('Offline'),
'unauthorized': gettext('Unauthorized'),
'preparing': gettext('Preparing'),
'ready': gettext('Ready'),
'using': gettext('Stop Using'),
'busy': gettext('Busy'),
'available': gettext('Use')
absent: gettext('Disconnected'),
present: gettext('Connected'),
offline: gettext('Offline'),
unauthorized: gettext('Unauthorized'),
preparing: gettext('Preparing'),
ready: gettext('Ready'),
using: gettext('Stop Using'),
busy: gettext('Busy'),
available: gettext('Use')
}[text] || gettext('Unknown')
}
})
.filter('statusNamePassive', function (gettext) {
return function (text) {
.filter('statusNamePassive', function(gettext) {
return function(text) {
return {
'absent': gettext('Disconnected'),
'present': gettext('Connected'),
'offline': gettext('Offline'),
'unauthorized': gettext('Unauthorized'),
'preparing': gettext('Preparing'),
'ready': gettext('Ready'),
'using': gettext('Using'),
'busy': gettext('Busy'),
'available': gettext('Available')
absent: gettext('Disconnected'),
present: gettext('Connected'),
offline: gettext('Offline'),
unauthorized: gettext('Unauthorized'),
preparing: gettext('Preparing'),
ready: gettext('Ready'),
using: gettext('Using'),
busy: gettext('Busy'),
available: gettext('Available')
}[text] || gettext('Unknown')
}
})
.filter('likelyLeaveReason', function (gettext) {
return function (text) {
.filter('likelyLeaveReason', function(gettext) {
return function(text) {
return {
'ungroup_request': gettext('You (or someone else) kicked the device.'),
'owner_change': gettext('Someone stole your device.'),
'automatic_timeout': gettext('Device was kicked by automatic timeout. '),
'device_absent': gettext('Device is not present anymore for some reason.'),
'status_change': gettext('Device is present but offline.')
ungroup_request: gettext('You (or someone else) kicked the device.'),
owner_change: gettext('Someone stole your device.'),
automatic_timeout: gettext('Device was kicked by automatic timeout. '),
device_absent: gettext('Device is not present anymore for some reason.'),
status_change: gettext('Device is present but offline.')
}[text] || gettext('Unknown reason.')
}
})
.filter('batteryHealth', function (gettext) {
return function (text) {
.filter('batteryHealth', function(gettext) {
return function(text) {
return {
'cold': gettext('Cold'),
'good': gettext('Good'),
'dead': gettext('Dead'),
'over_voltage': gettext('Over Voltage'),
'overheat': gettext('Overheat'),
'unspecified_failure': gettext('Unspecified Failure')
cold: gettext('Cold'),
good: gettext('Good'),
dead: gettext('Dead'),
over_voltage: gettext('Over Voltage'),
overheat: gettext('Overheat'),
unspecified_failure: gettext('Unspecified Failure')
}[text] || gettext('-')
}
})
.filter('batterySource', function (gettext) {
return function (text) {
.filter('batterySource', function(gettext) {
return function(text) {
return {
'ac': gettext('AC'),
'usb': gettext('USB'),
'wireless': gettext('Wireless')
ac: gettext('AC'),
usb: gettext('USB'),
wireless: gettext('Wireless')
}[text] || gettext('-')
}
})
.filter('batteryStatus', function (gettext) {
return function (text) {
.filter('batteryStatus', function(gettext) {
return function(text) {
return {
'charging': gettext('Charging'),
'discharging': gettext('Discharging'),
'full': gettext('Full'),
'not_charging': gettext('Not Charging')
charging: gettext('Charging'),
discharging: gettext('Discharging'),
full: gettext('Full'),
not_charging: gettext('Not Charging')
}[text] || gettext('-')
}
})
.filter('displayDensity', function () {
return function (text) {
.filter('displayDensity', function() {
return function(text) {
return {
'0.5': 'LDPI', // (120 dpi)
'1': 'MDPI', // (160 dpi)
@@ -83,38 +83,36 @@ module.exports = angular.module('stf.device-status', [])
}[text] || text
}
})
.filter('networkType', function (gettext) {
return function (text) {
.filter('networkType', function(gettext) {
return function(text) {
return {
'bluetooth': gettext('Bluetooth'),
'dummy': gettext('Dummy'),
'ethernet': gettext('Ethernet'),
'mobile': gettext('Mobile'),
'mobile_dun': gettext('Mobile DUN'),
'mobile_hipri': gettext('Mobile High Priority'),
'mobile_mms': gettext('Mobile MMS'),
'mobile_supl': gettext('Mobile SUPL'),
'mobile_wifi': gettext('WiFi'),
'wimax': gettext('WiMAX')
bluetooth: gettext('Bluetooth'),
dummy: gettext('Dummy'),
ethernet: gettext('Ethernet'),
mobile: gettext('Mobile'),
mobile_dun: gettext('Mobile DUN'),
mobile_hipri: gettext('Mobile High Priority'),
mobile_mms: gettext('Mobile MMS'),
mobile_supl: gettext('Mobile SUPL'),
mobile_wifi: gettext('WiFi'),
wimax: gettext('WiMAX')
}[text] || text
}
})
.filter('networkSubType', function (gettext) {
return function (text) {
.filter('networkSubType', function(gettext) {
return function(text) {
return {
'mobile_wifi': gettext('WiFi')
mobile_wifi: gettext('WiFi')
}[text] || text
}
})
.filter('humanizedBool', function (gettext) {
return function (text) {
.filter('humanizedBool', function(gettext) {
return function(text) {
switch (text) {
case true:
return gettext('Yes')
break;
case false:
return gettext('No')
break;
default:
return gettext('-')
}

View File

@@ -7,10 +7,9 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
function Tracker($scope, options) {
var devices = []
, devicesBySerial = Object.create(null)
, scopedSocket = socket.scoped($scope)
, digestTimer
, lastDigest
var devicesBySerial = Object.create(null)
var scopedSocket = socket.scoped($scope)
var digestTimer, lastDigest
$scope.$on('$destroy', function() {
clearTimeout(digestTimer)
@@ -81,7 +80,9 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
var modify = function modify(data, newData) {
_.merge(data, newData, function(a, b) {
// New Arrays overwrite old Arrays
return _.isArray(b) ? b : undefined
if (_.isArray(b)) {
return b
}
})
sync(data)
this.emit('change', data)
@@ -156,7 +157,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
Tracker.prototype = new EventEmitter()
deviceService.trackAll = function ($scope) {
deviceService.trackAll = function($scope) {
var tracker = new Tracker($scope, {
filter: function() {
return true
@@ -165,14 +166,14 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
})
oboe('/app/api/v1/devices')
.node('devices[*]', function (device) {
.node('devices[*]', function(device) {
tracker.add(device)
})
return tracker
}
deviceService.trackGroup = function ($scope) {
deviceService.trackGroup = function($scope) {
var tracker = new Tracker($scope, {
filter: function(device) {
return device.using
@@ -181,7 +182,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
})
oboe('/app/api/v1/group')
.node('devices[*]', function (device) {
.node('devices[*]', function(device) {
tracker.add(device)
})
@@ -190,12 +191,12 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
deviceService.load = function(serial) {
return $http.get('/app/api/v1/devices/' + serial)
.then(function (response) {
.then(function(response) {
return response.data.device
})
}
deviceService.get = function (serial, $scope) {
deviceService.get = function(serial, $scope) {
var tracker = new Tracker($scope, {
filter: function(device) {
return device.serial === serial
@@ -210,7 +211,7 @@ module.exports = function DeviceServiceFactory($http, socket, EnhanceDeviceServi
})
}
deviceService.updateNote = function (serial, note) {
deviceService.updateNote = function(serial, note) {
socket.emit('device.note', {
serial: serial,
note: note

View File

@@ -55,13 +55,13 @@ module.exports = function EnhanceDeviceServiceFactory($filter, AppState) {
if (device.owner) {
device.enhancedUserProfileUrl = enhanceUserProfileUrl(device.owner.email)
device.enhancedUserName = device.owner.name || "No name"
device.enhancedUserName = device.owner.name || 'No name'
}
}
function enhanceUserProfileUrl(email) {
var url
var userProfileUrl = (function () {
var userProfileUrl = (function() {
if (AppState && AppState.config && AppState.config.userProfileUrl) {
return AppState.config.userProfileUrl
}
@@ -73,7 +73,7 @@ module.exports = function EnhanceDeviceServiceFactory($filter, AppState) {
if (userProfileUrl && email) {
url = userProfileUrl.indexOf('{user}') !== -1 ?
userProfileUrl.replace('{user}', email) :
userProfileUrl + email;
userProfileUrl + email
}
} else if (email.indexOf('@') !== -1) {
url = 'mailto:' + email
@@ -83,7 +83,7 @@ module.exports = function EnhanceDeviceServiceFactory($filter, AppState) {
return url
}
service.enhance = function (device) {
service.enhance = function(device) {
setState(device)
enhanceDevice(device)
enhanceDeviceDetails(device)

View File

@@ -1,7 +1,7 @@
module.exports = function StateClassesService() {
var service = {}
service.stateButton = function (state) {
service.stateButton = function(state) {
var stateClasses = {
using: 'state-using btn-primary',
busy: 'state-busy btn-warning',
@@ -18,7 +18,7 @@ module.exports = function StateClassesService() {
return stateClasses
}
service.stateColor = function (state) {
service.stateColor = function(state) {
var stateClasses = {
using: 'state-using',
busy: 'state-busy',