summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2014-03-31 13:12:04 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2014-03-31 13:12:04 +0200
commit2be2a5d2c5d8cbc671c4f301eb337fee20023538 (patch)
tree4b6870b52f5606883d239485f6e971b77bdbb956 /apps/files
parent6ac85480f7bffeb65fcbc5820ea7bd4ecd8f21ad (diff)
parent65e3f634000a2142f412b85d0443f241bb64a9ab (diff)
downloadnextcloud-server-2be2a5d2c5d8cbc671c4f301eb337fee20023538.tar.gz
nextcloud-server-2be2a5d2c5d8cbc671c4f301eb337fee20023538.zip
external storage: fix merge conflict, indentation
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/download.php6
-rw-r--r--apps/files/ajax/getstoragestats.php3
-rw-r--r--apps/files/ajax/list.php6
-rw-r--r--apps/files/ajax/rawlist.php3
-rw-r--r--apps/files/appinfo/remote.php6
-rw-r--r--apps/files/command/scan.php1
-rw-r--r--apps/files/css/files.css4
-rw-r--r--apps/files/css/mobile.css68
-rw-r--r--apps/files/index.php1
-rw-r--r--apps/files/js/fileactions.js37
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/js/files.js13
-rw-r--r--apps/files/l10n/ru.php5
-rw-r--r--apps/files/templates/index.php6
-rw-r--r--apps/files/templates/part.breadcrumb.php2
15 files changed, 115 insertions, 48 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index 1f7e42e0d3e..4b4a7f8948d 100644
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -21,12 +21,6 @@
*
*/
-// only need filesystem apps
-$RUNTIME_APPTYPES=array('filesystem');
-
-// Init owncloud
-
-
// Check if we are a user
OCP\User::checkLoggedIn();
\OC::$session->close();
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 17415b6933f..dd8af39bada 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -1,8 +1,5 @@
<?php
-// only need filesystem apps
-$RUNTIME_APPTYPES = array('filesystem');
-
$dir = '/';
if (isset($_GET['dir'])) {
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index 667209599a0..3bb35579d5f 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -1,11 +1,5 @@
<?php
-// only need filesystem apps
-$RUNTIME_APPTYPES=array('filesystem');
-
-// Init owncloud
-
-
OCP\JSON::checkLoggedIn();
\OC::$session->close();
diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php
index 6c2569e2ebb..f18bbffb74a 100644
--- a/apps/files/ajax/rawlist.php
+++ b/apps/files/ajax/rawlist.php
@@ -1,8 +1,5 @@
<?php
-// only need filesystem apps
-$RUNTIME_APPTYPES = array('filesystem');
-
OCP\JSON::checkLoggedIn();
\OC::$session->close();
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php
index 826f72fb0e6..a8acfdb6e6e 100644
--- a/apps/files/appinfo/remote.php
+++ b/apps/files/appinfo/remote.php
@@ -22,12 +22,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-// load needed apps
-$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging');
-
-OC_App::loadApps($RUNTIME_APPTYPES);
-
-OC_Util::obEnd();
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php
index f334f29a939..25ab70af362 100644
--- a/apps/files/command/scan.php
+++ b/apps/files/command/scan.php
@@ -58,7 +58,6 @@ class Scan extends Command {
protected function execute(InputInterface $input, OutputInterface $output) {
if ($input->getOption('all')) {
- \OC_App::loadApps('authentication');
$users = $this->userManager->search('');
} else {
$users = $input->getArgument('user_id');
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index af863aca33e..1bac5d2b7db 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -77,10 +77,10 @@
}
/* make sure there's enough room for the file actions */
#body-user #filestable {
- min-width: 750px;
+ min-width: 688px; /* 768 (mobile break) - 80 (nav width) */
}
#body-user #controls {
- min-width: 600px;
+ min-width: 688px; /* 768 (mobile break) - 80 (nav width) */
}
#filestable tbody tr { background-color:#fff; height:40px; }
diff --git a/apps/files/css/mobile.css b/apps/files/css/mobile.css
new file mode 100644
index 00000000000..3ad7d634838
--- /dev/null
+++ b/apps/files/css/mobile.css
@@ -0,0 +1,68 @@
+@media only screen and (max-width: 768px) {
+
+/* don’t require a minimum width for files table */
+#body-user #filestable {
+ min-width: initial !important;
+}
+
+/* do not show Deleted Files on mobile, not optimized yet and button too long */
+#controls #trash {
+ display: none;
+}
+
+/* hide size and date columns */
+table th#headerSize,
+table td.filesize,
+table th#headerDate,
+table td.date {
+ display: none;
+}
+
+/* remove shift for multiselect bar to account for missing navigation */
+table.multiselect thead {
+ padding-left: 0;
+}
+
+/* restrict length of displayed filename to prevent overflow */
+table td.filename .nametext {
+ max-width: 75% !important;
+}
+
+/* always show actions on mobile, not only on hover */
+#fileList a.action {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)" !important;
+ filter: alpha(opacity=20) !important;
+ opacity: .2 !important;
+ display: inline !important;
+}
+/* do not show Rename or Versions on mobile */
+#fileList .action.action-rename,
+#fileList .action.action-versions {
+ display: none !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;
+}
+
+/* ellipsis on file names */
+.nametext {
+ width: 60%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+/* proper notification area for multi line messages */
+#notification-container {
+ display: -webkit-box;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+}
+}
diff --git a/apps/files/index.php b/apps/files/index.php
index c66cd40fb56..73601d26217 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -27,6 +27,7 @@ OCP\User::checkLoggedIn();
// Load the files we need
OCP\Util::addStyle('files', 'files');
OCP\Util::addStyle('files', 'upload');
+OCP\Util::addStyle('files', 'mobile');
OCP\Util::addscript('files', 'file-upload');
OCP\Util::addscript('files', 'jquery.iframe-transport');
OCP\Util::addscript('files', 'jquery.fileupload');
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 9a69d7b3688..a7d1fa9d8a2 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -15,21 +15,33 @@ var FileActions = {
defaults: {},
icons: {},
currentFile: null,
- register: function (mime, name, permissions, icon, action) {
+ register: function (mime, name, permissions, icon, action, displayName) {
if (!FileActions.actions[mime]) {
FileActions.actions[mime] = {};
}
if (!FileActions.actions[mime][name]) {
FileActions.actions[mime][name] = {};
}
+ if (!displayName) {
+ displayName = t('files', name);
+ }
FileActions.actions[mime][name]['action'] = action;
FileActions.actions[mime][name]['permissions'] = permissions;
+ FileActions.actions[mime][name]['displayName'] = displayName;
FileActions.icons[name] = icon;
},
setDefault: function (mime, name) {
FileActions.defaults[mime] = name;
},
get: function (mime, type, permissions) {
+ var actions = this.getActions(mime, type, permissions);
+ var filteredActions = {};
+ $.each(actions, function (name, action) {
+ filteredActions[name] = action.action;
+ });
+ return filteredActions;
+ },
+ getActions: function (mime, type, permissions) {
var actions = {};
if (FileActions.actions.all) {
actions = $.extend(actions, FileActions.actions.all);
@@ -51,7 +63,7 @@ var FileActions = {
var filteredActions = {};
$.each(actions, function (name, action) {
if (action.permissions & permissions) {
- filteredActions[name] = action.action;
+ filteredActions[name] = action;
}
});
return filteredActions;
@@ -82,7 +94,7 @@ var FileActions = {
*/
display: function (parent, triggerEvent) {
FileActions.currentFile = parent;
- var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
+ var actions = FileActions.getActions(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
var nameLinks;
if (FileList.findFileEl(file).data('renaming')) {
@@ -105,15 +117,16 @@ var FileActions = {
event.data.actionFunc(file);
};
- var addAction = function (name, action) {
+ var addAction = function (name, action, displayName) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name === 'Rename' && $('#dir').val() === '/Shared') {
return true;
}
if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') {
+
var img = FileActions.icons[name],
- actionText = t('files', name),
+ actionText = displayName,
actionContainer = 'a.name>span.fileactions';
if (name === 'Rename') {
@@ -125,7 +138,7 @@ var FileActions = {
if (img.call) {
img = img(file);
}
- var html = '<a href="#" class="action" data-action="' + name + '">';
+ var html = '<a href="#" class="action action-' + name.toLowerCase() + '" data-action="' + name + '">';
if (img) {
html += '<img class ="svg" src="' + img + '" />';
}
@@ -133,8 +146,7 @@ var FileActions = {
var element = $(html);
element.data('action', name);
- //alert(element);
- element.on('click', {a: null, elem: parent, actionFunc: actions[name]}, actionHandler);
+ element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler);
parent.find(actionContainer).append(element);
}
@@ -142,12 +154,15 @@ var FileActions = {
$.each(actions, function (name, action) {
if (name !== 'Share') {
- addAction(name, action);
+ displayName = action.displayName;
+ ah = action.action;
+
+ addAction(name, ah, displayName);
}
});
if(actions.Share && !($('#dir').val() === '/' && file === 'Shared')){
- // t('files', 'Share')
- addAction('Share', actions.Share);
+ displayName = t('files', 'Share');
+ addAction('Share', actions.Share, displayName);
}
// remove the existing delete action
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 503bf681139..cda4e823a73 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -71,7 +71,7 @@ window.FileList={
});
// filename td
td = $('<td></td>').attr({
- "class": "filename",
+ "class": "filename svg",
"style": 'background-image:url('+iconurl+'); background-size: 32px;'
});
var rand = Math.random().toString(16).slice(2);
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 1186a72a44f..1137364db4a 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -196,11 +196,14 @@ var Files = {
if (width !== Files.lastWidth) {
if ((width < Files.lastWidth || firstRun) && width < Files.breadcrumbsWidth) {
if (Files.hiddenBreadcrumbs === 0) {
- Files.breadcrumbsWidth -= $(Files.breadcrumbs[1]).get(0).offsetWidth;
- $(Files.breadcrumbs[1]).find('a').hide();
- $(Files.breadcrumbs[1]).append('<span>...</span>');
- Files.breadcrumbsWidth += $(Files.breadcrumbs[1]).get(0).offsetWidth;
- Files.hiddenBreadcrumbs = 2;
+ bc = $(Files.breadcrumbs[1]).get(0);
+ if (typeof bc != 'undefined') {
+ Files.breadcrumbsWidth -= bc.offsetWidth;
+ $(Files.breadcrumbs[1]).find('a').hide();
+ $(Files.breadcrumbs[1]).append('<span>...</span>');
+ Files.breadcrumbsWidth += bc.offsetWidth;
+ Files.hiddenBreadcrumbs = 2;
+ }
}
var i = Files.hiddenBreadcrumbs;
while (width < Files.breadcrumbsWidth && i > 1 && i < Files.breadcrumbs.length - 1) {
diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php
index 2c0335f3cc3..ac958e5dfd3 100644
--- a/apps/files/l10n/ru.php
+++ b/apps/files/l10n/ru.php
@@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Невозможно переместить %s - файл с таким именем уже существует",
"Could not move %s" => "Невозможно переместить %s",
"File name cannot be empty." => "Имя файла не может быть пустым.",
+"\"%s\" is an invalid file name." => "\"%s\" это не правильное имя файла.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправильное имя: символы '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' недопустимы.",
+"The target folder has been moved or deleted." => "Целевой каталог был перемещен или удален.",
"The name %s is already used in the folder %s. Please choose a different name." => "Имя %s уже используется для каталога %s. Пожалуйста, выберите другое имя.",
"Not a valid source" => "Неправильный источник",
"Server is not allowed to open URLs, please check the server configuration" => "Сервер не позволяет открывать URL-адреса, пожалуйста, проверьте настройки сервера",
@@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Неверный каталог.",
"Files" => "Файлы",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Невозможно загрузить {filename}, так как это либо каталог, либо файл нулевого размера",
+"Total file size {size1} exceeds upload limit {size2}" => "Полный размер файла {size1} превышает лимит по загрузке {size2}",
+"Not enough free space, you are uploading {size1} but only {size2} is left" => "Не достаточно свободного места, Вы загружаете {size1} но осталось только {size2}",
"Upload cancelled." => "Загрузка отменена.",
"Could not get result from server." => "Не удалось получить ответ от сервера.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Идёт загрузка файла. Покинув страницу, вы прервёте загрузку.",
@@ -48,6 +52,7 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n файл","%n файла","%n файлов"),
"{dirs} and {files}" => "{dirs} и {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Закачка %n файла","Закачка %n файлов","Закачка %n файлов"),
+"\"{name}\" is an invalid file name." => "\"{name}\" это не правильное имя файла.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше хранилище заполнено, произведите очистку перед загрузкой новых файлов.",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше хранилище почти заполнено ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Приложение для шифрования активно, но ваши ключи не инициализированы, пожалуйста, перелогиньтесь",
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 5b0bad7f341..34acd9c4f51 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -5,15 +5,15 @@
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
- <li class="icon-filetype-text"
+ <li class="icon-filetype-text svg"
data-type="file" data-newname="<?php p($l->t('New text file')) ?>.txt">
<p><?php p($l->t('Text file'));?></p>
</li>
- <li class="icon-filetype-folder"
+ <li class="icon-filetype-folder svg"
data-type="folder" data-newname="<?php p($l->t('New folder')) ?>">
<p><?php p($l->t('Folder'));?></p>
</li>
- <li class="icon-link" data-type="web">
+ <li class="icon-link svg" data-type="web">
<p><?php p($l->t('From link'));?></p>
</li>
</ul>
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 2a0df622767..69b4cbca10d 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,4 +1,4 @@
-<div class="crumb <?php if(!count($_["breadcrumb"])) p('last');?>" data-dir=''>
+<div class="crumb svg <?php if(!count($_["breadcrumb"])) p('last');?>" data-dir=''>
<a href="<?php print_unescaped($_['baseURL']); ?>">
<?php if(isset($_['rootBreadCrumb'])):
echo $_['rootBreadCrumb'];