summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/index.php9
-rw-r--r--apps/files/js/filelist.js41
-rw-r--r--apps/files/js/files.js22
-rw-r--r--apps/files/l10n/ru_RU.php14
-rw-r--r--apps/files/l10n/sk_SK.php8
-rw-r--r--apps/files/templates/index.php12
6 files changed, 89 insertions, 17 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 8d877be8ac9..f0f95b3bac8 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -118,6 +118,10 @@ if ($needUpgrade) {
$trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
}
+ $isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/');
+ $fileHeader = (!isset($files) or count($files) > 0);
+ $emptyContent = ($isCreatable and !$fileHeader) or $ajaxLoad;
+
OCP\Util::addscript('files', 'fileactions');
OCP\Util::addscript('files', 'files');
OCP\Util::addscript('files', 'keyboardshortcuts');
@@ -125,7 +129,7 @@ if ($needUpgrade) {
$tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir));
- $tmpl->assign('isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/'));
+ $tmpl->assign('isCreatable', $isCreatable);
$tmpl->assign('permissions', $permissions);
$tmpl->assign('files', $files);
$tmpl->assign('trash', $trashEnabled);
@@ -138,9 +142,12 @@ if ($needUpgrade) {
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles());
$tmpl->assign("mailNotificationEnabled", \OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'yes'));
+ $tmpl->assign("allowShareWithLink", \OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->assign("encryptionInitStatus", $encryptionInitStatus);
$tmpl->assign('disableSharing', false);
$tmpl->assign('ajaxLoad', $ajaxLoad);
+ $tmpl->assign('emptyContent', $emptyContent);
+ $tmpl->assign('fileHeader', $fileHeader);
$tmpl->printPage();
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 84ff1093253..85bdd509715 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -7,11 +7,9 @@ var FileList={
});
},
update:function(fileListHtml) {
- var $fileList = $('#fileList'),
- permissions = $('#permissions').val(),
- isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ var $fileList = $('#fileList');
$fileList.empty().html(fileListHtml);
- $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0);
+ FileList.updateEmptyContent();
$fileList.find('tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
@@ -251,12 +249,38 @@ var FileList={
$('.creatable').toggleClass('hidden', !isCreatable);
$('.notCreatable').toggleClass('hidden', isCreatable);
},
+ /**
+ * Shows/hides action buttons
+ *
+ * @param show true for enabling, false for disabling
+ */
+ showActions: function(show){
+ $('.actions,#file_action_panel').toggleClass('hidden', !show);
+ if (show){
+ // make sure to display according to permissions
+ var permissions = $('#permissions').val();
+ var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ $('.creatable').toggleClass('hidden', !isCreatable);
+ $('.notCreatable').toggleClass('hidden', isCreatable);
+ }
+ },
+ /**
+ * Enables/disables viewer mode.
+ * In viewer mode, apps can embed themselves under the controls bar.
+ * In viewer mode, the actions of the file list will be hidden.
+ * @param show true for enabling, false for disabling
+ */
+ setViewerMode: function(show){
+ this.showActions(!show);
+ $('#filestable').toggleClass('hidden', show);
+ },
remove:function(name){
$('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy');
$('tr').filterAttr('data-file',name).remove();
FileList.updateFileSummary();
if($('tr[data-file]').length==0){
$('#emptycontent').removeClass('hidden');
+ $('#filescontent th').addClass('hidden');
}
},
insertElement:function(name,type,element){
@@ -287,6 +311,7 @@ var FileList={
$('#fileList').append(element);
}
$('#emptycontent').addClass('hidden');
+ $('#filestable th').removeClass('hidden');
FileList.updateFileSummary();
},
loadingDone:function(name, id){
@@ -505,6 +530,7 @@ var FileList={
procesSelection();
checkTrashStatus();
FileList.updateFileSummary();
+ FileList.updateEmptyContent();
} else {
$.each(files,function(index,file) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
@@ -618,6 +644,13 @@ var FileList={
}
}
},
+ updateEmptyContent: function(){
+ var $fileList = $('#fileList');
+ var permissions = $('#permissions').val();
+ var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0);
+ $('#filestable th').toggleClass('hidden', $fileList.find('tr').length === 0);
+ },
showMask: function(){
// in case one was shown before
var $mask = $('#content .mask');
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index a35ed4add8c..ec2dc7c62ea 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -301,7 +301,7 @@ $(document).ready(function() {
});
$('.download').click('click',function(event) {
- var files=getSelectedFiles('name');
+ var files=getSelectedFilesTrash('name');
var fileslist = JSON.stringify(files);
var dir=$('#dir').val()||'/';
OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
@@ -315,7 +315,7 @@ $(document).ready(function() {
});
$('.delete-selected').click(function(event) {
- var files=getSelectedFiles('name');
+ var files=getSelectedFilesTrash('name');
event.preventDefault();
FileList.do_delete(files);
return false;
@@ -433,7 +433,7 @@ var createDragShadow = function(event){
$(event.target).parents('tr').find('td input:first').prop('checked',true);
}
- var selectedFiles = getSelectedFiles();
+ var selectedFiles = getSelectedFilesTrash();
if (!isDragSelected && selectedFiles.length == 1) {
//revert the selection
@@ -562,7 +562,7 @@ var crumbDropOptions={
}
function procesSelection(){
- var selected=getSelectedFiles();
+ var selected=getSelectedFilesTrash();
var selectedFiles=selected.filter(function(el){return el.type=='file'});
var selectedFolders=selected.filter(function(el){return el.type=='dir'});
if(selectedFiles.length==0 && selectedFolders.length==0) {
@@ -607,7 +607,7 @@ function procesSelection(){
* if property is set, an array with that property for each file is returnd
* if it's ommited an array of objects with all properties is returned
*/
-function getSelectedFiles(property){
+function getSelectedFilesTrash(property){
var elements=$('td.filename input:checkbox:checked').parent().parent();
var files=[];
elements.each(function(i,element){
@@ -663,8 +663,16 @@ function lazyLoadPreview(path, mime, ready, width, height) {
$.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29');
- //set preview thumbnail URL
- ready(previewURL + '&reload=true');
+ previewURL += '&reload=true';
+
+ // preload image to prevent delay
+ // this will make the browser cache the image
+ var img = new Image();
+ img.onload = function(){
+ //set preview thumbnail URL
+ ready(previewURL);
+ }
+ img.src = previewURL;
});
});
}
diff --git a/apps/files/l10n/ru_RU.php b/apps/files/l10n/ru_RU.php
new file mode 100644
index 00000000000..0764fef2ed9
--- /dev/null
+++ b/apps/files/l10n/ru_RU.php
@@ -0,0 +1,14 @@
+<?php
+$TRANSLATIONS = array(
+"Files" => "Файлы",
+"Error" => "Ошибка",
+"Share" => "Сделать общим",
+"Rename" => "Переименовать",
+"_%n folder_::_%n folders_" => array("","",""),
+"_%n file_::_%n files_" => array("","",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","",""),
+"Upload" => "Загрузка",
+"Cancel upload" => "Отмена загрузки",
+"Download" => "Загрузка"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php
index 962ce7d7e9b..c246492211c 100644
--- a/apps/files/l10n/sk_SK.php
+++ b/apps/files/l10n/sk_SK.php
@@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Chýba dočasný priečinok",
"Failed to write to disk" => "Zápis na disk sa nepodaril",
"Not enough storage available" => "Nedostatok dostupného úložného priestoru",
+"Upload failed. Could not get file info." => "Nahrávanie zlyhalo. Nepodarilo sa získať informácie o súbore.",
+"Upload failed. Could not find uploaded file" => "Nahrávanie zlyhalo. Nepodarilo sa nájsť nahrávaný súbor",
"Invalid directory." => "Neplatný priečinok.",
"Files" => "Súbory",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nemožno nahrať súbor {filename}, pretože je to priečinok, alebo má 0 bitov",
"Not enough space available" => "Nie je k dispozícii dostatok miesta",
"Upload cancelled." => "Odosielanie zrušené.",
+"Could not get result from server." => "Nepodarilo sa dostať výsledky zo servera.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.",
"URL cannot be empty." => "URL nemôže byť prázdne.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Neplatný názov priečinka. Názov \"Shared\" je rezervovaný pre ownCloud",
@@ -33,14 +37,18 @@ $TRANSLATIONS = array(
"undo" => "vrátiť",
"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"),
"_%n file_::_%n files_" => array("%n súbor","%n súbory","%n súborov"),
+"{dirs} and {files}" => "{dirs} a {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"),
"'.' is an invalid file name." => "'.' je neplatné meno súboru.",
"File name cannot be empty." => "Meno súboru nemôže byť prázdne",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nesprávne meno, '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nie sú povolené hodnoty.",
"Your storage is full, files can not be updated or synced anymore!" => "Vaše úložisko je plné. Súbory nemožno aktualizovať ani synchronizovať!",
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložisko je takmer plné ({usedSpacePercent}%)",
+"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikácia na šifrovanie je zapnutá, ale vaše kľúče nie sú inicializované. Odhláste sa a znovu sa prihláste.",
+"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chybný súkromný kľúč na šifrovanie aplikácií. Zaktualizujte si heslo súkromného kľúča v svojom osobnom nastavení, aby ste znovu získali prístup k svojim zašifrovaným súborom.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrovanie bolo zakázané, ale vaše súbory sú stále zašifrované. Prosím, choďte do osobného nastavenia pre dešifrovanie súborov.",
"Your download is being prepared. This might take some time if the files are big." => "Vaše sťahovanie sa pripravuje. Ak sú sťahované súbory veľké, môže to chvíľu trvať.",
+"Error moving file" => "Chyba pri presúvaní súboru",
"Name" => "Názov",
"Size" => "Veľkosť",
"Modified" => "Upravené",
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 32a59f1e1a6..2e88bf2dbb4 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -1,6 +1,6 @@
<div id="controls">
<?php print_unescaped($_['breadcrumb']); ?>
- <div class="actions creatable <?php if (!$_['isCreatable']):?>hidden<?php endif; ?> <?php if (isset($_['files']) and count($_['files'])==0):?>emptycontent<?php endif; ?>">
+ <div class="actions creatable <?php if (!$_['isCreatable']):?>hidden<?php endif; ?>">
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
@@ -42,14 +42,14 @@
<input type="hidden" name="permissions" value="<?php p($_['permissions']); ?>" id="permissions">
</div>
-<div id="emptycontent" <?php if (!isset($_['files']) or !$_['isCreatable'] or count($_['files']) > 0 or $_['ajaxLoad']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
+<div id="emptycontent" <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>
- <th id='headerName'>
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id='headerName'>
<div id="headerName-container">
<input type="checkbox" id="select_all" />
<label for="select_all"></label>
@@ -65,8 +65,8 @@
</span>
</div>
</th>
- <th id="headerSize"><?php p($l->t('Size')); ?></th>
- <th id="headerDate">
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerSize"><?php p($l->t('Size')); ?></th>
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
<!-- NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->
@@ -114,3 +114,5 @@
<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
+<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
+