summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-28 11:18:04 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-28 11:18:04 +0100
commit8067a1394e3dab551e65ec8abd12e673a811bf40 (patch)
treefd18fac68c7ca62ee50142e771f0da70a9c0925d /apps/files/js/filelist.js
parentdbb0d0407324830f4a7ff51781c535c1cb0d2a06 (diff)
parent857b15db3739fe8fbbad4df0f10e9b48ba1f90c2 (diff)
downloadnextcloud-server-8067a1394e3dab551e65ec8abd12e673a811bf40.tar.gz
nextcloud-server-8067a1394e3dab551e65ec8abd12e673a811bf40.zip
fix merge conflicts
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js69
1 files changed, 55 insertions, 14 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a9e88249644..afa2923a8c8 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -201,15 +201,14 @@ var FileList={
},
checkName:function(oldName, newName, isNewFile) {
if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) {
- if (isNewFile) {
- $('#notification').html(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
- } else {
- $('#notification').html(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
- }
$('#notification').data('oldName', oldName);
$('#notification').data('newName', newName);
$('#notification').data('isNewFile', isNewFile);
- $('#notification').fadeIn();
+ if (isNewFile) {
+ OC.Notification.showHtml(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
+ } else {
+ OC.Notification.showHtml(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
+ }
return true;
} else {
return false;
@@ -251,11 +250,10 @@ var FileList={
FileList.finishReplace();
};
if (isNewFile) {
- $('#notification').html(t('files', 'replaced {new_name}', {new_name: newName})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ OC.Notification.showHtml(t('files', 'replaced {new_name}', {new_name: newName})+'<span class="undo">'+t('files', 'undo')+'</span>');
} else {
- $('#notification').html(t('files', 'replaced {new_name} with {old_name}', {new_name: newName}, {old_name: oldName})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ OC.Notification.showHtml(t('files', 'replaced {new_name} with {old_name}', {new_name: newName}, {old_name: oldName})+'<span class="undo">'+t('files', 'undo')+'</span>');
}
- $('#notification').fadeIn();
},
finishReplace:function() {
if (!FileList.replaceCanceled && FileList.replaceOldName && FileList.replaceNewName) {
@@ -277,6 +275,49 @@ var FileList={
if (FileList.lastAction) {
FileList.lastAction();
}
+<<<<<<< HEAD
+=======
+
+ FileList.prepareDeletion(files);
+
+ if (!FileList.useUndo) {
+ FileList.lastAction();
+ } else {
+ // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder
+ if ($('#dir').val() == '/Shared') {
+ OC.Notification.showHtml(t('files', 'unshared {files}', {'files': escapeHTML(files)})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ } else {
+ OC.Notification.showHtml(t('files', 'deleted {files}', {'files': escapeHTML(files)})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ }
+ }
+ },
+ finishDelete:function(ready,sync){
+ if(!FileList.deleteCanceled && FileList.deleteFiles){
+ var fileNames=JSON.stringify(FileList.deleteFiles);
+ $.ajax({
+ url: OC.filePath('files', 'ajax', 'delete.php'),
+ async:!sync,
+ type:'post',
+ data: {dir:$('#dir').val(),files:fileNames},
+ complete: function(data){
+ boolOperationFinished(data, function(){
+ OC.Notification.hide();
+ $.each(FileList.deleteFiles,function(index,file){
+ FileList.remove(file);
+ });
+ FileList.deleteCanceled=true;
+ FileList.deleteFiles=null;
+ FileList.lastAction = null;
+ if(ready){
+ ready();
+ }
+ });
+ }
+ });
+ }
+ },
+ prepareDeletion:function(files){
+>>>>>>> origin/master
if(files.substr){
files=[files];
}
@@ -323,16 +364,16 @@ $(document).ready(function(){
FileList.replaceIsNewFile = null;
}
FileList.lastAction = null;
- $('#notification').fadeOut('400');
+ OC.Notification.hide();
});
$('#notification .replace').live('click', function() {
- $('#notification').fadeOut('400', function() {
- FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
- });
+ OC.Notification.hide(function() {
+ FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
+ });
});
$('#notification .suggest').live('click', function() {
$('tr').filterAttr('data-file', $('#notification').data('oldName')).show();
- $('#notification').fadeOut('400');
+ OC.Notification.hide();
});
$('#notification .cancel').live('click', function() {
if ($('#notification').data('isNewFile')) {