Fix various linter issues
This commit is contained in:
@@ -15,7 +15,7 @@ angular.module('Application').filter('prettyOwner', function () {
|
||||
if (uid === 1001) return 'git';
|
||||
|
||||
return uid;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// disable sce for footer https://code.angularjs.org/1.5.8/docs/api/ng/service/$sce
|
||||
@@ -23,7 +23,7 @@ app.config(function ($sceProvider) {
|
||||
$sceProvider.enabled(false);
|
||||
});
|
||||
|
||||
app.filter("trustUrl", ['$sce', function ($sce) {
|
||||
app.filter('trustUrl', ['$sce', function ($sce) {
|
||||
return function (recordingUrl) {
|
||||
return $sce.trustAsResourceUrl(recordingUrl);
|
||||
};
|
||||
@@ -36,7 +36,7 @@ angular.forEach(
|
||||
function(eventName) {
|
||||
var directiveName = 'ng' + eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
||||
|
||||
ngDragEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
|
||||
ngDragEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, /* $rootScope */) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
compile: function($element, attr) {
|
||||
@@ -85,7 +85,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
$scope.menuOptions = [
|
||||
{
|
||||
text: 'Download',
|
||||
enabled: function ($itemScope, $event, entry) { return !entry.isDirectory },
|
||||
enabled: function ($itemScope, $event, entry) { return !entry.isDirectory; },
|
||||
click: function ($itemScope, $event, entry) { download(entry); }
|
||||
}, {
|
||||
text: 'Rename',
|
||||
@@ -130,7 +130,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
Client.filesGet($scope.appId, filePath, 'download', function (error) {
|
||||
if (error) return Client.error(error);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
$scope.dragEnter = function ($event, entry) {
|
||||
$event.originalEvent.stopPropagation();
|
||||
@@ -140,7 +140,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
else $scope.dropToBody = true;
|
||||
|
||||
$event.originalEvent.dataTransfer.dropEffect = 'copy';
|
||||
}
|
||||
};
|
||||
|
||||
$scope.dragExit = function ($event, entry) {
|
||||
$event.originalEvent.stopPropagation();
|
||||
@@ -150,7 +150,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
$scope.dropToBody = false;
|
||||
|
||||
$event.originalEvent.dataTransfer.dropEffect = 'copy';
|
||||
}
|
||||
};
|
||||
|
||||
$scope.drop = function (event, entry) {
|
||||
event.originalEvent.stopPropagation();
|
||||
@@ -204,7 +204,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
|
||||
uploadFiles(fileList, targetFolder);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.refresh = function () {
|
||||
$scope.busy = true;
|
||||
@@ -255,7 +255,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
} else {
|
||||
Client.filesGet($scope.appId, filePath, 'open', function (error) { if (error) return Client.error(error); });
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.goDirectoryUp = function () {
|
||||
@@ -375,7 +375,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
|
||||
var filePath = sanitize($scope.cwd + '/' + $scope.newDirectory.name);
|
||||
|
||||
Client.filesCreateDirectory($scope.appId, filePath, function (error, result) {
|
||||
Client.filesCreateDirectory($scope.appId, filePath, function (error) {
|
||||
$scope.newDirectory.busy = false;
|
||||
if (error && error.statusCode === 409) return $scope.newDirectory.error = 'Already exists';
|
||||
if (error) return Client.error(error);
|
||||
@@ -408,7 +408,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
var oldFilePath = sanitize($scope.cwd + '/' + $scope.renameEntry.entry.fileName);
|
||||
var newFilePath = sanitize(($scope.renameEntry.newName[0] === '/' ? '' : ($scope.cwd + '/')) + $scope.renameEntry.newName);
|
||||
|
||||
Client.filesRename($scope.appId, oldFilePath, newFilePath, function (error, result) {
|
||||
Client.filesRename($scope.appId, oldFilePath, newFilePath, function (error) {
|
||||
$scope.renameEntry.busy = false;
|
||||
if (error) return Client.error(error);
|
||||
|
||||
@@ -537,7 +537,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
|
||||
var filePath = sanitize($scope.cwd + '/' + $scope.chownEntry.entry.fileName);
|
||||
|
||||
Client.filesChown($scope.appId, filePath, $scope.chownEntry.newOwner, $scope.chownEntry.recursive, function (error, result) {
|
||||
Client.filesChown($scope.appId, filePath, $scope.chownEntry.newOwner, $scope.chownEntry.recursive, function (error) {
|
||||
$scope.chownEntry.busy = false;
|
||||
if (error) return Client.error(error);
|
||||
|
||||
@@ -565,7 +565,7 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
|
||||
var filePath = sanitize($scope.cwd + '/' + $scope.entryRemove.entry.fileName);
|
||||
|
||||
Client.filesRemove($scope.appId, filePath, function (error, result) {
|
||||
Client.filesRemove($scope.appId, filePath, function (error) {
|
||||
$scope.entryRemove.busy = false;
|
||||
if (error) return Client.error(error);
|
||||
|
||||
@@ -633,14 +633,14 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
|
||||
// setup all the dialog focus handling
|
||||
['newDirectoryModal', 'renameEntryModal'].forEach(function (id) {
|
||||
$('#' + id).on('shown.bs.modal', function () {
|
||||
$(this).find("[autofocus]:first").focus();
|
||||
$(this).find('[autofocus]:first').focus();
|
||||
});
|
||||
});
|
||||
|
||||
// selects filename (without extension)
|
||||
['renameEntryModal'].forEach(function (id) {
|
||||
$('#' + id).on('shown.bs.modal', function () {
|
||||
var elem = $(this).find("[autofocus]:first");
|
||||
var elem = $(this).find('[autofocus]:first');
|
||||
var text = elem.val();
|
||||
elem[0].setSelectionRange(0, text.indexOf('.'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user