]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/jslib.js
Add command history.
[irc/quakenet/qwebirc.git] / js / jslib.js
index 2450a006c01f2add1cf682205e75690298ea877e..e5ecbd59abba743066ef07d62c5ea41a1cf10ca0 100644 (file)
@@ -29,3 +29,16 @@ String.prototype.splitMax = function(by, max) {
   
   return newitems;
 }
+
+function setAtEnd(obj) {
+  pos = obj.value.length;
+  
+  if(obj.createTextRange) { 
+    var range = obj.createTextRange(); 
+    range.move("character", pos); 
+    range.select(); 
+  } else if(obj.selectionStart) { 
+    obj.focus(); 
+    obj.setSelectionRange(pos, pos); 
+  } 
+}