]> source.dussan.org Git - nextcloud-server.git/commitdiff
finally remove the file size obfuscation as it had more disadvantages. I was wrong...
authorJan-Christoph Borchardt <hey@jancborchardt.net>
Thu, 18 Jul 2013 20:15:26 +0000 (22:15 +0200)
committerJan-Christoph Borchardt <hey@jancborchardt.net>
Thu, 18 Jul 2013 20:15:26 +0000 (22:15 +0200)
apps/files/js/filelist.js
apps/files/js/files.js
apps/files/templates/index.php
apps/files/templates/part.list.php
core/js/js.js
lib/public/template.php
lib/template.php

index c847e2eff8bd3b1b98977bb1377c4865406477fa..04a9fb91649d7d34ef3c23f56b4354f4e1317b3c 100644 (file)
@@ -47,7 +47,7 @@ var FileList={
 
                //size column
                if(size!=t('files', 'Pending')){
-                       simpleSize=simpleFileSize(size);
+                       simpleSize = humanFileSize(size);
                }else{
                        simpleSize=t('files', 'Pending');
                }
@@ -55,7 +55,6 @@ var FileList={
                var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
                td = $('<td></td>').attr({
                        "class": "filesize",
-                       "title": humanFileSize(size),
                        "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
                }).text(simpleSize);
                tr.append(td);
index 51b3f31fb961f65d8f721311810bff937ac884d8..98fc53b71a9d91d85726a6782d80f0085c5da5bc 100644 (file)
@@ -756,9 +756,7 @@ function procesSelection(){
                for(var i=0;i<selectedFolders.length;i++){
                        totalSize+=selectedFolders[i].size;
                };
-               simpleSize=simpleFileSize(totalSize);
-               $('#headerSize').text(simpleSize);
-               $('#headerSize').attr('title',humanFileSize(totalSize));
+               $('#headerSize').text(humanFileSize(totalSize));
                var selection='';
                if(selectedFolders.length>0){
                        if(selectedFolders.length==1){
index 7d679bc4bf65434cc14be3369d9df7c7230d1c9d..fa4cda6f6b2ed1f49818336b27a314830b24bf0a 100644 (file)
@@ -77,7 +77,7 @@
                                        <?php endif; ?>
                                </span>
                        </th>
-                       <th id="headerSize"><?php p($l->t('Size (MB)')); ?></th>
+                       <th id="headerSize"><?php p($l->t('Size')); ?></th>
                        <th id="headerDate">
                                <span id="modified"><?php p($l->t( 'Modified' )); ?></span>
                                <?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
index 97a9026860bc9ed87d085f1417d3ed247c0cfed6..0c7d6936697fb5ce09222a47896710307ce15308 100644 (file)
@@ -9,7 +9,6 @@ $totalsize = 0; ?>
        } else {
                $totalfiles++;
        }
-       $simple_file_size = OCP\simple_file_size($file['size']);
        // the bigger the file, the darker the shade of grey; megabytes*2
        $simple_size_color = intval(160-$file['size']/(1024*1024)*2);
        if($simple_size_color<0) $simple_size_color = 0;
@@ -52,9 +51,8 @@ $totalsize = 0; ?>
                        </a>
                </td>
                <td class="filesize"
-                       title="<?php p(OCP\human_file_size($file['size'])); ?>"
                        style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
-                               <?php print_unescaped($simple_file_size); ?>
+                               <?php print_unescaped(OCP\human_file_size($file['size'])); ?>
                </td>
                <td class="date">
                        <span class="modified"
@@ -91,7 +89,7 @@ $totalsize = 0; ?>
                        } ?>
                </span></td>
                <td class="filesize">
-               <?php print_unescaped(OCP\simple_file_size($totalsize)); ?>
+               <?php print_unescaped(OCP\human_file_size($totalsize)); ?>
                </td>
                <td></td>
        </tr>
index 5158b66d73a7ab849b31083d4a3a8fbba3d2bfd1..cf4e72324dc33427246365d183bae9a553f1c417 100644 (file)
@@ -666,8 +666,6 @@ $(document).ready(function(){
        $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
        $('a.delete').tipsy({gravity: 'e', fade:true, live:true});
        $('a.action').tipsy({gravity:'s', fade:true, live:true});
-       $('#headerSize').tipsy({gravity:'s', fade:true, live:true});
-       $('td.filesize').tipsy({gravity:'s', fade:true, live:true});
        $('td .modified').tipsy({gravity:'s', fade:true, live:true});
 
        $('input').tipsy({gravity:'w', fade:true});
@@ -697,14 +695,6 @@ function humanFileSize(size) {
        return relativeSize + ' ' + readableFormat;
 }
 
-function simpleFileSize(bytes) {
-       var 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){
        if(typeof date=='number'){
                date=new Date(date);
index ccf19cf052cbefc4a7e52c7a22f82cb898560858..d81a169579eaf0f0882d2259a47b5c850522529c 100644 (file)
@@ -76,16 +76,6 @@ function relative_modified_date($timestamp) {
 }
 
 
-/**
- * @brief Return a human readable outout for a file size.
- * @param $byte size of a file in byte
- * @returns human readable interpretation of a file size
- */
-function simple_file_size($bytes) {
-       return(\simple_file_size($bytes));
-}
-
-
 /**
  * @brief Generate html code for an options block.
  * @param $options the options
index ae9ea187445912434622f0f0a8481ac9a2d98d44..08df168afc604300382d856b46574576c514ccd5 100644 (file)
@@ -84,24 +84,6 @@ function human_file_size( $bytes ) {
        return OC_Helper::humanFileSize( $bytes );
 }
 
-function simple_file_size($bytes) {
-       if ($bytes < 0) {
-               return '?';
-       }
-       $mbytes = round($bytes / (1024 * 1024), 1);
-       if ($bytes == 0) {
-               return '0';
-       }
-       if ($mbytes < 0.1) {
-               return '&lt; 0.1';
-       }
-       if ($mbytes > 1000) {
-               return '&gt; 1000';
-       } else {
-               return number_format($mbytes, 1);
-       }
-}
-
 function relative_modified_date($timestamp) {
        $l=OC_L10N::get('lib');
        $timediff = time() - $timestamp;