mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 12:55:26 +02:00
Fix all res/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -11,17 +11,17 @@ module.exports = function SocketFactory(
|
||||
reconnection: false, transports: ['websocket']
|
||||
})
|
||||
|
||||
socket.scoped = function ($scope) {
|
||||
socket.scoped = function($scope) {
|
||||
var listeners = []
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
listeners.forEach(function (listener) {
|
||||
$scope.$on('$destroy', function() {
|
||||
listeners.forEach(function(listener) {
|
||||
socket.removeListener(listener.event, listener.handler)
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
on: function (event, handler) {
|
||||
on: function(event, handler) {
|
||||
listeners.push({
|
||||
event: event, handler: handler
|
||||
})
|
||||
@@ -31,12 +31,12 @@ module.exports = function SocketFactory(
|
||||
}
|
||||
}
|
||||
|
||||
socket.on('outdated', function () {
|
||||
socket.on('outdated', function() {
|
||||
VersionUpdateService.open()
|
||||
})
|
||||
|
||||
socket.on('socket.ip', function (ip) {
|
||||
$rootScope.$apply(function () {
|
||||
socket.on('socket.ip', function(ip) {
|
||||
$rootScope.$apply(function() {
|
||||
socket.ip = ip
|
||||
})
|
||||
})
|
||||
|
||||
@@ -7,12 +7,12 @@ module.exports = angular.module('stf/socket/socket-state', [
|
||||
])
|
||||
.directive('socketState', require('./socket-state-directive'))
|
||||
.config([
|
||||
'$provide', function ($provide) {
|
||||
'$provide', function($provide) {
|
||||
return $provide.decorator('$rootScope', [
|
||||
'$delegate', function ($delegate) {
|
||||
$delegate.safeApply = function (fn) {
|
||||
'$delegate', function($delegate) {
|
||||
$delegate.safeApply = function(fn) {
|
||||
var phase = $delegate.$$phase
|
||||
if (phase === "$apply" || phase === "$digest") {
|
||||
if (phase === '$apply' || phase === '$digest') {
|
||||
if (fn && typeof fn === 'function') {
|
||||
fn()
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = function SocketStateDirectiveFactory(
|
||||
return {
|
||||
restrict: 'EA',
|
||||
template: require('./socket-state.jade'),
|
||||
link: function (scope) {
|
||||
link: function(scope) {
|
||||
var hasFailedOnce = false
|
||||
|
||||
function setState(state) {
|
||||
@@ -40,36 +40,36 @@ module.exports = function SocketStateDirectiveFactory(
|
||||
break
|
||||
}
|
||||
|
||||
scope.$apply(function () {
|
||||
scope.$apply(function() {
|
||||
scope.socketState = state
|
||||
})
|
||||
}
|
||||
|
||||
var socketListeners = {
|
||||
'connect': function () {
|
||||
connect: function() {
|
||||
setState('connect')
|
||||
}
|
||||
, 'disconnect': function () {
|
||||
, disconnect: function() {
|
||||
setState('disconnect')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
, 'error': function () {
|
||||
, error: function() {
|
||||
setState('error')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
, 'connect_error': function () {
|
||||
, connect_error: function() {
|
||||
setState('connect_error')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
, 'reconnect_error': function () {
|
||||
, reconnect_error: function() {
|
||||
setState('reconnect_error')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
, 'reconnect_failed': function () {
|
||||
, reconnect_failed: function() {
|
||||
setState('reconnect_failed')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
, 'reconnect': function () {
|
||||
, reconnect: function() {
|
||||
setState('reconnect')
|
||||
hasFailedOnce = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user