mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
Improve upload module 2 (#3984)
* optimized upload file * improve upload * revert code * optimized code * optimized code * optimized code * optimized code * update resumablejs version
This commit is contained in:
@@ -989,11 +989,38 @@ export const Utils = {
|
||||
return false;
|
||||
},
|
||||
|
||||
registerGlobalVariable(namespace, key, value) {
|
||||
registerGlobalVariable: function(namespace, key, value) {
|
||||
if (!window[namespace]) {
|
||||
window[namespace] = {};
|
||||
}
|
||||
window[namespace][key] = value;
|
||||
},
|
||||
|
||||
formatTime: function(seconds) {
|
||||
var ss = parseInt(seconds);
|
||||
var mm = 0;
|
||||
var hh = 0;
|
||||
if (ss > 60) {
|
||||
mm = parseInt(ss / 60);
|
||||
ss = parseInt(ss % 60);
|
||||
}
|
||||
if (mm > 60) {
|
||||
hh = parseInt(mm / 60);
|
||||
mm = parseInt(mm % 60);
|
||||
}
|
||||
|
||||
var result = ('00' + parseInt(ss)).slice(-2);
|
||||
if (mm > 0) {
|
||||
result = ('00' + parseInt(mm)).slice(-2) + ':' + result;
|
||||
} else {
|
||||
result = '00:' + result;
|
||||
}
|
||||
if (hh > 0) {
|
||||
result = ('00' + parseInt(hh)).slice(-2) + ':' + result;
|
||||
} else {
|
||||
result = '00:' + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user