diff --git a/js/clipboard.js b/js/clipboard.js index 31bf72d..49bd93b 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -69,7 +69,6 @@ $(document).ready(function () { update(); } } -<<<<<<< HEAD function update(blink) { var permissions = parseInt($('#permissions').val()); @@ -79,7 +78,7 @@ $(document).ready(function () { if (clipboard) { var sameDirectory = clipboard.directory == $dir.val(), - noPermissions = !(permissions & OC.PERMISSION_WRITE), + noPermissions = !(permissions & OC.PERMISSION_CREATE), disabled = noPermissions || sameDirectory, title; if (sameDirectory) title = t(appid, 'Unable to paste: the files come from this directory.') @@ -105,48 +104,12 @@ $(document).ready(function () { } } else { $paste.hide(); -======= -} - -function update(blink) { - var permissions = parseInt($('#permissions').val()); - - $cut.toggle((permissions & OC.PERMISSION_READ && permissions & OC.PERMISSION_UPDATE) != 0); - $copy.toggle((permissions & OC.PERMISSION_READ) != 0); - - if (clipboard) { - var sameDirectory = clipboard.directory == $dir.val(), - noPermissions = !(permissions & OC.PERMISSION_CREATE), - disabled = noPermissions || sameDirectory, - title; - if (sameDirectory) title = t(appid, 'Unable to paste: the files come from this directory.') - else if (noPermissions) title = t(appid, 'Unable to paste: you do not have the permissions to create files in this directory.') - else title = n(appid, 'Paste %n item', 'Paste %n items', clipboard.files.length); - - $paste - .toggleClass('disabled', disabled) - .attr('title', title) - .tipsy({gravity:'ne', fade:true}) - .show(); - - if (clipboard.operation == 'cut' && clipboard.directory == $dir.val()) { - var $trs = $('tr', $fileList); - clipboard.files.forEach(function(file) { - $trs.filterAttr('data-file', file).addClass('cut'); - }); - } - - if (blink === true) { - $paste.addClass('blink'); - setTimeout(function () { $paste.removeClass('blink'); }, 500); ->>>>>>> master } }; function clearCut() { $('tr[data-file]', $fileList).removeClass('cut'); } -<<<<<<< HEAD function cut(file) { var files = file ? [file] : FileList.getSelectedFiles().map(function (file) { return file.name; }); @@ -206,8 +169,8 @@ function update(blink) { var rejectedFiles = results.filter(function (item) { return item !== true }); if (rejectedFiles.length) { var message; - if (clipboard.operation == 'cut') message = '' + n(appid, "%n error occurred during the move:", "%n errors occurred during the move:", rejectedFiles.length) + ''; - else message = '' + n(appid, "%n error occurred during the copy:", "%n errors occurred during the copy:", rejectedFiles.length) + ''; + if (clipboard.operation == 'cut') message = '' + t(appid, "An error occurred during the move.") + ''; + else message = '' + t(appid, "An error occurred during the copy.") + ''; message += '
';
for (var i = rejectedFiles.length - 1; i >= 0; --i) message += rejectedFiles[i] + '
';
message += '