Skip to content

Commit

Permalink
merge master into filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Jan 30, 2013
2 parents 95352fb + 2fbf3d4 commit 207aa22
Show file tree
Hide file tree
Showing 328 changed files with 11,817 additions and 9,739 deletions.
6 changes: 3 additions & 3 deletions apps/files/ajax/move.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
OCP\JSON::callCheck();

// Get data
$dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$target = stripslashes(rawurldecode($_GET["target"]));
$dir = stripslashes($_POST["dir"]);
$file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));

if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
Expand Down
12 changes: 11 additions & 1 deletion apps/files/css/files.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
#fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */
background:rgba(248,248,248,.9); box-shadow:-5px 0 7px rgba(248,248,248,.9);
}
#fileList tr.selected:hover .fileactions { /* slightly darker color for selected rows */
#fileList tr.selected:hover .fileactions, #fileList tr.mouseOver .fileactions { /* slightly darker color for selected rows */
background:rgba(238,238,238,.9); box-shadow:-5px 0 7px rgba(238,238,238,.9);
}
#fileList .fileactions a.action img { position:relative; top:.2em; }
Expand All @@ -123,6 +123,16 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }

div.crumb a{ padding:0.9em 0 0.7em 0; }

table.dragshadow {
width:auto;
}
table.dragshadow td.filename {
padding-left:36px;
padding-right:16px;
}
table.dragshadow td.size {
padding-right:8px;
}
#upgrade {
width: 400px;
position: absolute;
Expand Down
132 changes: 109 additions & 23 deletions apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ $(document).ready(function() {
$('#uploadprogressbar').progressbar('value',progress);
},
start: function(e, data) {
//IE < 10 does not fire the necessary events for the progress bar.
if($.browser.msie && parseInt($.browser.version) < 10) {
return;
}
$('#uploadprogressbar').progressbar({value:0});
$('#uploadprogressbar').fadeIn();
if(data.dataType != 'iframe ') {
Expand Down Expand Up @@ -801,32 +805,101 @@ function updateBreadcrumb(breadcrumbHtml) {
$('p.nav').empty().html(breadcrumbHtml);
}

//options for file drag/dropp
var createDragShadow = function(event){
//select dragged file
var isDragSelected = $(event.target).parents('tr').find('td input:first').prop('checked');
if (!isDragSelected) {
//select dragged file
$(event.target).parents('tr').find('td input:first').prop('checked',true);
}

var selectedFiles = getSelectedFiles();

if (!isDragSelected && selectedFiles.length == 1) {
//revert the selection
$(event.target).parents('tr').find('td input:first').prop('checked',false);
}

//also update class when we dragged more than one file
if (selectedFiles.length > 1) {
$(event.target).parents('tr').addClass('selected');
}

// build dragshadow
var dragshadow = $('<table class="dragshadow"></table>');
var tbody = $('<tbody></tbody>');
dragshadow.append(tbody);

var dir=$('#dir').val();

$(selectedFiles).each(function(i,elem){
var newtr = $('<tr data-dir="'+dir+'" data-filename="'+elem.name+'">'
+'<td class="filename">'+elem.name+'</td><td class="size">'+humanFileSize(elem.size)+'</td>'
+'</tr>');
tbody.append(newtr);
if (elem.type === 'dir') {
newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')');
} else {
getMimeIcon(elem.mime,function(path){
newtr.find('td.filename').attr('style','background-image:url('+path+')');
});
}
});

return dragshadow;
}

//options for file drag/drop
var dragOptions={
distance: 20, revert: 'invalid', opacity: 0.7, helper: 'clone',
revert: 'invalid', revertDuration: 300,
opacity: 0.7, zIndex: 100, appendTo: 'body', cursorAt: { left: -5, top: -5 },
helper: createDragShadow, cursor: 'move',
stop: function(event, ui) {
$('#fileList tr td.filename').addClass('ui-draggable');
}
};
}

var folderDropOptions={
drop: function( event, ui ) {
var file=ui.draggable.parent().data('file');
var target=$(this).find('.nametext').text().trim();
var dir=$('#dir').val();
$.ajax({
url: OC.filePath('files', 'ajax', 'move.php'),
data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(dir)+'/'+encodeURIComponent(target),
complete: function(data){boolOperationFinished(data, function(){
var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename');
el.draggable('destroy');
FileList.remove(file);
});}
//don't allow moving a file into a selected folder
if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) {
return false;
}

var target=$.trim($(this).find('.nametext').text());

var files = ui.helper.find('tr');
$(files).each(function(i,row){
var dir = $(row).data('dir');
var file = $(row).data('filename');
$.post(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: dir+'/'+target }, function(result) {
if (result) {
if (result.status === 'success') {
//recalculate folder size
var oldSize = $('#fileList tr').filterAttr('data-file',target).data('size');
var newSize = oldSize + $('#fileList tr').filterAttr('data-file',file).data('size');
$('#fileList tr').filterAttr('data-file',target).data('size', newSize);
$('#fileList tr').filterAttr('data-file',target).find('td.filesize').text(humanFileSize(newSize));

FileList.remove(file);
procesSelection();
$('#notification').hide();
} else {
$('#notification').hide();
$('#notification').text(result.data.message);
$('#notification').fadeIn();
}
} else {
OC.dialogs.alert(t('Error moving file'));
}
});
});
}
},
tolerance: 'pointer'
}

var crumbDropOptions={
drop: function( event, ui ) {
var file=ui.draggable.parent().data('file');
var target=$(this).data('dir');
var dir=$('#dir').val();
while(dir.substr(0,1)=='/'){//remove extra leading /'s
Expand All @@ -839,12 +912,25 @@ var crumbDropOptions={
if(target==dir || target+'/'==dir){
return;
}
$.ajax({
url: OC.filePath('files', 'ajax', 'move.php'),
data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(target),
complete: function(data){boolOperationFinished(data, function(){
FileList.remove(file);
});}
var files = ui.helper.find('tr');
$(files).each(function(i,row){
var dir = $(row).data('dir');
var file = $(row).data('filename');
$.post(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: target }, function(result) {
if (result) {
if (result.status === 'success') {
FileList.remove(file);
procesSelection();
$('#notification').hide();
} else {
$('#notification').hide();
$('#notification').text(result.data.message);
$('#notification').fadeIn();
}
} else {
OC.dialogs.alert(t('Error moving file'));
}
});
});
},
tolerance: 'pointer'
Expand Down Expand Up @@ -951,7 +1037,7 @@ function getUniqueName(name){
num=parseInt(numMatch[numMatch.length-1])+1;
base=base.split('(')
base.pop();
base=base.join('(').trim();
base=$.trim(base.join('('));
}
name=base+' ('+num+')';
if (extension) {
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/cs_CZ.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Žádný soubor nebyl odeslán",
"Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk selhal",
"Not enough storage available" => "Nedostatek dostupného úložného prostoru",
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
"Unshare" => "Zrušit sdílení",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' je neplatným názvem souboru.",
"File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neplatný název, znaky '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nejsou povoleny.",
"Your storage is full, files can not be updated or synced anymore!" => "Vaše úložiště je plné, nelze aktualizovat ani synchronizovat soubory.",
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložiště je téměř plné ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Vaše soubory ke stažení se připravují. Pokud jsou velké může to chvíli trvat.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nelze odeslat Váš soubor, protože je to adresář nebo má velikost 0 bajtů",
"Upload Error" => "Chyba odesílání",
Expand Down
11 changes: 11 additions & 0 deletions apps/files/l10n/da.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Kunne ikke flytte %s - der findes allerede en fil med dette navn",
"Could not move %s" => "Kunne ikke flytte %s",
"Unable to rename file" => "Kunne ikke omdøbe fil",
"No file was uploaded. Unknown error" => "Ingen fil blev uploadet. Ukendt fejl.",
"There is no error, the file uploaded with success" => "Der er ingen fejl, filen blev uploadet med success",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Den uploadede fil overstiger upload_max_filesize direktivet i php.ini",
Expand All @@ -7,6 +10,8 @@
"No file was uploaded" => "Ingen fil blev uploadet",
"Missing a temporary folder" => "Mangler en midlertidig mappe",
"Failed to write to disk" => "Fejl ved skrivning til disk.",
"Not enough storage available" => "Der er ikke nok plads til rådlighed",
"Invalid directory." => "Ugyldig mappe.",
"Files" => "Filer",
"Unshare" => "Fjern deling",
"Delete" => "Slet",
Expand All @@ -20,7 +25,12 @@
"replaced {new_name} with {old_name}" => "erstattede {new_name} med {old_name}",
"unshared {files}" => "ikke delte {files}",
"deleted {files}" => "slettede {files}",
"'.' is an invalid file name." => "'.' er et ugyldigt filnavn.",
"File name cannot be empty." => "Filnavnet kan ikke stå tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldigt navn, '\\', '/', '<', '>', ':' | '?', '\"', '', og '*' er ikke tilladt.",
"Your storage is full, files can not be updated or synced anymore!" => "Din opbevaringsplads er fyldt op, filer kan ikke opdateres eller synkroniseres længere!",
"Your storage is almost full ({usedSpacePercent}%)" => "Din opbevaringsplads er næsten fyldt op ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Dit download forberedes. Dette kan tage lidt tid ved større filer.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kunne ikke uploade din fil, da det enten er en mappe eller er tom",
"Upload Error" => "Fejl ved upload",
"Close" => "Luk",
Expand All @@ -30,6 +40,7 @@
"Upload cancelled." => "Upload afbrudt.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
"URL cannot be empty." => "URLen kan ikke være tom.",
"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "Ugyldigt mappenavn. Brug af \"Shared\" er forbeholdt Owncloud",
"{count} files scanned" => "{count} filer skannet",
"error while scanning" => "fejl under scanning",
"Name" => "Navn",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Temporärer Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough storage available" => "Nicht genug Speicherplatz verfügbar",
"Invalid directory." => "Ungültiges Verzeichnis",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicherplatz ist voll, Dateien können nicht mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicherplatz ist fast aufgebraucht ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Dein Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Deine Datei kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist.",
"Upload Error" => "Fehler beim Upload",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/de_DE.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Der temporäre Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough storage available" => "Nicht genug Speicher vorhanden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll. Daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei größeren Dateien einen Moment dauern.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Ihre Datei kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist.",
"Upload Error" => "Fehler beim Upload",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/el.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Κανένα αρχείο δεν στάλθηκε",
"Missing a temporary folder" => "Λείπει ο προσωρινός φάκελος",
"Failed to write to disk" => "Αποτυχία εγγραφής στο δίσκο",
"Not enough storage available" => "Μη επαρκής διαθέσιμος αποθηκευτικός χώρος",
"Invalid directory." => "Μη έγκυρος φάκελος.",
"Files" => "Αρχεία",
"Unshare" => "Διακοπή κοινής χρήσης",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' είναι μη έγκυρο όνομα αρχείου.",
"File name cannot be empty." => "Το όνομα αρχείου δεν πρέπει να είναι κενό.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Μη έγκυρο όνομα, '\\', '/', '<', '>', ':', '\"', '|', '?' και '*' δεν επιτρέπονται.",
"Your storage is full, files can not be updated or synced anymore!" => "Ο αποθηκευτικός σας χώρος είναι γεμάτος, τα αρχεία δεν μπορούν να ενημερωθούν ή να συγχρονιστούν πια!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ο αποθηκευτικός χώρος είναι σχεδόν γεμάτος ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην αποστολή του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes",
"Upload Error" => "Σφάλμα Αποστολής",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/fi_FI.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"No file was uploaded" => "Yhtäkään tiedostoa ei lähetetty",
"Missing a temporary folder" => "Väliaikaiskansiota ei ole olemassa",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
"Not enough storage available" => "Tallennustilaa ei ole riittävästi käytettävissä",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
"Unshare" => "Peru jakaminen",
Expand All @@ -22,6 +23,8 @@
"'.' is an invalid file name." => "'.' on virheellinen nimi tiedostolle.",
"File name cannot be empty." => "Tiedoston nimi ei voi olla tyhjä.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Virheellinen nimi, merkit '\\', '/', '<', '>', ':', '\"', '|', '?' ja '*' eivät ole sallittuja.",
"Your storage is full, files can not be updated or synced anymore!" => "Tallennustila on loppu, tiedostoja ei voi enää päivittää tai synkronoida!",
"Your storage is almost full ({usedSpacePercent}%)" => "Tallennustila on melkein loppu ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Lataustasi valmistellaan. Tämä saattaa kestää hetken, jos tiedostot ovat suuria kooltaan.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Tiedoston lähetys epäonnistui, koska sen koko on 0 tavua tai kyseessä on kansio",
"Upload Error" => "Lähetysvirhe.",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Aucun fichier n'a été téléversé",
"Missing a temporary folder" => "Il manque un répertoire temporaire",
"Failed to write to disk" => "Erreur d'écriture sur le disque",
"Not enough storage available" => "Plus assez d'espace de stockage disponible",
"Invalid directory." => "Dossier invalide.",
"Files" => "Fichiers",
"Unshare" => "Ne plus partager",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' n'est pas un nom de fichier valide.",
"File name cannot be empty." => "Le nom de fichier ne peut être vide.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nom invalide, les caractères '\\', '/', '<', '>', ':', '\"', '|', '?' et '*' ne sont pas autorisés.",
"Your storage is full, files can not be updated or synced anymore!" => "Votre espage de stockage est plein, les fichiers ne peuvent plus être téléversés ou synchronisés !",
"Your storage is almost full ({usedSpacePercent}%)" => "Votre espace de stockage est presque plein ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Votre téléchargement est cours de préparation. Ceci peut nécessiter un certain temps si les fichiers sont volumineux.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible de charger vos fichiers car il s'agit d'un dossier ou le fichier fait 0 octet.",
"Upload Error" => "Erreur de chargement",
Expand Down
3 changes: 3 additions & 0 deletions apps/files/l10n/hu_HU.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"No file was uploaded" => "Nem töltődött fel semmi",
"Missing a temporary folder" => "Hiányzik egy ideiglenes mappa",
"Failed to write to disk" => "Nem sikerült a lemezre történő írás",
"Not enough storage available" => "Nincs elég szabad hely.",
"Invalid directory." => "Érvénytelen mappa.",
"Files" => "Fájlok",
"Unshare" => "Megosztás visszavonása",
Expand All @@ -27,6 +28,8 @@
"'.' is an invalid file name." => "'.' fájlnév érvénytelen.",
"File name cannot be empty." => "A fájlnév nem lehet semmi.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Érvénytelen elnevezés. Ezek a karakterek nem használhatók: '\\', '/', '<', '>', ':', '\"', '|', '?' és '*'",
"Your storage is full, files can not be updated or synced anymore!" => "A tároló tele van, a fájlok nem frissíthetőek vagy szinkronizálhatóak a jövőben.",
"Your storage is almost full ({usedSpacePercent}%)" => "A tároló majdnem tele van ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Készül a letöltendő állomány. Ez eltarthat egy ideig, ha nagyok a fájlok.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nem tölthető fel, mert mappa volt, vagy 0 byte méretű",
"Upload Error" => "Feltöltési hiba",
Expand Down
Loading

0 comments on commit 207aa22

Please sign in to comment.