1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
887 B

//if (typeof String.addLeadingChar)
if (typeof Object.size !== "function") {
var fnSize = function (obj) { return Object.keys(obj).length; };
if (typeof Object.keys !== "function") {
fnSize = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
}
Object.size = fnSize;
}
if (!String.prototype.pad) {
String.prototype.pad = function(l, s) {
return (l -= this.length) > 0
? (s = new Array(Math.ceil(l / s.length) + 1).join(s)).substr(0, s.length) + this + s.substr(0, l - s.length)
: this;
};
}
function songMSTimeFormat(v, record)
{
return songTimeFormat(v/1000)
}
function songTimeFormat(v, record)
{
return Math.floor(v / 60).toFixed().pad(2, "0") + ":" + (v % 60).toFixed().pad(2, "0");
}
String.prototype.ucfirst = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}