summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-12 19:54:20 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-15 17:51:04 +0200
commit6fd084243b65a556d4775209ba3916145ef5912a (patch)
tree6162c2af1861d8e3b8bbf1340ac55c4affc5ad61 /apps/files_sharing
parent9d38e3602b2faf37d861729c52690ce51b8fee97 (diff)
downloadnextcloud-server-6fd084243b65a556d4775209ba3916145ef5912a.tar.gz
nextcloud-server-6fd084243b65a556d4775209ba3916145ef5912a.zip
Fixed many issues, clean up
- fixed upload and storage statistics - fixed infinite scroll to use the correct contain for scroll detection - fixed unit test that sometimes fail for rename case - controls are now sticky again - fixed selection overlay to be aligned with the table - fixed "select all" checkbox that had id conflicts - fixed public page - fixed global actions permissions detection - fix when URL contains an invalid view id - viewer mode now hides the sidebar (ex: text editor) - added unit tests for trashbin - clean up storage info in template (most is retrieved via ajax call now)
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/css/public.css8
-rw-r--r--apps/files_sharing/js/public.js26
-rw-r--r--apps/files_sharing/js/share.js13
-rw-r--r--apps/files_sharing/public.php2
4 files changed, 33 insertions, 16 deletions
diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css
index 8abeb8b0340..70897af9eb9 100644
--- a/apps/files_sharing/css/public.css
+++ b/apps/files_sharing/css/public.css
@@ -1,11 +1,3 @@
-#controls {
- left: 0;
-}
-
-#filestable {
- margin-top: 90px;
-}
-
#preview {
background: #fff;
text-align: center;
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 6ee54968e1e..d3d4479215e 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -8,7 +8,8 @@
*
*/
-/* global OC, FileActions, FileList, Files */
+/* global FileActions, Files */
+/* global dragOptions, folderDropOptions */
OCA.Sharing = {};
if (!OCA.Files) {
OCA.Files = {};
@@ -23,7 +24,16 @@ OCA.Sharing.PublicApp = {
this._initialized = true;
// file list mode ?
if ($el.find('#filestable')) {
- this.fileList = new OCA.Files.FileList($el);
+ this.fileList = new OCA.Files.FileList(
+ $el,
+ {
+ scrollContainer: $(window),
+ dragOptions: dragOptions,
+ folderDropOptions: folderDropOptions
+ }
+ );
+ this.files = OCA.Files.Files;
+ this.files.initialize();
}
var mimetype = $('#mimetype').val();
@@ -145,5 +155,17 @@ OCA.Sharing.PublicApp = {
$(document).ready(function() {
var App = OCA.Sharing.PublicApp;
App.initialize($('#preview'));
+
+ // HACK: for oc-dialogs previews that depends on Files:
+ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
+ return App.fileList.lazyLoadPreview({
+ path: path,
+ mime: mime,
+ callback: ready,
+ width: width,
+ height: height,
+ etag: etag
+ });
+ };
});
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index ac46ab7b9e5..973c63c5d7e 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -8,14 +8,15 @@
*
*/
-/* global OC, t, FileList, FileActions */
+/* global FileList, FileActions */
$(document).ready(function() {
var sharesLoaded = false;
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') {
- var oldCreateRow = FileList._createRow;
- FileList._createRow = function(fileData) {
+ // TODO: make a separate class for this or a hook or jQuery event ?
+ var oldCreateRow = OCA.Files.FileList.prototype._createRow;
+ OCA.Files.FileList.prototype._createRow = function(fileData) {
var tr = oldCreateRow.apply(this, arguments);
if (fileData.shareOwner) {
tr.attr('data-share-owner', fileData.shareOwner);
@@ -24,14 +25,16 @@ $(document).ready(function() {
};
$('#fileList').on('fileActionsReady',function(){
-
- var allShared = $('#fileList').find('[data-share-owner] [data-Action="Share"]');
+ var $fileList = $(this);
+ var allShared = $fileList.find('[data-share-owner] [data-Action="Share"]');
allShared.addClass('permanent');
allShared.find('span').text(function(){
var $owner = $(this).closest('tr').attr('data-share-owner');
return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner});
});
+ // FIXME: these calls are also working on hard-coded
+ // list selectors...
if (!sharesLoaded){
OC.Share.loadIcons('file');
// assume that we got all shares, so switching directories
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index a73d97f4fef..8a86cb3806a 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -153,7 +153,7 @@ if (isset($path)) {
$folder->assign('dir', $getPath);
$folder->assign('dirToken', $linkItem['token']);
$folder->assign('permissions', OCP\PERMISSION_READ);
- $folder->assign('isPublic',true);
+ $folder->assign('isPublic', true);
$folder->assign('publicUploadEnabled', 'no');
$folder->assign('files', $files);
$folder->assign('uploadMaxFilesize', $maxUploadFilesize);