/*global define, window */
/*jshint indent:4 */

define([], function () {
    "use strict";

    var exports = {};

    /**
     * Convert number of bytes into human readable format
     * from http://codeaid.net/javascript/convert-size-in-bytes-to-human-readable-format-(javascript)
     *
     * @param bytes Number of bytes to convert
     * @param precision Number of digits after the decimal separator
     * @return string
     */
    exports.convertBytesToSize = function (bytes, precision) {
        var kilobyte = 1024;
        var megabyte = kilobyte * 1024;
        var gigabyte = megabyte * 1024;
        var terabyte = gigabyte * 1024;

        if ((bytes >= 0) && (bytes < kilobyte)) {
            return bytes + ' B';
        }

        if ((bytes >= kilobyte) && (bytes < megabyte)) {
            return (bytes / kilobyte).toFixed(precision) + ' KB';
        }

        if ((bytes >= megabyte) && (bytes < gigabyte)) {
            return (bytes / megabyte).toFixed(precision) + ' MB';
        }

        if ((bytes >= gigabyte) && (bytes < terabyte)) {
            return (bytes / gigabyte).toFixed(precision) + ' GB';
        }

        if (bytes >= terabyte) {
            return (bytes / terabyte).toFixed(precision) + ' TB';
        }

        return bytes + ' B';
    };

    return exports;
});

@@ -12,24 +12,16 @@
 fine
-, window
  */%0A/*js
 hint
@@ -20,21 +20,26 @@
 /*js
-h
+l
 int 
-indent:4
+browser: true
  */%0A
@@ -513,25 +513,25 @@
 obyte = 1024
-;
+,
 %0A        var
@@ -527,19 +527,19 @@
         
-var
+   
  megabyt
@@ -549,33 +549,33 @@
  kilobyte * 1024
-;
+,
 %0A        var gig
@@ -567,19 +567,19 @@
         
-var
+   
  gigabyt
@@ -597,17 +597,17 @@
 e * 1024
-;
+,
 %0A       
@@ -607,19 +607,19 @@
         
-var
+   
  terabyt

fix code style of the files model