From 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 25 Aug 2010 16:48:55 +0200 Subject: merged gui --- core/module/web/media/default/js/funktions.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 core/module/web/media/default/js/funktions.js (limited to 'core/module/web/media/default/js/funktions.js') diff --git a/core/module/web/media/default/js/funktions.js b/core/module/web/media/default/js/funktions.js new file mode 100644 index 000000000..4c42ee336 --- /dev/null +++ b/core/module/web/media/default/js/funktions.js @@ -0,0 +1,23 @@ +// 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 (size == 0) ? "0 KB" : (Math.round( size / a , 2) + " " + filesizename[i]); +} + +Array.prototype.remove = function(from, to) { + var rest = this.slice((to || from) + 1 || this.length); + this.length = from < 0 ? this.length + from : from; + if (this.length == 0) return []; + return this.push.apply(this, rest); +}; \ No newline at end of file -- cgit v1.2.3