Skip to content

Commit

Permalink
Merge branch 'master' into 0.7
Browse files Browse the repository at this point in the history
Conflicts:
	js/clipboard.js
  • Loading branch information
leizh committed Jan 13, 2018
2 parents 535298d + 027bb29 commit ff0879c
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 6 deletions.
92 changes: 92 additions & 0 deletions js/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ $(document).ready(function () {
update();
}
}
<<<<<<< HEAD

function update(blink) {
var permissions = parseInt($('#permissions').val());
Expand Down Expand Up @@ -104,12 +105,48 @@ $(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; });
Expand Down Expand Up @@ -179,6 +216,61 @@ $(document).ready(function () {
if (clipboard.operation == 'cut') {
sessionStorage.removeItem(appid);
clipboard = null;
=======
};

function clearCut() {
$('tr[data-file]', $fileList).removeClass('cut');
}

function cut (file) {
var files = file ? [ file ] : FileList.getSelectedFiles().map(function(file) { return file.name; });
clipboard = { operation: 'cut', directory: $dir.val(), files: files };
sessionStorage.setItem(appid, JSON.stringify(clipboard));
clearCut();
clearSelection();
update(true);
}

function copy (file) {
var files = file ? [ file ] : FileList.getSelectedFiles().map(function(file) { return file.name; });
clipboard = { operation: 'copy', directory: $dir.val(), files: files };
sessionStorage.setItem(appid, JSON.stringify(clipboard));
clearCut();
clearSelection();
update(true);
}

function clearSelection() {
$('tr[data-file]', $fileList).removeClass('selected');
$('tr[data-file] input[type="checkbox"]', $fileList).removeAttr('checked');
FileList._selectedFiles = {};
FileList._selectionSummary.clear();
FileList.updateSelectionSummary();
}

function paste() {
if ($(this).hasClass('disabled')) return;
FileList.showMask();
clipboard.destination = $dir.val();
$(window).on('beforeunload', processing);
replaceExistingFiles(function(replace) {
if (!replace) FileList.hideMask();
else $.ajax({
type: 'POST',
url: OC.filePath(appid, 'ajax', 'clipboard.php'),
data: clipboard,
success: function (data) {
if (data.status == 'error') {
var message;
if (data.messages.length === 1) {
message = data.messages[0];
} else {
if (clipboard.operation == 'cut') {
message = '<b>An error occurred during the move.</b>';
} else {
message = '<b>An error occurred during the copy.</b>';
>>>>>>> master
}
$(window).off('beforeunload', processing);
FileList.reload();
Expand Down
2 changes: 1 addition & 1 deletion l10n/de/files_clipboard.po
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ msgid "An error occurred during the move."
msgstr "Beim verschieben ist ein Fehler aufgetreten."

#: js/clipboard.js:132
msgid "Une erreur s'est produite during the copy."
msgid "An error occurred during the copy."
msgstr "Beim kopieren ist ein Fehler aufgetreten."

#: js/clipboard.js:153
Expand Down
2 changes: 1 addition & 1 deletion l10n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OC.L10N.register(
"Unable to paste: you do not have the permissions to create files in this directory." : "No se ha podido copiar: no tienes permisos para crear archivos en esta carpeta.",
"_Paste %n item_::_Paste %n items_" : "[ Pegar %n objeto,Pegar %n objetos]",
"An error occurred during the move." : "Ha ocurrido un error al mover.",
"Une erreur s'est produite during the copy." : "Ha ocurrido un error al copiar.",
"An error occurred during the copy." : "Ha ocurrido un error al copiar.",
"Processing. Leaving the page now will interrupt the move." : "Procesando. Abandonar la página ahora interrumpirá la acción de mover.",
"Processing. Leaving the page now will interrupt the copy." : "Procesando. Abandonar la página ahora interrumpirá la copia.",
"The contents of the clipboard is in conflicts with elements already present in this directory. Do you want to replace them ?" : "Los contenidos del portapapeles está en conflicto con elementos ya presentes en esta carpeta. ¿Quieres reemplazarlos?"
Expand Down
2 changes: 1 addition & 1 deletion l10n/es.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translations":{"Could not remove '%s'":"No se ha podido eliminar '%s'","Could not move '%s'":"No se ha podido mover '%s'","Could not copy '%s'":"No se ha podido copiar '%s'","Cut":"Cortar","Copy":"Copiar","Paste":"Pegar","Unable to paste: the files come from this directory.":"No se ha podido pegar: los archivos vienen de esta carpeta.","Unable to paste: you do not have the permissions to create files in this directory.":"No se ha podido copiar: no tienes permisos para crear archivos en esta carpeta.","_Paste %n item_::_Paste %n items_":["Pegar %n objeto","Pegar %n objetos"],"An error occurred during the move.":"Ha ocurrido un error al mover.","Une erreur s'est produite during the copy.":"Ha ocurrido un error al copiar.","Processing. Leaving the page now will interrupt the move.":"Procesando. Abandonar la p\u00e1gina ahora interrumpir\u00e1 la acci\u00f3n de mover.","Processing. Leaving the page now will interrupt the copy.":"Procesando. Abandonar la p\u00e1gina ahora interrumpir\u00e1 la copia.","The contents of the clipboard is in conflicts with elements already present in this directory. Do you want to replace them ?":"Los contenidos del portapapeles est\u00e1 en conflicto con elementos ya presentes en esta carpeta. \u00bfQuieres reemplazarlos?"},"pluralForm":""}
{"translations":{"Could not remove '%s'":"No se ha podido eliminar '%s'","Could not move '%s'":"No se ha podido mover '%s'","Could not copy '%s'":"No se ha podido copiar '%s'","Cut":"Cortar","Copy":"Copiar","Paste":"Pegar","Unable to paste: the files come from this directory.":"No se ha podido pegar: los archivos vienen de esta carpeta.","Unable to paste: you do not have the permissions to create files in this directory.":"No se ha podido copiar: no tienes permisos para crear archivos en esta carpeta.","_Paste %n item_::_Paste %n items_":["Pegar %n objeto","Pegar %n objetos"],"An error occurred during the move.":"Ha ocurrido un error al mover.","An error occurred during the copy.":"Ha ocurrido un error al copiar.","Processing. Leaving the page now will interrupt the move.":"Procesando. Abandonar la p\u00e1gina ahora interrumpir\u00e1 la acci\u00f3n de mover.","Processing. Leaving the page now will interrupt the copy.":"Procesando. Abandonar la p\u00e1gina ahora interrumpir\u00e1 la copia.","The contents of the clipboard is in conflicts with elements already present in this directory. Do you want to replace them ?":"Los contenidos del portapapeles est\u00e1 en conflicto con elementos ya presentes en esta carpeta. \u00bfQuieres reemplazarlos?"},"pluralForm":""}
2 changes: 1 addition & 1 deletion l10n/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Unable to paste: you do not have the permissions to create files in this directory." => "No se ha podido copiar: no tienes permisos para crear archivos en esta carpeta.",
"_Paste %n item_::_Paste %n items_" => array("Pegar %n objeto","Pegar %n objetos"),
"An error occurred during the move." => "Ha ocurrido un error al mover.",
"Une erreur s'est produite during the copy." => "Ha ocurrido un error al copiar.",
"An error occurred during the copy." => "Ha ocurrido un error al copiar.",
"Processing. Leaving the page now will interrupt the move." => "Procesando. Abandonar la página ahora interrumpirá la acción de mover.",
"Processing. Leaving the page now will interrupt the copy." => "Procesando. Abandonar la página ahora interrumpirá la copia.",
"The contents of the clipboard is in conflicts with elements already present in this directory. Do you want to replace them ?" => "Los contenidos del portapapeles está en conflicto con elementos ya presentes en esta carpeta. ¿Quieres reemplazarlos?"
Expand Down
2 changes: 1 addition & 1 deletion l10n/es/files_clipboard.po
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ msgid "An error occurred during the move."
msgstr "Ha ocurrido un error al mover."

#: js/clipboard.js:132
msgid "Une erreur s'est produite during the copy."
msgid "An error occurred during the copy."
msgstr "Ha ocurrido un error al copiar."

#: js/clipboard.js:153
Expand Down
92 changes: 92 additions & 0 deletions l10n/nl/files_clipboard.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#
# Translators:
# Casper <casper@vrije-mens.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: ownCloud files_clipboard\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
"POT-Creation-Date: 2018-01-11 18:54+0100\n"
"PO-Revision-Date: 2018-01-11 06:18+0000\n"
"Last-Translator: Casper <casper@vrije-mens.org>\n"
"Language-Team: Dutch\n"
"Language: nl_NL\n"
"Plural-Forms: nplurals=2; plural=n!=1\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Loco-Source-Locale: nl_NL\n"
"X-Loco-Parser: loco_parse_po\n"
"X-Generator: Loco - https://localise.biz/"

#: ajax/clipboard.php:48
#, php-format
msgid "Could not remove '%s'"
msgstr "Kon '%s' niet verwijderen."

#: ajax/clipboard.php:55
#, php-format
msgid "Could not move '%s'"
msgstr "Kon '%s' niet verplaatsen."

#: ajax/clipboard.php:59
#, php-format
msgid "Could not copy '%s'"
msgstr "Kon '%s' niet kopiëren."

#: js/clipboard.js:11
msgid "Cut"
msgstr "Knippen"

#: js/clipboard.js:19
msgid "Copy"
msgstr "Kopiëren"

#: js/clipboard.js:26 js/clipboard.js:165
msgid "Paste"
msgstr "Plakken"

#: js/clipboard.js:63
msgid "Unable to paste: the files come from this directory."
msgstr "Plakken niet mogelijk: de bestanden stammen uit deze folder."

#: js/clipboard.js:64
msgid ""
"Unable to paste: you do not have the permissions to create files in this "
"directory."
msgstr ""
"Plakken niet mogelijk: U heeft geen toestemming om bestanden in deze "
"folder aan te maken."

#: js/clipboard.js:65
#, c-format
msgid "Paste %n item"
msgid_plural "Paste %n items"
msgstr[0] "Een item plakken"
msgstr[1] "%n items einfügen"

#: js/clipboard.js:131
msgid "An error occurred during the move."
msgstr "Bij het verplaatsen is een fout opgetreden."

#: js/clipboard.js:132
msgid "An error occurred during the copy."
msgstr "Bij het kopiëren is een fout opgetreden."

#: js/clipboard.js:153
msgid "Processing. Leaving the page now will interrupt the move."
msgstr ""
"Verwerking: Als u de pagina nu verlaat, dan wordt het verplaatsen "
"afgebroken."

#: js/clipboard.js:154
msgid "Processing. Leaving the page now will interrupt the copy."
msgstr ""
"Verwerking: Als u de pagina nu verlaat, dan wordt het kopiëren afgebroken."

#: js/clipboard.js:164
msgid ""
"The contents of the clipboard is in conflicts with elements already present "
"in this directory. Do you want to replace them ?"
msgstr ""
"De inhoud van het prikbord conflicteert met items die reeds in deze folder "
"aanwezig zijn. Wilt u ze vervangen?"
2 changes: 1 addition & 1 deletion l10n/templates/files_clipboard.pot
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ msgid "An error occurred during the move."
msgstr ""

#: js/clipboard.js:132
msgid "Une erreur s'est produite during the copy."
msgid "An error occurred during the copy."
msgstr ""

#: js/clipboard.js:153
Expand Down

0 comments on commit ff0879c

Please sign in to comment.