Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added common.js

  • Loading branch information...
commit 05079e760b7bdd0ba0a8fadd298924422b6d07ba 1 parent c32984a
Denis Olshin authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 js/common.js
19 js/common.js
View
@@ -0,0 +1,19 @@
+String.prototype.trim = function() {
+ var i = 0;
+ while (i < this.length && (this.charAt(i) == " " || this.charAt(i) == "\n" || this.charAt(i) == "\r" || this.charAt(i) == "\t")) i++;
+ var j = this.length - 1;
+ while (j >= 0 && (this.charAt(j) == " " || this.charAt(j) == "\n" || this.charAt(j) == "\r" || this.charAt(j) == "\t")) j--;
+ return this.substr(i, j - i + 1);
+}
+Array.prototype.indexOf = function(v) {
+ for (var i = 0; i < this.length; i++)
+ if (this[i] == v)
+ return i;
+ return -1;
+}
+function wrapAs(s, c) {
+ return "<span class='" + c + "'>" + s + "</span>";
+}
+function ge(e) {
+ return document.getElementById(e);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.