summaryrefslogtreecommitdiffstats
path: root/module/web/media/default/js/funktions.js
diff options
context:
space:
mode:
authorGravatar Wugy <wugy@mally-soft.com> 2010-01-06 14:22:31 +0100
committerGravatar Wugy <wugy@mally-soft.com> 2010-01-06 14:22:31 +0100
commit5bd5ffbaf7de6436f8648591b9430dad1e3c1eef (patch)
treecac08a4575435b0d6548dea91a884a96821fa74e /module/web/media/default/js/funktions.js
parentfixed cli (diff)
downloadpyload-5bd5ffbaf7de6436f8648591b9430dad1e3c1eef.tar.xz
default Dir in module/web/media/
Diffstat (limited to 'module/web/media/default/js/funktions.js')
-rw-r--r--module/web/media/default/js/funktions.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/web/media/default/js/funktions.js b/module/web/media/default/js/funktions.js
new file mode 100644
index 000000000..ed1471595
--- /dev/null
+++ b/module/web/media/default/js/funktions.js
@@ -0,0 +1,16 @@
+// JavaScript Document
+function SecToRightTime(sek)
+{
+ vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : '';
+ vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 );
+ return vreturn;
+}
+
+function HumanFileSize(size)
+{
+ var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
+ var loga = Math.log(size)/Math.log(1024);
+ var i = Math.floor(loga);
+ var a = Math.pow(1024, i);
+ return Math.round( size / a , 2) + " " + filesizename[i];
+} \ No newline at end of file