|
38 | 38 | _rdata = /^data:[^,]+,/,
|
39 | 39 |
|
40 | 40 | _pow = Math.pow,
|
| 41 | + _round = Math.round, |
| 42 | + _num = Number, |
41 | 43 | _from = function (sz) {
|
42 |
| - return Math.round(sz * this); |
| 44 | + return _round(sz * this); |
43 | 45 | },
|
44 |
| - _KB = new Number(1024), |
45 |
| - _MB = new Number(_pow(_KB, 2)), |
46 |
| - _GB = new Number(_pow(_KB, 3)), |
47 |
| - _TB = new Number(_pow(_KB, 4)), |
| 46 | + _KB = new _num(1024), |
| 47 | + _MB = new _num(_pow(_KB, 2)), |
| 48 | + _GB = new _num(_pow(_KB, 3)), |
| 49 | + _TB = new _num(_pow(_KB, 4)), |
48 | 50 |
|
49 | 51 | _elEvents = {}, // element event listeners
|
50 | 52 | _infoReader = [], // list of file info processors
|
|
75 | 77 | GB: (_GB.from = _from, _GB),
|
76 | 78 | TB: (_TB.from = _from, _TB),
|
77 | 79 |
|
78 |
| - toKB : function (sz) { |
79 |
| - return Math.round(sz * this.KB); |
80 |
| - }, |
81 |
| - toMB : function (sz) { |
82 |
| - return Math.round(sz * this.MB); |
83 |
| - }, |
84 |
| - toGB : function (sz) { |
85 |
| - return Math.round(sz * this.GB); |
86 |
| - }, |
87 |
| - toTB : function (sz) { |
88 |
| - return Math.round(sz * this.TB); |
89 |
| - }, |
90 |
| - |
91 | 80 | expando: 'fileapi' + (new Date).getTime(),
|
92 | 81 |
|
93 | 82 | uid: function (obj){
|
|
0 commit comments