webui-aria2/js/utils.js
Hamza Zia a5ebd19ec2 connection handling refactored all the way
all the refactored connection handling code resides in the connection.js
file, its a lot more rebost although still might have bugs
2012-09-05 22:53:09 +08:00

19 lines
398 B
JavaScript

var utils = {
randStr: function() {
var str = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
str[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
return str.join("");
},
mixin: function(fromObj, toObj) {
for (var key in toObj) {
if (toObj.hasOwnProperty(key) && fromObj[key]) {
toObj[key] = fromObj[key];
}
}
return toObj;
}
};