Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-02-07 20:08:25 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2014-02-07 20:08:25 +0400
commitfb6290c87a9cfd43ca1332c6ef65ccbb29b073c6 (patch)
tree02fed9f6a282af3393b231d0cc3239ac6c0a18ea /apps
parent9c9b161f5116ba37d67620628965f9d42bb7120e (diff)
parent5edc4c95bc686a702b37e5a2b93e0557d50b86ec (diff)
Merge pull request #7083 from owncloud/backport_6777_stable6
Backport 6777 stable6
Diffstat (limited to 'apps')
-rw-r--r--apps/files/css/files.css15
-rw-r--r--apps/files/js/fileactions.js4
-rw-r--r--apps/files/js/files.js2
-rw-r--r--apps/files/templates/index.php10
-rw-r--r--apps/files_sharing/css/mobile.css49
-rw-r--r--apps/files_sharing/css/public.css67
-rw-r--r--apps/files_sharing/js/public.js24
-rw-r--r--apps/files_sharing/public.php5
-rw-r--r--apps/files_sharing/templates/public.php83
9 files changed, 122 insertions, 137 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index 2fc86ca537d..1c48d61c4e8 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -65,9 +65,14 @@
top: 44px;
width: 100%;
}
-#filestable, #controls {
- min-width: 680px;
+/* make sure there's enough room for the file actions */
+#body-user #filestable {
+ min-width: 750px;
}
+#body-user #controls {
+ min-width: 600px;
+}
+
#filestable tbody tr { background-color:#fff; height:2.5em; }
#filestable tbody tr:hover, tbody tr:active {
background-color: rgb(240,240,240);
@@ -98,7 +103,7 @@ table td {
}
table th#headerName {
position: relative;
- width: 100em; /* not really sure why this works better than 100% … table styling */
+ width: 9999px; /* not really sure why this works better than 100% … table styling */
padding: 0;
}
#headerName-container {
@@ -140,7 +145,7 @@ table.multiselect thead th {
}
table.multiselect #headerName {
position: relative;
- width: 100%;
+ width: 9999px; /* when we use 100%, the styling breaks on mobile … table styling */
}
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
table td.filename a.name {
@@ -237,7 +242,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
#fileList tr td.filename a.name label {
position: absolute;
- width: 100%;
+ width: 80%;
height: 50px;
}
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 74bb711ef3d..9fea7f5145e 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -103,9 +103,9 @@ var FileActions = {
}
var html = '<a href="#" class="action" data-action="' + name + '">';
if (img) {
- html += '<img class ="svg" src="' + img + '" /> ';
+ html += '<img class ="svg" src="' + img + '" />';
}
- html += t('files', name) + '</a>';
+ html += '<span> ' + t('files', name) + '</span></a>';
var element = $(html);
element.data('action', name);
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 76ac87d38ed..b5633ae01aa 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -720,7 +720,7 @@ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) {
console.warn('Files.lazyLoadPreview(): missing etag argument');
}
- if ( $('#public_upload').length ) {
+ if ( $('#isPublic').length ) {
urlSpec.t = $('#dirToken').val();
previewURL = OC.Router.generate('core_ajax_public_preview', urlSpec);
} else {
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 5ed1ee0c7a0..ff78f0ca551 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -1,6 +1,7 @@
<div id="controls">
<?php print_unescaped($_['breadcrumb']); ?>
<div class="actions creatable <?php if (!$_['isCreatable']):?>hidden<?php endif; ?>">
+ <?php if(!isset($_['dirToken'])):?>
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
@@ -12,12 +13,17 @@
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. '.$_['uploadMaxHumanFilesize']) ?>">
<?php if($_['uploadMaxFilesize'] >= 0):?>
<input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
value="<?php p($_['uploadMaxFilesize']) ?>">
<?php endif;?>
+ <?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">
@@ -26,7 +32,7 @@
<a href="#" class="svg icon 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') : '' ?>></input>
+ <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>
@@ -44,7 +50,7 @@
<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>
+<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>
diff --git a/apps/files_sharing/css/mobile.css b/apps/files_sharing/css/mobile.css
new file mode 100644
index 00000000000..7d2116d190d
--- /dev/null
+++ b/apps/files_sharing/css/mobile.css
@@ -0,0 +1,49 @@
+@media only screen and (max-width: 600px) {
+
+/* make header scroll up for single shares, more view of content on small screens */
+#header.share-file {
+ position: absolute !important;
+}
+
+/* hide size and date columns */
+table th#headerSize,
+table td.filesize,
+table th#headerDate,
+table td.date {
+ display: none;
+}
+
+/* restrict length of displayed filename to prevent overflow */
+table td.filename .nametext {
+ max-width: 75% !important;
+}
+
+/* on mobile, show single shared image at full width without margin */
+#imgframe {
+ width: 100%;
+ padding: 0;
+ margin-bottom: 35px;
+}
+/* some margin for the file type icon */
+#imgframe .publicpreview {
+ margin-top: 32px;
+}
+
+/* always show actions on mobile */
+#fileList a.action {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)" !important;
+ filter: alpha(opacity=20) !important;
+ opacity: .2 !important;
+ display: inline !important;
+}
+/* some padding for better clickability */
+#fileList a.action img {
+ padding: 0 6px 0 12px;
+}
+/* hide text of the actions on mobile */
+#fileList a.action span {
+ display: none;
+}
+
+
+}
diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css
index afcee14e1b5..8d03868a972 100644
--- a/apps/files_sharing/css/public.css
+++ b/apps/files_sharing/css/public.css
@@ -14,39 +14,17 @@ body {
padding:7px;
}
-#details {
- color:#fff;
- float: left;
-}
-
-#public_upload,
-#download {
- font-weight:700;
- margin: 0 0 0 .4em;
- padding: 0 5px;
- height: 32px;
- float: left;
-
-}
-
-.header-right #details {
- margin-right: 28px;
-}
-
.header-right {
padding: 0;
height: 32px;
}
-#public_upload {
- margin-left: 0.3em;
-}
-
-#public_upload img,
-#download img {
- padding-left:.1em;
- padding-right:.3em;
- vertical-align:text-bottom;
+#details {
+ color:#fff;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ filter: alpha(opacity=50);
+ opacity: .5;
+ padding-right: 5px;
}
#controls {
@@ -71,9 +49,8 @@ footer {
p.info {
color: #777;
text-align: center;
- width: 22em;
margin: 0 auto;
- padding: 20px;
+ padding: 20px 0;
}
p.info a {
@@ -94,9 +71,13 @@ p.info a {
max-width:100%;
}
-thead{
- background-color: white;
- padding-left:0 !important; /* fixes multiselect bar offset on shared page */
+/* some margin for the file type icon */
+#imgframe .publicpreview {
+ margin-top: 10%;
+}
+
+thead {
+ padding-left: 0 !important; /* fixes multiselect bar offset on shared page */
}
#data-upload-form {
@@ -110,25 +91,21 @@ thead{
margin: 0;
}
-#file_upload_start {
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
- filter: alpha(opacity=0);
- opacity: 0;
- z-index: 20;
- position: absolute !important;
- top: 0;
- left: 0;
- width: 100% !important;
-}
-
+.directDownload,
.directLink {
margin-bottom: 20px;
}
+.directDownload .button img {
+ vertical-align: text-bottom;
+}
.directLink label {
font-weight: normal;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ filter: alpha(opacity=50);
+ opacity: .5;
}
.directLink input {
- margin-left: 10px;
+ margin-left: 5px;
width: 300px;
}
.public_actions {
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 4c0b0ad9d48..730649c6378 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -9,22 +9,13 @@ function fileDownloadPath(dir, file) {
$(document).ready(function() {
- $('#data-upload-form').tipsy({gravity:'ne', fade:true});
-
if (typeof FileActions !== 'undefined') {
var mimetype = $('#mimetype').val();
// Show file preview if previewer is available, images are already handled by the template
if (mimetype.substr(0, mimetype.indexOf('/')) != 'image' && $('.publicpreview').length === 0) {
// Trigger default action if not download TODO
var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ);
- if (typeof action === 'undefined') {
- $('#noPreview').show();
- if (mimetype != 'httpd/unix-directory') {
- // NOTE: Remove when a better file previewer solution exists
- $('#content').remove();
- $('table').remove();
- }
- } else {
+ if (typeof action !== 'undefined') {
action($('#filename').val());
}
}
@@ -58,16 +49,9 @@ $(document).ready(function() {
};
});
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#controls .actions div#uploadprogresswrapper'));
- $('#uploadprogresswrapper').addClass('public_actions');
-
- // Cancel upload trigger
- $('#cancel_upload_button').click(function() {
- OC.Upload.cancelUploads();
- procesSelection();
+ $(document).on('click', '#directLink', function() {
+ $(this).focus();
+ $(this).select();
});
- $('#directLink').focus();
-
});
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 2407903a928..23e147eecbe 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -136,6 +136,7 @@ if (isset($path)) {
} else {
OCP\Util::addScript('files', 'file-upload');
OCP\Util::addStyle('files_sharing', 'public');
+ OCP\Util::addStyle('files_sharing', 'mobile');
OCP\Util::addScript('files_sharing', 'public');
OCP\Util::addScript('files', 'fileactions');
OCP\Util::addScript('files', 'jquery.iframe-transport');
@@ -158,7 +159,6 @@ if (isset($path)) {
if ($linkItem['item_type'] !== 'folder') {
$allowPublicUploadEnabled = false;
}
- $tmpl->assign('allowPublicUploadEnabled', $allowPublicUploadEnabled);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
@@ -224,7 +224,8 @@ if (isset($path)) {
$folder->assign('fileList', $list->fetchPage());
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage());
$folder->assign('dir', $getPath);
- $folder->assign('isCreatable', false);
+ $folder->assign('isCreatable', $allowPublicUploadEnabled);
+ $folder->assign('dirToken', $linkItem['token']);
$folder->assign('permissions', OCP\PERMISSION_READ);
$folder->assign('isPublic',true);
$folder->assign('publicUploadEnabled', 'no');
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index e1132142eff..3ddaf4446df 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -9,54 +9,14 @@
<input type="hidden" name="sharingToken" value="<?php p($_['sharingToken']) ?>" id="sharingToken">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
-<header><div id="header" class="icon icon-noise">
+<header><div id="header" class="icon icon-noise <?php p((isset($_['folder']) ? 'share-folder' : 'share-file')) ?>">
<a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg"
src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a>
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
<div class="header-right">
- <?php if (isset($_['folder'])): ?>
- <span id="details"><?php p($l->t('%s shared the folder %s with you',
- array($_['displayName'], $_['filename']))) ?></span>
- <?php else: ?>
- <span id="details"><?php p($l->t('%s shared the file %s with you',
- array($_['displayName'], $_['filename']))) ?></span>
- <?php endif; ?>
-
-
- <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
- <a href="<?php p($_['downloadURL']); ?>" class="button" id="download">
- <img class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
- <span><?php p($l->t('Download'))?></span>
- </a>
- <?php endif; ?>
-
- <?php if ($_['allowPublicUploadEnabled']):?>
-
-
- <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
- <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" />
- <input type="hidden" id="uploadMaxFilesize" name="uploadMaxFilesize" value="<?php p($_['uploadMaxFilesize']) ?>" />
- <input type="hidden" id="uploadMaxHumanFilesize" name="uploadMaxHumanFilesize" value="<?php p($_['uploadMaxHumanFilesize']) ?>" />
- <input type="hidden" id="directory_path" name="directory_path" value="<?php p($_['directory_path']) ?>" />
- <?php if($_['uploadMaxFilesize'] >= 0):?>
- <input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
- value="<?php p($_['uploadMaxFilesize']) ?>">
- <?php endif;?>
-
-
- <div id="data-upload-form" title="<?php p($l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize']) ?>">
- <input id="file_upload_start" type="file" name="files[]" data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" multiple>
- <a href="#" id="public_upload" class="button">
- <img class="svg" alt="Upload" src="<?php print_unescaped(OCP\image_path("core", "actions/upload.svg")); ?>" />
- <span><?php p($l->t('Upload'))?></span>
- </a>
- </div>
-
- </div>
- <div>
- <?php endif; ?>
+ <span id="details"><?php p($l->t('shared by %s', array($_['displayName']))) ?></span>
</div>
- </div></header>
+</div></header>
<div id="content">
<div id="preview">
<?php if (isset($_['folder'])): ?>
@@ -72,25 +32,28 @@
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
</video>
</div>
- <?php elseif (\OC\Preview::isMimeSupported($_['mimetype'])): ?>
+ <?php else: ?>
<div id="imgframe">
- <img src="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => 500, 'y' => 500, 'file' => urlencode($_['directory_path']), 't' => $_['dirToken']))); ?>" class="publicpreview"/>
+ <?php $size = \OC\Preview::isMimeSupported($_['mimetype']) ? 500 : 128 ?>
+ <img src="<?php p(OCP\Util::linkToRoute( 'core_ajax_public_preview', array('x' => $size, 'y' => $size, 'file' => urlencode($_['directory_path']), 't' => $_['dirToken']))); ?>" class="publicpreview"/>
</div>
- <?php else: ?>
- <ul id="noPreview">
- <li class="error">
- <?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>
- </li>
- </ul>
<?php endif; ?>
- <div class="directLink"><label for="directLink"><?php p($l->t('Direct link')) ?></label><input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"></input></div>
+ <div class="directDownload">
+ <a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
+ <img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
+ <?php p($l->t('Download %s', array($_['filename'])))?>
+ </a>
+ </div>
+ <div class="directLink">
+ <label for="directLink"><?php p($l->t('Direct link')) ?></label>
+ <input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>">
+ </div>
<?php endif; ?>
</div>
- <footer>
- <p class="info">
- <?php print_unescaped($theme->getLongFooter()); ?>
- </p>
- </footer>
+
+</div>
+<footer>
+ <p class="info">
+ <?php print_unescaped($theme->getLongFooter()); ?>
+ </p>
+</footer>