summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVicDeo <dubiniuk@owncloud.com>2013-10-07 08:19:40 -0700
committerVicDeo <dubiniuk@owncloud.com>2013-10-07 08:19:40 -0700
commitd8b7e42fc1626c64a28a31cfbde4a3789b9097bf (patch)
treeff67b75013249405357f73d2f35d52302df3aa75
parentb48dffa9a302881e8d1effe9d03bc97e96adc23b (diff)
parent4ccbace68df0150cdadaa8e680a7cb2639e8c628 (diff)
downloadnextcloud-server-d8b7e42fc1626c64a28a31cfbde4a3789b9097bf.tar.gz
nextcloud-server-d8b7e42fc1626c64a28a31cfbde4a3789b9097bf.zip
Merge pull request #4921 from owncloud/file_conflicts_dialog_fixes
File conflicts dialog fixes
-rw-r--r--apps/files/js/file-upload.js20
-rw-r--r--apps/files/js/fileactions.js15
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/js/files.js8
-rw-r--r--apps/files/templates/index.php2
-rw-r--r--core/js/oc-dialogs.js2
6 files changed, 7 insertions, 42 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index b52221ac1fc..f1ef485fc3d 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -42,26 +42,6 @@ function supportAjaxUploadWithProgress() {
OC.Upload = {
_uploads: [],
/**
- * cancels a single upload,
- * @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after
- * they have been uploaded.
- * @param {string} dir
- * @param {string} filename
- * @returns {unresolved}
- */
- cancelUpload:function(dir, filename) {
- var self = this;
- var deleted = false;
- //FIXME _selections
- jQuery.each(this._uploads, function(i, jqXHR) {
- if (selection.dir === dir && selection.uploads[filename]) {
- deleted = self.deleteSelectionUpload(selection, filename);
- return false; // end searching through selections
- }
- });
- return deleted;
- },
- /**
* deletes the jqHXR object from a data selection
* @param {object} data
*/
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 67d3d5ead8d..e14e52eb6ca 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -177,20 +177,7 @@ $(document).ready(function () {
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
- if (OC.Upload.cancelUpload($('#dir').val(), filename)) {
- if (filename.substr) {
- filename = [filename];
- }
- $.each(filename, function (index, file) {
- var filename = $('tr').filterAttr('data-file', file);
- filename.hide();
- filename.find('input[type="checkbox"]').removeAttr('checked');
- filename.removeClass('selected');
- });
- procesSelection();
- } else {
- FileList.do_delete(filename);
- }
+ FileList.do_delete(filename);
$('.tipsy').remove();
});
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 3c99e3876c7..a9297996778 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -804,7 +804,7 @@ $(document).ready(function(){
data.context.attr('data-mime',file.mime).attr('data-id',file.id);
var permissions = data.context.data('permissions');
- if(permissions != file.permissions) {
+ if(permissions !== file.permissions) {
data.context.attr('data-permissions', file.permissions);
data.context.data('permissions', file.permissions);
}
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 53858d65c65..37b66858840 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -369,7 +369,7 @@ $(document).ready(function() {
}
});
}
-
+
//scroll to and highlight preselected file
if (getURLParameter('scrollto')) {
FileList.scrollTo(getURLParameter('scrollto'));
@@ -647,7 +647,7 @@ function lazyLoadPreview(path, mime, ready, width, height) {
// get mime icon url
getMimeIcon(mime, function(iconURL) {
ready(iconURL); // set mimeicon URL
-
+
// now try getting a preview thumbnail URL
if ( ! width ) {
width = $('#filestable').data('preview-x');
@@ -656,9 +656,9 @@ function lazyLoadPreview(path, mime, ready, width, height) {
height = $('#filestable').data('preview-y');
}
if( $('#publicUploadButtonMock').length ) {
- var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()});
+ var previewURL = OC.Router.generate('core_ajax_public_preview', {file: path, x:width, y:height, t:$('#dirToken').val()});
} else {
- var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
+ var previewURL = OC.Router.generate('core_ajax_preview', {file: path, x:width, y:height});
}
$.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28');
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 245c7f142da..5e7ad41b0f0 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -19,8 +19,6 @@
<input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
value="<?php p($_['uploadMaxFilesize']) ?>">
<?php endif;?>
- <!-- Send the requesttoken, this is needed for older IE versions
- because they don't send the CSRF token via HTTP header in this case -->
<input type="hidden" class="max_human_file_size"
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index ac37b109e76..e5e9f6dbb7d 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -294,7 +294,7 @@ var OCdialogs = {
conflict.find('.replacement .mtime').text(formatDate(replacement.lastModifiedDate));
}
var path = getPathForPreview(original.name);
- lazyLoadPreview(path, original.type, function(previewpath){
+ lazyLoadPreview(path, original.mime, function(previewpath){
conflict.find('.original .icon').css('background-image','url('+previewpath+')');
}, 96, 96);
getCroppedPreview(replacement).then(