|
|
|
@ -43,7 +43,7 @@ var FileList={ |
|
|
|
|
"href": linktarget |
|
|
|
|
}); |
|
|
|
|
//split extension from filename for non dirs
|
|
|
|
|
if (type != 'dir' && name.indexOf('.')!=-1) { |
|
|
|
|
if (type !== 'dir' && name.indexOf('.') !== -1) { |
|
|
|
|
basename=name.substr(0,name.lastIndexOf('.')); |
|
|
|
|
extension=name.substr(name.lastIndexOf('.')); |
|
|
|
|
} else { |
|
|
|
@ -56,7 +56,7 @@ var FileList={ |
|
|
|
|
name_span.append($('<span></span>').addClass('extension').text(extension)); |
|
|
|
|
} |
|
|
|
|
//dirs can show the number of uploaded files
|
|
|
|
|
if (type == 'dir') { |
|
|
|
|
if (type === 'dir') { |
|
|
|
|
link_elem.append($('<span></span>').attr({ |
|
|
|
|
'class': 'uploadtext', |
|
|
|
|
'currentUploads': 0 |
|
|
|
@ -66,7 +66,7 @@ var FileList={ |
|
|
|
|
tr.append(td); |
|
|
|
|
|
|
|
|
|
//size column
|
|
|
|
|
if(size!=t('files', 'Pending')){ |
|
|
|
|
if (size !== t('files', 'Pending')) { |
|
|
|
|
simpleSize = humanFileSize(size); |
|
|
|
|
} else { |
|
|
|
|
simpleSize=t('files', 'Pending'); |
|
|
|
@ -156,6 +156,7 @@ var FileList={ |
|
|
|
|
* @brief Changes the current directory and reload the file list. |
|
|
|
|
* @param targetDir target directory (non URL encoded) |
|
|
|
|
* @param changeUrl false if the URL must not be changed (defaults to true) |
|
|
|
|
* @param {boolean} force set to true to force changing directory |
|
|
|
|
*/ |
|
|
|
|
changeDirectory: function(targetDir, changeUrl, force) { |
|
|
|
|
var $dir = $('#dir'), |
|
|
|
@ -227,7 +228,7 @@ var FileList={ |
|
|
|
|
FileList.setDirectoryPermissions(result.data.permissions); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(typeof(result.data.breadcrumb) != 'undefined'){ |
|
|
|
|
if (typeof(result.data.breadcrumb) !== 'undefined') { |
|
|
|
|
$controls.find('.crumb').remove(); |
|
|
|
|
$controls.prepend(result.data.breadcrumb); |
|
|
|
|
|
|
|
|
@ -278,7 +279,7 @@ var FileList={ |
|
|
|
|
$('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy'); |
|
|
|
|
$('tr').filterAttr('data-file',name).remove(); |
|
|
|
|
FileList.updateFileSummary(); |
|
|
|
|
if($('tr[data-file]').length==0){ |
|
|
|
|
if ( ! $('tr[data-file]').exists() ) { |
|
|
|
|
$('#emptycontent').removeClass('hidden'); |
|
|
|
|
$('#filescontent th').addClass('hidden'); |
|
|
|
|
} |
|
|
|
@ -292,20 +293,22 @@ var FileList={ |
|
|
|
|
pos = fileElements.length - 1; |
|
|
|
|
} else { |
|
|
|
|
for(pos = 0; pos<fileElements.length-1; pos++) { |
|
|
|
|
if(name.localeCompare($(fileElements[pos]).attr('data-file'))>0 && name.localeCompare($(fileElements[pos+1]).attr('data-file'))<0){ |
|
|
|
|
if (name.localeCompare($(fileElements[pos]).attr('data-file')) > 0 |
|
|
|
|
&& name.localeCompare($(fileElements[pos+1]).attr('data-file')) < 0) |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(fileElements.length){ |
|
|
|
|
if(pos==-1){ |
|
|
|
|
if (fileElements.exists()) { |
|
|
|
|
if (pos === -1) { |
|
|
|
|
$(fileElements[0]).before(element); |
|
|
|
|
} else { |
|
|
|
|
$(fileElements[pos]).after(element); |
|
|
|
|
} |
|
|
|
|
}else if(type=='dir' && $('tr[data-file]').length>0){ |
|
|
|
|
} else if (type === 'dir' && $('tr[data-file]').exists()) { |
|
|
|
|
$('tr[data-file]').first().before(element); |
|
|
|
|
} else if(type=='file' && $('tr[data-file]').length>0) { |
|
|
|
|
} else if (type === 'file' && $('tr[data-file]').exists()) { |
|
|
|
|
$('tr[data-file]').last().before(element); |
|
|
|
|
} else { |
|
|
|
|
$('#fileList').append(element); |
|
|
|
@ -315,11 +318,11 @@ var FileList={ |
|
|
|
|
FileList.updateFileSummary(); |
|
|
|
|
}, |
|
|
|
|
loadingDone:function(name, id) { |
|
|
|
|
var mime, tr=$('tr').filterAttr('data-file',name); |
|
|
|
|
var mime, tr = $('tr[data-file="'+name+'"]'); |
|
|
|
|
tr.data('loading', false); |
|
|
|
|
mime = tr.data('mime'); |
|
|
|
|
tr.attr('data-mime', mime); |
|
|
|
|
if (id != null) { |
|
|
|
|
if (id) { |
|
|
|
|
tr.attr('data-id', id); |
|
|
|
|
} |
|
|
|
|
var path = getPathForPreview(name); |
|
|
|
@ -329,14 +332,14 @@ var FileList={ |
|
|
|
|
tr.find('td.filename').draggable(dragOptions); |
|
|
|
|
}, |
|
|
|
|
isLoading:function(name) { |
|
|
|
|
return $('tr').filterAttr('data-file',name).data('loading'); |
|
|
|
|
return $('tr[data-file="'+name+'"]').data('loading'); |
|
|
|
|
}, |
|
|
|
|
rename:function(name){ |
|
|
|
|
rename:function(oldname) { |
|
|
|
|
var tr, td, input, form; |
|
|
|
|
tr=$('tr').filterAttr('data-file',name); |
|
|
|
|
tr = $('tr[data-file="'+oldname+'"]'); |
|
|
|
|
tr.data('renaming',true); |
|
|
|
|
td = tr.children('td.filename'); |
|
|
|
|
input=$('<input type="text" class="filename"/>').val(name); |
|
|
|
|
input = $('<input type="text" class="filename"/>').val(oldname); |
|
|
|
|
form = $('<form></form>'); |
|
|
|
|
form.append(input); |
|
|
|
|
td.children('a.name').hide(); |
|
|
|
@ -349,16 +352,27 @@ var FileList={ |
|
|
|
|
} |
|
|
|
|
input.selectRange(0, len); |
|
|
|
|
|
|
|
|
|
var checkInput = function () { |
|
|
|
|
var filename = input.val(); |
|
|
|
|
if (filename !== oldname) { |
|
|
|
|
if (!Files.isFileNameValid(filename)) { |
|
|
|
|
// Files.isFileNameValid(filename) throws an exception itself
|
|
|
|
|
} else if($('#dir').val() === '/' && filename === 'Shared') { |
|
|
|
|
throw t('files','In the home folder \'Shared\' is a reserved filename'); |
|
|
|
|
} else if (FileList.inList(filename)) { |
|
|
|
|
throw t('files', '{new_name} already exists', {new_name: filename}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
form.submit(function(event) { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
event.preventDefault(); |
|
|
|
|
try { |
|
|
|
|
var newname = input.val(); |
|
|
|
|
if (!Files.isFileNameValid(newname)) { |
|
|
|
|
return false; |
|
|
|
|
} else if (newname != name) { |
|
|
|
|
if (FileList.checkName(name, newname, false)) { |
|
|
|
|
newname = name; |
|
|
|
|
} else { |
|
|
|
|
if (newname !== oldname) { |
|
|
|
|
checkInput(); |
|
|
|
|
// save background image, because it's replaced by a spinner while async request
|
|
|
|
|
var oldBackgroundImage = td.css('background-image'); |
|
|
|
|
// mark as loading
|
|
|
|
@ -368,16 +382,16 @@ var FileList={ |
|
|
|
|
data: { |
|
|
|
|
dir : $('#dir').val(), |
|
|
|
|
newname: newname, |
|
|
|
|
file: name |
|
|
|
|
file: oldname |
|
|
|
|
}, |
|
|
|
|
success: function(result) { |
|
|
|
|
if (!result || result.status === 'error') { |
|
|
|
|
OC.Notification.show(result.data.message); |
|
|
|
|
newname = name; |
|
|
|
|
OC.dialogs.alert(result.data.message, t('core', 'Could not rename file')); |
|
|
|
|
// revert changes
|
|
|
|
|
newname = oldname; |
|
|
|
|
tr.attr('data-file', newname); |
|
|
|
|
var path = td.children('a.name').attr('href'); |
|
|
|
|
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname))); |
|
|
|
|
td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newname))); |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { |
|
|
|
|
var basename=newname.substr(0,newname.lastIndexOf('.')); |
|
|
|
|
} else { |
|
|
|
@ -385,7 +399,7 @@ var FileList={ |
|
|
|
|
} |
|
|
|
|
td.find('a.name span.nametext').text(basename); |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { |
|
|
|
|
if (td.find('a.name span.extension').length === 0 ) { |
|
|
|
|
if ( ! td.find('a.name span.extension').exists() ) { |
|
|
|
|
td.find('a.name span.nametext').append('<span class="extension"></span>'); |
|
|
|
|
} |
|
|
|
|
td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.'))); |
|
|
|
@ -393,34 +407,55 @@ var FileList={ |
|
|
|
|
tr.find('.fileactions').effect('highlight', {}, 5000); |
|
|
|
|
tr.effect('highlight', {}, 5000); |
|
|
|
|
} |
|
|
|
|
// reinsert row
|
|
|
|
|
tr.detach(); |
|
|
|
|
FileList.insertElement( tr.attr('data-file'), tr.attr('data-type'),tr ); |
|
|
|
|
// remove loading mark and recover old image
|
|
|
|
|
td.css('background-image', oldBackgroundImage); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
input.tipsy('hide'); |
|
|
|
|
tr.data('renaming',false); |
|
|
|
|
tr.attr('data-file', newname); |
|
|
|
|
var path = td.children('a.name').attr('href'); |
|
|
|
|
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname))); |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { |
|
|
|
|
var basename=newname.substr(0,newname.lastIndexOf('.')); |
|
|
|
|
} else { |
|
|
|
|
// FIXME this will fail if the path contains the filename.
|
|
|
|
|
td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newname))); |
|
|
|
|
var basename = newname; |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { |
|
|
|
|
basename = newname.substr(0, newname.lastIndexOf('.')); |
|
|
|
|
}
|
|
|
|
|
td.find('a.name span.nametext').text(basename); |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { |
|
|
|
|
if (td.find('a.name span.extension').length == 0 ) { |
|
|
|
|
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') { |
|
|
|
|
if ( ! td.find('a.name span.extension').exists() ) { |
|
|
|
|
td.find('a.name span.nametext').append('<span class="extension"></span>'); |
|
|
|
|
} |
|
|
|
|
td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.'))); |
|
|
|
|
} |
|
|
|
|
form.remove(); |
|
|
|
|
td.children('a.name').show(); |
|
|
|
|
} catch (error) { |
|
|
|
|
input.attr('title', error); |
|
|
|
|
input.tipsy({gravity: 'w', trigger: 'manual'}); |
|
|
|
|
input.tipsy('show'); |
|
|
|
|
input.addClass('error'); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
input.keyup(function(event) { |
|
|
|
|
if (event.keyCode == 27) { |
|
|
|
|
// verify filename on typing
|
|
|
|
|
try { |
|
|
|
|
checkInput(); |
|
|
|
|
input.tipsy('hide'); |
|
|
|
|
input.removeClass('error'); |
|
|
|
|
} catch (error) { |
|
|
|
|
input.attr('title', error); |
|
|
|
|
input.tipsy({gravity: 'w', trigger: 'manual'}); |
|
|
|
|
input.tipsy('show'); |
|
|
|
|
input.addClass('error'); |
|
|
|
|
} |
|
|
|
|
if (event.keyCode === 27) { |
|
|
|
|
input.tipsy('hide'); |
|
|
|
|
tr.data('renaming',false); |
|
|
|
|
form.remove(); |
|
|
|
|
td.children('a.name').show(); |
|
|
|
@ -434,29 +469,14 @@ var FileList={ |
|
|
|
|
form.trigger('submit'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
checkName:function(oldName, newName, isNewFile) { |
|
|
|
|
if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) { |
|
|
|
|
var html; |
|
|
|
|
if(isNewFile){ |
|
|
|
|
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{ |
|
|
|
|
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>'; |
|
|
|
|
} |
|
|
|
|
html = $('<span>' + html + '</span>'); |
|
|
|
|
html.attr('data-oldName', oldName); |
|
|
|
|
html.attr('data-newName', newName); |
|
|
|
|
html.attr('data-isNewFile', isNewFile); |
|
|
|
|
OC.Notification.showHtml(html); |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
inList:function(filename) { |
|
|
|
|
return $('#fileList tr[data-file="'+filename+'"]').length; |
|
|
|
|
}, |
|
|
|
|
replace:function(oldName, newName, isNewFile) { |
|
|
|
|
// Finish any existing actions
|
|
|
|
|
$('tr').filterAttr('data-file', oldName).hide(); |
|
|
|
|
$('tr').filterAttr('data-file', newName).hide(); |
|
|
|
|
var tr = $('tr').filterAttr('data-file', oldName).clone(); |
|
|
|
|
$('tr[data-file="'+oldName+'"]').hide(); |
|
|
|
|
$('tr[data-file="'+newName+'"]').hide(); |
|
|
|
|
var tr = $('tr[data-file="'+oldName+'"]').clone(); |
|
|
|
|
tr.attr('data-replace', 'true'); |
|
|
|
|
tr.attr('data-file', newName); |
|
|
|
|
var td = tr.children('td.filename'); |
|
|
|
@ -491,8 +511,8 @@ var FileList={ |
|
|
|
|
finishReplace:function() { |
|
|
|
|
if (!FileList.replaceCanceled && FileList.replaceOldName && FileList.replaceNewName) { |
|
|
|
|
$.ajax({url: OC.filePath('files', 'ajax', 'rename.php'), async: false, data: { dir: $('#dir').val(), newname: FileList.replaceNewName, file: FileList.replaceOldName }, success: function(result) { |
|
|
|
|
if (result && result.status == 'success') { |
|
|
|
|
$('tr').filterAttr('data-replace', 'true').removeAttr('data-replace'); |
|
|
|
|
if (result && result.status === 'success') { |
|
|
|
|
$('tr[data-replace="true"').removeAttr('data-replace'); |
|
|
|
|
} else { |
|
|
|
|
OC.dialogs.alert(result.data.message, 'Error moving file'); |
|
|
|
|
} |
|
|
|
@ -508,7 +528,7 @@ var FileList={ |
|
|
|
|
files=[files]; |
|
|
|
|
} |
|
|
|
|
for (var i=0; i<files.length; i++) { |
|
|
|
|
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); |
|
|
|
|
var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete"); |
|
|
|
|
deleteAction.removeClass('delete-icon').addClass('progress-icon'); |
|
|
|
|
} |
|
|
|
|
// Finish any existing actions
|
|
|
|
@ -520,9 +540,9 @@ var FileList={ |
|
|
|
|
$.post(OC.filePath('files', 'ajax', 'delete.php'), |
|
|
|
|
{dir:$('#dir').val(),files:fileNames}, |
|
|
|
|
function(result) { |
|
|
|
|
if (result.status == 'success') { |
|
|
|
|
if (result.status === 'success') { |
|
|
|
|
$.each(files,function(index,file) { |
|
|
|
|
var files = $('tr').filterAttr('data-file',file); |
|
|
|
|
var files = $('tr[data-file="'+file+'"]'); |
|
|
|
|
files.remove(); |
|
|
|
|
files.find('input[type="checkbox"]').removeAttr('checked'); |
|
|
|
|
files.removeClass('selected'); |
|
|
|
@ -533,14 +553,14 @@ var FileList={ |
|
|
|
|
FileList.updateEmptyContent(); |
|
|
|
|
} else { |
|
|
|
|
$.each(files,function(index,file) { |
|
|
|
|
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); |
|
|
|
|
var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete"); |
|
|
|
|
deleteAction.removeClass('progress-icon').addClass('delete-icon'); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
createFileSummary: function() { |
|
|
|
|
if( $('#fileList tr').length > 0 ) { |
|
|
|
|
if ( $('#fileList tr').exists() ) { |
|
|
|
|
var totalDirs = 0; |
|
|
|
|
var totalFiles = 0; |
|
|
|
|
var totalSize = 0; |
|
|
|
@ -562,7 +582,7 @@ var FileList={ |
|
|
|
|
var infoVars = { |
|
|
|
|
dirs: '<span class="dirinfo">'+directoryInfo+'</span><span class="connector">', |
|
|
|
|
files: '</span><span class="fileinfo">'+fileInfo+'</span>' |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var info = t('files', '{dirs} and {files}', infoVars); |
|
|
|
|
|
|
|
|
@ -648,13 +668,13 @@ var FileList={ |
|
|
|
|
var $fileList = $('#fileList'); |
|
|
|
|
var permissions = $('#permissions').val(); |
|
|
|
|
var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; |
|
|
|
|
$('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0); |
|
|
|
|
$('#filestable th').toggleClass('hidden', $fileList.find('tr').length === 0); |
|
|
|
|
$('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').exists()); |
|
|
|
|
$('#filestable th').toggleClass('hidden', $fileList.find('tr').exists() === false); |
|
|
|
|
}, |
|
|
|
|
showMask: function() { |
|
|
|
|
// in case one was shown before
|
|
|
|
|
var $mask = $('#content .mask'); |
|
|
|
|
if ($mask.length){ |
|
|
|
|
if ($mask.exists()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -678,13 +698,13 @@ var FileList={ |
|
|
|
|
}, |
|
|
|
|
scrollTo:function(file) { |
|
|
|
|
//scroll to and highlight preselected file
|
|
|
|
|
var scrolltorow = $('tr[data-file="'+file+'"]'); |
|
|
|
|
if (scrolltorow.length > 0) { |
|
|
|
|
scrolltorow.addClass('searchresult'); |
|
|
|
|
$(window).scrollTop(scrolltorow.position().top); |
|
|
|
|
var $scrolltorow = $('tr[data-file="'+file+'"]'); |
|
|
|
|
if ($scrolltorow.exists()) { |
|
|
|
|
$scrolltorow.addClass('searchresult'); |
|
|
|
|
$(window).scrollTop($scrolltorow.position().top); |
|
|
|
|
//remove highlight when hovered over
|
|
|
|
|
scrolltorow.one('hover', function(){ |
|
|
|
|
scrolltorow.removeClass('searchresult'); |
|
|
|
|
$scrolltorow.one('hover', function() { |
|
|
|
|
$scrolltorow.removeClass('searchresult'); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -698,7 +718,7 @@ var FileList={ |
|
|
|
|
}); |
|
|
|
|
//do not use scrollto to prevent removing searchresult css class
|
|
|
|
|
var first = $('#fileList tr.searchresult').first(); |
|
|
|
|
if (first.length !== 0) { |
|
|
|
|
if (first.exists()) { |
|
|
|
|
$(window).scrollTop(first.position().top); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -728,7 +748,7 @@ $(document).ready(function(){ |
|
|
|
|
// if from file list, need to prepend parent dir
|
|
|
|
|
if (dir) { |
|
|
|
|
var parentDir = $('#dir').val() || '/'; |
|
|
|
|
if (parentDir[parentDir.length - 1] != '/'){ |
|
|
|
|
if (parentDir[parentDir.length - 1] !== '/') { |
|
|
|
|
parentDir += '/'; |
|
|
|
|
} |
|
|
|
|
dir = parentDir + dir; |
|
|
|
@ -833,7 +853,7 @@ $(document).ready(function(){ |
|
|
|
|
} |
|
|
|
|
var date=new Date(); |
|
|
|
|
var param = {}; |
|
|
|
|
if ($('#publicUploadRequestToken').length) { |
|
|
|
|
if ($('#publicUploadRequestToken').exists()) { |
|
|
|
|
param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + file.name; |
|
|
|
|
} |
|
|
|
|
//should the file exist in the list remove it
|
|
|
|
@ -890,7 +910,7 @@ $(document).ready(function(){ |
|
|
|
|
$('#notification').on('click', '.undo', function() { |
|
|
|
|
if (FileList.deleteFiles) { |
|
|
|
|
$.each(FileList.deleteFiles,function(index,file) { |
|
|
|
|
$('tr').filterAttr('data-file',file).show(); |
|
|
|
|
$('tr[data-file="'+file+'"]').show(); |
|
|
|
|
}); |
|
|
|
|
FileList.deleteCanceled=true; |
|
|
|
|
FileList.deleteFiles=null; |
|
|
|
@ -900,10 +920,10 @@ $(document).ready(function(){ |
|
|
|
|
FileList.deleteCanceled = false; |
|
|
|
|
FileList.deleteFiles = [FileList.replaceOldName]; |
|
|
|
|
} else { |
|
|
|
|
$('tr').filterAttr('data-file', FileList.replaceOldName).show(); |
|
|
|
|
$('tr[data-file="'+FileList.replaceOldName+'"]').show(); |
|
|
|
|
} |
|
|
|
|
$('tr').filterAttr('data-replace', 'true').remove(); |
|
|
|
|
$('tr').filterAttr('data-file', FileList.replaceNewName).show(); |
|
|
|
|
$('tr[data-replace="true"').remove(); |
|
|
|
|
$('tr[data-file="'+FileList.replaceNewName+'"]').show(); |
|
|
|
|
FileList.replaceCanceled = true; |
|
|
|
|
FileList.replaceOldName = null; |
|
|
|
|
FileList.replaceNewName = null; |
|
|
|
@ -918,7 +938,7 @@ $(document).ready(function(){ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
$('#notification:first-child').on('click', '.suggest', function() { |
|
|
|
|
$('tr').filterAttr('data-file', $('#notification > span').attr('data-oldName')).show(); |
|
|
|
|
$('tr[data-file="'+$('#notification > span').attr('data-oldName')+'"]').show(); |
|
|
|
|
OC.Notification.hide(); |
|
|
|
|
}); |
|
|
|
|
$('#notification:first-child').on('click', '.cancel', function() { |
|
|
|
@ -986,7 +1006,7 @@ $(document).ready(function(){ |
|
|
|
|
if (targetDir) { |
|
|
|
|
FileList.changeDirectory(targetDir, false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (parseInt($('#ajaxLoad').val(), 10) === 1) { |
|
|
|
|
// need to initially switch the dir to the one from the hash (IE8)
|
|
|
|
|