/* simple file list javascript | mitchell bennis | element engage, llc | mitch@elementengage.com */ console.log('eesfl frontside head js loaded'); // file size formatting function eesfl_getfilesize(bytes, si) { var thresh = si ? 1000 : 1024; if(math.abs(bytes) < thresh) { return bytes + ' b'; } var units = si ? ['kb','mb','gb','tb','pb','eb','zb','yb'] : ['kib','mib','gib','tib','pib','eib','zib','yib']; var u = -1; do { bytes /= thresh; ++u; } while(math.abs(bytes) >= thresh && u < units.length - 1); return bytes.tofixed(1)+' '+units[u]; }