diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php
index 78ed218c13..93063e52eb 100644
--- a/apps/files/ajax/move.php
+++ b/apps/files/ajax/move.php
@@ -11,8 +11,10 @@ $dir = stripslashes($_POST["dir"]);
$file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));
+$l = OC_L10N::get('files');
+
if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
- OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
+ OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s - File with this name already exists", array($file)) )));
exit;
}
@@ -22,8 +24,8 @@ if ($dir != '' || $file != 'Shared') {
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
} else {
- OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
+ OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}
}else{
- OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
+ OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}
diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php
index 970aaa638d..9fd2ce3ad4 100644
--- a/apps/files/ajax/rename.php
+++ b/apps/files/ajax/rename.php
@@ -11,14 +11,16 @@ $dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
+$l = OC_L10N::get('files');
+
if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') {
$targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname);
$sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file);
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
} else {
- OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
+ OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}
}else{
- OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
+ OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 676612c0e4..07977f5ddf 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -49,7 +49,7 @@ foreach ($files['size'] as $size) {
$totalSize += $size;
}
if ($totalSize > \OC\Files\Filesystem::free_space($dir)) {
- OCP\JSON::error(array('data' => array('message' => $l->t('Not enough space available'),
+ OCP\JSON::error(array('data' => array('message' => $l->t('Not enough storage available'),
'uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize)));
exit();
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index f37ac4c262..1dae49c1cf 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -3,7 +3,7 @@
See the COPYING-README file. */
/* FILE MENU */
-.actions { padding:.3em; float:left; height:2em; width: 100%; }
+.actions { padding:.3em; height:2em; width: 100%; }
.actions input, .actions button, .actions .button { margin:0; float:left; }
#new {
@@ -25,7 +25,7 @@
#trash { height:17px; margin: 0 1em; z-index:1010; float: right; }
-#upload {
+#upload {
height:27px; padding:0; margin-left:0.2em; overflow:hidden;
}
#upload a {
@@ -55,7 +55,7 @@
font-size:1.5em; font-weight:bold;
color:#888; text-shadow:#fff 0 1px 0;
}
-table { position:relative; width:100%; }
+table { position:relative; top:37px; width:100%; }
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; }
@@ -74,9 +74,9 @@ table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-
/* Multiselect bar */
table.multiselect { top:63px; }
-table.multiselect thead { position:fixed; top:82px; z-index:1; }
+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 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; }
diff --git a/apps/files/index.php b/apps/files/index.php
index 104cf1a55d..434e98c6ea 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -92,7 +92,7 @@ foreach (explode('/', $dir) as $i) {
$list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files, false);
$list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=', false);
-$list->assign('downloadURL', OCP\Util::linkTo('files', 'download.php') . '?file=', false);
+$list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/')), false);
$list->assign('disableSharing', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index af3fc48391..38f5bab6f7 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -81,7 +81,7 @@ var FileActions = {
event.data.actionFunc(file);
};
- $.each(actions, function (name, action) {
+ var addAction = function (name, action) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name === 'Rename' && $('#dir').val() === '/Shared') {
return true;
@@ -92,7 +92,7 @@ var FileActions = {
if (img.call) {
img = img(file);
}
- var html = '';
+ var html = '';
if (img) {
html += ' ';
}
@@ -101,21 +101,27 @@ 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]}, actionHandler);
parent.find('a.name>span.fileactions').append(element);
}
+ };
+
+ $.each(actions, function (name, action) {
+ if (name !== 'Share') {
+ addAction(name, action);
+ }
});
+ if(actions.Share){
+ addAction('Share', actions.Share);
+ }
if (actions['Delete']) {
var img = FileActions.icons['Delete'];
if (img.call) {
img = img(file);
}
- // NOTE: Temporary fix to allow unsharing of files in root of Shared folder
- if ($('#dir').val() == '/Shared') {
- var html = '';
- } else if (typeof trashBinApp !== 'undefined' && trashBinApp) {
+ if (typeof trashBinApp !== 'undefined' && trashBinApp) {
var html = '';
} else {
var html = '';
@@ -125,7 +131,7 @@ var FileActions = {
element.append($('
'));
}
element.data('action', actions['Delete']);
- element.on('click',{a:null, elem:parent, actionFunc:actions['Delete']},actionHandler);
+ element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler);
parent.parent().children().last().append(element);
}
},
@@ -149,7 +155,7 @@ $(document).ready(function () {
} else {
var downloadScope = 'file';
}
-
+
if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) {
FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
@@ -157,11 +163,11 @@ $(document).ready(function () {
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());
});
}
-
- $('#fileList tr').each(function(){
+
+ $('#fileList tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
-
+
});
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 72b353b48c..cc107656da 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -3,35 +3,92 @@ var FileList={
update:function(fileListHtml) {
$('#fileList').empty().html(fileListHtml);
},
- addFile:function(name,size,lastModified,loading,hidden){
- var basename, extension, simpleSize, sizeColor, lastModifiedTime, modifiedColor,
- img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png'),
- html='