]>
jfr.im git - irc/quakenet/qwebirc.git/blob - static/js/jslib.js
1 Array
.prototype.indexFromEnd = function(d
) {
5 return p
[p
.length
+ d
];
10 /* how horribly inefficient */
11 String
.prototype.replaceAll = function(f
, t
) {
12 var i
= this.indexOf(f
);
22 /* how horribly inefficient (again) */
23 String
.prototype.splitMax = function(by
, max
) {
24 var items
= this.split(by
);
25 var newitems
= items
.slice(0, max
-1);
27 if(items
.length
>= max
)
28 newitems
.push(items
.slice(max
-1).join(by
));