Merge branch 'master' into cleanup-list-code

Conflicts:
	apps/files_sharing/ajax/list.php
This commit is contained in:
Thomas Müller 2014-05-19 20:52:25 +02:00
commit 51a6764f31
1565 changed files with 70647 additions and 38612 deletions

View file

@ -26,6 +26,7 @@
"fakeServer": true,
"_": true,
"OC": true,
"OCA": true,
"t": true,
"n": true
}

View file

@ -32,7 +32,7 @@ If you have questions about how to install or use ownCloud, please direct these
Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
[template]: https://raw.github.com/owncloud/core/master/issue_template.md
[mailinglist]: https://mail.kde.org/mailman/listinfo/owncloud
[mailinglist]: http://mailman.owncloud.org/mailman/listinfo/owncloud
[forum]: http://forum.owncloud.org/
[irc]: http://webchat.freenode.net/?channels=owncloud&uio=d4

View file

@ -17,8 +17,11 @@ $baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';
$permissions = $dirInfo->getPermissions();
$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name';
$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false;
// make filelist
$files = \OCA\Files\Helper::getFiles($dir);
$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection);
$data['directory'] = $dir;
$data['files'] = \OCA\Files\Helper::formatFileInfos($files);

View file

@ -19,3 +19,13 @@ $templateManager->registerTemplate('text/html', 'core/templates/filetemplates/te
$templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp');
$templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt');
$templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods');
\OCA\Files\App::getNavigationManager()->add(
array(
"id" => 'files',
"appname" => 'files',
"script" => 'list.php',
"order" => 0,
"name" => $l->t('All files')
)
);

View file

@ -1,46 +0,0 @@
<?php
// fix webdav properties,add namespace in front of the property, update for OC4.5
$installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) {
$concat = OC_DB::getConnection()->getDatabasePlatform()->
getConcatExpression( '\'{DAV:}\'', '`propertyname`' );
$query = OC_DB::prepare('
UPDATE `*PREFIX*properties`
SET `propertyname` = ' . $concat . '
WHERE `propertyname` NOT LIKE \'{%\'
');
$query->execute();
}
//update from OC 3
//try to remove remaining files.
//Give a warning if not possible
$filesToRemove = array(
'ajax',
'appinfo',
'css',
'js',
'l10n',
'templates',
'admin.php',
'download.php',
'index.php',
'settings.php'
);
foreach($filesToRemove as $file) {
$filepath = OC::$SERVERROOT . '/files/' . $file;
if(!file_exists($filepath)) {
continue;
}
$success = OCP\Files::rmdirr($filepath);
if($success === false) {
//probably not sufficient privileges, give up and give a message.
OCP\Util::writeLog('files', 'Could not clean /files/ directory.'
.' Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
break;
}
}

View file

@ -3,10 +3,11 @@
See the COPYING-README file. */
/* FILE MENU */
.actions { padding:5px; height:32px; width: 100%; }
.actions { padding:5px; height:32px; display: inline-block; float: left; }
.actions input, .actions button, .actions .button { margin:0; float:left; }
.actions .button a { color: #555; }
.actions .button a:hover, .actions .button a:active { color: #333; }
.actions.hidden { display: none; }
#new {
z-index: 1010;
@ -75,6 +76,7 @@
top: 44px;
width: 100%;
}
/* make sure there's enough room for the file actions */
#body-user #filestable {
min-width: 688px; /* 768 (mobile break) - 80 (nav width) */
@ -83,6 +85,40 @@
min-width: 688px; /* 768 (mobile break) - 80 (nav width) */
}
#filestable tbody tr { background-color:#fff; height:51px; }
.app-files #app-content {
position: relative;
}
/**
* Override global #controls styles
* to be more flexible / relative
*/
#body-user .app-files #controls {
left: 310px; /* main nav bar + sidebar */
position: fixed;
padding-left: 0px;
}
/* this is mostly for file viewer apps, text editor, etc */
#body-user .app-files.no-sidebar #controls {
left: 0px;
padding-left: 80px; /* main nav bar */
}
.app-files #app-navigation {
width: 230px;
}
.app-files #app-settings {
width: 229px; /* DUH */
}
.app-files #app-settings input {
width: 90%;
}
#filestable tbody tr { background-color:#fff; height:40px; }
#filestable tbody tr:hover, tbody tr:active {
background-color: rgb(240,240,240);
@ -116,10 +152,29 @@ tr:hover span.extension {
table tr.mouseOver td { background-color:#eee; }
table th { height:24px; padding:0 8px; color:#999; }
table th .name {
position: absolute;
left: 55px;
top: 15px;
table th .columntitle {
display: inline-block;
padding: 15px;
width: 100%;
height: 50px;
box-sizing: border-box;
-moz-box-sizing: border-box;
vertical-align: middle;
}
table th .columntitle.name {
padding-left: 5px;
margin-left: 50px;
max-width: 300px;
}
/* hover effect on sortable column */
table th a.columntitle:hover {
background-color: #F0F0F0;
}
table th .sort-indicator {
width: 10px;
height: 8px;
margin-left: 10px;
display: inline-block;
}
table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; }
table td {
@ -139,8 +194,11 @@ table th#headerName {
}
table th#headerSize, table td.filesize {
min-width: 48px;
padding: 0 16px;
text-align: right;
padding: 0;
}
table table td.filesize {
padding: 0 16px;
}
table th#headerDate, table td.date {
-moz-box-sizing: border-box;
@ -161,9 +219,7 @@ table.multiselect thead {
z-index: 10;
-moz-box-sizing: border-box;
box-sizing: border-box;
left: 0;
padding-left: 80px;
width: 100%;
left: 310px; /* main nav bar + sidebar */
}
table.multiselect thead th {
@ -197,10 +253,6 @@ table td.filename input.filename {
table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:3px 8px 8px 3px; }
table td.filename .nametext, .uploadtext, .modified { float:left; padding:14px 0; }
#modified {
position: absolute;
top: 15px;
}
.modified {
position: relative;
padding-left: 8px;
@ -254,7 +306,7 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; }
/* Use label to have bigger clickable size for checkbox */
#fileList tr td.filename>input[type="checkbox"] + label,
#select_all + label {
.select-all + label {
height: 50px;
position: absolute;
width: 50px;
@ -268,10 +320,10 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; }
#fileList tr td.filename>input[type="checkbox"] + label {
left: 0;
}
#select_all + label {
.select-all + label {
top: 0;
}
#select_all {
.select-all {
position: absolute;
top: 18px;
left: 18px;
@ -319,6 +371,9 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
display: inline;
padding: 17px 5px;
}
.selectedActions a.hidden {
display: none;
}
.selectedActions a img {
position:relative;
top:5px;
@ -394,7 +449,7 @@ table.dragshadow td.size {
}
.mask {
z-index: 50;
position: fixed;
position: absolute;
top: 0;
left: 0;
right: 0;

View file

@ -28,6 +28,7 @@ OCP\User::checkLoggedIn();
OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('files', 'upload');
OCP\Util::addStyle('files', 'mobile');
OCP\Util::addscript('files', 'app');
OCP\Util::addscript('files', 'file-upload');
OCP\Util::addscript('files', 'jquery.iframe-transport');
OCP\Util::addscript('files', 'jquery.fileupload');
@ -37,28 +38,23 @@ OCP\Util::addscript('files', 'breadcrumb');
OCP\Util::addscript('files', 'filelist');
OCP\App::setActiveNavigationEntry('files_index');
// Load the files
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);
$dirInfo = \OC\Files\Filesystem::getFileInfo($dir, false);
// Redirect if directory does not exist
if (!$dirInfo || !$dirInfo->getType() === 'dir') {
header('Location: ' . OCP\Util::getScriptName() . '');
exit();
}
$isIE8 = false;
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 0 && $matches[1] <= 8){
if (count($matches) > 0 && $matches[1] <= 9) {
$isIE8 = true;
}
// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path"
if ($isIE8 && isset($_GET['dir'])){
if ($dir === ''){
$dir = '/';
// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview"
if ($isIE8 && (isset($_GET['dir']) || isset($_GET['view']))) {
$hash = '#?';
$dir = isset($_GET['dir']) ? $_GET['dir'] : '/';
$view = isset($_GET['view']) ? $_GET['view'] : 'files';
$hash = '#?dir=' . \OCP\Util::encodePath($dir);
if ($view !== 'files') {
$hash .= '&view=' . urlencode($view);
}
header('Location: ' . OCP\Util::linkTo('files', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir));
header('Location: ' . OCP\Util::linkTo('files', 'index.php') . $hash);
exit();
}
@ -66,49 +62,62 @@ $user = OC_User::getUser();
$config = \OC::$server->getConfig();
// needed for share init, permissions will be reloaded
// anyway with ajax load
$permissions = $dirInfo->getPermissions();
// information about storage capacities
$storageInfo=OC_Helper::getStorageInfo($dir, $dirInfo);
$freeSpace=$storageInfo['free'];
$uploadLimit=OCP\Util::uploadLimit();
$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir, $freeSpace);
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
// mostly for the home storage's free space
$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
$storageInfo=OC_Helper::getStorageInfo('/', $dirInfo);
// if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code)
$encryptionInitStatus = 2;
if (OC_App::isEnabled('files_encryption')) {
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$encryptionInitStatus = $session->getInitialized();
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$encryptionInitStatus = $session->getInitialized();
}
$trashEnabled = \OCP\App::isEnabled('files_trashbin');
$trashEmpty = true;
if ($trashEnabled) {
$trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
$nav = new OCP\Template('files', 'appnavigation', '');
$navItems = \OCA\Files\App::getNavigationManager()->getAll();
$nav->assign('navigationItems', $navItems);
$contentItems = array();
function renderScript($appName, $scriptName) {
$content = '';
$appPath = OC_App::getAppPath($appName);
$scriptPath = $appPath . '/' . $scriptName;
if (file_exists($scriptPath)) {
// TODO: sanitize path / script name ?
ob_start();
include $scriptPath;
$content = ob_get_contents();
@ob_end_clean();
}
return $content;
}
// render the container content for every navigation item
foreach ($navItems as $item) {
$content = '';
if (isset($item['script'])) {
$content = renderScript($item['appname'], $item['script']);
}
$contentItem = array();
$contentItem['id'] = $item['id'];
$contentItem['content'] = $content;
$contentItems[] = $contentItem;
}
OCP\Util::addscript('files', 'fileactions');
OCP\Util::addscript('files', 'files');
OCP\Util::addscript('files', 'navigation');
OCP\Util::addscript('files', 'keyboardshortcuts');
$tmpl = new OCP\Template('files', 'index', 'user');
$tmpl->assign('dir', $dir);
$tmpl->assign('permissions', $permissions);
$tmpl->assign('trash', $trashEnabled);
$tmpl->assign('trashEmpty', $trashEmpty);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); // minimium of freeSpace and uploadLimit
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('freeSpace', $freeSpace);
$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']);
$tmpl->assign('isPublic', false);
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles());
$tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_allow_mail_notification', 'yes'));
$tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->assign("encryptionInitStatus", $encryptionInitStatus);
$tmpl->assign('disableSharing', false);
$tmpl->assign('appNavigation', $nav);
$tmpl->assign('appContents', $contentItems);
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->printPage();

147
apps/files/js/app.js Normal file
View file

@ -0,0 +1,147 @@
/*
* Copyright (c) 2014
*
* @author Vincent Petry
* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
/* global dragOptions, folderDropOptions */
(function() {
if (!OCA.Files) {
OCA.Files = {};
}
var App = {
navigation: null,
initialize: function() {
this.navigation = new OCA.Files.Navigation($('#app-navigation'));
// TODO: ideally these should be in a separate class / app (the embedded "all files" app)
this.fileActions = OCA.Files.FileActions;
this.files = OCA.Files.Files;
this.fileList = new OCA.Files.FileList(
$('#app-content-files'), {
scrollContainer: $('#app-content'),
dragOptions: dragOptions,
folderDropOptions: folderDropOptions
}
);
this.files.initialize();
this.fileActions.registerDefaultActions(this.fileList);
this.fileList.setFileActions(this.fileActions);
// for backward compatibility, the global FileList will
// refer to the one of the "files" view
window.FileList = this.fileList;
this._setupEvents();
// trigger URL change event handlers
this._onPopState(OC.Util.History.parseUrlQuery());
},
/**
* Returns the container of the currently visible app.
*
* @return app container
*/
getCurrentAppContainer: function() {
return this.navigation.getActiveContainer();
},
/**
* Setup events based on URL changes
*/
_setupEvents: function() {
OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this));
// detect when app changed their current directory
$('#app-content').delegate('>div', 'changeDirectory', _.bind(this._onDirectoryChanged, this));
$('#app-content').delegate('>div', 'changeViewerMode', _.bind(this._onChangeViewerMode, this));
$('#app-navigation').on('itemChanged', _.bind(this._onNavigationChanged, this));
},
/**
* Event handler for when the current navigation item has changed
*/
_onNavigationChanged: function(e) {
var params;
if (e && e.itemId) {
params = {
view: e.itemId,
dir: '/'
};
this._changeUrl(params.view, params.dir);
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
}
},
/**
* Event handler for when an app notified that its directory changed
*/
_onDirectoryChanged: function(e) {
if (e.dir) {
this._changeUrl(this.navigation.getActiveItem(), e.dir);
}
},
/**
* Event handler for when an app notifies that it needs space
* for viewer mode.
*/
_onChangeViewerMode: function(e) {
var state = !!e.viewerModeEnabled;
$('#app-navigation').toggleClass('hidden', state);
$('.app-files').toggleClass('viewer-mode no-sidebar', state);
},
/**
* Event handler for when the URL changed
*/
_onPopState: function(params) {
params = _.extend({
dir: '/',
view: 'files'
}, params);
var lastId = this.navigation.getActiveItem();
if (!this.navigation.itemExists(params.view)) {
params.view = 'files';
}
this.navigation.setActiveItem(params.view, {silent: true});
if (lastId !== this.navigation.getActiveItem()) {
this.navigation.getActiveContainer().trigger(new $.Event('show'));
}
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
},
/**
* Change the URL to point to the given dir and view
*/
_changeUrl: function(view, dir) {
var params = {dir: dir};
if (view !== 'files') {
params.view = view;
}
OC.Util.History.pushState(params);
}
};
OCA.Files.App = App;
})();
$(document).ready(function() {
// wait for other apps/extensions to register their event handlers
// in the "ready" clause
_.defer(function() {
OCA.Files.App.initialize();
});
});

View file

@ -159,7 +159,11 @@
this.totalWidth = 64;
// FIXME: this class should not know about global elements
if ( $('#navigation').length ) {
this.totalWidth += $('#navigation').get(0).offsetWidth;
this.totalWidth += $('#navigation').outerWidth();
}
if ( $('#app-navigation').length && !$('#app-navigation').hasClass('hidden')) {
this.totalWidth += $('#app-navigation').outerWidth();
}
this.hiddenBreadcrumbs = 0;
@ -167,8 +171,8 @@
this.totalWidth += $(this.breadcrumbs[i]).get(0).offsetWidth;
}
$.each($('#controls .actions>div'), function(index, action) {
self.totalWidth += $(action).get(0).offsetWidth;
$.each($('#controls .actions'), function(index, action) {
self.totalWidth += $(action).outerWidth();
});
},
@ -236,6 +240,6 @@
}
};
window.BreadCrumb = BreadCrumb;
OCA.Files.BreadCrumb = BreadCrumb;
})();

View file

@ -18,7 +18,7 @@
* - TODO music upload button
*/
/* global OC, t, n */
/* global Files, FileList, jQuery, oc_requesttoken, humanFileSize, getUniqueName */
/**
* Function that will allow us to know if Ajax uploads are supported
@ -65,7 +65,7 @@ OC.Upload = {
*/
cancelUploads:function() {
this.log('canceling uploads');
jQuery.each(this._uploads,function(i, jqXHR) {
jQuery.each(this._uploads, function(i, jqXHR) {
jqXHR.abort();
});
this._uploads = [];
@ -83,7 +83,7 @@ OC.Upload = {
isProcessing:function() {
var count = 0;
jQuery.each(this._uploads,function(i, data) {
jQuery.each(this._uploads, function(i, data) {
if (data.state() === 'pending') {
count++;
}
@ -205,14 +205,16 @@ OC.Upload = {
*/
add: function(e, data) {
OC.Upload.log('add', e, data);
var that = $(this);
var freeSpace;
var that = $(this), freeSpace;
// we need to collect all data upload objects before starting the upload so we can check their existence
// and set individual conflict actions. unfortunately there is only one variable that we can use to identify
// the selection a data upload is part of, so we have to collect them in data.originalFiles
// turning singleFileUploads off is not an option because we want to gracefully handle server errors like
// already exists
// we need to collect all data upload objects before
// starting the upload so we can check their existence
// and set individual conflict actions. Unfortunately,
// there is only one variable that we can use to identify
// the selection a data upload is part of, so we have to
// collect them in data.originalFiles turning
// singleFileUploads off is not an option because we want
// to gracefully handle server errors like 'already exists'
// create a container where we can store the data objects
if ( ! data.originalFiles.selection ) {
@ -244,14 +246,15 @@ OC.Upload = {
// in case folder drag and drop is not supported file will point to a directory
// http://stackoverflow.com/a/20448357
if (!file.type && file.size%4096 === 0 && file.size <= 102400) {
if ( ! file.type && file.size%4096 === 0 && file.size <= 102400) {
try {
reader = new FileReader();
reader.readAsBinaryString(f);
var reader = new FileReader();
reader.readAsBinaryString(file);
} catch (NS_ERROR_FILE_ACCESS_DENIED) {
//file is a directory
data.textStatus = 'dirorzero';
data.errorThrown = t('files', 'Unable to upload {filename} as it is a directory or has 0 bytes',
data.errorThrown = t('files',
'Unable to upload {filename} as it is a directory or has 0 bytes',
{filename: file.name}
);
}
@ -263,7 +266,8 @@ OC.Upload = {
// check PHP upload limit
if (selection.totalBytes > $('#upload_limit').val()) {
data.textStatus = 'sizeexceedlimit';
data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}', {
data.errorThrown = t('files',
'Total file size {size1} exceeds upload limit {size2}', {
'size1': humanFileSize(selection.totalBytes),
'size2': humanFileSize($('#upload_limit').val())
});
@ -273,7 +277,8 @@ OC.Upload = {
freeSpace = $('#free_space').val();
if (freeSpace >= 0 && selection.totalBytes > freeSpace) {
data.textStatus = 'notenoughspace';
data.errorThrown = t('files', 'Not enough free space, you are uploading {size1} but only {size2} is left', {
data.errorThrown = t('files',
'Not enough free space, you are uploading {size1} but only {size2} is left', {
'size1': humanFileSize(selection.totalBytes),
'size2': humanFileSize($('#free_space').val())
});
@ -341,7 +346,7 @@ OC.Upload = {
// noone set update parameters, we set the minimum
data.formData = {
requesttoken: oc_requesttoken,
dir: $('#dir').val(),
dir: FileList.getCurrentDirectory(),
file_directory: fileDirectory
};
}
@ -384,31 +389,29 @@ OC.Upload = {
//fetch response from iframe
response = data.result[0].body.innerText;
}
var result=$.parseJSON(response);
var result = $.parseJSON(response);
delete data.jqXHR;
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
if (result.status === 'error' && result.data && result.data.message){
data.textStatus = 'servererror';
data.errorThrown = result.data.message;
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
fu._trigger('fail', e, data);
} else if (typeof result[0] === 'undefined') {
data.textStatus = 'servererror';
data.errorThrown = t('files', 'Could not get result from server.');
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
fu._trigger('fail', e, data);
} else if (result[0].status === 'existserror') {
//show "file already exists" dialog
var original = result[0];
var replacement = data.files[0];
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
OC.dialogs.fileexists(data, original, replacement, OC.Upload, fu);
} else if (result[0].status !== 'success') {
//delete data.jqXHR;
data.textStatus = 'servererror';
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);
}
},
@ -440,7 +443,7 @@ OC.Upload = {
fileupload.on('fileuploadstart', function(e, data) {
OC.Upload.log('progress handle fileuploadstart', e, data);
$('#uploadprogresswrapper input.stop').show();
$('#uploadprogressbar').progressbar({value:0});
$('#uploadprogressbar').progressbar({value: 0});
$('#uploadprogressbar').fadeIn();
});
fileupload.on('fileuploadprogress', function(e, data) {
@ -457,7 +460,6 @@ OC.Upload = {
$('#uploadprogresswrapper input.stop').fadeOut();
$('#uploadprogressbar').fadeOut();
Files.updateStorageStatistics();
});
fileupload.on('fileuploadfail', function(e, data) {
OC.Upload.log('progress handle fileuploadfail', e, data);
@ -468,8 +470,6 @@ OC.Upload = {
}
});
} else {
console.log('skipping file progress because your browser is broken');
}
}
@ -509,7 +509,7 @@ OC.Upload = {
$('#new li').each(function(i,element) {
if ($(element).children('p').length === 0) {
$(element).children('form').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
$(element).append('<p>' + $(element).data('text') + '</p>');
}
});
});
@ -527,16 +527,16 @@ OC.Upload = {
$('#new .error').tipsy('hide');
$('#new li').each(function(i,element) {
$('#new li').each(function(i, element) {
if ($(element).children('p').length === 0) {
$(element).children('form').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
$(element).append('<p>' + $(element).data('text') + '</p>');
}
});
var type=$(this).data('type');
var text=$(this).children('p').text();
$(this).data('text',text);
var type = $(this).data('type');
var text = $(this).children('p').text();
$(this).data('text', text);
$(this).children('p').remove();
// add input field
@ -553,7 +553,7 @@ OC.Upload = {
var filename = input.val();
if (type === 'web' && filename.length === 0) {
throw t('files', 'URL cannot be empty');
} else if (type !== 'web' && !Files.isFileNameValid(filename)) {
} else if (type !== 'web' && ! Files.isFileNameValid(filename)) {
// Files.isFileNameValid(filename) throws an exception itself
} else if (FileList.inList(filename)) {
throw t('files', '{new_name} already exists', {new_name: filename});
@ -592,7 +592,7 @@ OC.Upload = {
if (FileList.lastAction) {
FileList.lastAction();
}
var name = getUniqueName(newname);
var name = FileList.getUniqueName(newname);
if (newname !== name) {
FileList.checkName(name, newname, true);
var hidden = true;
@ -603,7 +603,10 @@ OC.Upload = {
case 'file':
$.post(
OC.filePath('files', 'ajax', 'newfile.php'),
{dir:$('#dir').val(), filename:name},
{
dir: FileList.getCurrentDirectory(),
filename: name
},
function(result) {
if (result.status === 'success') {
FileList.add(result.data, {hidden: hidden, animate: true});
@ -616,7 +619,10 @@ OC.Upload = {
case 'folder':
$.post(
OC.filePath('files','ajax','newfolder.php'),
{dir:$('#dir').val(), foldername:name},
{
dir: FileList.getCurrentDirectory(),
foldername: name
},
function(result) {
if (result.status === 'success') {
FileList.add(result.data, {hidden: hidden, animate: true});
@ -627,39 +633,46 @@ OC.Upload = {
);
break;
case 'web':
if (name.substr(0,8) !== 'https://' && name.substr(0,7) !== 'http://') {
if (name.substr(0, 8) !== 'https://' && name.substr(0, 7) !== 'http://') {
name = 'http://' + name;
}
var localName=name;
if (localName.substr(localName.length-1,1)==='/') {//strip /
localName=localName.substr(0,localName.length-1);
var localName = name;
if (localName.substr(localName.length-1, 1) === '/') {//strip /
localName = localName.substr(0, localName.length-1);
}
if (localName.indexOf('/')) {//use last part of url
localName=localName.split('/').pop();
if (localName.indexOf('/')) { //use last part of url
localName = localName.split('/').pop();
} else { //or the domain
localName=(localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.','');
localName = (localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.', '');
}
localName = getUniqueName(localName);
localName = FileList.getUniqueName(localName);
//IE < 10 does not fire the necessary events for the progress bar.
if ($('html.lte9').length === 0) {
$('#uploadprogressbar').progressbar({value:0});
$('#uploadprogressbar').progressbar({value: 0});
$('#uploadprogressbar').fadeIn();
}
var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName});
eventSource.listen('progress',function(progress) {
var eventSource = new OC.EventSource(
OC.filePath('files', 'ajax', 'newfile.php'),
{
dir: FileList.getCurrentDirectory(),
source: name,
filename: localName
}
);
eventSource.listen('progress', function(progress) {
//IE < 10 does not fire the necessary events for the progress bar.
if ($('html.lte9').length === 0) {
$('#uploadprogressbar').progressbar('value',progress);
}
});
eventSource.listen('success',function(data) {
eventSource.listen('success', function(data) {
var file = data;
$('#uploadprogressbar').fadeOut();
FileList.add(file, {hidden: hidden, animate: true});
});
eventSource.listen('error',function(error) {
eventSource.listen('error', function(error) {
$('#uploadprogressbar').fadeOut();
var message = (error && error.message) || t('core', 'Error fetching URL');
OC.Notification.show(message);
@ -670,12 +683,12 @@ OC.Upload = {
});
break;
}
var li=form.parent();
var li = form.parent();
form.remove();
/* workaround for IE 9&10 click event trap, 2 lines: */
$('input').first().focus();
$('#content').focus();
li.append('<p>'+li.data('text')+'</p>');
li.append('<p>' + li.data('text') + '</p>');
$('#new>a').click();
} catch (error) {
input.attr('title', error);

View file

@ -8,242 +8,255 @@
*
*/
/* global OC, FileList, Files */
/* global trashBinApp */
var FileActions = {
actions: {},
defaults: {},
icons: {},
currentFile: null,
register: function (mime, name, permissions, icon, action, displayName) {
if (!FileActions.actions[mime]) {
FileActions.actions[mime] = {};
}
if (!FileActions.actions[mime][name]) {
FileActions.actions[mime][name] = {};
}
if (!displayName) {
displayName = t('files', name);
}
FileActions.actions[mime][name]['action'] = action;
FileActions.actions[mime][name]['permissions'] = permissions;
FileActions.actions[mime][name]['displayName'] = displayName;
FileActions.icons[name] = icon;
},
setDefault: function (mime, name) {
FileActions.defaults[mime] = name;
},
get: function (mime, type, permissions) {
var actions = this.getActions(mime, type, permissions);
var filteredActions = {};
$.each(actions, function (name, action) {
filteredActions[name] = action.action;
});
return filteredActions;
},
getActions: function (mime, type, permissions) {
var actions = {};
if (FileActions.actions.all) {
actions = $.extend(actions, FileActions.actions.all);
}
if (type) {//type is 'dir' or 'file'
if (FileActions.actions[type]) {
actions = $.extend(actions, FileActions.actions[type]);
(function() {
var FileActions = {
actions: {},
defaults: {},
icons: {},
currentFile: null,
register: function (mime, name, permissions, icon, action, displayName) {
if (!this.actions[mime]) {
this.actions[mime] = {};
}
}
if (mime) {
var mimePart = mime.substr(0, mime.indexOf('/'));
if (FileActions.actions[mimePart]) {
actions = $.extend(actions, FileActions.actions[mimePart]);
if (!this.actions[mime][name]) {
this.actions[mime][name] = {};
}
if (FileActions.actions[mime]) {
actions = $.extend(actions, FileActions.actions[mime]);
if (!displayName) {
displayName = t('files', name);
}
}
var filteredActions = {};
$.each(actions, function (name, action) {
if (action.permissions & permissions) {
filteredActions[name] = action;
this.actions[mime][name]['action'] = action;
this.actions[mime][name]['permissions'] = permissions;
this.actions[mime][name]['displayName'] = displayName;
this.icons[name] = icon;
},
clear: function() {
this.actions = {};
this.defaults = {};
this.icons = {};
this.currentFile = null;
},
setDefault: function (mime, name) {
this.defaults[mime] = name;
},
get: function (mime, type, permissions) {
var actions = this.getActions(mime, type, permissions);
var filteredActions = {};
$.each(actions, function (name, action) {
filteredActions[name] = action.action;
});
return filteredActions;
},
getActions: function (mime, type, permissions) {
var actions = {};
if (this.actions.all) {
actions = $.extend(actions, this.actions.all);
}
});
return filteredActions;
},
getDefault: function (mime, type, permissions) {
var mimePart;
if (mime) {
mimePart = mime.substr(0, mime.indexOf('/'));
}
var name = false;
if (mime && FileActions.defaults[mime]) {
name = FileActions.defaults[mime];
} else if (mime && FileActions.defaults[mimePart]) {
name = FileActions.defaults[mimePart];
} else if (type && FileActions.defaults[type]) {
name = FileActions.defaults[type];
} else {
name = FileActions.defaults.all;
}
var actions = this.get(mime, type, permissions);
return actions[name];
},
/**
* Display file actions for the given element
* @param parent "td" element of the file for which to display actions
* @param triggerEvent if true, triggers the fileActionsReady on the file
* list afterwards (false by default)
*/
display: function (parent, triggerEvent) {
FileActions.currentFile = parent;
var actions = FileActions.getActions(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
var nameLinks;
if (FileList.findFileEl(file).data('renaming')) {
return;
}
// recreate fileactions
nameLinks = parent.children('a.name');
nameLinks.find('.fileactions, .nametext .action').remove();
nameLinks.append('<span class="fileactions" />');
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var actionHandler = function (event) {
event.stopPropagation();
event.preventDefault();
FileActions.currentFile = event.data.elem;
var file = FileActions.getCurrentFile();
event.data.actionFunc(file);
};
var addAction = function (name, action, displayName) {
if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') {
var img = FileActions.icons[name],
actionText = displayName,
actionContainer = 'a.name>span.fileactions';
if (name === 'Rename') {
// rename has only an icon which appears behind
// the file name
actionText = '';
actionContainer = 'a.name span.nametext';
if (type) {//type is 'dir' or 'file'
if (this.actions[type]) {
actions = $.extend(actions, this.actions[type]);
}
}
if (mime) {
var mimePart = mime.substr(0, mime.indexOf('/'));
if (this.actions[mimePart]) {
actions = $.extend(actions, this.actions[mimePart]);
}
if (this.actions[mime]) {
actions = $.extend(actions, this.actions[mime]);
}
}
var filteredActions = {};
$.each(actions, function (name, action) {
if (action.permissions & permissions) {
filteredActions[name] = action;
}
});
return filteredActions;
},
getDefault: function (mime, type, permissions) {
var mimePart;
if (mime) {
mimePart = mime.substr(0, mime.indexOf('/'));
}
var name = false;
if (mime && this.defaults[mime]) {
name = this.defaults[mime];
} else if (mime && this.defaults[mimePart]) {
name = this.defaults[mimePart];
} else if (type && this.defaults[type]) {
name = this.defaults[type];
} else {
name = this.defaults.all;
}
var actions = this.get(mime, type, permissions);
return actions[name];
},
/**
* Display file actions for the given element
* @param parent "td" element of the file for which to display actions
* @param triggerEvent if true, triggers the fileActionsReady on the file
* list afterwards (false by default)
*/
display: function (parent, triggerEvent) {
this.currentFile = parent;
var self = this;
var actions = this.getActions(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions());
var file = this.getCurrentFile();
var nameLinks;
if (parent.closest('tr').data('renaming')) {
return;
}
// recreate fileactions
nameLinks = parent.children('a.name');
nameLinks.find('.fileactions, .nametext .action').remove();
nameLinks.append('<span class="fileactions" />');
var defaultAction = this.getDefault(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions());
var actionHandler = function (event) {
event.stopPropagation();
event.preventDefault();
self.currentFile = event.data.elem;
var file = self.getCurrentFile();
event.data.actionFunc(file);
};
var addAction = function (name, action, displayName) {
if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') {
var img = self.icons[name],
actionText = displayName,
actionContainer = 'a.name>span.fileactions';
if (name === 'Rename') {
// rename has only an icon which appears behind
// the file name
actionText = '';
actionContainer = 'a.name span.nametext';
}
if (img.call) {
img = img(file);
}
var html = '<a href="#" class="action action-' + name.toLowerCase() + '" data-action="' + name + '">';
if (img) {
html += '<img class ="svg" src="' + img + '" />';
}
html += '<span> ' + actionText + '</span></a>';
var element = $(html);
element.data('action', name);
element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler);
parent.find(actionContainer).append(element);
}
};
$.each(actions, function (name, action) {
if (name !== 'Share') {
displayName = action.displayName;
ah = action.action;
addAction(name, ah, displayName);
}
});
if(actions.Share){
displayName = t('files', 'Share');
addAction('Share', actions.Share, displayName);
}
// remove the existing delete action
parent.parent().children().last().find('.action.delete').remove();
if (actions['Delete']) {
var img = self.icons['Delete'];
var html;
if (img.call) {
img = img(file);
}
var html = '<a href="#" class="action action-' + name.toLowerCase() + '" data-action="' + name + '">';
if (img) {
html += '<img class ="svg" src="' + img + '" />';
if (typeof trashBinApp !== 'undefined' && trashBinApp) {
html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />';
} else {
html = '<a href="#" class="action delete delete-icon" />';
}
html += '<span> ' + actionText + '</span></a>';
var element = $(html);
element.data('action', name);
element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler);
parent.find(actionContainer).append(element);
element.data('action', actions['Delete']);
element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler);
parent.parent().children().last().append(element);
}
};
$.each(actions, function (name, action) {
if (name !== 'Share') {
displayName = action.displayName;
ah = action.action;
addAction(name, ah, displayName);
if (triggerEvent){
$('#fileList').trigger(jQuery.Event("fileActionsReady"));
}
});
if(actions.Share){
displayName = t('files', 'Share');
addAction('Share', actions.Share, displayName);
}
},
getCurrentFile: function () {
return this.currentFile.parent().attr('data-file');
},
getCurrentMimeType: function () {
return this.currentFile.parent().attr('data-mime');
},
getCurrentType: function () {
return this.currentFile.parent().attr('data-type');
},
getCurrentPermissions: function () {
return this.currentFile.parent().data('permissions');
},
// remove the existing delete action
parent.parent().children().last().find('.action.delete').remove();
if (actions['Delete']) {
var img = FileActions.icons['Delete'];
var html;
if (img.call) {
img = img(file);
}
if (typeof trashBinApp !== 'undefined' && trashBinApp) {
html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />';
/**
* Register the actions that are used by default for the files app.
*/
registerDefaultActions: function(fileList) {
// TODO: try to find a way to not make it depend on fileList,
// maybe get a handler or listener to trigger events on
this.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
fileList.do_delete(filename);
$('.tipsy').remove();
});
// t('files', 'Rename')
this.register('all', 'Rename', OC.PERMISSION_UPDATE, function () {
return OC.imagePath('core', 'actions/rename');
}, function (filename) {
fileList.rename(filename);
});
this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) {
var dir = fileList.getCurrentDirectory();
if (dir !== '/') {
dir = dir + '/';
}
fileList.changeDirectory(dir + filename);
});
this.setDefault('dir', 'Open');
var downloadScope;
if ($('#allowZipDownload').val() == 1) {
downloadScope = 'all';
} else {
html = '<a href="#" class="action delete delete-icon" />';
downloadScope = 'file';
}
var element = $(html);
element.data('action', actions['Delete']);
element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler);
parent.parent().children().last().append(element);
this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
}, function (filename) {
var url = OCA.Files.Files.getDownloadUrl(filename, fileList.getCurrentDirectory());
if (url) {
OC.redirect(url);
}
});
fileList.$fileList.trigger(jQuery.Event("fileActionsReady"));
}
};
if (triggerEvent){
$('#fileList').trigger(jQuery.Event("fileActionsReady"));
}
},
getCurrentFile: function () {
return FileActions.currentFile.parent().attr('data-file');
},
getCurrentMimeType: function () {
return FileActions.currentFile.parent().attr('data-mime');
},
getCurrentType: function () {
return FileActions.currentFile.parent().attr('data-type');
},
getCurrentPermissions: function () {
return FileActions.currentFile.parent().data('permissions');
}
};
OCA.Files.FileActions = FileActions;
})();
$(document).ready(function () {
var downloadScope;
if ($('#allowZipDownload').val() == 1) {
downloadScope = 'all';
} else {
downloadScope = 'file';
}
// for backward compatibility
window.FileActions = OCA.Files.FileActions;
if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) {
FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
}, function (filename) {
var url = Files.getDownloadUrl(filename);
if (url) {
OC.redirect(url);
}
});
}
$('#fileList tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
$('#fileList').trigger(jQuery.Event("fileActionsReady"));
});
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
FileList.do_delete(filename);
$('.tipsy').remove();
});
// t('files', 'Rename')
FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () {
return OC.imagePath('core', 'actions/rename');
}, function (filename) {
FileList.rename(filename);
});
FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) {
var dir = $('#dir').val() || '/';
if (dir !== '/') {
dir = dir + '/';
}
FileList.changeDirectory(dir + filename);
});
FileActions.setDefault('dir', 'Open');

File diff suppressed because it is too large Load diff

View file

@ -8,257 +8,296 @@
*
*/
/* global OC, t, FileList */
/* global getURLParameter */
var Files = {
// file space size sync
_updateStorageStatistics: function() {
Files._updateStorageStatisticsTimeout = null;
var currentDir = FileList.getCurrentDirectory(),
state = Files.updateStorageStatistics;
if (state.dir){
if (state.dir === currentDir) {
/**
* Utility class for file related operations
*/
(function() {
var Files = {
// file space size sync
_updateStorageStatistics: function(currentDir) {
var state = Files.updateStorageStatistics;
if (state.dir){
if (state.dir === currentDir) {
return;
}
// cancel previous call, as it was for another dir
state.call.abort();
}
state.dir = currentDir;
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) {
state.dir = null;
state.call = null;
Files.updateMaxUploadFilesize(response);
});
},
/**
* Update storage statistics such as free space, max upload,
* etc based on the given directory.
*
* Note this function is debounced to avoid making too
* many ajax calls in a row.
*
* @param dir directory
* @param force whether to force retrieving
*/
updateStorageStatistics: function(dir, force) {
if (!OC.currentUser) {
return;
}
// cancel previous call, as it was for another dir
state.call.abort();
}
state.dir = currentDir;
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) {
state.dir = null;
state.call = null;
Files.updateMaxUploadFilesize(response);
});
},
updateStorageStatistics: function(force) {
if (!OC.currentUser) {
return;
}
// debounce to prevent calling too often
if (Files._updateStorageStatisticsTimeout) {
clearTimeout(Files._updateStorageStatisticsTimeout);
}
if (force) {
Files._updateStorageStatistics();
}
else {
Files._updateStorageStatisticsTimeout = setTimeout(Files._updateStorageStatistics, 250);
}
},
updateMaxUploadFilesize:function(response) {
if (response === undefined) {
return;
}
if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) {
$('#max_upload').val(response.data.uploadMaxFilesize);
$('#free_space').val(response.data.freeSpace);
$('#upload.button').attr('original-title', response.data.maxHumanFilesize);
$('#usedSpacePercent').val(response.data.usedSpacePercent);
Files.displayStorageWarnings();
}
if (response[0] === undefined) {
return;
}
if (response[0].uploadMaxFilesize !== undefined) {
$('#max_upload').val(response[0].uploadMaxFilesize);
$('#upload.button').attr('original-title', response[0].maxHumanFilesize);
$('#usedSpacePercent').val(response[0].usedSpacePercent);
Files.displayStorageWarnings();
}
},
/**
* Fix path name by removing double slash at the beginning, if any
*/
fixPath: function(fileName) {
if (fileName.substr(0, 2) == '//') {
return fileName.substr(1);
}
return fileName;
},
/**
* Checks whether the given file name is valid.
* @param name file name to check
* @return true if the file name is valid.
* Throws a string exception with an error message if
* the file name is not valid
*/
isFileNameValid: function (name) {
var trimmedName = name.trim();
if (trimmedName === '.' || trimmedName === '..')
{
throw t('files', '"{name}" is an invalid file name.', {name: name});
} else if (trimmedName.length === 0) {
throw t('files', 'File name cannot be empty.');
}
// check for invalid characters
var invalidCharacters =
['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n'];
for (var i = 0; i < invalidCharacters.length; i++) {
if (trimmedName.indexOf(invalidCharacters[i]) !== -1) {
throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.");
if (force) {
Files._updateStorageStatistics(dir);
}
}
return true;
},
displayStorageWarnings: function() {
if (!OC.Notification.isHidden()) {
return;
}
var usedSpacePercent = $('#usedSpacePercent').val();
if (usedSpacePercent > 98) {
OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!'));
return;
}
if (usedSpacePercent > 90) {
OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)',
{usedSpacePercent: usedSpacePercent}));
}
},
displayEncryptionWarning: function() {
if (!OC.Notification.isHidden()) {
return;
}
var encryptedFiles = $('#encryptedFiles').val();
var initStatus = $('#encryptionInitStatus').val();
if (initStatus === '0') { // enc not initialized, but should be
OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again'));
return;
}
if (initStatus === '1') { // encryption tried to init but failed
OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.'));
return;
}
if (encryptedFiles === '1') {
OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.'));
return;
}
},
// TODO: move to FileList class
setupDragAndDrop: function() {
var $fileList = $('#fileList');
//drag/drop of files
$fileList.find('tr td.filename').each(function(i,e) {
if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) {
$(e).draggable(dragOptions);
else {
Files._updateStorageStatisticsDebounced(dir);
}
});
},
$fileList.find('tr[data-type="dir"] td.filename').each(function(i,e) {
if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE) {
$(e).droppable(folderDropOptions);
updateMaxUploadFilesize:function(response) {
if (response === undefined) {
return;
}
if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) {
$('#max_upload').val(response.data.uploadMaxFilesize);
$('#free_space').val(response.data.freeSpace);
$('#upload.button').attr('original-title', response.data.maxHumanFilesize);
$('#usedSpacePercent').val(response.data.usedSpacePercent);
Files.displayStorageWarnings();
}
if (response[0] === undefined) {
return;
}
if (response[0].uploadMaxFilesize !== undefined) {
$('#max_upload').val(response[0].uploadMaxFilesize);
$('#upload.button').attr('original-title', response[0].maxHumanFilesize);
$('#usedSpacePercent').val(response[0].usedSpacePercent);
Files.displayStorageWarnings();
}
});
},
/**
* Returns the download URL of the given file(s)
* @param filename string or array of file names to download
* @param dir optional directory in which the file name is, defaults to the current directory
*/
getDownloadUrl: function(filename, dir) {
if ($.isArray(filename)) {
filename = JSON.stringify(filename);
}
var params = {
dir: dir || FileList.getCurrentDirectory(),
files: filename
};
return this.getAjaxUrl('download', params);
},
},
/**
* Returns the ajax URL for a given action
* @param action action string
* @param params optional params map
*/
getAjaxUrl: function(action, params) {
var q = '';
if (params) {
q = '?' + OC.buildQueryString(params);
}
return OC.filePath('files', 'ajax', action + '.php') + q;
}
};
$(document).ready(function() {
// FIXME: workaround for trashbin app
if (window.trashBinApp) {
return;
}
Files.displayEncryptionWarning();
Files.bindKeyboardShortcuts(document, jQuery);
/**
* Fix path name by removing double slash at the beginning, if any
*/
fixPath: function(fileName) {
if (fileName.substr(0, 2) == '//') {
return fileName.substr(1);
}
return fileName;
},
Files.setupDragAndDrop();
/**
* Checks whether the given file name is valid.
* @param name file name to check
* @return true if the file name is valid.
* Throws a string exception with an error message if
* the file name is not valid
*/
isFileNameValid: function (name) {
var trimmedName = name.trim();
if (trimmedName === '.' || trimmedName === '..')
{
throw t('files', '"{name}" is an invalid file name.', {name: name});
} else if (trimmedName.length === 0) {
throw t('files', 'File name cannot be empty.');
}
// check for invalid characters
var invalidCharacters =
['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n'];
for (var i = 0; i < invalidCharacters.length; i++) {
if (trimmedName.indexOf(invalidCharacters[i]) !== -1) {
throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.");
}
}
return true;
},
displayStorageWarnings: function() {
if (!OC.Notification.isHidden()) {
return;
}
$('#file_action_panel').attr('activeAction', false);
var usedSpacePercent = $('#usedSpacePercent').val();
if (usedSpacePercent > 98) {
OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!'));
return;
}
if (usedSpacePercent > 90) {
OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)',
{usedSpacePercent: usedSpacePercent}));
}
},
// Triggers invisible file input
$('#upload a').on('click', function() {
$(this).parent().children('#file_upload_start').trigger('click');
return false;
});
displayEncryptionWarning: function() {
// Trigger cancelling of file upload
$('#uploadprogresswrapper .stop').on('click', function() {
OC.Upload.cancelUploads();
FileList.updateSelectionSummary();
});
if (!OC.Notification.isHidden()) {
return;
}
// Show trash bin
$('#trash').on('click', function() {
window.location=OC.filePath('files_trashbin', '', 'index.php');
});
var encryptedFiles = $('#encryptedFiles').val();
var initStatus = $('#encryptionInitStatus').val();
if (initStatus === '0') { // enc not initialized, but should be
OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again'));
return;
}
if (initStatus === '1') { // encryption tried to init but failed
OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.'));
return;
}
if (encryptedFiles === '1') {
OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.'));
return;
}
},
// drag&drop support using jquery.fileupload
// TODO use OC.dialogs
$(document).bind('drop dragover', function (e) {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
/**
* Returns the download URL of the given file(s)
* @param filename string or array of file names to download
* @param dir optional directory in which the file name is, defaults to the current directory
*/
getDownloadUrl: function(filename, dir) {
if ($.isArray(filename)) {
filename = JSON.stringify(filename);
}
var params = {
dir: dir,
files: filename
};
return this.getAjaxUrl('download', params);
},
//do a background scan if needed
scanFiles();
/**
* Returns the ajax URL for a given action
* @param action action string
* @param params optional params map
*/
getAjaxUrl: function(action, params) {
var q = '';
if (params) {
q = '?' + OC.buildQueryString(params);
}
return OC.filePath('files', 'ajax', action + '.php') + q;
},
// display storage warnings
setTimeout(Files.displayStorageWarnings, 100);
OC.Notification.setDefault(Files.displayStorageWarnings);
// only possible at the moment if user is logged in
if (OC.currentUser) {
// start on load - we ask the server every 5 minutes
var updateStorageStatisticsInterval = 5*60*1000;
var updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval);
// Use jquery-visibility to de-/re-activate file stats sync
if ($.support.pageVisibility) {
$(document).on({
'show.visibility': function() {
if (!updateStorageStatisticsIntervalId) {
updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval);
getMimeIcon: function(mime, ready) {
if (Files.getMimeIcon.cache[mime]) {
ready(Files.getMimeIcon.cache[mime]);
} else {
$.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) {
if(OC.Util.hasSVGSupport()){
path = path.substr(0, path.length-4) + '.svg';
}
},
'hide.visibility': function() {
clearInterval(updateStorageStatisticsIntervalId);
updateStorageStatisticsIntervalId = 0;
Files.getMimeIcon.cache[mime]=path;
ready(Files.getMimeIcon.cache[mime]);
});
}
},
/**
* Generates a preview URL based on the URL space.
* @param urlSpec map with {x: width, y: height, file: file path}
* @return preview URL
* @deprecated used OCA.Files.FileList.generatePreviewUrl instead
*/
generatePreviewUrl: function(urlSpec) {
console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance');
return OCA.Files.App.fileList.generatePreviewUrl(urlSpec);
},
/**
* Lazy load preview
* @deprecated used OCA.Files.FileList.lazyLoadPreview instead
*/
lazyLoadPreview : function(path, mime, ready, width, height, etag) {
console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance');
return OCA.Files.App.fileList.lazyLoadPreview({
path: path,
mime: mime,
callback: ready,
width: width,
height: height,
etag: etag
});
},
/**
* Initialize the files view
*/
initialize: function() {
Files.getMimeIcon.cache = {};
Files.displayEncryptionWarning();
Files.bindKeyboardShortcuts(document, $);
// TODO: move file list related code (upload) to OCA.Files.FileList
$('#file_action_panel').attr('activeAction', false);
// Triggers invisible file input
$('#upload a').on('click', function() {
$(this).parent().children('#file_upload_start').trigger('click');
return false;
});
// Trigger cancelling of file upload
$('#uploadprogresswrapper .stop').on('click', function() {
OC.Upload.cancelUploads();
});
// drag&drop support using jquery.fileupload
// TODO use OC.dialogs
$(document).bind('drop dragover', function (e) {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
//do a background scan if needed
scanFiles();
// display storage warnings
setTimeout(Files.displayStorageWarnings, 100);
OC.Notification.setDefault(Files.displayStorageWarnings);
// only possible at the moment if user is logged in or the files app is loaded
if (OC.currentUser && OCA.Files.App) {
// start on load - we ask the server every 5 minutes
var updateStorageStatisticsInterval = 5*60*1000;
var updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval);
// TODO: this should also stop when switching to another view
// Use jquery-visibility to de-/re-activate file stats sync
if ($.support.pageVisibility) {
$(document).on({
'show.visibility': function() {
if (!updateStorageStatisticsIntervalId) {
updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval);
}
},
'hide.visibility': function() {
clearInterval(updateStorageStatisticsIntervalId);
updateStorageStatisticsIntervalId = 0;
}
});
}
}
$('#app-settings-header').on('click', function() {
var $settings = $('#app-settings');
$settings.toggleClass('opened');
if ($settings.hasClass('opened')) {
$settings.find('input').focus();
}
});
//scroll to and highlight preselected file
/*
if (getURLParameter('scrollto')) {
FileList.scrollTo(getURLParameter('scrollto'));
}
*/
}
}
//scroll to and highlight preselected file
if (getURLParameter('scrollto')) {
FileList.scrollTo(getURLParameter('scrollto'));
}
});
Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250);
OCA.Files.Files = Files;
})();
function scanFiles(force, dir, users) {
if (!OC.currentUser) {
@ -292,7 +331,9 @@ function scanFiles(force, dir, users) {
scannerEventSource.listen('done',function(count) {
scanFiles.scanning=false;
console.log('done after ' + count + ' files');
Files.updateStorageStatistics();
if (OCA.Files.App) {
OCA.Files.App.fileList.updateStorageStatistics(true);
}
});
scannerEventSource.listen('user',function(user) {
console.log('scanning files for ' + user);
@ -303,6 +344,7 @@ scanFiles.scanning=false;
// TODO: move to FileList
var createDragShadow = function(event) {
//select dragged file
var FileList = OCA.Files.App.fileList;
var isDragSelected = $(event.target).parents('tr').find('td input:first').prop('checked');
if (!isDragSelected) {
//select dragged file
@ -311,7 +353,7 @@ var createDragShadow = function(event) {
// do not show drag shadow for too many files
var selectedFiles = _.first(FileList.getSelectedFiles(), FileList.pageSize);
selectedFiles.sort(FileList._fileInfoCompare);
selectedFiles = _.sortBy(selectedFiles, FileList._fileInfoCompare);
if (!isDragSelected && selectedFiles.length === 1) {
//revert the selection
@ -323,7 +365,7 @@ var createDragShadow = function(event) {
var tbody = $('<tbody></tbody>');
dragshadow.append(tbody);
var dir=$('#dir').val();
var dir = FileList.getCurrentDirectory();
$(selectedFiles).each(function(i,elem) {
var newtr = $('<tr/>')
@ -336,8 +378,8 @@ var createDragShadow = function(event) {
if (elem.type === 'dir') {
newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')');
} else {
var path = getPathForPreview(elem.name);
Files.lazyLoadPreview(path, elem.mime, function(previewpath) {
var path = dir + '/' + elem.name;
OCA.Files.App.files.lazyLoadPreview(path, elem.mime, function(previewpath) {
newtr.find('td.filename').attr('style','background-image:url('+previewpath+')');
}, null, null, elem.etag);
}
@ -350,9 +392,14 @@ var createDragShadow = function(event) {
//start&stop handlers needs some cleaning up
// TODO: move to FileList class
var dragOptions={
revert: 'invalid', revertDuration: 300,
opacity: 0.7, zIndex: 100, appendTo: 'body', cursorAt: { left: 24, top: 18 },
helper: createDragShadow, cursor: 'move',
revert: 'invalid',
revertDuration: 300,
opacity: 0.7,
zIndex: 100,
appendTo: 'body',
cursorAt: { left: 24, top: 18 },
helper: createDragShadow,
cursor: 'move',
start: function(event, ui){
var $selectedFiles = $('td.filename input:checkbox:checked');
if($selectedFiles.length > 1){
@ -383,6 +430,7 @@ var folderDropOptions = {
hoverClass: "canDrop",
drop: function( event, ui ) {
// don't allow moving a file into a selected folder
var FileList = OCA.Files.App.fileList;
if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) {
return false;
}
@ -400,115 +448,11 @@ var folderDropOptions = {
tolerance: 'pointer'
};
Files.getMimeIcon = function(mime, ready) {
if (Files.getMimeIcon.cache[mime]) {
ready(Files.getMimeIcon.cache[mime]);
} else {
$.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) {
if(OC.Util.hasSVGSupport()){
path = path.substr(0, path.length-4) + '.svg';
}
Files.getMimeIcon.cache[mime]=path;
ready(Files.getMimeIcon.cache[mime]);
});
}
}
Files.getMimeIcon.cache={};
function getPathForPreview(name) {
var path = $('#dir').val() + '/' + name;
return path;
}
/**
* Generates a preview URL based on the URL space.
* @param urlSpec map with {x: width, y: height, file: file path}
* @return preview URL
*/
Files.generatePreviewUrl = function(urlSpec) {
urlSpec = urlSpec || {};
if (!urlSpec.x) {
urlSpec.x = $('#filestable').data('preview-x');
}
if (!urlSpec.y) {
urlSpec.y = $('#filestable').data('preview-y');
}
urlSpec.y *= window.devicePixelRatio;
urlSpec.x *= window.devicePixelRatio;
urlSpec.forceIcon = 0;
return OC.generateUrl('/core/preview.png?') + $.param(urlSpec);
};
Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
// get mime icon url
Files.getMimeIcon(mime, function(iconURL) {
var previewURL,
urlSpec = {};
ready(iconURL); // set mimeicon URL
urlSpec.file = Files.fixPath(path);
if (etag){
// use etag as cache buster
urlSpec.c = etag;
}
else {
console.warn('Files.lazyLoadPreview(): missing etag argument');
}
previewURL = Files.generatePreviewUrl(urlSpec);
previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29');
// preload image to prevent delay
// this will make the browser cache the image
var img = new Image();
img.onload = function(){
// if loading the preview image failed (no preview for the mimetype) then img.width will < 5
if (img.width > 5) {
ready(previewURL);
}
};
img.src = previewURL;
});
};
function getUniqueName(name) {
if (FileList.findFileEl(name).exists()) {
var numMatch;
var parts=name.split('.');
var extension = "";
if (parts.length > 1) {
extension=parts.pop();
}
var base=parts.join('.');
numMatch=base.match(/\((\d+)\)/);
var num=2;
if (numMatch && numMatch.length>0) {
num=parseInt(numMatch[numMatch.length-1])+1;
base=base.split('(');
base.pop();
base=$.trim(base.join('('));
}
name=base+' ('+num+')';
if (extension) {
name = name+'.'+extension;
}
return getUniqueName(name);
}
return name;
}
function checkTrashStatus() {
$.post(OC.filePath('files_trashbin', 'ajax', 'isEmpty.php'), function(result) {
if (result.data.isEmpty === false) {
$("input[type=button][id=trash]").removeAttr("disabled");
}
});
}
// override core's fileDownloadPath (legacy)
function fileDownloadPath(dir, file) {
return Files.getDownloadUrl(file, dir);
return OCA.Files.Files.getDownloadUrl(file, dir);
}
// for backward compatibility
window.Files = OCA.Files.Files;

View file

@ -190,6 +190,6 @@
this.$el.append($summary);
}
};
window.FileSummary = FileSummary;
OCA.Files.FileSummary = FileSummary;
})();

View file

@ -12,7 +12,6 @@
* enter: open file/folder
* delete/backspace: delete file/folder
*****************************/
var Files = Files || {};
(function(Files) {
var keys = [];
var keyCodes = {
@ -167,4 +166,4 @@ var Files = Files || {};
removeA(keys, event.keyCode);
});
};
})(Files);
})((OCA.Files && OCA.Files.Files) || {});

122
apps/files/js/navigation.js Normal file
View file

@ -0,0 +1,122 @@
/*
* Copyright (c) 2014
*
* @author Vincent Petry
* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
(function() {
var Navigation = function($el) {
this.initialize($el);
};
Navigation.prototype = {
/**
* Currently selected item in the list
*/
_activeItem: null,
/**
* Currently selected container
*/
$currentContent: null,
/**
* Initializes the navigation from the given container
* @param $el element containing the navigation
*/
initialize: function($el) {
this.$el = $el;
this._activeItem = null;
this.$currentContent = null;
this._setupEvents();
},
/**
* Setup UI events
*/
_setupEvents: function() {
this.$el.on('click', 'li a', _.bind(this._onClickItem, this));
},
/**
* Returns the container of the currently active app.
*
* @return app container
*/
getActiveContainer: function() {
return this.$currentContent;
},
/**
* Returns the currently active item
*
* @return item ID
*/
getActiveItem: function() {
return this._activeItem;
},
/**
* Switch the currently selected item, mark it as selected and
* make the content container visible, if any.
*
* @param string itemId id of the navigation item to select
* @param array options "silent" to not trigger event
*/
setActiveItem: function(itemId, options) {
var oldItemId = this._activeItem;
if (itemId === this._activeItem) {
if (!options || !options.silent) {
this.$el.trigger(
new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId})
);
}
return;
}
this.$el.find('li').removeClass('selected');
if (this.$currentContent) {
this.$currentContent.addClass('hidden');
this.$currentContent.trigger(jQuery.Event('hide'));
}
this._activeItem = itemId;
this.$el.find('li[data-id=' + itemId + ']').addClass('selected');
this.$currentContent = $('#app-content-' + itemId);
this.$currentContent.removeClass('hidden');
if (!options || !options.silent) {
this.$currentContent.trigger(jQuery.Event('show'));
this.$el.trigger(
new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId})
);
}
},
/**
* Returns whether a given item exists
*/
itemExists: function(itemId) {
return this.$el.find('li[data-id=' + itemId + ']').length;
},
/**
* Event handler for when clicking on an item.
*/
_onClickItem: function(ev) {
var $target = $(ev.target);
var itemId = $target.closest('li').attr('data-id');
this.setActiveItem(itemId);
return false;
}
};
OCA.Files.Navigation = Navigation;
})();

View file

@ -52,12 +52,13 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 = غير محدود",
"Maximum input size for ZIP files" => "الحد الأقصى المسموح به لملفات ZIP",
"Save" => "حفظ",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "استخدم هذا العنوان لـ <a href=\"%s\" target=\"_blank\">الدخول الى ملفاتك عن طريق WebDAV</a>",
"New" => "جديد",
"Text file" => "ملف",
"New folder" => "مجلد جديد",
"Folder" => "مجلد",
"From link" => "من رابط",
"Deleted files" => "حذف الملفات",
"Cancel upload" => "إلغاء رفع الملفات",
"Nothing in here. Upload something!" => "لا يوجد شيء هنا. إرفع بعض الملفات!",
"Download" => "تحميل",

View file

@ -1,29 +1,67 @@
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Nun pudo movese %s - Yá existe un ficheru con esi nome.",
"Could not move %s" => "Nun pudo movese %s",
"File name cannot be empty." => "El nome de ficheru nun pue quedar baleru.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválidu, los caráuteres \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" nun tán permitíos.",
"Unable to set upload directory." => "Nun se puede afitar la carpeta de xubida.",
"Invalid Token" => "Token inválidu",
"No file was uploaded. Unknown error" => "Nun se xubió dengún ficheru. Fallu desconocíu",
"There is no error, the file uploaded with success" => "Nun hai dengún fallu, el ficheru xubióse ensin problemes",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "El ficheru xubíu perpasa la direutiva \"upload_max_filesize\" del ficheru php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "El ficheru xubíu perpasa la direutiva \"MAX_FILE_SIZE\" especificada nel formulariu HTML",
"The uploaded file was only partially uploaded" => "El ficheru xubióse de mou parcial",
"No file was uploaded" => "Nun se xubió dengún ficheru",
"Missing a temporary folder" => "Falta una carpeta temporal",
"Failed to write to disk" => "Fallu al escribir al discu",
"Not enough storage available" => "Nun hai abondu espaciu disponible",
"Upload failed. Could not find uploaded file" => "Xubida fallía. Nun se pudo atopar el ficheru xubíu.",
"Upload failed. Could not get file info." => "Falló la xubida. Nun se pudo obtener la información del ficheru.",
"Invalid directory." => "Carpeta non válida.",
"Files" => "Ficheros",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nun se pudo xubir {filename}, paez que ye un directoriu o tien 0 bytes",
"Upload cancelled." => "Xubida encaboxada.",
"Could not get result from server." => "Nun se pudo obtener el resultáu del servidor.",
"File upload is in progress. Leaving the page now will cancel the upload." => "La xubida del ficheru ta en progresu. Si dexes esta páxina encaboxarase la xubida.",
"{new_name} already exists" => "{new_name} yá existe",
"Share" => "Compartir",
"Delete permanently" => "Desaniciar dafechu",
"Rename" => "Renomar",
"Your download is being prepared. This might take some time if the files are big." => "Ta preparándose la descarga. Esto podría llevar dalgún tiempu si los ficheros son grandes.",
"Error moving file" => "Fallu moviendo'l ficheru",
"Error" => "Fallu",
"Name" => "Nome",
"Size" => "Tamañu",
"Modified" => "Modificáu",
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
"Your storage is full, files can not be updated or synced anymore!" => "L'almacenamientu ta completu, ¡yá nun se pueden anovar o sincronizar ficheros!",
"Your storage is almost full ({usedSpacePercent}%)" => "L'almacenamientu ta casi completu ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Deshabilitose'l cifráu pero los tos ficheros tovía tan cifraos. Por favor, vete a los axustes personales pa descrifrar los tos ficheros.",
"%s could not be renamed" => "Nun se puede renomar %s ",
"File handling" => "Alministración de ficheros",
"Maximum upload size" => "Tamañu máximu de xubida",
"max. possible: " => "máx. posible:",
"Needed for multi-file and folder downloads." => "Ye necesariu pa descargues multificheru y de carpetes",
"Enable ZIP-download" => "Activar descarga ZIP",
"0 is unlimited" => "0 ye illimitao",
"Maximum input size for ZIP files" => "Tamañu máximu d'entrada pa ficheros ZIP",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Usa esta direición pa <a href=\"%s/server/5.0/user_manual/files/files.html\" target=\"_blank\">acceder a los ficheros a traviés de WebDAV</a>",
"New" => "Nuevu",
"Text file" => "Ficheru de testu",
"New folder" => "Nueva carpeta",
"Folder" => "Carpeta",
"From link" => "Dende enllaz",
"Cancel upload" => "Encaboxar xuba",
"Nothing in here. Upload something!" => "Nun hai nada equí. ¡Xubi daqué!",
"Download" => "Descargar",
"Delete" => "Desaniciar"
"Delete" => "Desaniciar",
"Upload too large" => "La xubida ye demasiao grande",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los ficheros que tas intentando xubir perpasen el tamañu máximu pa les xubíes de ficheros nesti servidor.",
"Files are being scanned, please wait." => "Tan escaniándose los ficheros, espera por favor.",
"Current scanning" => "Escanéu actual"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -23,6 +23,7 @@ $TRANSLATIONS = array(
"Maximum upload size" => "Максимален размер за качване",
"0 is unlimited" => "Ползвайте 0 за без ограничения",
"Save" => "Запис",
"WebDAV" => "WebDAV",
"New" => "Ново",
"Text file" => "Текстов файл",
"New folder" => "Нова папка",

View file

@ -35,6 +35,7 @@ $TRANSLATIONS = array(
"0 is unlimited" => " এর অর্থ অসীম",
"Maximum input size for ZIP files" => "ZIP ফাইলের ইনপুটের সর্বোচ্চ আকার",
"Save" => "সংরক্ষণ",
"WebDAV" => "WebDAV",
"New" => "নতুন",
"Text file" => "টেক্সট ফাইল",
"Folder" => "ফোল্ডার",

View file

@ -44,6 +44,7 @@ $TRANSLATIONS = array(
"Rename" => "Reanomena",
"Your download is being prepared. This might take some time if the files are big." => "S'està preparant la baixada. Pot trigar una estona si els fitxers són grans.",
"Pending" => "Pendent",
"Error moving file." => "Error en moure el fitxer.",
"Error moving file" => "Error en moure el fitxer",
"Error" => "Error",
"Could not rename file" => "No es pot canviar el nom de fitxer",
@ -70,13 +71,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 és sense límit",
"Maximum input size for ZIP files" => "Mida màxima d'entrada per fitxers ZIP",
"Save" => "Desa",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Useu aquesta adreça per <a href=\"%s\" target=\"_blank\">accedir als fitxers via WebDAV</a>",
"New" => "Nou",
"New text file" => "Nou fitxer de text",
"Text file" => "Fitxer de text",
"New folder" => "Carpeta nova",
"Folder" => "Carpeta",
"From link" => "Des d'enllaç",
"Deleted files" => "Fitxers esborrats",
"Cancel upload" => "Cancel·la la pujada",
"You dont have permission to upload or create files here" => "No teniu permisos per a pujar o crear els fitxers aquí",
"Nothing in here. Upload something!" => "Res per aquí. Pugeu alguna cosa!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 znamená bez omezení",
"Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory",
"Save" => "Uložit",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Použijte <a href=\"%s\" target=\"_blank\">tuto adresu pro přístup k vašim souborům přes WebDAV</a>",
"New" => "Nový",
"New text file" => "Nový textový soubor",
"Text file" => "Textový soubor",
"New folder" => "Nová složka",
"Folder" => "Složka",
"From link" => "Z odkazu",
"Deleted files" => "Odstraněné soubory",
"Cancel upload" => "Zrušit odesílání",
"You dont have permission to upload or create files here" => "Nemáte oprávnění zde nahrávat či vytvářet soubory",
"Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.",

View file

@ -44,7 +44,6 @@ $TRANSLATIONS = array(
"Text file" => "Ffeil destun",
"Folder" => "Plygell",
"From link" => "Dolen o",
"Deleted files" => "Ffeiliau ddilewyd",
"Cancel upload" => "Diddymu llwytho i fyny",
"Nothing in here. Upload something!" => "Does dim byd fan hyn. Llwythwch rhywbeth i fyny!",
"Download" => "Llwytho i lawr",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 er ubegrænset",
"Maximum input size for ZIP files" => "Maksimal størrelse på ZIP filer",
"Save" => "Gem",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Brug denne adresse for at <a href=\"%s\" target=\"_blank\">tilgå dine filer via WebDAV</a>",
"New" => "Ny",
"New text file" => "Ny tekstfil",
"Text file" => "Tekstfil",
"New folder" => "Ny Mappe",
"Folder" => "Mappe",
"From link" => "Fra link",
"Deleted files" => "Slettede filer",
"Cancel upload" => "Fortryd upload",
"You dont have permission to upload or create files here" => "Du har ikke tilladelse til at uploade eller oprette filer her",
"Nothing in here. Upload something!" => "Her er tomt. Upload noget!",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"All files" => "Alle Dateien",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, du möchtest {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 bedeutet unbegrenzt",
"Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien",
"Save" => "Speichern",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Verwenden Sie diese Adresse, um <a href=\"%s\" target=\"_blank\">via WebDAV auf Ihre Dateien zuzugreifen</a>",
"New" => "Neu",
"New text file" => "Neue Textdatei",
"Text file" => "Textdatei",
"New folder" => "Neuer Ordner",
"Folder" => "Ordner",
"From link" => "Von einem Link",
"Deleted files" => "Gelöschte Dateien",
"Cancel upload" => "Upload abbrechen",
"You dont have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen",
"Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!",

View file

@ -44,12 +44,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 bedeutet unbegrenzt",
"Maximum input size for ZIP files" => "Maximale Grösse für ZIP-Dateien",
"Save" => "Speichern",
"WebDAV" => "WebDAV",
"New" => "Neu",
"Text file" => "Textdatei",
"New folder" => "Neues Verzeichnis",
"Folder" => "Ordner",
"From link" => "Von einem Link",
"Deleted files" => "Gelöschte Dateien",
"Cancel upload" => "Upload abbrechen",
"Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!",
"Download" => "Herunterladen",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Die Dateiinformationen konnten nicht abgerufen werden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"All files" => "Alle Dateien",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, Sie möchten {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 bedeutet unbegrenzt",
"Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien",
"Save" => "Speichern",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Verwenden Sie diese Adresse, um <a href=\"%s\" target=\"_blank\">via WebDAV auf Ihre Dateien zuzugreifen</a>",
"New" => "Neu",
"New text file" => "Neue Textdatei",
"Text file" => "Textdatei",
"New folder" => "Neuer Ordner",
"Folder" => "Ordner",
"From link" => "Von einem Link",
"Deleted files" => "Gelöschte Dateien",
"Cancel upload" => "Upload abbrechen",
"You dont have permission to upload or create files here" => "Sie besitzen hier keine Berechtigung Dateien hochzuladen oder zu erstellen",
"Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!",

View file

@ -44,6 +44,7 @@ $TRANSLATIONS = array(
"Rename" => "Μετονομασία",
"Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.",
"Pending" => "Εκκρεμεί",
"Error moving file." => "Σφάλμα κατά τη μετακίνηση του αρχείου.",
"Error moving file" => "Σφάλμα κατά τη μετακίνηση του αρχείου",
"Error" => "Σφάλμα",
"Could not rename file" => "Αδυναμία μετονομασίας αρχείου",
@ -71,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 για απεριόριστο",
"Maximum input size for ZIP files" => "Μέγιστο μέγεθος για αρχεία ZIP",
"Save" => "Αποθήκευση",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Χρησιμοποιήστε αυτήν την διεύθυνση για να αποκτήσετε <a href=\"%s\" target=\"_blank\">πρόσβαση στα αρχεία σας μέσω WebDAV</a>",
"New" => "Νέο",
"New text file" => "Νέο αρχείο κειμένου",
"Text file" => "Αρχείο κειμένου",
"New folder" => "Νέος κατάλογος",
"Folder" => "Φάκελος",
"From link" => "Από σύνδεσμο",
"Deleted files" => "Διαγραμμένα αρχεία",
"Cancel upload" => "Ακύρωση αποστολής",
"You dont have permission to upload or create files here" => "Δεν έχετε δικαιώματα φόρτωσης ή δημιουργίας αρχείων εδώ",
"Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανεβάστε κάτι!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 is unlimited",
"Maximum input size for ZIP files" => "Maximum input size for ZIP files",
"Save" => "Save",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>",
"New" => "New",
"New text file" => "New text file",
"Text file" => "Text file",
"New folder" => "New folder",
"Folder" => "Folder",
"From link" => "From link",
"Deleted files" => "Deleted files",
"Cancel upload" => "Cancel upload",
"You dont have permission to upload or create files here" => "You dont have permission to upload or create files here",
"Nothing in here. Upload something!" => "Nothing in here. Upload something!",

View file

@ -58,12 +58,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 signifas senlime",
"Maximum input size for ZIP files" => "Maksimuma enirgrando por ZIP-dosieroj",
"Save" => "Konservi",
"WebDAV" => "WebDAV",
"New" => "Nova",
"Text file" => "Tekstodosiero",
"New folder" => "Nova dosierujo",
"Folder" => "Dosierujo",
"From link" => "El ligilo",
"Deleted files" => "Forigitaj dosieroj",
"Cancel upload" => "Nuligi alŝuton",
"You dont have permission to upload or create files here" => "Vi ne havas permeson alŝuti aŭ krei dosierojn ĉi tie",
"Nothing in here. Upload something!" => "Nenio estas ĉi tie. Alŝutu ion!",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Actualización fallida. No se pudo obtener información del archivo.",
"Invalid directory." => "Directorio inválido.",
"Files" => "Archivos",
"All files" => "Todos los archivos",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "No ha sido posible subir {filename} porque es un directorio o tiene 0 bytes",
"Total file size {size1} exceeds upload limit {size2}" => "El tamaño total del archivo {size1} excede el límite {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "No hay suficiente espacio libre. Quiere subir {size1} pero solo quedan {size2}",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 significa ilimitado",
"Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Use esta URL <a href=\"%s\" target=\"_blank\">para acceder via WebDAV</a>",
"New" => "Nuevo",
"New text file" => "Nuevo archivo de texto",
"Text file" => "Archivo de texto",
"New folder" => "Nueva carpeta",
"Folder" => "Carpeta",
"From link" => "Desde enlace",
"Deleted files" => "Archivos eliminados",
"Cancel upload" => "Cancelar subida",
"You dont have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.",
"Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!",

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 significa ilimitado",
"Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Usar esta dirección para <a href=\"%s\" target=\"_blank\">acceder a tus archivos vía WebDAV</a>",
"New" => "Nuevo",
"New text file" => "Nuevo archivo de texto",
"Text file" => "Archivo de texto",
"New folder" => "Nueva Carpeta",
"Folder" => "Carpeta",
"From link" => "Desde enlace",
"Deleted files" => "Archivos borrados",
"Cancel upload" => "Cancelar subida",
"You dont have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí",
"Nothing in here. Upload something!" => "No hay nada. ¡Subí contenido!",

View file

@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -8,6 +8,7 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
"New folder" => "Nuevo directorio",
"Cancel upload" => "cancelar subida",
"Download" => "Descargar"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 significa ilimitado",
"Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Utilice esta dirección para <a href=\"%s\" target=\"_blank\">acceder a sus archivos vía WebDAV</a>",
"New" => "Nuevo",
"New text file" => "Nuevo archivo de texto",
"Text file" => "Archivo de texto",
"New folder" => "Nueva carpeta",
"Folder" => "Carpeta",
"From link" => "Desde enlace",
"Deleted files" => "Archivos eliminados",
"Cancel upload" => "Cancelar subida",
"You dont have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.",
"Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!",

View file

@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -0,0 +1,7 @@
<?php
$TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -71,13 +71,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 tähendab piiramatut",
"Maximum input size for ZIP files" => "Maksimaalne ZIP-faili sisestatava faili suurus",
"Save" => "Salvesta",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Kasuta seda aadressi <a href=\"%s\" target=\"_blank\">oma failidele ligipääsuks WebDAV kaudu</a>",
"New" => "Uus",
"New text file" => "Uus tekstifail",
"Text file" => "Tekstifail",
"New folder" => "Uus kaust",
"Folder" => "Kaust",
"From link" => "Allikast",
"Deleted files" => "Kustutatud failid",
"Cancel upload" => "Tühista üleslaadimine",
"You dont have permission to upload or create files here" => "Sul puuduvad õigused siia failide üleslaadimiseks või tekitamiseks",
"Nothing in here. Upload something!" => "Siin pole midagi. Lae midagi üles!",

View file

@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Ezin da %s mugitu - Izen hau duen fitxategia dagoeneko existitzen da",
"Could not move %s" => "Ezin dira fitxategiak mugitu %s",
"File name cannot be empty." => "Fitxategi izena ezin da hutsa izan.",
"\"%s\" is an invalid file name." => "\"%s\" ez da fitxategi izen baliogarria.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "IZen aliogabea, '\\', '/', '<', '>', ':', '\"', '|', '?' eta '*' ez daude baimenduta.",
"The target folder has been moved or deleted." => "Jatorrizko karpeta mugitu edo ezabatu da.",
"The name %s is already used in the folder %s. Please choose a different name." => "%s izena dagoeneko erabilita dago %s karpetan. Mesdez hautatu izen ezberdina.",
"Not a valid source" => "Ez da jatorri baliogarria",
"Server is not allowed to open URLs, please check the server configuration" => "Zerbitzaria ez dago URLak irekitzeko baimendua, mesedez egiaztatu zerbitzariaren konfigurazioa",
@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Baliogabeko karpeta.",
"Files" => "Fitxategiak",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Ezin da {filename} igo karpeta bat delako edo 0 byte dituelako",
"Total file size {size1} exceeds upload limit {size2}" => "Fitxategiaren tamainak {size1} igotzeko muga {size2} gainditzen du",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Ez dago leku nahikorik, zu {size1} igotzen ari zara baina bakarrik {size2} libre dago",
"Upload cancelled." => "Igoera ezeztatuta",
"Could not get result from server." => "Ezin da zerbitzaritik emaitzik lortu",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.",
@ -40,6 +44,7 @@ $TRANSLATIONS = array(
"Rename" => "Berrizendatu",
"Your download is being prepared. This might take some time if the files are big." => "Zure deskarga prestatu egin behar da. Denbora bat har lezake fitxategiak handiak badira. ",
"Pending" => "Zain",
"Error moving file." => "Errorea fitxategia mugitzean.",
"Error moving file" => "Errorea fitxategia mugitzean",
"Error" => "Errorea",
"Could not rename file" => "Ezin izan da fitxategia berrizendatu",
@ -50,6 +55,7 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"),
"_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"),
"_Uploading %n file_::_Uploading %n files_" => array("Fitxategi %n igotzen","%n fitxategi igotzen"),
"\"{name}\" is an invalid file name." => "\"{name}\" ez da fitxategi izen baliogarria.",
"Your storage is full, files can not be updated or synced anymore!" => "Zure biltegiratzea beterik dago, ezingo duzu aurrerantzean fitxategirik igo edo sinkronizatu!",
"Your storage is almost full ({usedSpacePercent}%)" => "Zure biltegiratzea nahiko beterik dago (%{usedSpacePercent})",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Enkriptazio aplikazioa gaituta dago baina zure gakoak ez daude konfiguratuta, mesedez saioa bukatu eta berriro hasi",
@ -57,6 +63,7 @@ $TRANSLATIONS = array(
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Enkriptazioa desgaitua izan da baina zure fitxategiak oraindik enkriptatuta daude. Mesedez jo zure ezarpen pertsonaletara zure fitxategiak dekodifikatzeko.",
"{dirs} and {files}" => "{dirs} eta {files}",
"%s could not be renamed" => "%s ezin da berrizendatu",
"Upload (max. %s)" => "Igo (max. %s)",
"File handling" => "Fitxategien kudeaketa",
"Maximum upload size" => "Igo daitekeen gehienezko tamaina",
"max. possible: " => "max, posiblea:",
@ -65,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 mugarik gabe esan nahi du",
"Maximum input size for ZIP files" => "ZIP fitxategien gehienezko tamaina",
"Save" => "Gorde",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "<a href=\"%s\" target=\"_blank\">helbidea erabili zure fitxategiak WebDAV bidez eskuratzeko</a>",
"New" => "Berria",
"New text file" => "Testu fitxategi berria",
"Text file" => "Testu fitxategia",
"New folder" => "Karpeta berria",
"Folder" => "Karpeta",
"From link" => "Estekatik",
"Deleted files" => "Ezabatutako fitxategiak",
"Cancel upload" => "Ezeztatu igoera",
"You dont have permission to upload or create files here" => "Ez duzu fitxategiak hona igotzeko edo hemen sortzeko baimenik",
"Nothing in here. Upload something!" => "Ez dago ezer. Igo zerbait!",

View file

@ -43,12 +43,13 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 نامحدود است",
"Maximum input size for ZIP files" => "حداکثرمقدار برای بار گزاری پرونده های فشرده",
"Save" => "ذخیره",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "از این آدرس استفاده کنید تا <a href=\"%s\" target=\"_blank\">بتوانید به فایل‌های خود توسط WebDAV دسترسی پیدا کنید</a>",
"New" => "جدید",
"Text file" => "فایل متنی",
"New folder" => "پوشه جدید",
"Folder" => "پوشه",
"From link" => "از پیوند",
"Deleted files" => "فایل های حذف شده",
"Cancel upload" => "متوقف کردن بار گذاری",
"Nothing in here. Upload something!" => "اینجا هیچ چیز نیست.",
"Download" => "دانلود",

View file

@ -27,6 +27,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Lähetys epäonnistui. Lähettävää tiedostoa ei löydetty.",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
"All files" => "Kaikki tiedostot",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kohdetta {filename} ei voi lähettää, koska se on joko kansio tai sen koko on 0 tavua",
"Total file size {size1} exceeds upload limit {size2}" => "Yhteiskoko {size1} ylittää lähetysrajan {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Ei riittävästi vapaata tilaa. Lähetyksesi koko on {size1}, mutta vain {size2} on jäljellä",
@ -71,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 on rajoittamaton",
"Maximum input size for ZIP files" => "ZIP-tiedostojen enimmäiskoko",
"Save" => "Tallenna",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Käytä tätä osoitetta <a href=\"%s\" target=\"_blank\">käyttääksesi tiedostojasi WebDAVin kautta</a>",
"New" => "Uusi",
"New text file" => "Uusi tekstitiedosto",
"Text file" => "Tekstitiedosto",
"New folder" => "Uusi kansio",
"Folder" => "Kansio",
"From link" => "Linkistä",
"Deleted files" => "Poistetut tiedostot",
"Cancel upload" => "Peru lähetys",
"You dont have permission to upload or create files here" => "Käyttöoikeutesi eivät riitä tiedostojen lähettämiseen tai kansioiden luomiseen tähän sijaintiin",
"Nothing in here. Upload something!" => "Täällä ei ole mitään. Lähetä tänne jotakin!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 est illimité",
"Maximum input size for ZIP files" => "Taille maximale pour les fichiers ZIP",
"Save" => "Sauvegarder",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Utiliser cette adresse pour <a href=\"%s\" target=\"_blank\"> accéder à vos fichiers par WebDAV</a>",
"New" => "Nouveau",
"New text file" => "Nouveau fichier texte",
"Text file" => "Fichier texte",
"New folder" => "Nouveau dossier",
"Folder" => "Dossier",
"From link" => "Depuis le lien",
"Deleted files" => "Fichiers supprimés",
"Cancel upload" => "Annuler l'envoi",
"You dont have permission to upload or create files here" => "Vous n'avez pas la permission de téléverser ou de créer des fichiers ici",
"Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "O envío fracasou. Non foi posíbel obter información do ficheiro.",
"Invalid directory." => "O directorio é incorrecto.",
"Files" => "Ficheiros",
"All files" => "Todos os ficheiros",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Non é posíbel enviar {filename}, xa que ou é un directorio ou ten 0 bytes",
"Total file size {size1} exceeds upload limit {size2}" => "O tamaño total do ficheiro {size1} excede do límite de envío {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Non hai espazo libre abondo, o seu envío é de {size1} mais só dispón de {size2}",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 significa ilimitado",
"Maximum input size for ZIP files" => "Tamaño máximo de descarga para os ficheiros ZIP",
"Save" => "Gardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Empregue esta ligazón para <a href=\"%s\" target=\"_blank\">acceder aos seus ficheiros mediante WebDAV</a>",
"New" => "Novo",
"New text file" => "Ficheiro novo de texto",
"Text file" => "Ficheiro de texto",
"New folder" => "Novo cartafol",
"Folder" => "Cartafol",
"From link" => "Desde a ligazón",
"Deleted files" => "Ficheiros eliminados",
"Cancel upload" => "Cancelar o envío",
"You dont have permission to upload or create files here" => "Non ten permisos para enviar ou crear ficheiros aquí.",
"Nothing in here. Upload something!" => "Aquí non hai nada. Envíe algo.",

View file

@ -40,11 +40,11 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 - ללא הגבלה",
"Maximum input size for ZIP files" => "גודל הקלט המרבי לקובצי ZIP",
"Save" => "שמירה",
"WebDAV" => "WebDAV",
"New" => "חדש",
"Text file" => "קובץ טקסט",
"Folder" => "תיקייה",
"From link" => "מקישור",
"Deleted files" => "קבצים שנמחקו",
"Cancel upload" => "ביטול ההעלאה",
"Nothing in here. Upload something!" => "אין כאן שום דבר. אולי ברצונך להעלות משהו?",
"Download" => "הורדה",

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 = korlátlan",
"Maximum input size for ZIP files" => "ZIP-fájlok maximális kiindulási mérete",
"Save" => "Mentés",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Ezt a címet használd, hogy <a href=\"%s\" target=\"_blank\">hozzáférj a fileokhoz WebDAV-on keresztül</a>",
"New" => "Új",
"New text file" => "Új szöveges file",
"Text file" => "Szövegfájl",
"New folder" => "Új mappa",
"Folder" => "Mappa",
"From link" => "Feltöltés linkről",
"Deleted files" => "Törölt fájlok",
"Cancel upload" => "A feltöltés megszakítása",
"You dont have permission to upload or create files here" => "Önnek nincs jogosultsága ahhoz, hogy ide állományokat töltsön föl, vagy itt újakat hozzon létre",
"Nothing in here. Upload something!" => "Itt nincs semmi. Töltsön fel valamit!",

View file

@ -63,13 +63,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 berarti tidak terbatas",
"Maximum input size for ZIP files" => "Ukuran masukan maksimum untuk berkas ZIP",
"Save" => "Simpan",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Gunakan alamat ini untuk <a href=\"%s\" target=\"_blank\">mengakses Berkas via WebDAV</a>",
"New" => "Baru",
"New text file" => "Berkas teks baru",
"Text file" => "Berkas teks",
"New folder" => "Map baru",
"Folder" => "Folder",
"From link" => "Dari tautan",
"Deleted files" => "Berkas yang dihapus",
"Cancel upload" => "Batal pengunggahan",
"You dont have permission to upload or create files here" => "Anda tidak memiliki akses untuk mengunggah atau membuat berkas disini",
"Nothing in here. Upload something!" => "Tidak ada apa-apa di sini. Unggah sesuatu!",

View file

@ -35,6 +35,7 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 er ótakmarkað",
"Maximum input size for ZIP files" => "Hámarks inntaksstærð fyrir ZIP skrár",
"Save" => "Vista",
"WebDAV" => "WebDAV",
"New" => "Nýtt",
"Text file" => "Texta skrá",
"Folder" => "Mappa",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Caricamento non riuscito. Impossibile ottenere informazioni sul file.",
"Invalid directory." => "Cartella non valida.",
"Files" => "File",
"All files" => "Tutti i file",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure ha una dimensione di 0 byte.",
"Total file size {size1} exceeds upload limit {size2}" => "La dimensione totale del file {size1} supera il limite di caricamento {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Spazio insufficiente, stai caricando {size1}, ma è rimasto solo {size2}",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 è illimitato",
"Maximum input size for ZIP files" => "Dimensione massima per i file ZIP",
"Save" => "Salva",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Utilizza questo indirizzo per <a href=\"%s\" target=\"_blank\">accedere ai tuoi file con WebDAV</a>",
"New" => "Nuovo",
"New text file" => "Nuovo file di testo",
"Text file" => "File di testo",
"New folder" => "Nuova cartella",
"Folder" => "Cartella",
"From link" => "Da collegamento",
"Deleted files" => "File eliminati",
"Cancel upload" => "Annulla invio",
"You dont have permission to upload or create files here" => "Qui non hai i permessi di caricare o creare file",
"Nothing in here. Upload something!" => "Non c'è niente qui. Carica qualcosa!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0を指定した場合は無制限",
"Maximum input size for ZIP files" => "ZIPファイルでの最大入力サイズ",
"Save" => "保存",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "<a href=\"%s\" target=\"_blank\">WebDAV 経由でファイルにアクセス</a> するにはこのアドレスを利用してください",
"New" => "新規作成",
"New text file" => "新規のテキストファイル作成",
"Text file" => "テキストファイル",
"New folder" => "新しいフォルダー",
"Folder" => "フォルダー",
"From link" => "リンク",
"Deleted files" => "ゴミ箱",
"Cancel upload" => "アップロードをキャンセル",
"You dont have permission to upload or create files here" => "ここにファイルをアップロードもしくは作成する権限がありません",
"Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。",

View file

@ -40,12 +40,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 is unlimited",
"Maximum input size for ZIP files" => "ZIP ფაილების მაქსიმუმ დასაშვები ზომა",
"Save" => "შენახვა",
"WebDAV" => "WebDAV",
"New" => "ახალი",
"Text file" => "ტექსტური ფაილი",
"New folder" => "ახალი ფოლდერი",
"Folder" => "საქაღალდე",
"From link" => "მისამართიდან",
"Deleted files" => "წაშლილი ფაილები",
"Cancel upload" => "ატვირთვის გაუქმება",
"Nothing in here. Upload something!" => "აქ არაფერი არ არის. ატვირთე რამე!",
"Download" => "ჩამოტვირთვა",

View file

@ -1,17 +1,37 @@
<?php
$TRANSLATIONS = array(
"File name cannot be empty." => "ឈ្មោះ​ឯកសារ​មិន​អាច​នៅ​ទទេ​បាន​ឡើយ។",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "ឈ្មោះ​មិន​ត្រឹម​ត្រូវ, មិន​អនុញ្ញាត '\\', '/', '<', '>', ':', '\"', '|', '?' និង '*' ទេ។",
"Files" => "ឯកសារ",
"Upload cancelled." => "បាន​បោះបង់​ការ​ផ្ទុក​ឡើង។",
"{new_name} already exists" => "មាន​ឈ្មោះ {new_name} រួច​ហើយ",
"Share" => "ចែក​រំលែក",
"Delete permanently" => "លុប​ជា​អចិន្ត្រៃយ៍",
"Rename" => "ប្ដូរ​ឈ្មោះ",
"Your download is being prepared. This might take some time if the files are big." => "ការ​ទាញយក​របស់​អ្នក​កំពុង​ត្រូវ​បាន​រៀបចំ​ហើយ។ នេះ​អាច​ចំណាយ​ពេល​មួយ​សំទុះ ប្រសិន​បើ​ឯកសារ​ធំ។",
"Pending" => "កំពុង​រង់ចាំ",
"Error" => "កំហុស",
"Name" => "ឈ្មោះ",
"Size" => "ទំហំ",
"Modified" => "បាន​កែ​ប្រែ",
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
"Maximum upload size" => "ទំហំ​ផ្ទុកឡើង​ជា​អតិបរមា",
"Enable ZIP-download" => "បើក​ការ​ទាញយក​ជា ZIP",
"0 is unlimited" => "0 គឺ​មិន​កំណត់",
"Maximum input size for ZIP files" => "ទំហំ​ចូល​ជា​អតិបរមា​សម្រាប់​ឯកសារ ZIP",
"Save" => "រក្សាទុក",
"WebDAV" => "WebDAV",
"New" => "ថ្មី",
"Text file" => "ឯកសារ​អក្សរ",
"New folder" => "ថត​ថ្មី",
"Folder" => "ថត",
"From link" => "ពី​តំណ",
"Cancel upload" => "បោះបង់​ការ​ផ្ទុកឡើង",
"Nothing in here. Upload something!" => "គ្មាន​អ្វី​នៅ​ទីនេះ​ទេ។ ផ្ទុក​ឡើង​អ្វី​មួយ!",
"Download" => "ទាញយក",
"Delete" => "លុប"
"Delete" => "លុប",
"Upload too large" => "ផ្ទុក​ឡើង​ធំ​ពេក"
);
$PLURAL_FORMS = "nplurals=1; plural=0;";

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0은 무제한입니다",
"Maximum input size for ZIP files" => "ZIP 파일 최대 크기",
"Save" => "저장",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "WebDAV로 파일에 접근하려면 <a href=\"%s\" target=\"_blank\">이 주소를 사용하십시오</a>",
"New" => "새로 만들기",
"New text file" => "새 텍스트 파일",
"Text file" => "텍스트 파일",
"New folder" => "새 폴더",
"Folder" => "폴더",
"From link" => "링크에서",
"Deleted files" => "삭제된 파일",
"Cancel upload" => "업로드 취소",
"You dont have permission to upload or create files here" => "여기에 파일을 업로드하거나 만들 권한이 없습니다",
"Nothing in here. Upload something!" => "내용이 없습니다. 업로드할 수 있습니다!",

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 yra neribotas",
"Maximum input size for ZIP files" => "Maksimalus ZIP archyvo failo dydis",
"Save" => "Išsaugoti",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Naudokite šį adresą, kad <a href=\"%s\" target=\"_blank\">pasiektumėte savo failus per WebDAV</a>",
"New" => "Naujas",
"New text file" => "Naujas tekstinis failas",
"Text file" => "Teksto failas",
"New folder" => "Naujas aplankas",
"Folder" => "Katalogas",
"From link" => "Iš nuorodos",
"Deleted files" => "Ištrinti failai",
"Cancel upload" => "Atšaukti siuntimą",
"You dont have permission to upload or create files here" => "Jūs neturite leidimo čia įkelti arba kurti failus",
"Nothing in here. Upload something!" => "Čia tuščia. Įkelkite ką nors!",

View file

@ -44,12 +44,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 ir neierobežots",
"Maximum input size for ZIP files" => "Maksimālais ievades izmērs ZIP datnēm",
"Save" => "Saglabāt",
"WebDAV" => "WebDAV",
"New" => "Jauna",
"Text file" => "Teksta datne",
"New folder" => "Jauna mape",
"Folder" => "Mape",
"From link" => "No saites",
"Deleted files" => "Dzēstās datnes",
"Cancel upload" => "Atcelt augšupielādi",
"Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšupielādēt!",
"Download" => "Lejupielādēt",

View file

@ -56,11 +56,11 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 е неограничено",
"Maximum input size for ZIP files" => "Максимална големина за внес на ZIP датотеки",
"Save" => "Сними",
"WebDAV" => "WebDAV",
"New" => "Ново",
"Text file" => "Текстуална датотека",
"Folder" => "Папка",
"From link" => "Од врска",
"Deleted files" => "Избришани датотеки",
"Cancel upload" => "Откажи прикачување",
"Nothing in here. Upload something!" => "Тука нема ништо. Снимете нешто!",
"Download" => "Преземи",

View file

@ -65,13 +65,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 er ubegrenset",
"Maximum input size for ZIP files" => "Maksimal størrelse på ZIP-filer",
"Save" => "Lagre",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Bruk denne adressen for å <a href=\"%s\" target=\"_blank\">aksessere filene dine via WebDAV</a>",
"New" => "Ny",
"New text file" => "Ny tekstfil",
"Text file" => "Tekstfil",
"New folder" => "Ny mappe",
"Folder" => "Mappe",
"From link" => "Fra link",
"Deleted files" => "Slettede filer",
"Cancel upload" => "Avbryt opplasting",
"You dont have permission to upload or create files here" => "Du har ikke tillatelse til å laste opp eller opprette filer her",
"Nothing in here. Upload something!" => "Ingenting her. Last opp noe!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 is ongelimiteerd",
"Maximum input size for ZIP files" => "Maximale grootte voor ZIP bestanden",
"Save" => "Bewaren",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Gebruik deze link <a href=\"%s\" target=\"_blank\">om uw bestanden via WebDAV te benaderen</a>",
"New" => "Nieuw",
"New text file" => "Nieuw tekstbestand",
"Text file" => "Tekstbestand",
"New folder" => "Nieuwe map",
"Folder" => "Map",
"From link" => "Vanaf link",
"Deleted files" => "Verwijderde bestanden",
"Cancel upload" => "Upload afbreken",
"You dont have permission to upload or create files here" => "U hebt geen toestemming om hier te uploaden of bestanden te maken",
"Nothing in here. Upload something!" => "Er bevindt zich hier niets. Upload een bestand!",

View file

@ -50,12 +50,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 er ubegrensa",
"Maximum input size for ZIP files" => "Maksimal storleik for ZIP-filer",
"Save" => "Lagre",
"WebDAV" => "WebDAV",
"New" => "Ny",
"Text file" => "Tekst fil",
"New folder" => "Ny mappe",
"Folder" => "Mappe",
"From link" => "Frå lenkje",
"Deleted files" => "Sletta filer",
"Cancel upload" => "Avbryt opplasting",
"Nothing in here. Upload something!" => "Ingenting her. Last noko opp!",
"Download" => "Last ned",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 - bez limitów",
"Maximum input size for ZIP files" => "Maksymalna wielkość pliku wejściowego ZIP ",
"Save" => "Zapisz",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Użyj tego adresu do <a href=\"%s\" target=\"_blank\">dostępu do twoich plików przez WebDAV</a>",
"New" => "Nowy",
"New text file" => "Nowy plik tekstowy",
"Text file" => "Plik tekstowy",
"New folder" => "Nowy folder",
"Folder" => "Folder",
"From link" => "Z odnośnika",
"Deleted files" => "Pliki usunięte",
"Cancel upload" => "Anuluj wysyłanie",
"You dont have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu",
"Nothing in here. Upload something!" => "Pusto. Wyślij coś!",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Falha no envio. Não foi possível obter informações do arquivo.",
"Invalid directory." => "Diretório inválido.",
"Files" => "Arquivos",
"All files" => "Todos os arquivos",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de fazer o envio de {filename}, pois é um diretório ou tem 0 bytes",
"Total file size {size1} exceeds upload limit {size2}" => "Tamanho total do arquivo {size1} excede limite de envio {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Não há espaço suficiente, você está enviando {size1} mas resta apenas {size2}",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 para ilimitado",
"Maximum input size for ZIP files" => "Tamanho máximo para arquivo ZIP",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Use este endereço <a href=\"%s\" target=\"_blank\">para ter acesso a seus Arquivos via WebDAV</a>",
"New" => "Novo",
"New text file" => "Novo arquivo texto",
"Text file" => "Arquivo texto",
"New folder" => "Nova pasta",
"Folder" => "Pasta",
"From link" => "Do link",
"Deleted files" => "Arquivos apagados",
"Cancel upload" => "Cancelar upload",
"You dont have permission to upload or create files here" => "Você não tem permissão para carregar ou criar arquivos aqui",
"Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!",

View file

@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Não pôde mover o ficheiro %s - Já existe um ficheiro com esse nome",
"Could not move %s" => "Não foi possível move o ficheiro %s",
"File name cannot be empty." => "O nome do ficheiro não pode estar vazio.",
"\"%s\" is an invalid file name." => "\"%s\" é um nome de ficheiro inválido.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, os caracteres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.",
"The target folder has been moved or deleted." => "A pasta de destino foi movida ou eliminada.",
"The name %s is already used in the folder %s. Please choose a different name." => "O nome %s já está em uso na pasta %s. Por favor escolha um nome diferente.",
"Not a valid source" => "Não é uma fonte válida",
"Server is not allowed to open URLs, please check the server configuration" => "O servidor não consegue abrir URLs, por favor verifique a configuração do servidor",
@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Directório Inválido",
"Files" => "Ficheiros",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de enviar {filename}, dado que é uma pasta, ou tem 0 bytes",
"Total file size {size1} exceeds upload limit {size2}" => "O tamanho total do ficheiro {size1} excede o limite de carregamento {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Não existe espaço suficiente. Está a enviar {size1} mas apenas existe {size2} disponível",
"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.",
@ -40,6 +44,7 @@ $TRANSLATIONS = array(
"Rename" => "Renomear",
"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.",
"Pending" => "Pendente",
"Error moving file." => "Erro a mover o ficheiro.",
"Error moving file" => "Erro ao mover o ficheiro",
"Error" => "Erro",
"Could not rename file" => "Não pôde renomear o ficheiro",
@ -50,6 +55,7 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n pasta","%n pastas"),
"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"),
"_Uploading %n file_::_Uploading %n files_" => array("A carregar %n ficheiro","A carregar %n ficheiros"),
"\"{name}\" is an invalid file name." => "\"{name}\" é um nome de ficheiro inválido.",
"Your storage is full, files can not be updated or synced anymore!" => "O seu armazenamento está cheio, os ficheiros não podem ser sincronizados.",
"Your storage is almost full ({usedSpacePercent}%)" => "O seu espaço de armazenamento está quase cheiro ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "A Aplicação de Encriptação está ativada, mas as suas chaves não inicializaram. Por favor termine e inicie a sessão novamente",
@ -57,6 +63,7 @@ $TRANSLATIONS = array(
"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.",
"{dirs} and {files}" => "{dirs} e {files}",
"%s could not be renamed" => "%s não pode ser renomeada",
"Upload (max. %s)" => "Enviar (max. %s)",
"File handling" => "Manuseamento de ficheiros",
"Maximum upload size" => "Tamanho máximo de envio",
"max. possible: " => "max. possivel: ",
@ -65,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 é ilimitado",
"Maximum input size for ZIP files" => "Tamanho máximo para ficheiros ZIP",
"Save" => "Guardar",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Utilize esta ligação para <a href=\"%s\" target=\"_blank\">aceder aos seus ficheiros via WebDAV</a>",
"New" => "Novo",
"New text file" => "Novo ficheiro de texto",
"Text file" => "Ficheiro de texto",
"New folder" => "Nova Pasta",
"Folder" => "Pasta",
"From link" => "Da ligação",
"Deleted files" => "Ficheiros eliminados",
"Cancel upload" => "Cancelar envio",
"You dont have permission to upload or create files here" => "Você não tem permissão para enviar ou criar ficheiros aqui",
"Nothing in here. Upload something!" => "Vazio. Envie alguma coisa!",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 este nelimitat",
"Maximum input size for ZIP files" => "Dimensiunea maximă de intrare pentru fișierele ZIP",
"Save" => "Salvează",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Folosește această adresă <a href=\"%s\" target=\"_blank\">pentru acces la fișierele tale folosind WebDAV</a>",
"New" => "Nou",
"New text file" => "Un nou fișier text",
"Text file" => "Fișier text",
"New folder" => "Un nou dosar",
"Folder" => "Dosar",
"From link" => "De la adresa",
"Deleted files" => "Fișiere șterse",
"Cancel upload" => "Anulează încărcarea",
"You dont have permission to upload or create files here" => "Nu aveti permisiunea de a incarca sau crea fisiere aici",
"Nothing in here. Upload something!" => "Nimic aici. Încarcă ceva!",

View file

@ -71,13 +71,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 - без ограничений",
"Maximum input size for ZIP files" => "Максимальный исходный размер для ZIP файлов",
"Save" => "Сохранить",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Используйте этот адресс для <a href=\"%s\" target=\"_blank\">доступа к вашим файлам через WebDAV</a>",
"New" => "Новый",
"New text file" => "Новый текстовый файл",
"Text file" => "Текстовый файл",
"New folder" => "Новый каталог",
"Folder" => "Каталог",
"From link" => "Объект по ссылке",
"Deleted files" => "Удалённые файлы",
"Cancel upload" => "Отменить загрузку",
"You dont have permission to upload or create files here" => "У вас нет прав для загрузки или создания файлов здесь.",
"Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!",

View file

@ -71,13 +71,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 znamená neobmedzené",
"Maximum input size for ZIP files" => "Najväčšia veľkosť ZIP súborov",
"Save" => "Uložiť",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Použite túto linku <a href=\"%s\" target=\"_blank\">pre prístup k vašim súborom cez WebDAV</a>",
"New" => "Nový",
"New text file" => "Nový textový súbor",
"Text file" => "Textový súbor",
"New folder" => "Nový priečinok",
"Folder" => "Priečinok",
"From link" => "Z odkazu",
"Deleted files" => "Zmazané súbory",
"Cancel upload" => "Zrušiť odosielanie",
"You dont have permission to upload or create files here" => "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory",
"Nothing in here. Upload something!" => "Žiadny súbor. Nahrajte niečo!",

View file

@ -44,6 +44,7 @@ $TRANSLATIONS = array(
"Rename" => "Preimenuj",
"Your download is being prepared. This might take some time if the files are big." => "Postopek priprave datoteke za prejem je lahko dolgotrajen, kadar je datoteka zelo velika.",
"Pending" => "V čakanju ...",
"Error moving file." => "Napaka premikanja datoteke.",
"Error moving file" => "Napaka premikanja datoteke",
"Error" => "Napaka",
"Could not rename file" => "Ni mogoče preimenovati datoteke",
@ -71,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 predstavlja neomejeno vrednost",
"Maximum input size for ZIP files" => "Največja vhodna velikost za datoteke ZIP",
"Save" => "Shrani",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Uporabite naslov <a href=\"%s\" target=\"_blank\"> za dostop do datotek rpeko sistema WebDAV</a>.",
"New" => "Novo",
"New text file" => "Nova besedilna datoteka",
"Text file" => "Besedilna datoteka",
"New folder" => "Nova mapa",
"Folder" => "Mapa",
"From link" => "Iz povezave",
"Deleted files" => "Izbrisane datoteke",
"Cancel upload" => "Prekliči pošiljanje",
"You dont have permission to upload or create files here" => "Ni ustreznih dovoljenj za pošiljanje ali ustvarjanje datotek na tem mestu.",
"Nothing in here. Upload something!" => "Tukaj še ni ničesar. Najprej je treba kakšno datoteko poslati v oblak!",

View file

@ -48,12 +48,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "o është pa limit",
"Maximum input size for ZIP files" => "Maksimumi hyrës i skedarëve ZIP",
"Save" => "Ruaj",
"WebDAV" => "WebDAV",
"New" => "E re",
"Text file" => "Skedar tekst",
"New folder" => "Dosje e're",
"Folder" => "Dosje",
"From link" => "Nga lidhja",
"Deleted files" => "Skedarë të fshirë ",
"Cancel upload" => "Anullo ngarkimin",
"Nothing in here. Upload something!" => "Këtu nuk ka asgje. Ngarko dicka",
"Download" => "Shkarko",

View file

@ -40,11 +40,11 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 је неограничено",
"Maximum input size for ZIP files" => "Највећа величина ZIP датотека",
"Save" => "Сачувај",
"WebDAV" => "WebDAV",
"New" => "Нова",
"Text file" => "текстуална датотека",
"Folder" => "фасцикла",
"From link" => "Са везе",
"Deleted files" => "Обрисане датотеке",
"Cancel upload" => "Прекини отпремање",
"Nothing in here. Upload something!" => "Овде нема ничег. Отпремите нешто!",
"Download" => "Преузми",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Uppladdning misslyckades. Gick inte att hämta filinformation.",
"Invalid directory." => "Felaktig mapp.",
"Files" => "Filer",
"All files" => "Alla 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.",
"Total file size {size1} exceeds upload limit {size2}" => "Totala filstorleken {size1} överskrider uppladdningsgränsen {size2}",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Inte tillräckligt med ledigt utrymme, du laddar upp {size1} men endast {size2} finns kvar.",
@ -44,6 +45,7 @@ $TRANSLATIONS = array(
"Rename" => "Byt namn",
"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.",
"Pending" => "Väntar",
"Error moving file." => "Fel vid flytt av fil.",
"Error moving file" => "Fel uppstod vid flyttning av fil",
"Error" => "Fel",
"Could not rename file" => "Kan ej byta filnamn",
@ -71,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 är oändligt",
"Maximum input size for ZIP files" => "Största tillåtna storlek för ZIP-filer",
"Save" => "Spara",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Använd denna adress till <a href=\"%s\" target=\"_blank\">nå dina Filer via WebDAV</a>",
"New" => "Ny",
"New text file" => "Ny textfil",
"Text file" => "Textfil",
"New folder" => "Ny mapp",
"Folder" => "Mapp",
"From link" => "Från länk",
"Deleted files" => "Raderade filer",
"Cancel upload" => "Avbryt uppladdning",
"You dont have permission to upload or create files here" => "Du har ej tillåtelse att ladda upp eller skapa filer här",
"Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!",

View file

@ -39,6 +39,7 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 หมายถึงไม่จำกัด",
"Maximum input size for ZIP files" => "ขนาดไฟล์ ZIP สูงสุด",
"Save" => "บันทึก",
"WebDAV" => "WebDAV",
"New" => "อัพโหลดไฟล์ใหม่",
"Text file" => "ไฟล์ข้อความ",
"New folder" => "โฟลเดอร์ใหม่",

View file

@ -28,6 +28,7 @@ $TRANSLATIONS = array(
"Upload failed. Could not get file info." => "Yükleme başarısız. Dosya bilgisi alınamadı.",
"Invalid directory." => "Geçersiz dizin.",
"Files" => "Dosyalar",
"All files" => "Tüm dosyalar",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Bir dizin veya 0 bayt olduğundan {filename} yüklenemedi",
"Total file size {size1} exceeds upload limit {size2}" => "Toplam dosya boyutu {size1}, {size2} gönderme sınırınııyor",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Yeterince boş alan yok. Gönderdiğiniz boyut {size1} ancak {size2} alan mevcut",
@ -72,13 +73,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 limitsiz demektir",
"Maximum input size for ZIP files" => "ZIP dosyaları için en fazla girdi boyutu",
"Save" => "Kaydet",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "<a href=\"%s\" target=\"_blank\">Dosyalarınıza WebDAV aracılığıyla erişmek için</a> bu adresi kullanın",
"New" => "Yeni",
"New text file" => "Yeni metin dosyası",
"Text file" => "Metin dosyası",
"New folder" => "Yeni klasör",
"Folder" => "Klasör",
"From link" => "Bağlantıdan",
"Deleted files" => "Silinmiş dosyalar",
"Cancel upload" => "Yüklemeyi iptal et",
"You dont have permission to upload or create files here" => "Buraya dosya yükleme veya oluşturma izniniz yok",
"Nothing in here. Upload something!" => "Burada hiçbir şey yok. Bir şeyler yükleyin!",

View file

@ -22,11 +22,11 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
"Save" => "ساقلا",
"WebDAV" => "WebDAV",
"New" => "يېڭى",
"Text file" => "تېكىست ھۆججەت",
"New folder" => "يېڭى قىسقۇچ",
"Folder" => "قىسقۇچ",
"Deleted files" => "ئۆچۈرۈلگەن ھۆججەتلەر",
"Cancel upload" => "يۈكلەشتىن ۋاز كەچ",
"Nothing in here. Upload something!" => "بۇ جايدا ھېچنېمە يوق. Upload something!",
"Download" => "چۈشۈر",

View file

@ -48,12 +48,12 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 є безліміт",
"Maximum input size for ZIP files" => "Максимальний розмір завантажуємого ZIP файлу",
"Save" => "Зберегти",
"WebDAV" => "WebDAV",
"New" => "Створити",
"Text file" => "Текстовий файл",
"New folder" => "Нова тека",
"Folder" => "Тека",
"From link" => "З посилання",
"Deleted files" => "Видалено файлів",
"Cancel upload" => "Перервати завантаження",
"Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!",
"Download" => "Завантажити",

View file

@ -1,8 +1,12 @@
<?php
$TRANSLATIONS = array(
"Share" => "تقسیم",
"Error" => "ایرر",
"Name" => "اسم",
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("","")
"_Uploading %n file_::_Uploading %n files_" => array("",""),
"Save" => "حفظ",
"Delete" => "حذف کریں"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

View file

@ -63,13 +63,13 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 là không giới hạn",
"Maximum input size for ZIP files" => "Kích thước tối đa cho các tập tin ZIP",
"Save" => "Lưu",
"WebDAV" => "WebDAV",
"New" => "Tạo mới",
"New text file" => "File text mới",
"Text file" => "Tập tin văn bản",
"New folder" => "Tạo thư mục",
"Folder" => "Thư mục",
"From link" => "Từ liên kết",
"Deleted files" => "File đã bị xóa",
"Cancel upload" => "Hủy upload",
"You dont have permission to upload or create files here" => "Bạn không có quyền upload hoặc tạo files ở đây",
"Nothing in here. Upload something!" => "Không có gì ở đây .Hãy tải lên một cái gì đó !",

View file

@ -72,13 +72,14 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0 为无限制",
"Maximum input size for ZIP files" => "ZIP 文件的最大输入大小",
"Save" => "保存",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "使用这个地址 <a href=\"%s\" target=\"_blank\">通过 WebDAV 访问您的文件</a>",
"New" => "新建",
"New text file" => "创建文本文件",
"Text file" => "文本文件",
"New folder" => "添加文件夹",
"Folder" => "文件夹",
"From link" => "来自链接",
"Deleted files" => "已删除文件",
"Cancel upload" => "取消上传",
"You dont have permission to upload or create files here" => "您没有权限来上传湖州哦和创建文件",
"Nothing in here. Upload something!" => "这里还什么都没有。上传些东西吧!",

View file

@ -62,12 +62,13 @@ $TRANSLATIONS = array(
"0 is unlimited" => "0代表沒有限制",
"Maximum input size for ZIP files" => "ZIP 壓縮前的原始大小限制",
"Save" => "儲存",
"WebDAV" => "WebDAV",
"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "使用這個地址<a href=\"%s\" target=\"_blank\">來透過 WebDAV 存取檔案</a>",
"New" => "新增",
"Text file" => "文字檔",
"New folder" => "新資料夾",
"Folder" => "資料夾",
"From link" => "從連結",
"Deleted files" => "回收桶",
"Cancel upload" => "取消上傳",
"You dont have permission to upload or create files here" => "您沒有權限在這裡上傳或建立檔案",
"Nothing in here. Upload something!" => "這裡還沒有東西,上傳一些吧!",

View file

@ -30,6 +30,11 @@ class App {
*/
private $l10n;
/**
* @var \OCP\INavigationManager
*/
private static $navigationManager;
/**
* @var \OC\Files\View
*/
@ -40,6 +45,18 @@ class App {
$this->l10n = $l10n;
}
/**
* Returns the app's navigation manager
*
* @return \OCP\INavigationManager
*/
public static function getNavigationManager() {
if (self::$navigationManager === null) {
self::$navigationManager = new \OC\NavigationManager();
}
return self::$navigationManager;
}
/**
* rename a file
*

View file

@ -1,7 +1,16 @@
<?php
/**
* Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCA\Files;
/**
* Helper class for manipulating file information
*/
class Helper
{
public static function buildFileStorageStatistics($dir) {
@ -9,12 +18,12 @@ class Helper
$storageInfo = \OC_Helper::getStorageInfo($dir);
$l = new \OC_L10N('files');
$maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']);
$maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize);
$maxHumanFilesize = $l->t('Upload (max. %s)', array($maxHumanFilesize));
$maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']);
$maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize);
$maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize));
return array('uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize,
return array('uploadMaxFilesize' => $maxUploadFileSize,
'maxHumanFilesize' => $maxHumanFileSize,
'freeSpace' => $storageInfo['free'],
'usedSpacePercent' => (int)$storageInfo['relative']);
}
@ -27,20 +36,11 @@ class Helper
*/
public static function determineIcon($file) {
if($file['type'] === 'dir') {
$dir = $file['directory'];
$icon = \OC_Helper::mimetypeIcon('dir');
$absPath = $file->getPath();
$mount = \OC\Files\Filesystem::getMountManager()->find($absPath);
if (!is_null($mount)) {
$sid = $mount->getStorageId();
if (!is_null($sid)) {
$sid = explode(':', $sid);
if ($sid[0] === 'shared') {
$icon = \OC_Helper::mimetypeIcon('dir-shared');
} elseif ($sid[0] !== 'local' and $sid[0] !== 'home') {
$icon = \OC_Helper::mimetypeIcon('dir-external');
}
}
if ($file->isShared()) {
$icon = \OC_Helper::mimetypeIcon('dir-shared');
} elseif ($file->isMounted()) {
$icon = \OC_Helper::mimetypeIcon('dir-external');
}
}else{
$icon = \OC_Helper::mimetypeIcon($file->getMimetype());
@ -57,7 +57,7 @@ class Helper
* @param \OCP\Files\FileInfo $b file
* @return int -1 if $a must come before $b, 1 otherwise
*/
public static function fileCmp($a, $b) {
public static function compareFileNames($a, $b) {
$aType = $a->getType();
$bType = $b->getType();
if ($aType === 'dir' and $bType !== 'dir') {
@ -69,6 +69,32 @@ class Helper
}
}
/**
* Comparator function to sort files by date
*
* @param \OCP\Files\FileInfo $a file
* @param \OCP\Files\FileInfo $b file
* @return int -1 if $a must come before $b, 1 otherwise
*/
public static function compareTimestamp($a, $b) {
$aTime = $a->getMTime();
$bTime = $b->getMTime();
return $aTime - $bTime;
}
/**
* Comparator function to sort files by size
*
* @param \OCP\Files\FileInfo $a file
* @param \OCP\Files\FileInfo $b file
* @return int -1 if $a must come before $b, 1 otherwise
*/
public static function compareSize($a, $b) {
$aSize = $a->getSize();
$bSize = $b->getSize();
return $aSize - $bSize;
}
/**
* Formats the file info to be returned as JSON to the client.
*
@ -120,12 +146,35 @@ class Helper
* returns it as a sorted array of FileInfo.
*
* @param string $dir path to the directory
* @param string $sortAttribute attribute to sort on
* @param bool $sortDescending true for descending sort, false otherwise
* @return \OCP\Files\FileInfo[] files
*/
public static function getFiles($dir) {
public static function getFiles($dir, $sortAttribute = 'name', $sortDescending = false) {
$content = \OC\Files\Filesystem::getDirectoryContent($dir);
usort($content, array('\OCA\Files\Helper', 'fileCmp'));
return $content;
return self::sortFiles($content, $sortAttribute, $sortDescending);
}
/**
* Sort the given file info array
*
* @param \OCP\Files\FileInfo[] $files files to sort
* @param string $sortAttribute attribute to sort on
* @param bool $sortDescending true for descending sort, false otherwise
* @return \OCP\Files\FileInfo[] sorted files
*/
public static function sortFiles($files, $sortAttribute = 'name', $sortDescending = false) {
$sortFunc = 'compareFileNames';
if ($sortAttribute === 'mtime') {
$sortFunc = 'compareTimestamp';
} else if ($sortAttribute === 'size') {
$sortFunc = 'compareSize';
}
usort($files, array('\OCA\Files\Helper', $sortFunc));
if ($sortDescending) {
$files = array_reverse($files);
}
return $files;
}
}

38
apps/files/list.php Normal file
View file

@ -0,0 +1,38 @@
<?php
/**
* ownCloud - Files list
*
* @author Vincent Petry
* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Check if we are a user
OCP\User::checkLoggedIn();
$config = \OC::$server->getConfig();
// TODO: move this to the generated config.js
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
$uploadLimit=OCP\Util::uploadLimit();
// renders the controls and table headers template
$tmpl = new OCP\Template('files', 'list', '');
$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->printPage();

View file

@ -0,0 +1,17 @@
<div id="app-navigation">
<ul>
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>"><a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"><?php p($item['name']);?></a></li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button"></button>
</div>
<div id="app-settings-content">
<h2><?php p($l->t('WebDAV'));?></h2>
<div><input id="webdavurl" type="text" readonly="readonly" value="<?php p(OC_Helper::linkToRemote('webdav')); ?>"></input></div>
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>

View file

@ -1,117 +1,15 @@
<div id="controls">
<div class="actions creatable hidden">
<?php if(!isset($_['dirToken'])):?>
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
<li class="icon-filetype-text svg"
data-type="file" data-newname="<?php p($l->t('New text file')) ?>.txt">
<p><?php p($l->t('Text file'));?></p>
</li>
<li class="icon-filetype-folder svg"
data-type="folder" data-newname="<?php p($l->t('New folder')) ?>">
<p><?php p($l->t('Folder'));?></p>
</li>
<li class="icon-link svg" data-type="web">
<p><?php p($l->t('From link'));?></p>
</li>
</ul>
</div>
<?php endif;?>
<div id="upload" class="button"
title="<?php p($l->t('Upload (max. %s)', array($_['uploadMaxHumanFilesize']))) ?>">
<?php if($_['uploadMaxFilesize'] >= 0):?>
<input type="hidden" id="max_upload" name="MAX_FILE_SIZE" value="<?php p($_['uploadMaxFilesize']) ?>">
<?php endif;?>
<input type="hidden" id="upload_limit" value="<?php p($_['uploadLimit']) ?>">
<input type="hidden" id="free_space" value="<?php p($_['freeSpace']) ?>">
<?php if(isset($_['dirToken'])):?>
<input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
<input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" />
<?php endif;?>
<input type="hidden" class="max_human_file_size"
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<input type="file" id="file_upload_start" name='files[]'
data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
<a href="#" class="svg icon-upload"></a>
</div>
<?php if ($_['trash']): ?>
<input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?> />
<?php endif; ?>
<div id="uploadprogresswrapper">
<div id="uploadprogressbar"></div>
<input type="button" class="stop" style="display:none"
value="<?php p($l->t('Cancel upload'));?>"
/>
</div>
</div>
<div id="file_action_panel"></div>
<div class="notCreatable notPublic hidden">
<?php p($l->t('You dont have permission to upload or create files here'))?>
</div>
<input type="hidden" name="permissions" value="<?php p($_['permissions']); ?>" id="permissions">
</div>
<div id="emptycontent" class="hidden"><?php p($l->t('Nothing in here. Upload something!'))?></div>
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>" />
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>
<th class="hidden" id='headerName'>
<div id="headerName-container">
<input type="checkbox" id="select_all" />
<label for="select_all"></label>
<span class="name"><?php p($l->t( 'Name' )); ?></span>
<span id="selectedActionsList" class="selectedActions">
<?php if($_['allowZipDownload']) : ?>
<a href="" class="download">
<img class="svg" alt="Download"
src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
<?php p($l->t('Download'))?>
</a>
<?php endif; ?>
</span>
</div>
</th>
<th class="hidden" id="headerSize"><?php p($l->t('Size')); ?></th>
<th class="hidden" id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
<span class="selectedActions"><a href="" class="delete-selected">
<?php p($l->t('Delete'))?>
<img class="svg" alt="<?php p($l->t('Delete'))?>"
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
</a></span>
<?php endif; ?>
</th>
</tr>
</thead>
<tbody id="fileList">
</tbody>
<tfoot>
</tfoot>
</table>
<div id="editor"></div><!-- FIXME Do not use this div in your app! It is deprecated and will be removed in the future! -->
<div id="uploadsize-message" title="<?php p($l->t('Upload too large'))?>">
<p>
<?php p($l->t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?>
</p>
</div>
<div id="scanning-message">
<h3>
<?php p($l->t('Files are being scanned, please wait.'));?> <span id='scan-count'></span>
</h3>
<p>
<?php p($l->t('Current scanning'));?> <span id='scan-current'></span>
</p>
</div>
<?php /** @var $l OC_L10N */ ?>
<?php $_['appNavigation']->printPage(); ?>
<div id="app-content">
<?php foreach ($_['appContents'] as $content) { ?>
<div id="app-content-<?php p($content['id']) ?>" class="hidden">
<?php print_unescaped($content['content']) ?>
</div>
<?php } ?>
</div><!-- closing app-content -->
<!-- config hints for javascript -->
<input type="hidden" name="filesApp" id="filesApp" value="1" />
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" />
<?php if (!$_['isPublic']) :?>
<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />

View file

@ -0,0 +1,107 @@
<div id="controls">
<div class="actions creatable hidden">
<?php if(!isset($_['dirToken'])):?>
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
<li class="icon-filetype-text svg"
data-type="file" data-newname="<?php p($l->t('New text file')) ?>.txt">
<p><?php p($l->t('Text file'));?></p>
</li>
<li class="icon-filetype-folder svg"
data-type="folder" data-newname="<?php p($l->t('New folder')) ?>">
<p><?php p($l->t('Folder'));?></p>
</li>
<li class="icon-link svg" data-type="web">
<p><?php p($l->t('From link'));?></p>
</li>
</ul>
</div>
<?php endif;?>
<?php /* Note: the template attributes are here only for the public page. These are normally loaded
through ajax instead (updateStorageStatistics).
*/ ?>
<div id="upload" class="button"
title="<?php isset($_['uploadMaxHumanFilesize']) ? p($l->t('Upload (max. %s)', array($_['uploadMaxHumanFilesize']))) : '' ?>">
<input type="hidden" id="max_upload" name="MAX_FILE_SIZE" value="<?php isset($_['uploadMaxFilesize']) ? p($_['uploadMaxFilesize']) : '' ?>">
<input type="hidden" id="upload_limit" value="<?php isset($_['uploadLimit']) ? p($_['uploadLimit']) : '' ?>">
<input type="hidden" id="free_space" value="<?php isset($_['freeSpace']) ? p($_['freeSpace']) : '' ?>">
<?php if(isset($_['dirToken'])):?>
<input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
<input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" />
<?php endif;?>
<input type="hidden" class="max_human_file_size"
value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)">
<input type="file" id="file_upload_start" name='files[]'
data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
<a href="#" class="svg icon-upload"></a>
</div>
<div id="uploadprogresswrapper">
<div id="uploadprogressbar"></div>
<input type="button" class="stop" style="display:none"
value="<?php p($l->t('Cancel upload'));?>"
/>
</div>
</div>
<div id="file_action_panel"></div>
<div class="notCreatable notPublic hidden">
<?php p($l->t('You dont have permission to upload or create files here'))?>
</div>
<input type="hidden" name="permissions" value="" id="permissions">
</div>
<div id="emptycontent" class="hidden"><?php p($l->t('Nothing in here. Upload something!'))?></div>
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
<div id="headerName-container">
<input type="checkbox" id="select_all_files" class="select-all"/>
<label for="select_all_files"></label>
<a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a>
<span id="selectedActionsList" class="selectedActions">
<?php if($_['allowZipDownload']) : ?>
<a href="" class="download">
<img class="svg" alt="Download"
src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
<?php p($l->t('Download'))?>
</a>
<?php endif; ?>
</span>
</div>
</th>
<th id="headerSize" class="hidden column-size">
<a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a>
</th>
<th id="headerDate" class="hidden column-mtime">
<a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a>
<span class="selectedActions"><a href="" class="delete-selected">
<?php p($l->t('Delete'))?>
<img class="svg" alt="<?php p($l->t('Delete'))?>"
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
</a></span>
</th>
</tr>
</thead>
<tbody id="fileList">
</tbody>
<tfoot>
</tfoot>
</table>
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
<input type="hidden" name="dir" id="dir" value="" />
<div id="editor"></div><!-- FIXME Do not use this div in your app! It is deprecated and will be removed in the future! -->
<div id="uploadsize-message" title="<?php p($l->t('Upload too large'))?>">
<p>
<?php p($l->t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?>
</p>
</div>
<div id="scanning-message">
<h3>
<?php p($l->t('Files are being scanned, please wait.'));?> <span id='scan-count'></span>
</h3>
<p>
<?php p($l->t('Current scanning'));?> <span id='scan-current'></span>
</p>
</div>

View file

@ -24,6 +24,16 @@
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
private static $user;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
private $viewMock;
/**
* @var \OCA\Files\App
*/
private $files;
function setUp() {
// mock OC_L10n
if (!self::$user) {
@ -56,7 +66,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
}
/**
* @brief test rename of file/folder
* test rename of file/folder
*/
function testRenameFolder() {
$dir = '/';
@ -72,7 +82,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
->method('getFileInfo')
->will($this->returnValue(new \OC\Files\FileInfo(
'/',
null,
new \OC\Files\Storage\Local(array('datadir' => '/')),
'/',
array(
'fileid' => 123,

View file

@ -0,0 +1,98 @@
<?php
/**
* Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once __DIR__ . '/../lib/helper.php';
use OCA\Files;
/**
* Class Test_Files_Helper
*/
class Test_Files_Helper extends \PHPUnit_Framework_TestCase {
private function makeFileInfo($name, $size, $mtime, $isDir = false) {
return new \OC\Files\FileInfo(
'/',
null,
'/',
array(
'name' => $name,
'size' => $size,
'mtime' => $mtime,
'type' => $isDir ? 'dir' : 'file',
'mimetype' => $isDir ? 'httpd/unix-directory' : 'application/octet-stream'
)
);
}
/**
* Returns a file list for testing
*/
private function getTestFileList() {
return array(
self::makeFileInfo('a.txt', 4, 1000),
self::makeFileInfo('q.txt', 5, 150),
self::makeFileInfo('subdir2', 87, 128, true),
self::makeFileInfo('b.txt', 166, 800),
self::makeFileInfo('o.txt', 12, 100),
self::makeFileInfo('subdir', 88, 125, true),
);
}
function sortDataProvider() {
return array(
array(
'name',
false,
array('subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'),
),
array(
'name',
true,
array('q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'),
),
array(
'size',
false,
array('a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'),
),
array(
'size',
true,
array('b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'),
),
array(
'mtime',
false,
array('o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'),
),
array(
'mtime',
true,
array('a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'),
),
);
}
/**
* @dataProvider sortDataProvider
*/
public function testSortByName($sort, $sortDescending, $expectedOrder) {
$files = self::getTestFileList();
$files = \OCA\Files\Helper::sortFiles($files, $sort, $sortDescending);
$fileNames = array();
foreach ($files as $fileInfo) {
$fileNames[] = $fileInfo->getName();
}
$this->assertEquals(
$expectedOrder,
$fileNames
);
}
}

View file

@ -0,0 +1,220 @@
/**
* ownCloud
*
* @author Vincent Petry
* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
describe('OCA.Files.App tests', function() {
var App = OCA.Files.App;
var pushStateStub;
var parseUrlQueryStub;
beforeEach(function() {
$('#testArea').append(
'<div id="content" class="app-files">' +
'<div id="app-navigation">' +
'<ul><li data-id="files"><a>Files</a></li>' +
'<li data-id="other"><a>Other</a></li>' +
'</div>' +
'<div id="app-content">' +
'<div id="app-content-files" class="hidden">' +
'</div>' +
'<div id="app-content-other" class="hidden">' +
'</div>' +
'</div>' +
'</div>' +
'</div>'
);
pushStateStub = sinon.stub(OC.Util.History, 'pushState');
parseUrlQueryStub = sinon.stub(OC.Util.History, 'parseUrlQuery');
parseUrlQueryStub.returns({});
App.initialize();
});
afterEach(function() {
App.navigation = null;
App.fileList = null;
App.files = null;
App.fileActions.clear();
App.fileActions = null;
pushStateStub.restore();
parseUrlQueryStub.restore();
});
describe('initialization', function() {
it('initializes the default file list with the default file actions', function() {
expect(App.fileList).toBeDefined();
expect(App.fileList.fileActions.actions.all).toBeDefined();
expect(App.fileList.$el.is('#app-content-files')).toEqual(true);
});
});
describe('URL handling', function() {
it('pushes the state to the URL when current app changed directory', function() {
$('#app-content-files').trigger(new $.Event('changeDirectory', {dir: 'subdir'}));
expect(pushStateStub.calledOnce).toEqual(true);
expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir');
expect(pushStateStub.getCall(0).args[0].view).not.toBeDefined();
$('li[data-id=other]>a').click();
pushStateStub.reset();
$('#app-content-other').trigger(new $.Event('changeDirectory', {dir: 'subdir'}));
expect(pushStateStub.calledOnce).toEqual(true);
expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir');
expect(pushStateStub.getCall(0).args[0].view).toEqual('other');
});
describe('onpopstate', function() {
it('sends "urlChanged" event to current app', function() {
var handler = sinon.stub();
$('#app-content-files').on('urlChanged', handler);
App._onPopState({view: 'files', dir: '/somedir'});
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('files');
expect(handler.getCall(0).args[0].dir).toEqual('/somedir');
});
it('sends "show" event to current app and sets navigation', function() {
var showHandlerFiles = sinon.stub();
var showHandlerOther = sinon.stub();
var hideHandlerFiles = sinon.stub();
var hideHandlerOther = sinon.stub();
$('#app-content-files').on('show', showHandlerFiles);
$('#app-content-files').on('hide', hideHandlerFiles);
$('#app-content-other').on('show', showHandlerOther);
$('#app-content-other').on('hide', hideHandlerOther);
App._onPopState({view: 'other', dir: '/somedir'});
expect(showHandlerFiles.notCalled).toEqual(true);
expect(hideHandlerFiles.calledOnce).toEqual(true);
expect(showHandlerOther.calledOnce).toEqual(true);
expect(hideHandlerOther.notCalled).toEqual(true);
showHandlerFiles.reset();
showHandlerOther.reset();
hideHandlerFiles.reset();
hideHandlerOther.reset();
App._onPopState({view: 'files', dir: '/somedir'});
expect(showHandlerFiles.calledOnce).toEqual(true);
expect(hideHandlerFiles.notCalled).toEqual(true);
expect(showHandlerOther.notCalled).toEqual(true);
expect(hideHandlerOther.calledOnce).toEqual(true);
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
expect($('#app-content-other').hasClass('hidden')).toEqual(true);
});
it('does not send "show" or "hide" event to current app when already visible', function() {
var showHandler = sinon.stub();
var hideHandler = sinon.stub();
$('#app-content-files').on('show', showHandler);
$('#app-content-files').on('hide', hideHandler);
App._onPopState({view: 'files', dir: '/somedir'});
expect(showHandler.notCalled).toEqual(true);
expect(hideHandler.notCalled).toEqual(true);
});
it('state defaults to files app with root dir', function() {
var handler = sinon.stub();
parseUrlQueryStub.returns({});
$('#app-content-files').on('urlChanged', handler);
App._onPopState();
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('files');
expect(handler.getCall(0).args[0].dir).toEqual('/');
});
it('activates files app if invalid view is passed', function() {
App._onPopState({view: 'invalid', dir: '/somedir'});
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
});
});
describe('navigation', function() {
it('switches the navigation item and panel visibility when onpopstate', function() {
App._onPopState({view: 'other', dir: '/somedir'});
expect(App.navigation.getActiveItem()).toEqual('other');
expect($('#app-content-files').hasClass('hidden')).toEqual(true);
expect($('#app-content-other').hasClass('hidden')).toEqual(false);
expect($('li[data-id=files]').hasClass('selected')).toEqual(false);
expect($('li[data-id=other]').hasClass('selected')).toEqual(true);
App._onPopState({view: 'files', dir: '/somedir'});
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
expect($('#app-content-other').hasClass('hidden')).toEqual(true);
expect($('li[data-id=files]').hasClass('selected')).toEqual(true);
expect($('li[data-id=other]').hasClass('selected')).toEqual(false);
});
it('clicking on navigation switches the panel visibility', function() {
$('li[data-id=other]>a').click();
expect(App.navigation.getActiveItem()).toEqual('other');
expect($('#app-content-files').hasClass('hidden')).toEqual(true);
expect($('#app-content-other').hasClass('hidden')).toEqual(false);
expect($('li[data-id=files]').hasClass('selected')).toEqual(false);
expect($('li[data-id=other]').hasClass('selected')).toEqual(true);
$('li[data-id=files]>a').click();
expect(App.navigation.getActiveItem()).toEqual('files');
expect($('#app-content-files').hasClass('hidden')).toEqual(false);
expect($('#app-content-other').hasClass('hidden')).toEqual(true);
expect($('li[data-id=files]').hasClass('selected')).toEqual(true);
expect($('li[data-id=other]').hasClass('selected')).toEqual(false);
});
it('clicking on navigation sends "show" and "urlChanged" event', function() {
var handler = sinon.stub();
var showHandler = sinon.stub();
$('#app-content-other').on('urlChanged', handler);
$('#app-content-other').on('show', showHandler);
$('li[data-id=other]>a').click();
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('other');
expect(handler.getCall(0).args[0].dir).toEqual('/');
expect(showHandler.calledOnce).toEqual(true);
});
it('clicking on activate navigation only sends "urlChanged" event', function() {
var handler = sinon.stub();
var showHandler = sinon.stub();
$('#app-content-files').on('urlChanged', handler);
$('#app-content-files').on('show', showHandler);
$('li[data-id=files]>a').click();
expect(handler.calledOnce).toEqual(true);
expect(handler.getCall(0).args[0].view).toEqual('files');
expect(handler.getCall(0).args[0].dir).toEqual('/');
expect(showHandler.notCalled).toEqual(true);
});
});
describe('viewer mode', function() {
it('toggles the sidebar when viewer mode is enabled', function() {
$('#app-content-files').trigger(
new $.Event('changeViewerMode', {viewerModeEnabled: true}
));
expect($('#app-navigation').hasClass('hidden')).toEqual(true);
expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(true);
$('#app-content-files').trigger(
new $.Event('changeViewerMode', {viewerModeEnabled: false}
));
expect($('#app-navigation').hasClass('hidden')).toEqual(false);
expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(false);
});
});
});
});

View file

@ -20,7 +20,9 @@
*/
/* global BreadCrumb */
describe('BreadCrumb tests', function() {
describe('OCA.Files.BreadCrumb tests', function() {
var BreadCrumb = OCA.Files.BreadCrumb;
describe('Rendering', function() {
var bc;
beforeEach(function() {

View file

@ -19,35 +19,45 @@
*
*/
/* global OC, FileActions, FileList */
describe('FileActions tests', function() {
var $filesTable;
describe('OCA.Files.FileActions tests', function() {
var $filesTable, fileList;
var FileActions = OCA.Files.FileActions;
beforeEach(function() {
// init horrible parameters
var $body = $('body');
var $body = $('#testArea');
$body.append('<input type="hidden" id="dir" value="/subdir"></input>');
$body.append('<input type="hidden" id="permissions" value="31"></input>');
// dummy files table
$filesTable = $body.append('<table id="filestable"></table>');
FileList.files = [];
fileList = new OCA.Files.FileList($('#testArea'));
FileActions.registerDefaultActions(fileList);
});
afterEach(function() {
FileActions.clear();
fileList = undefined;
$('#dir, #permissions, #filestable').remove();
});
it('calling clear() clears file actions', function() {
FileActions.clear();
expect(FileActions.actions).toEqual({});
expect(FileActions.defaults).toEqual({});
expect(FileActions.icons).toEqual({});
expect(FileActions.currentFile).toBe(null);
});
it('calling display() sets file actions', function() {
var fileData = {
id: 18,
type: 'file',
name: 'testName.txt',
mimetype: 'plain/text',
mimetype: 'text/plain',
size: '1234',
etag: 'a01234c',
mtime: '123456'
};
// note: FileActions.display() is called implicitly
var $tr = FileList.add(fileData);
var $tr = fileList.add(fileData);
// actions defined after call
expect($tr.find('.action.action-download').length).toEqual(1);
@ -61,12 +71,12 @@ describe('FileActions tests', function() {
id: 18,
type: 'file',
name: 'testName.txt',
mimetype: 'plain/text',
mimetype: 'text/plain',
size: '1234',
etag: 'a01234c',
mtime: '123456'
};
var $tr = FileList.add(fileData);
var $tr = fileList.add(fileData);
FileActions.display($tr.find('td.filename'), true);
FileActions.display($tr.find('td.filename'), true);
@ -82,12 +92,12 @@ describe('FileActions tests', function() {
id: 18,
type: 'file',
name: 'testName.txt',
mimetype: 'plain/text',
mimetype: 'text/plain',
size: '1234',
etag: 'a01234c',
mtime: '123456'
};
var $tr = FileList.add(fileData);
var $tr = fileList.add(fileData);
FileActions.display($tr.find('td.filename'), true);
$tr.find('.action-download').click();
@ -97,17 +107,17 @@ describe('FileActions tests', function() {
redirectStub.restore();
});
it('deletes file when clicking delete', function() {
var deleteStub = sinon.stub(FileList, 'do_delete');
var deleteStub = sinon.stub(fileList, 'do_delete');
var fileData = {
id: 18,
type: 'file',
name: 'testName.txt',
mimetype: 'plain/text',
mimetype: 'text/plain',
size: '1234',
etag: 'a01234c',
mtime: '123456'
};
var $tr = FileList.add(fileData);
var $tr = fileList.add(fileData);
FileActions.display($tr.find('td.filename'), true);
$tr.find('.action.delete').click();

File diff suppressed because it is too large Load diff

View file

@ -19,8 +19,9 @@
*
*/
/* global OC, Files */
describe('Files tests', function() {
describe('OCA.Files.Files tests', function() {
var Files = OCA.Files.Files;
describe('File name validation', function() {
it('Validates correct file names', function() {
var fileNames = [
@ -83,18 +84,6 @@ describe('Files tests', function() {
});
});
describe('getDownloadUrl', function() {
var curDirStub;
beforeEach(function() {
curDirStub = sinon.stub(FileList, 'getCurrentDirectory');
});
afterEach(function() {
curDirStub.restore();
});
it('returns the ajax download URL when only filename specified', function() {
curDirStub.returns('/subdir');
var url = Files.getDownloadUrl('test file.txt');
expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt');
});
it('returns the ajax download URL when filename and dir specified', function() {
var url = Files.getDownloadUrl('test file.txt', '/subdir');
expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt');

View file

@ -20,7 +20,8 @@
*/
/* global FileSummary */
describe('FileSummary tests', function() {
describe('OCA.Files.FileSummary tests', function() {
var FileSummary = OCA.Files.FileSummary;
var $container;
beforeEach(function() {

View file

@ -6,7 +6,7 @@ if (OC::$CLI) {
if (count($argv) === 2) {
$file = $argv[1];
list(, $user) = explode('/', $file);
OCP\JSON::checkUserExists($owner);
OCP\JSON::checkUserExists($user);
OC_Util::setupFS($user);
$view = new \OC\Files\View('');
/**

View file

@ -5,7 +5,7 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief Script to handle admin settings for encrypted key recovery
* Script to handle admin settings for encrypted key recovery
*/
use OCA\Encryption;

View file

@ -5,7 +5,7 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief Script to change recovery key password
* Script to change recovery key password
*
*/
@ -23,7 +23,7 @@ $oldPassword = $_POST['oldPassword'];
$newPassword = $_POST['newPassword'];
$view = new \OC\Files\View('/');
$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
$util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;

View file

@ -4,7 +4,7 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief check migration status
* check migration status
*/
use OCA\Encryption\Util;
@ -18,7 +18,7 @@ $migrationStatus = Util::MIGRATION_COMPLETED;
if ($loginname !== '' && $password !== '') {
$username = \OCP\User::checkPassword($loginname, $password);
if ($username) {
$util = new Util(new \OC_FilesystemView('/'), $username);
$util = new Util(new \OC\Files\View('/'), $username);
$migrationStatus = $util->getMigrationStatus();
}
}

View file

@ -5,7 +5,7 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief Script to change recovery key password
* Script to change recovery key password
*
*/

View file

@ -4,7 +4,7 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*
* @brief Script to handle admin settings for encrypted key recovery
* Script to handle admin settings for encrypted key recovery
*/
use OCA\Encryption;
@ -19,7 +19,7 @@ if (
) {
$userId = \OCP\USER::getUser();
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, $userId);
// Save recovery preference to DB

View file

@ -40,7 +40,7 @@ if (!OC_Config::getValue('maintenance', false)) {
\OC_Util::setupFS();
}
$view = new OC_FilesystemView('/');
$view = new OC\Files\View('/');
$sessionReady = OCA\Encryption\Helper::checkRequirements();
if($sessionReady) {

View file

@ -36,7 +36,7 @@ class Hooks {
private static $deleteFiles = array();
/**
* @brief Startup encryption backend upon user login
* Startup encryption backend upon user login
* @note This method should never be called for users using client side encryption
*/
public static function login($params) {
@ -48,7 +48,7 @@ class Hooks {
$l = new \OC_L10N('files_encryption');
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
// ensure filesystem is loaded
if(!\OC\Files\Filesystem::$loaded) {
@ -93,7 +93,7 @@ class Hooks {
// If migration not yet done
if ($ready) {
$userView = new \OC_FilesystemView('/' . $params['uid']);
$userView = new \OC\Files\View('/' . $params['uid']);
// Set legacy encryption key if it exists, to support
// depreciated encryption system
@ -136,26 +136,26 @@ class Hooks {
}
/**
* @brief setup encryption backend upon user created
* setup encryption backend upon user created
* @note This method should never be called for users using client side encryption
*/
public static function postCreateUser($params) {
if (\OCP\App::isEnabled('files_encryption')) {
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$util = new Util($view, $params['uid']);
Helper::setupUser($util, $params['password']);
}
}
/**
* @brief cleanup encryption backend upon user deleted
* cleanup encryption backend upon user deleted
* @note This method should never be called for users using client side encryption
*/
public static function postDeleteUser($params) {
if (\OCP\App::isEnabled('files_encryption')) {
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
// cleanup public key
$publicKey = '/public-keys/' . $params['uid'] . '.public.key';
@ -171,7 +171,7 @@ class Hooks {
}
/**
* @brief If the password can't be changed within ownCloud, than update the key password in advance.
* If the password can't be changed within ownCloud, than update the key password in advance.
*/
public static function preSetPassphrase($params) {
if (\OCP\App::isEnabled('files_encryption')) {
@ -182,7 +182,7 @@ class Hooks {
}
/**
* @brief Change a user's encryption passphrase
* Change a user's encryption passphrase
* @param array $params keys: uid, password
*/
public static function setPassphrase($params) {
@ -196,7 +196,7 @@ class Hooks {
// the necessary keys)
if (Crypt::mode() === 'server') {
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
if ($params['uid'] === \OCP\User::getUser()) {
@ -259,10 +259,10 @@ class Hooks {
}
/*
* @brief check if files can be encrypted to every user.
* check if files can be encrypted to every user.
*/
/**
* @param $params
* @param array $params
*/
public static function preShared($params) {
@ -308,7 +308,7 @@ class Hooks {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
@ -350,7 +350,7 @@ class Hooks {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
$path = \OC\Files\Filesystem::getPath($params['fileSource']);
@ -398,12 +398,12 @@ class Hooks {
}
/**
* @brief mark file as renamed so that we know the original source after the file was renamed
* mark file as renamed so that we know the original source after the file was renamed
* @param array $params with the old path and the new path
*/
public static function preRename($params) {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$util = new Util($view, $user);
list($ownerOld, $pathOld) = $util->getUidAndFilename($params['oldpath']);
@ -421,8 +421,8 @@ class Hooks {
}
/**
* @brief after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing
* @param array with oldpath and newpath
* after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing
* @param array $params array with oldpath and newpath
*
* This function is connected to the rename signal of OC_Filesystem and adjust the name and location
* of the stored versions along the actual file
@ -437,7 +437,7 @@ class Hooks {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$view = new \OC_FilesystemView('/');
$view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
@ -557,7 +557,7 @@ class Hooks {
}
/**
* @brief if the file was really deleted we remove the encryption keys
* if the file was really deleted we remove the encryption keys
* @param array $params
* @return boolean|null
*/
@ -597,7 +597,7 @@ class Hooks {
}
/**
* @brief remember the file which should be deleted and it's owner
* remember the file which should be deleted and it's owner
* @param array $params
* @return boolean|null
*/
@ -610,7 +610,7 @@ class Hooks {
return true;
}
$util = new Util(new \OC_FilesystemView('/'), \OCP\USER::getUser());
$util = new Util(new \OC\Files\View('/'), \OCP\USER::getUser());
list($owner, $ownerPath) = $util->getUidAndFilename($path);
self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array(

Some files were not shown because too many files have changed in this diff Show more