]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseui.js
TODO update, also include more instead of sortables.
[irc/quakenet/qwebirc.git] / js / ui / baseui.js
index b8b515abf7b5857e94dceead41e1380d5b466a6a..a563b6367298679ea25c6586e49437a733595052 100644 (file)
@@ -120,13 +120,19 @@ qwebirc.ui.StandardUI = new Class({
   Extends: qwebirc.ui.BaseUI,
   initialize: function(parentElement, windowClass, uiName, options) {
     this.parent(parentElement, windowClass, uiName, options);
+
+    this.tabCompleter = new qwebirc.ui.TabCompleterFactory(this);
+
     window.addEvent("keydown", function(x) {
       if(!x.alt || x.control)
         return;
         
+      var success = false;
       if(x.key == "a" || x.key == "A") {
         var highestNum = 0;
         var highestIndex = -1;
+        success = true;
+        
         new Event(x).stop();
         for(var i=0;i<this.windowArray.length;i++) {
           var h = this.windowArray[i].hilighted;
@@ -138,7 +144,7 @@ qwebirc.ui.StandardUI = new Class({
         if(highestIndex > -1)
           this.selectWindow(this.windowArray[highestIndex]);
       } else if(x.key >= '0' && x.key <= '9') {
-        new Event(x).stop();
+        success = true;
         
         number = x.key - '0';
         if(number == 0)
@@ -152,9 +158,13 @@ qwebirc.ui.StandardUI = new Class({
         this.selectWindow(this.windowArray[number]);
       } else if(x.key == "left") {
         this.prevWindow();
+        success = true;
       } else if(x.key == "right") {
         this.nextWindow();
+        success = true;
       }
+      if(success)
+        new Event(x).stop();      
     }.bind(this));
   },
   newCustomWindow: function(name, select, type) {
@@ -182,6 +192,7 @@ qwebirc.ui.StandardUI = new Class({
       this.embedded = null;
     }.bind(this));
         
+    this.embedded.lines.addClass("embeddedwizard");
     var ew = new qwebirc.ui.EmbedWizard({parent: this.embedded.lines});
     ew.addEvent("close", function() {
       this.embedded.close();
@@ -192,6 +203,12 @@ qwebirc.ui.StandardUI = new Class({
       return ["a", this.embeddedWindow.bind(this)];
 
     return null;
+  },
+  tabComplete: function(element) {
+    this.tabCompleter.tabComplete(element);
+  },
+  resetTabComplete: function() {
+    this.tabCompleter.reset();
   }
 });
 
@@ -199,7 +216,7 @@ qwebirc.ui.QuakeNetUI = new Class({
   Extends: qwebirc.ui.StandardUI,
   urlDispatcher: function(name, window) {
     if(name == "qwhois") {
-      return ["a", function(auth) {
+      return ["span", function(auth) {
         this.client.exec("/MSG Q whois #" + auth);
       }.bind(window)];
     }