diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-30 10:41:04 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-30 13:40:01 +0100 |
commit | d36a2ff9eeedc9ebb2ebbba5d55cc255281e9929 (patch) | |
tree | b54a03363f008fa6eac6f8fc0552d6c9482d4667 /apps/files/js/fileactions.js | |
parent | 299a8285bd2601ccbac988b2e3e9b067d47921a2 (diff) | |
download | nextcloud-server-d36a2ff9eeedc9ebb2ebbba5d55cc255281e9929.tar.gz nextcloud-server-d36a2ff9eeedc9ebb2ebbba5d55cc255281e9929.zip |
Added .jshintrc
- Also fixes a few JSHint warnings in files app
- Added "global" comment on top of files app to suppress warning and
also inform devs about what globals are use
Diffstat (limited to 'apps/files/js/fileactions.js')
-rw-r--r-- | apps/files/js/fileactions.js | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index d0ef2491bdf..ecd0484b0fe 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -1,3 +1,15 @@ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global OC, FileList */ +/* global trashBinApp */ var FileActions = { actions: {}, defaults: {}, @@ -45,8 +57,9 @@ var FileActions = { return filteredActions; }, getDefault: function (mime, type, permissions) { + var mimePart; if (mime) { - var mimePart = mime.substr(0, mime.indexOf('/')); + mimePart = mime.substr(0, mime.indexOf('/')); } var name = false; if (mime && FileActions.defaults[mime]) { @@ -130,13 +143,14 @@ var FileActions = { parent.parent().children().last().find('.action.delete').remove(); if (actions['Delete']) { var img = FileActions.icons['Delete']; + var html; if (img.call) { img = img(file); } if (typeof trashBinApp !== 'undefined' && trashBinApp) { - var html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />'; + html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />'; } else { - var html = '<a href="#" class="action delete delete-icon" />'; + html = '<a href="#" class="action delete delete-icon" />'; } var element = $(html); element.data('action', actions['Delete']); @@ -163,10 +177,11 @@ var FileActions = { }; $(document).ready(function () { + var downloadScope; if ($('#allowZipDownload').val() == 1) { - var downloadScope = 'all'; + downloadScope = 'all'; } else { - var downloadScope = 'file'; + downloadScope = 'file'; } if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) { |