Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-09-25 19:19:42 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-01 18:16:09 +0300
commitb9bc2417e7a8dc81feb0abe20359bedaf864f790 (patch)
tree61b47fbf37c1d168da8625224debde9e6a985348 /apps/files_trashbin/src/app.js
parent7fb651235128dcbca8a6683b5cdafdf835f46300 (diff)
Comply to eslint
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_trashbin/src/app.js')
-rw-r--r--apps/files_trashbin/src/app.js107
1 files changed, 53 insertions, 54 deletions
diff --git a/apps/files_trashbin/src/app.js b/apps/files_trashbin/src/app.js
index 2bc8e08b812..3405f79b15f 100644
--- a/apps/files_trashbin/src/app.js
+++ b/apps/files_trashbin/src/app.js
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright (c) 2014
*
* This file is licensed under the Affero General Public License version 3
@@ -11,7 +11,7 @@
/**
* @namespace OCA.Trashbin
*/
-OCA.Trashbin = {};
+OCA.Trashbin = {}
/**
* @namespace OCA.Trashbin.App
*/
@@ -20,19 +20,19 @@ OCA.Trashbin.App = {
/** @type {OC.Files.Client} */
client: null,
- initialize: function ($el) {
+ initialize: function($el) {
if (this._initialized) {
- return;
+ return
}
- this._initialized = true;
+ this._initialized = true
this.client = new OC.Files.Client({
host: OC.getHost(),
port: OC.getPort(),
root: OC.linkToRemoteBase('dav') + '/trashbin/' + OC.getCurrentUser().uid,
useHTTPS: OC.getProtocol() === 'https'
- });
- var urlParams = OC.Util.History.parseUrlQuery();
+ })
+ var urlParams = OC.Util.History.parseUrlQuery()
this.fileList = new OCA.Trashbin.FileList(
$('#app-content-trashbin'), {
fileActions: this._createFileActions(),
@@ -43,12 +43,12 @@ OCA.Trashbin.App = {
{
name: 'restore',
displayName: t('files_trashbin', 'Restore'),
- iconClass: 'icon-history',
+ iconClass: 'icon-history'
},
{
name: 'delete',
displayName: t('files_trashbin', 'Delete permanently'),
- iconClass: 'icon-delete',
+ iconClass: 'icon-delete'
}
],
client: this.client,
@@ -57,18 +57,18 @@ OCA.Trashbin.App = {
// if handling the event with the file list already created.
shown: true
}
- );
+ )
},
- _createFileActions: function () {
- var client = this.client;
- var fileActions = new OCA.Files.FileActions();
- fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
- var dir = context.fileList.getCurrentDirectory();
- context.fileList.changeDirectory(OC.joinPaths(dir, filename));
- });
+ _createFileActions: function() {
+ var client = this.client
+ var fileActions = new OCA.Files.FileActions()
+ fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {
+ var dir = context.fileList.getCurrentDirectory()
+ context.fileList.changeDirectory(OC.joinPaths(dir, filename))
+ })
- fileActions.setDefault('dir', 'Open');
+ fileActions.setDefault('dir', 'Open')
fileActions.registerAction({
name: 'Restore',
@@ -77,21 +77,21 @@ OCA.Trashbin.App = {
mime: 'all',
permissions: OC.PERMISSION_READ,
iconClass: 'icon-history',
- actionHandler: function (filename, context) {
- var fileList = context.fileList;
- var tr = fileList.findFileEl(filename);
- fileList.showFileBusyState(tr, true);
- var dir = context.fileList.getCurrentDirectory();
+ actionHandler: function(filename, context) {
+ var fileList = context.fileList
+ var tr = fileList.findFileEl(filename)
+ fileList.showFileBusyState(tr, true)
+ var dir = context.fileList.getCurrentDirectory()
client.move(OC.joinPaths('trash', dir, filename), OC.joinPaths('restore', filename), true)
.then(
fileList._removeCallback.bind(fileList, [filename]),
- function () {
- fileList.showFileBusyState(tr, false);
- OC.Notification.show(t('files_trashbin', 'Error while restoring file from trashbin'));
+ function() {
+ fileList.showFileBusyState(tr, false)
+ OC.Notification.show(t('files_trashbin', 'Error while restoring file from trashbin'))
}
- );
+ )
}
- });
+ })
fileActions.registerAction({
name: 'Delete',
@@ -99,39 +99,38 @@ OCA.Trashbin.App = {
mime: 'all',
permissions: OC.PERMISSION_READ,
iconClass: 'icon-delete',
- render: function (actionSpec, isDefault, context) {
- var $actionLink = fileActions._makeActionLink(actionSpec, context);
- $actionLink.attr('original-title', t('files_trashbin', 'Delete permanently'));
- $actionLink.children('img').attr('alt', t('files_trashbin', 'Delete permanently'));
- context.$file.find('td:last').append($actionLink);
- return $actionLink;
+ render: function(actionSpec, isDefault, context) {
+ var $actionLink = fileActions._makeActionLink(actionSpec, context)
+ $actionLink.attr('original-title', t('files_trashbin', 'Delete permanently'))
+ $actionLink.children('img').attr('alt', t('files_trashbin', 'Delete permanently'))
+ context.$file.find('td:last').append($actionLink)
+ return $actionLink
},
- actionHandler: function (filename, context) {
- var fileList = context.fileList;
- $('.tipsy').remove();
- var tr = fileList.findFileEl(filename);
- fileList.showFileBusyState(tr, true);
- var dir = context.fileList.getCurrentDirectory();
+ actionHandler: function(filename, context) {
+ var fileList = context.fileList
+ $('.tipsy').remove()
+ var tr = fileList.findFileEl(filename)
+ fileList.showFileBusyState(tr, true)
+ var dir = context.fileList.getCurrentDirectory()
client.remove(OC.joinPaths('trash', dir, filename))
.then(
fileList._removeCallback.bind(fileList, [filename]),
- function () {
- fileList.showFileBusyState(tr, false);
- OC.Notification.show(t('files_trashbin', 'Error while removing file from trashbin'));
+ function() {
+ fileList.showFileBusyState(tr, false)
+ OC.Notification.show(t('files_trashbin', 'Error while removing file from trashbin'))
}
- );
+ )
}
- });
- return fileActions;
+ })
+ return fileActions
}
-};
+}
-$(document).ready(function () {
- $('#app-content-trashbin').one('show', function () {
- var App = OCA.Trashbin.App;
- App.initialize($('#app-content-trashbin'));
+$(document).ready(function() {
+ $('#app-content-trashbin').one('show', function() {
+ var App = OCA.Trashbin.App
+ App.initialize($('#app-content-trashbin'))
// force breadcrumb init
// App.fileList.changeDirectory(App.fileList.getCurrentDirectory(), false, true);
- });
-});
-
+ })
+})