summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/file-upload.js26
-rw-r--r--apps/files/js/fileactions.js19
-rw-r--r--apps/files/js/filelist.js8
-rw-r--r--apps/files/js/files.js2
-rw-r--r--apps/files/js/filesummary.js6
-rw-r--r--apps/files/js/newfilemenu.js4
6 files changed, 44 insertions, 21 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index e07093dd17b..56ea384c9e0 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -347,10 +347,6 @@ OC.Upload = {
//file is a directory
dirUploadFailure = true;
}
- if (file.size === 0) {
- // file is empty or a directory
- dirUploadFailure = true;
- }
if (dirUploadFailure) {
data.textStatus = 'dirorzero';
@@ -667,8 +663,23 @@ OC.Upload = {
OC.Upload._hideProgressBar();
}
});
+ var disableDropState = function() {
+ $('#app-content').removeClass('file-drag');
+ $('.dropping-to-dir').removeClass('dropping-to-dir');
+ $('.dir-drop').removeClass('dir-drop');
+ $('.icon-filetype-folder-drag-accept').removeClass('icon-filetype-folder-drag-accept');
+ };
+ var disableClassOnFirefox = _.debounce(function() {
+ disableDropState();
+ }, 100);
fileupload.on('fileuploaddragover', function(e){
$('#app-content').addClass('file-drag');
+ // dropping a folder in firefox doesn't cause a drop event
+ // this is simulated by simply invoke disabling all classes
+ // once no dragover event isn't noticed anymore
+ if ($.browser['mozilla']) {
+ disableClassOnFirefox();
+ }
$('#emptycontent .icon-folder').addClass('icon-filetype-folder-drag-accept');
var filerow = $(e.delegatedEvent.target).closest('tr');
@@ -685,12 +696,7 @@ OC.Upload = {
filerow.find('.thumbnail').addClass('icon-filetype-folder-drag-accept');
}
});
- fileupload.on('fileuploaddragleave fileuploaddrop', function (){
- $('#app-content').removeClass('file-drag');
- $('.dropping-to-dir').removeClass('dropping-to-dir');
- $('.dir-drop').removeClass('dir-drop');
- $('.icon-filetype-folder-drag-accept').removeClass('icon-filetype-folder-drag-accept');
- });
+ fileupload.on('fileuploaddragleave fileuploaddrop', disableDropState);
} else {
// for all browsers that don't support the progress bar
// IE 8 & 9
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 015635c2e1d..3e0cf998254 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -363,7 +363,7 @@
/**
* Renders the menu trigger on the given file list row
- *
+ *
* @param {Object} $tr file list row element
* @param {OCA.Files.FileActionContext} context rendering context
*/
@@ -617,6 +617,20 @@
}
});
+ this.registerAction({
+ name: 'Move',
+ displayName: t('files', 'Move'),
+ mime: 'all',
+ order: -25,
+ permissions: OC.PERMISSION_UPDATE,
+ iconClass: 'icon-external',
+ actionHandler: function (filename, context) {
+ OC.dialogs.filepicker(t('files', 'Target folder'), function(targetPath) {
+ context.fileList.move(filename, targetPath);
+ }, false, "httpd/unix-directory", true);
+ }
+ });
+
this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory();
context.fileList.changeDirectory(OC.joinPaths(dir, filename), true, false, parseInt(context.$file.attr('data-id'), 10));
@@ -744,7 +758,7 @@
OCA.Files.legacyFileActions = new OCA.Files.FileActions();
// for backward compatibility
- //
+ //
// legacy apps are expecting a stateful global FileActions object to register
// their actions on. Since legacy apps are very likely to break with other
// FileList views than the main one ("All files"), actions registered
@@ -763,4 +777,3 @@
OCA.Files.FileActions.prototype.display.call(window.FileActions, parent, triggerEvent, fileList);
};
})();
-
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 09c35e0d061..896af1dd6e5 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1941,7 +1941,9 @@
// Files.isFileNameValid(filename) throws an exception itself
OCA.Files.Files.isFileNameValid(filename);
if (self.inList(filename)) {
- throw t('files', '{newName} already exists', {newName: filename});
+ throw t('files', '{newName} already exists', {newName: filename}, undefined, {
+ escape: false
+ });
}
}
return true;
@@ -2341,10 +2343,8 @@
this.$table.addClass('hidden');
this.$el.find('#emptycontent').addClass('hidden');
- $mask = $('<div class="mask transparent"></div>');
+ $mask = $('<div class="mask transparent icon-loading"></div>');
- $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')');
- $mask.css('background-repeat', 'no-repeat');
this.$el.append($mask);
$mask.removeClass('transparent');
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 53e07ddb090..2873b84bc9a 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -360,7 +360,7 @@ var createDragShadow = function(event) {
tbody.append(newtr);
if (elem.type === 'dir') {
newtr.find('td.filename')
- .css('background-image', 'url(' + OC.imagePath('core', 'filetypes/folder.png') + ')');
+ .css('background-image', 'url(' + OC.imagePath('core', 'filetypes/folder.svg') + ')');
} else {
var path = dir + '/' + elem.name;
Files.lazyLoadPreview(path, elem.mimetype, function(previewpath) {
diff --git a/apps/files/js/filesummary.js b/apps/files/js/filesummary.js
index 519718cfc82..7545654ec44 100644
--- a/apps/files/js/filesummary.js
+++ b/apps/files/js/filesummary.js
@@ -23,7 +23,7 @@
var INFO_TEMPLATE =
'<span class="info">' +
'<span class="dirinfo"></span>' +
- '<span class="connector"> and </span>' +
+ '<span class="connector">{{connectorLabel}}</span>' +
'<span class="fileinfo"></span>' +
'<span class="hiddeninfo"></span>' +
'<span class="filter"></span>' +
@@ -203,7 +203,9 @@
if (!this._infoTemplateCompiled) {
this._infoTemplateCompiled = Handlebars.compile(INFO_TEMPLATE);
}
- return this._infoTemplateCompiled(data);
+ return this._infoTemplateCompiled(_.extend({
+ connectorLabel: t('files', '{dirs} and {files}', {dirs: '', files: ''})
+ }, data));
},
/**
diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js
index f6cf87a55bf..75c4cdcc0ba 100644
--- a/apps/files/js/newfilemenu.js
+++ b/apps/files/js/newfilemenu.js
@@ -146,7 +146,9 @@
if (!Files.isFileNameValid(filename)) {
// Files.isFileNameValid(filename) throws an exception itself
} else if (self.fileList.inList(filename)) {
- throw t('files', '{newname} already exists', {newname: filename});
+ throw t('files', '{newName} already exists', {newName: filename}, undefined, {
+ escape: false
+ });
} else {
return true;
}