]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/jslib.js
Dos2Unix
[irc/quakenet/qwebirc.git] / js / jslib.js
index e2f1e9891d6f8fa90893990410a24d03b39fc9ee..2450a006c01f2add1cf682205e75690298ea877e 100644 (file)
@@ -1,31 +1,31 @@
-Array.prototype.indexFromEnd = function(d) {\r
-  var p = this;\r
-  \r
-  if(d < 0)\r
-    return p[p.length + d];\r
-\r
-  return p[d];\r
-}\r
-\r
-/* how horribly inefficient */\r
-String.prototype.replaceAll = function(f, t) {\r
-  var i = this.indexOf(f);\r
-  var c = this;\r
\r
-  while(i > -1) {\r
-    c = c.replace(f, t);\r
-    i = c.indexOf(f);\r
-  }\r
-  return c;\r
-}\r
-\r
-/* how horribly inefficient (again) */\r
-String.prototype.splitMax = function(by, max) {\r
-  var items = this.split(by);\r
-  var newitems = items.slice(0, max-1);\r
-\r
-  if(items.length >= max)\r
-    newitems.push(items.slice(max-1).join(by));\r
-  \r
-  return newitems;\r
-}\r
+Array.prototype.indexFromEnd = function(d) {
+  var p = this;
+  
+  if(d < 0)
+    return p[p.length + d];
+
+  return p[d];
+}
+
+/* how horribly inefficient */
+String.prototype.replaceAll = function(f, t) {
+  var i = this.indexOf(f);
+  var c = this;
+  while(i > -1) {
+    c = c.replace(f, t);
+    i = c.indexOf(f);
+  }
+  return c;
+}
+
+/* how horribly inefficient (again) */
+String.prototype.splitMax = function(by, max) {
+  var items = this.split(by);
+  var newitems = items.slice(0, max-1);
+
+  if(items.length >= max)
+    newitems.push(items.slice(max-1).join(by));
+  
+  return newitems;
+}