summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-26 14:21:06 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-26 14:21:06 +0100
commitd4d09b06f80462394983fe04d291a0345dd57280 (patch)
treee4452055533c7ec7bb6fa49ac7f6b5c93ba8c4f7 /files
parentea8f71a19c59e7138d4a504bacc0beb410fc77e8 (diff)
parent3d0d47957e65a72e17d33a924c9c4efcd5088ed2 (diff)
downloadnextcloud-server-d4d09b06f80462394983fe04d291a0345dd57280.tar.gz
nextcloud-server-d4d09b06f80462394983fe04d291a0345dd57280.zip
merge master into encryption
Diffstat (limited to 'files')
-rw-r--r--files/ajax/upload.php13
-rw-r--r--files/js/files.js33
2 files changed, 7 insertions, 39 deletions
diff --git a/files/ajax/upload.php b/files/ajax/upload.php
index 034b8914607..f8b8f0e2e5f 100644
--- a/files/ajax/upload.php
+++ b/files/ajax/upload.php
@@ -16,12 +16,13 @@ foreach ($_FILES['files']['error'] as $error) {
if ($error != 0) {
$l=new OC_L10N('files');
$errors = array(
- 0=>$l->t("There is no error, the file uploaded with success"),
- 1=>$l->t("The uploaded file exceeds the upload_max_filesize directive in php.ini").ini_get('upload_max_filesize'),
- 2=>$l->t("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"),
- 3=>$l->t("The uploaded file was only partially uploaded"),
- 4=>$l->t("No file was uploaded"),
- 6=>$l->t("Missing a temporary folder")
+ UPLOAD_ERR_OK=>$l->t("There is no error, the file uploaded with success"),
+ UPLOAD_ERR_INI_SIZE=>$l->t("The uploaded file exceeds the upload_max_filesize directive in php.ini").ini_get('upload_max_filesize'),
+ UPLOAD_ERR_FORM_SIZE=>$l->t("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"),
+ UPLOAD_ERR_PARTIAL=>$l->t("The uploaded file was only partially uploaded"),
+ UPLOAD_ERR_NO_FILE=>$l->t("No file was uploaded"),
+ UPLOAD_ERR_NO_TMP_DIR=>$l->t("Missing a temporary folder"),
+ UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'),
);
OC_JSON::error(array("data" => array( "message" => $errors[$error] )));
exit();
diff --git a/files/js/files.js b/files/js/files.js
index 9f1f5368df0..f5dc40ad45d 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -387,39 +387,6 @@ function updateBreadcrumb(breadcrumbHtml) {
$('p.nav').empty().html(breadcrumbHtml);
}
-function humanFileSize(bytes){
- if( bytes < 1024 ){
- return bytes+' B';
- }
- bytes = Math.round(bytes / 1024, 1 );
- if( bytes < 1024 ){
- return bytes+' kB';
- }
- bytes = Math.round( bytes / 1024, 1 );
- if( bytes < 1024 ){
- return bytes+' MB';
- }
-
- // Wow, heavy duty for owncloud
- bytes = Math.round( bytes / 1024, 1 );
- return bytes+' GB';
-}
-
-function simpleFileSize(bytes) {
- mbytes = Math.round(bytes/(1024*1024/10))/10;
- if(bytes == 0) { return '0'; }
- else if(mbytes < 0.1) { return '< 0.1'; }
- else if(mbytes > 1000) { return '> 1000'; }
- else { return mbytes.toFixed(1); }
-}
-
-function formatDate(date){
- var monthNames = [ t('files','January'), t('files','February'), t('files','March'), t('files','April'), t('files','May'), t('files','June'),
- t('files','July'), t('files','August'), t('files','September'), t('files','October'), t('files','November'), t('files','December') ];
- return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+date.getMinutes();
-}
-
-
//options for file drag/dropp
var dragOptions={
distance: 20, revert: 'invalid', opacity: 0.7,