diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 0920bf62109..45fb17de94a 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -110,30 +110,35 @@ if (strpos($dir, '..') === false) { || (isset($_POST['resolution']) && $_POST['resolution']==='replace') ) { // upload and overwrite file - if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { - - // updated max file size after upload - $storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir); - - $meta = \OC\Files\Filesystem::getFileInfo($target); - if ($meta === false) { - $error = $l->t('Upload failed. Could not get file info.'); + try + { + if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { + + // updated max file size after upload + $storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir); + + $meta = \OC\Files\Filesystem::getFileInfo($target); + if ($meta === false) { + $error = $l->t('Upload failed. Could not get file info.'); + } else { + $result[] = array('status' => 'success', + 'mime' => $meta['mimetype'], + 'mtime' => $meta['mtime'], + 'size' => $meta['size'], + 'id' => $meta['fileid'], + 'name' => basename($target), + 'originalname' => $files['tmp_name'][$i], + 'uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, + 'permissions' => $meta['permissions'], + ); + } + } else { - $result[] = array('status' => 'success', - 'mime' => $meta['mimetype'], - 'mtime' => $meta['mtime'], - 'size' => $meta['size'], - 'id' => $meta['fileid'], - 'name' => basename($target), - 'originalname' => $files['tmp_name'][$i], - 'uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize, - 'permissions' => $meta['permissions'], - ); + $error = $l->t('Upload failed. Could not find uploaded file'); } - - } else { - $error = $l->t('Upload failed. Could not find uploaded file'); + } catch(Exception $ex) { + $error = $ex->getMessage(); } } else { @@ -164,5 +169,5 @@ if ($error === false) { OCP\JSON::encodedPrint($result); exit(); } else { - OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats))); + OCP\JSON::error(array(array('data' => array_merge(array('message' => $error), $storageStats)))); } diff --git a/apps/files/css/files.css b/apps/files/css/files.css index cbf34279f54..ac2a243f2b4 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -105,8 +105,6 @@ table th#headerDate, table td.date { box-sizing: border-box; position: relative; min-width: 11em; - display: block; - height: 51px; } /* Multiselect bar */ @@ -161,8 +159,6 @@ table td.filename .nametext, .uploadtext, .modified { float:left; padding:.3em 0 } .modified { position: relative; - top: 11px; - left: 5px; } /* TODO fix usability bug (accidental file/folder selection) */ @@ -178,6 +174,9 @@ table td.filename .nametext { table td.filename .uploadtext { font-weight:normal; margin-left:.5em; } table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } +.ie8 input[type="checkbox"]{ + padding: 0; +} /* File checkboxes */ #fileList tr td.filename>input[type="checkbox"]:first-child { @@ -240,22 +239,12 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } top: 14px; right: 0; } -#fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */ - background-color: rgba(240,240,240,0.898); - box-shadow: -5px 0 7px rgba(240,240,240,0.898); -} -#fileList tr.selected:hover .fileactions, #fileList tr.mouseOver .fileactions { /* slightly darker color for selected rows */ - background-color: rgba(230,230,230,.9); - box-shadow: -5px 0 7px rgba(230,230,230,.9); -} #fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; } #fileList a.action.delete { position: absolute; right: 0; - top: 0; - margin: 0; - padding: 15px 14px 19px !important; + padding: 9px 14px 19px !important; } a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index f1ef485fc3d..c03e9037cec 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -345,7 +345,7 @@ $(document).ready(function() { } else if (result[0].status !== 'success') { //delete data.jqXHR; data.textStatus = 'servererror'; - data.errorThrown = result.data.message; // error message has been translated on server + data.errorThrown = result[0].data.message; // error message has been translated on server var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); fu._trigger('fail', e, data); } @@ -523,8 +523,10 @@ $(document).ready(function() { function(result){ if (result.status == 'success') { var date=new Date(); - FileList.addFile(name,0,date,false,hidden); - var tr=$('tr').filterAttr('data-file',name); + // TODO: ideally addFile should be able to receive + // all attributes and set them automatically, + // and also auto-load the preview + var tr = FileList.addFile(name,0,date,false,hidden); tr.attr('data-size',result.data.size); tr.attr('data-mime',result.data.mime); tr.attr('data-id', result.data.id); @@ -533,6 +535,7 @@ $(document).ready(function() { lazyLoadPreview(path, result.data.mime, function(previewpath){ tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); + FileActions.display(tr.find('td.filename')); } else { OC.dialogs.alert(result.data.message, t('core', 'Error')); } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 37b66858840..9e7a2364b18 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -703,7 +703,10 @@ function checkTrashStatus() { } function onClickBreadcrumb(e){ - var $el = $(e.target).closest('.crumb'); - e.preventDefault(); - FileList.changeDirectory(decodeURIComponent($el.data('dir'))); + var $el = $(e.target).closest('.crumb'), + $targetDir = $el.data('dir'); + if ($targetDir !== undefined){ + e.preventDefault(); + FileList.changeDirectory(decodeURIComponent($targetDir)); + } } diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php index c747555e40b..96a4be20b5c 100644 --- a/apps/files/l10n/en_GB.php +++ b/apps/files/l10n/en_GB.php @@ -44,6 +44,8 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Invalid name: '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.", "Your storage is full, files can not be updated or synced anymore!" => "Your storage is full, files can not be updated or synced anymore!", "Your storage is almost full ({usedSpacePercent}%)" => "Your storage is almost full ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Encryption App is enabled but your keys are not initialised, please log-out and log-in again", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.", "Your download is being prepared. This might take some time if the files are big." => "Your download is being prepared. This might take some time if the files are big.", "Error moving file" => "Error moving file", diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index bfed4b22276..b7091fe544d 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -44,6 +44,8 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre Invalido, \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" no están permitidos ", "Your storage is full, files can not be updated or synced anymore!" => "Su almacenamiento está lleno, ¡no se pueden actualizar o sincronizar más!", "Your storage is almost full ({usedSpacePercent}%)" => "Su almacenamiento está casi lleno ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Encryption App está habilitada pero tus claves no han sido inicializadas, por favor, cierra la sesión y vuelva a iniciarla de nuevo.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "La clave privada no es válida para Encryption App. Por favor, actualiza la contraseña de tu clave privada en tus ajustes personales para recuperar el acceso a tus archivos encriptados.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "El cifrado ha sido deshabilitado pero tus archivos permanecen cifrados. Por favor, ve a tus ajustes personales para descifrar tus archivos.", "Your download is being prepared. This might take some time if the files are big." => "Su descarga está siendo preparada. Esto puede tardar algún tiempo si los archivos son grandes.", "Error moving file" => "Error moviendo archivo", diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php index cb637d849b3..d25b737037f 100644 --- a/apps/files/l10n/et_EE.php +++ b/apps/files/l10n/et_EE.php @@ -17,6 +17,7 @@ $TRANSLATIONS = array( "Upload failed. Could not find uploaded file" => "Üleslaadimine ebaõnnestus. Üleslaetud faili ei leitud", "Invalid directory." => "Vigane kaust.", "Files" => "Failid", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Ei saa üles laadida {filename}, kuna see on kataloog või selle suurus on 0 baiti", "Not enough space available" => "Pole piisavalt ruumi", "Upload cancelled." => "Üleslaadimine tühistati.", "Could not get result from server." => "Serverist ei saadud tulemusi", @@ -43,6 +44,8 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Vigane nimi, '\\', '/', '<', '>', ':', '\"', '|', '?' ja '*' pole lubatud.", "Your storage is full, files can not be updated or synced anymore!" => "Sinu andmemaht on täis! Faile ei uuendata ega sünkroniseerita!", "Your storage is almost full ({usedSpacePercent}%)" => "Su andmemaht on peaaegu täis ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krüpteerimisrakend on lubatud, kuid võtmeid pole lähtestatud. Palun logi välja ning uuesti sisse.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Vigane Krüpteerimisrakendi privaatvõti . Palun uuenda oma privaatse võtme parool oma personaasete seadete all taastamaks ligipääsu oma krüpteeritud failidele.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Krüpteering on keelatud, kuid sinu failid on endiselt krüpteeritud. Palun vaata oma personaalseid seadeid oma failide dekrüpteerimiseks.", "Your download is being prepared. This might take some time if the files are big." => "Valmistatakse allalaadimist. See võib võtta veidi aega, kui on tegu suurte failidega. ", "Error moving file" => "Viga faili eemaldamisel", diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php index 03505a2a269..ca1ed09ef3d 100644 --- a/apps/files/l10n/fr.php +++ b/apps/files/l10n/fr.php @@ -44,6 +44,8 @@ $TRANSLATIONS = array( "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}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'application de chiffrement est activée mais vos clés ne sont pas initialisées, veuillez vous déconnecter et ensuite vous reconnecter.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Votre clef privée pour l'application de chiffrement est invalide ! Veuillez mettre à jour le mot de passe de votre clef privée dans vos paramètres personnels pour récupérer l'accès à vos fichiers chiffrés.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Le chiffrement était désactivé mais vos fichiers sont toujours chiffrés. Veuillez vous rendre sur vos Paramètres personnels pour déchiffrer vos fichiers.", "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.", "Error moving file" => "Erreur lors du déplacement du fichier", diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php index 65ad5265237..5e2a752b974 100644 --- a/apps/files/l10n/nl.php +++ b/apps/files/l10n/nl.php @@ -13,10 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Er ontbreekt een tijdelijke map", "Failed to write to disk" => "Schrijven naar schijf mislukt", "Not enough storage available" => "Niet genoeg opslagruimte beschikbaar", +"Upload failed. Could not get file info." => "Upload mislukt, Kon geen bestandsinfo krijgen.", +"Upload failed. Could not find uploaded file" => "Upload mislukt. Kon ge-uploade bestand niet vinden", "Invalid directory." => "Ongeldige directory.", "Files" => "Bestanden", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan {filename} niet uploaden omdat het een map is of 0 bytes groot is", "Not enough space available" => "Niet genoeg ruimte beschikbaar", "Upload cancelled." => "Uploaden geannuleerd.", +"Could not get result from server." => "Kon het resultaat van de server niet terugkrijgen.", "File upload is in progress. Leaving the page now will cancel the upload." => "Bestandsupload is bezig. Wanneer de pagina nu verlaten wordt, stopt de upload.", "URL cannot be empty." => "URL kan niet leeg zijn.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ongeldige mapnaam. Gebruik van 'Gedeeld' is voorbehouden aan Owncloud zelf", @@ -40,8 +44,11 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Onjuiste naam; '\\', '/', '<', '>', ':', '\"', '|', '?' en '*' zijn niet toegestaan.", "Your storage is full, files can not be updated or synced anymore!" => "Uw opslagruimte zit vol, Bestanden kunnen niet meer worden ge-upload of gesynchroniseerd!", "Your storage is almost full ({usedSpacePercent}%)" => "Uw opslagruimte zit bijna vol ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Crypto app is geactiveerd, maar uw sleutels werden niet geïnitialiseerd. Log uit en log daarna opnieuw in.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ongeldige privésleutel voor crypto app. Werk het privésleutel wachtwoord bij in uw persoonlijke instellingen om opnieuw toegang te krijgen tot uw versleutelde bestanden.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encryptie is uitgeschakeld maar uw bestanden zijn nog steeds versleuteld. Ga naar uw persoonlijke instellingen om uw bestanden te decoderen.", "Your download is being prepared. This might take some time if the files are big." => "Uw download wordt voorbereid. Dit kan enige tijd duren bij grote bestanden.", +"Error moving file" => "Fout bij verplaatsen bestand", "Name" => "Naam", "Size" => "Grootte", "Modified" => "Aangepast", diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php index f6d61fc9873..342cab2bf4e 100644 --- a/apps/files/l10n/pt_PT.php +++ b/apps/files/l10n/pt_PT.php @@ -13,10 +13,12 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "Está a faltar a pasta temporária", "Failed to write to disk" => "Falhou a escrita no disco", "Not enough storage available" => "Não há espaço suficiente em disco", +"Upload failed. Could not get file info." => "O carregamento falhou. Não foi possível obter a informação do ficheiro.", "Invalid directory." => "Directório Inválido", "Files" => "Ficheiros", "Not enough space available" => "Espaço em disco insuficiente!", "Upload cancelled." => "Envio cancelado.", +"Could not get result from server." => "Não foi possível obter o resultado do servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "Envio de ficheiro em progresso. Irá cancelar o envio se sair da página agora.", "URL cannot be empty." => "O URL não pode estar vazio.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome da pasta inválido. Palavra 'Shared' é reservado pela ownCloud", @@ -42,6 +44,7 @@ $TRANSLATIONS = array( "Your storage is almost full ({usedSpacePercent}%)" => "O seu espaço de armazenamento está quase cheiro ({usedSpacePercent}%)", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "A encriptação foi desactivada mas os seus ficheiros continuam encriptados. Por favor consulte as suas definições pessoais para desencriptar os ficheiros.", "Your download is being prepared. This might take some time if the files are big." => "O seu download está a ser preparado. Este processo pode demorar algum tempo se os ficheiros forem grandes.", +"Error moving file" => "Erro ao mover o ficheiro", "Name" => "Nome", "Size" => "Tamanho", "Modified" => "Modificado", diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index 208dcd4ea12..32267ea2e71 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -13,10 +13,14 @@ $TRANSLATIONS = array( "Missing a temporary folder" => "En temporär mapp saknas", "Failed to write to disk" => "Misslyckades spara till disk", "Not enough storage available" => "Inte tillräckligt med lagringsutrymme tillgängligt", +"Upload failed. Could not get file info." => "Uppladdning misslyckades. Gick inte att hämta filinformation.", +"Upload failed. Could not find uploaded file" => "Uppladdning misslyckades. Kunde inte hitta den uppladdade filen", "Invalid directory." => "Felaktig mapp.", "Files" => "Filer", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan inte ladda upp {filename} eftersom den antingen är en mapp eller har 0 bytes.", "Not enough space available" => "Inte tillräckligt med utrymme tillgängligt", "Upload cancelled." => "Uppladdning avbruten.", +"Could not get result from server." => "Gick inte att hämta resultat från server.", "File upload is in progress. Leaving the page now will cancel the upload." => "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.", "URL cannot be empty." => "URL kan inte vara tom.", "Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ogiltigt mappnamn. Användning av 'Shared' är reserverad av ownCloud", @@ -40,8 +44,11 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ogiltigt namn, '\\', '/', '<', '>', ':', '\"', '|', '?' och '*' är inte tillåtet.", "Your storage is full, files can not be updated or synced anymore!" => "Ditt lagringsutrymme är fullt, filer kan inte längre uppdateras eller synkroniseras!", "Your storage is almost full ({usedSpacePercent}%)" => "Ditt lagringsutrymme är nästan fullt ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ogiltig privat nyckel i krypteringsprogrammet. Vänligen uppdatera lösenordet till din privata nyckel under dina personliga inställningar för att återfå tillgång till dina krypterade filer.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Kryptering inaktiverades men dina filer är fortfarande krypterade. Vänligen gå till sidan för dina personliga inställningar för att dekryptera dina filer.", "Your download is being prepared. This might take some time if the files are big." => "Din nedladdning förbereds. Det kan ta tid om det är stora filer.", +"Error moving file" => "Fel uppstod vid flyttning av fil", "Name" => "Namn", "Size" => "Storlek", "Modified" => "Ändrad", diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index ebdca097e74..32a59f1e1a6 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,4 +1,3 @@ -