color:#888; text-shadow:#fff 0 1px 0;
}
#filestable { position: relative; top:37px; width:100%; }
+/* make sure there's enough room for the file actions */
+#body-user #filestable {
+ min-width: 750px;
+}
+#body-user #controls {
+ min-width: 600px;
+}
+
tbody tr { background-color:#fff; height:2.5em; }
tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; }
tbody tr.selected { background-color:#eee; }
table th .name { float:left; margin-left:.5em; }
table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; }
table td { border-bottom:1px solid #eee; font-style:normal; background-position:1em .5em; background-repeat:no-repeat; }
-table th#headerName { width:100em; /* not really sure why this works better than 100% … table styling */ }
+
+table th#headerName {
+ width: 9999px; /* not really sure why this works better than 100% … table styling */
+}
table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-align:right; }
table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; }
#filestable.multiselect { top:63px; }
table.multiselect thead { position:fixed; top:82px; z-index:1; -moz-box-sizing: border-box; box-sizing: border-box; left: 0; padding-left: 64px; width:100%; }
table.multiselect thead th { background:rgba(230,230,230,.8); color:#000; font-weight:bold; border-bottom:0; }
-table.multiselect #headerName { width: 100%; }
+
+table.multiselect #headerName {
+ position: relative;
+ 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 { display:block; height:1.5em; vertical-align:middle; margin-left:3em; }
table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; }
}
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);
<?php print_unescaped($_['breadcrumb']); ?>
<?php if ($_['isCreatable']):?>
<div class="actions <?php if (isset($_['files']) and count($_['files'])==0):?>emptyfolder<?php endif; ?>">
+ <?php if(!isset($_['dirToken'])):?>
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
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']) ?>">
<form data-upload-id='1'
value="<?php p($_['uploadMaxFilesize']) ?>">
<!-- Send the requesttoken, this is needed for older IE versions
because they don't send the CSRF token via HTTP header in this case -->
- <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken">
+ <?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">
<div id="emptyfolder"><?php p($l->t('Nothing in here. Upload something!'))?></div>
<?php endif; ?>
+<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>" />
+
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>">
<thead>
<tr>
#details {
color:#fff;
- float: left;
-}
-
-#public_upload,
-#download {
- font-weight:700;
- margin: 0 0.4em 0 0;
- padding: 0 5px;
- height: 27px;
- float: left;
-
-}
-
-.header-right #details {
- margin-right: 2em;
-}
-
-#public_upload {
- margin-left: 0.3em;
-}
-
-#public_upload img,
-#download img {
- padding-left:.1em;
- padding-right:.3em;
- vertical-align:text-bottom;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ filter: alpha(opacity=50);
+ opacity: .5;
+ padding-right: 5px;
}
#preview {
}
p.info {
- color:#777;
- text-align:center;
- text-shadow:#fff 0 1px 0;
- width:22em;
- margin:2em auto;
+ color: #777;
+ text-align: center;
+ margin: 0 auto;
+ padding: 20px 0;
}
p.info a {
#imgframe {
height:75%;
- padding-bottom:2em;
- padding-top:2em;
+ padding-bottom:32px;
+ padding-top:32px;
width:80%;
margin:0 auto;
}
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 {
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;
}
-
-#download span {
- position: relative;
- bottom: 3px;
+.directDownload .button img {
+ vertical-align: text-bottom;
}
-
-#publicUploadButtonMock {
- position:relative;
- display:block;
- width:100%;
- height:27px;
- cursor:pointer;
- z-index:10;
- background-image:url('%webroot%/core/img/actions/upload.svg');
- background-repeat:no-repeat;
- background-position:7px 6px;
+.directLink label {
+ font-weight: normal;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ filter: alpha(opacity=50);
+ opacity: .5;
}
-
-#publicUploadButtonMock span {
- margin: 0 5px 0 28px;
- position: relative;
- top: -2px;
- color: #555;
+.directLink input {
+ margin-left: 5px;
+ width: 300px;
}
$(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') {
// 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());
}
}
subdir: $('input#dir').val()
};
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
-
- // Cancel upload trigger
- $('#cancel_upload_button').click(Files.cancelUploads);
+ $(document).on('click', '#directLink', function() {
+ $(this).focus();
+ $(this).select();
+ });
});
} 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');
$tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
$tmpl->assign('fileTarget', basename($linkItem['file_target']));
$tmpl->assign('dirToken', $linkItem['token']);
- $allowPublicUploadEnabled = (($linkItem['permissions'] & OCP\PERMISSION_CREATE) ? true : false );
+ $allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE);
if (\OCP\App::isEnabled('files_encryption')) {
$allowPublicUploadEnabled = false;
}
$allowPublicUploadEnabled = false;
}
- $tmpl->assign('allowPublicUploadEnabled', $allowPublicUploadEnabled);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$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');
<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
<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">
+<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="ownCloud" /></a>
<div id="logo-claim" style="display:none;"><?php p($defaults->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'], $_['fileTarget']))) ?></span>
- <?php else: ?>
- <span id="details"><?php p($l->t('%s shared the file %s with you',
- array($_['displayName'], $_['fileTarget']))) ?></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" class="button" 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="publicUploadButtonMock" class="svg">
- <span><?php p($l->t('Upload'))?></span>
- </a>
- </div>
-
+ <span id="details"><?php p($l->t('shared by %s', array($_['displayName']))) ?></span>
</div>
-
- <div id="additional_controls" style="display:none">
- <div id="uploadprogresswrapper">
- <div id="uploadprogressbar"></div>
- <input id="cancel_upload_button" type="button" class="stop" style="display:none"
- value="<?php p($l->t('Cancel upload'));?>"
- />
- </div>
-
-
-
-
- <?php endif; ?>
-
- </div>
- </div></header>
+</div></header>
<div id="content">
<div id="preview">
<?php if (isset($_['folder'])): ?>
<ul id="noPreview">
<li class="error">
<?php p($l->t('No preview available for').' '.$_['fileTarget']); ?><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>
+ <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>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <g>
+ <rect rx=".5" ry=".5" height="4" width="4" y="1" x="1"/>
+ <rect rx=".5" ry=".5" height="1" width="9" y="2" x="6"/>
+ <rect rx=".5" ry=".5" height="4" width="4" y="6" x="1"/>
+ <rect rx=".5" ry=".5" height="1" width="9" y="7" x="6"/>
+ <rect rx=".5" ry=".5" height="4" width="4" y="11" x="1"/>
+ <rect rx=".5" ry=".5" height="1" width="9" y="12" x="6"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <g>
+ <rect rx=".5" ry=".5" height="6" width="6" y="1" x="1"/>
+ <rect rx=".5" ry=".5" height="6" width="6" y="1" x="9"/>
+ <rect rx=".5" ry=".5" height="6" width="6" y="9" x="9"/>
+ <rect rx=".5" ry=".5" height="6" width="6" y="9" x="1"/>
+ </g>
+</svg>
<?php p($defaults->getName()); ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" />
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" />
<?php foreach ($_['cssfiles'] as $cssfile): ?>
<?php p($defaults->getName()); ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-itunes-app" content="app-id=543672169">
<link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" />
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" />
</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-itunes-app" content="app-id=543672169">
<link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" />
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" />
*/
private static function isOverwriteCondition($type = '') {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
- return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1
+ return $regex === '//' or (isset($_SERVER['REMOTE_ADDR']) && preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1)
or ($type !== 'protocol' and OC_Config::getValue('forcessl', false));
}