summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/index.php8
-rw-r--r--apps/files/js/filelist.js17
-rw-r--r--apps/files/js/files.js12
-rw-r--r--apps/files/templates/index.php10
-rw-r--r--apps/files_encryption/hooks/hooks.php11
-rwxr-xr-xapps/files_encryption/lib/helper.php1
-rw-r--r--apps/files_encryption/lib/util.php2
-rw-r--r--apps/files_sharing/templates/public.php6
8 files changed, 50 insertions, 17 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 2f1e084560b..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);
@@ -142,6 +146,8 @@ if ($needUpgrade) {
$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 980260928e8..c33a06bbdc3 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').exists());
+ FileList.updateEmptyContent();
$fileList.find('tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
@@ -252,7 +250,6 @@ var FileList={
$('.creatable').toggleClass('hidden', !isCreatable);
$('.notCreatable').toggleClass('hidden', isCreatable);
},
-
/**
* Shows/hides action buttons
*
@@ -284,6 +281,7 @@ var FileList={
FileList.updateFileSummary();
if ( ! $('tr[data-file]').exists() ) {
$('#emptycontent').removeClass('hidden');
+ $('#filescontent th').addClass('hidden');
}
},
insertElement:function(name, type, element) {
@@ -316,6 +314,7 @@ var FileList={
$('#fileList').append(element);
}
$('#emptycontent').addClass('hidden');
+ $('#filestable th').removeClass('hidden');
FileList.updateFileSummary();
},
loadingDone:function(name, id) {
@@ -551,6 +550,7 @@ var FileList={
procesSelection();
checkTrashStatus();
FileList.updateFileSummary();
+ FileList.updateEmptyContent();
} else {
$.each(files,function(index,file) {
var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete");
@@ -664,6 +664,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').exists());
+ $('#filestable th').toggleClass('hidden', $fileList.find('tr').exists() === false);
+ },
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 3567904f2f2..389bf1bf197 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -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/templates/index.php b/apps/files/templates/index.php
index 001adb77ab5..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 -->
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index d9a76becf25..6e2d360917b 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -555,4 +555,15 @@ class Hooks {
}
}
+ /**
+ * set the init status to 'NOT_INITIALIZED' (0) if the app gets enabled
+ * @param array $params contains the app ID
+ */
+ public static function postEnable($params) {
+ if ($params['app'] === 'files_encryption') {
+ $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
+ $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
+ }
+ }
+
}
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index a754f9f28c4..91dd08ec08d 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -69,6 +69,7 @@ class Helper {
public static function registerAppHooks() {
\OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
+ \OCP\Util::connectHook('OC_App', 'post_disable', 'OCA\Encryption\Hooks', 'postEnable');
}
/**
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 53d58fbf40d..b9592a32cb2 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1278,7 +1278,7 @@ class Util {
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
- return false;
+ return self::MIGRATION_OPEN;
// If a record is found
} else {
return (int)$migrationStatus[0];
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 1f5453468b4..ef4c1c433da 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -15,10 +15,10 @@
<div class="header-right">
<?php if (isset($_['folder'])): ?>
<span id="details"><?php p($l->t('%s shared the folder %s with you',
- array($_['displayName'], $_['fileTarget']))) ?></span>
+ array($_['displayName'], $_['filename']))) ?></span>
<?php else: ?>
<span id="details"><?php p($l->t('%s shared the file %s with you',
- array($_['displayName'], $_['fileTarget']))) ?></span>
+ array($_['displayName'], $_['filename']))) ?></span>
<?php endif; ?>
@@ -88,7 +88,7 @@
<?php else: ?>
<ul id="noPreview">
<li class="error">
- <?php p($l->t('No preview available for').' '.$_['fileTarget']); ?><br />
+ <?php p($l->t('No preview available for').' '.$_['filename']); ?><br />
<a href="<?php p($_['downloadURL']); ?>" id="download"><img class="svg" alt="Download"
src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
/><?php p($l->t('Download'))?></a>