]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
enhancements:
authorChris Porter <redacted>
Mon, 11 Aug 2014 18:13:35 +0000 (19:13 +0100)
committerChris Porter <redacted>
Mon, 11 Aug 2014 18:13:35 +0000 (19:13 +0100)
  bigger more obvious input box, with placeholder text
  input box now activates on connect
  # in status window now tells user to type join
  better connection messages

fixes:
  can now type "/ /wibble" to say "/wibble"
  /topic now accepts a channel as first arg

css/colours.css
css/qui.mcss
js/irc/baseircclient.js
js/irc/commandparser.js
js/irc/commands.js
js/irc/ircclient.js
js/ui/baseui.js
js/ui/baseuiwindow.js
js/ui/frontends/qui.js
js/ui/theme.js

index 0661e0102b9a079fe1819fc9ac0b130460cb5091..d34a7a26e24e98cc47e97f2c5086c335518e07d6 100644 (file)
 }
 
 .qwebirc .infocolour {
-  background-color: #9090ff;
+  background-color: #d6d6ff;
 }
index 4ce32a5ea196c45171081b0d899ef3ea2d2c0848..74a79e752dbef312558f267bcc1b7b67100607d7 100644 (file)
@@ -91,10 +91,18 @@ html {
 
 .qwebirc-qui .input input.keyboard-input {
   border: 0px;
-  margin: 2px 0px 0px 0px;
+  margin: 0px 0px 0px 0px;
+  font-size: 1.2em;
+  padding-left: 4px;
+  padding-top: 3px;
+  padding-bottom: 3px;
   width: 99%;
 }
 
+.qwebirc-qui .input-flash {
+  background: #ffdddd;
+}
+
 .qwebirc-qui .input input.mobile-input {
   border: 0px;
   margin: 2px 0px 0px 0px;
index e448201c70bd60773b45dc5962dd3a94b5adc22e..85aa264b05d11a83bc0b0c26221e26dc2616c435 100644 (file)
@@ -15,7 +15,7 @@ qwebirc.irc.RegisteredCTCPs = {
 };
 
 qwebirc.irc.BaseIRCClient = new Class({
-  Implements: [Options],
+  Implements: [Options, Events],
   options: {
     nickname: "qwebirc"
   },
@@ -40,11 +40,13 @@ qwebirc.irc.BaseIRCClient = new Class({
     });
   
     this.send = this.connection.send.bind(this.connection);
-    this.connect = this.connection.connect.bind(this.connection);
     this.disconnect = this.connection.disconnect.bind(this.connection);
 
     this.setupGenericErrors();
   },
+  connect: function() {
+    this.connection.connect.apply(this.connection);
+  },
   dispatch: function(data) {
     var message = data[0];
     if(message == "connect") {
index f68444625b86e25a3bcd15260cbd60c684f782ce..d9362ce438653ff031ccde1712136d77e107a9a5 100644 (file)
@@ -47,8 +47,16 @@ qwebirc.irc.BaseCommandParser = new Class({
     if(line.length == 0)
       return;
 
-    if(line.charAt(0) != "/")
+    if(line.charAt(0) != "/") {
+      if (this.getActiveWindow().type == qwebirc.ui.WINDOW_STATUS) {
+        if(line.charAt(0) != "#")
+          line = "#" + line;
+
+        this.getActiveWindow().errorMessage("To join a channel type: /JOIN " + line);
+        return;
+      }
       line = "/SAY " + line;
+    }
     
     var line = line.substr(1);
     var allargs = line.splitMax(" ", 2);
index 79d0c29fa57d8ad4473c4a2f5cb76e98f5736f78..af9fb74ebc13034f78e943f04061a4b17d3d1bec 100644 (file)
@@ -10,7 +10,8 @@ qwebirc.irc.Commands = new Class({
       "Q": "QUERY",
       "BACK": "AWAY",
       "PRIVACY": "PRIVACYPOLICY",
-      "HOP": "CYCLE"
+      "HOP": "CYCLE",
+      "": "SAY"
     };
   },
   
@@ -141,7 +142,12 @@ qwebirc.irc.Commands = new Class({
     this.automode("-", "v", args);
   }],
   cmd_TOPIC: [true, 1, 1, function(args) {
-    this.send("TOPIC " + this.getActiveWindow().name + " :" + args[0]);
+    var w = this.getActiveWindow();
+    if(w.client.isChannel(args[0])) {
+      this.send("TOPIC " + args[0]);
+    } else {
+      this.send("TOPIC " + w.name + " :" + args[0]);
+    }
   }],
   cmd_AWAY: [false, 1, 0, function(args) {
     this.send("AWAY :" + (args?args[0]:""));
index a26ae86861749da9f84bf6ebec6bff2d8a7788f7..509ce12730cddb2ac6ae553f09dba9dce40721fd 100644 (file)
@@ -26,6 +26,10 @@ qwebirc.irc.IRCClient = new Class({
     this.loginRegex = new RegExp(this.ui.options.loginRegex);
     this.tracker = new qwebirc.irc.IRCTracker(this);
   },
+  connect: function() {
+    this.parent();
+    this.newServerInfoLine("CONNECTING", "");
+  },
   newLine: function(window, type, data) {
     if(!data)
       data = {};
@@ -56,6 +60,9 @@ qwebirc.irc.IRCClient = new Class({
   newServerLine: function(type, data) {
     this.statusWindow.addLine(type, data);
   },
+  newServerInfoLine: function(type, data) {
+    this.statusWindow.infoMessage(type, data);
+  },
   newActiveLine: function(type, data) {
     this.getActiveWindow().addLine(type, data);
   },
@@ -225,7 +232,7 @@ qwebirc.irc.IRCClient = new Class({
     /* we guarantee that +x is sent out before the joins */
     if(this.ui.uiOptions.USE_HIDDENHOST)
       this.exec("/UMODE +x");
-      
+
     if(this.options.autojoin) {
       if(qwebirc.auth.loggedin() && this.ui.uiOptions.USE_HIDDENHOST) {
         var d = function() {
@@ -241,7 +248,11 @@ qwebirc.irc.IRCClient = new Class({
       }
 
       this.exec("/AUTOJOIN");
+    } else {
+      var d = function() { this.newServerInfoLine("CONNECTED", ""); }.delay(1000, this);
     }
+
+    this.fireEvent("signedOn");
   },
   userJoined: function(user, channel) {
     var nick = user.hostToNick();
@@ -567,7 +578,7 @@ qwebirc.irc.IRCClient = new Class({
   },
   connected: function() {
     qwebirc.connected = true;
-    this.newServerLine("CONNECT");
+    this.newServerInfoLine("CONNECT", "");
   },
   serverError: function(message) {
     this.newServerLine("ERROR", {"m": message});
index ec54d473b1e1cc064ebfc7e118468de99b7d40b7..0870af73c2bef49181ef0a187c09a0bd3ede9558 100644 (file)
@@ -51,7 +51,9 @@ qwebirc.ui.BaseUI = new Class({
   newClient: function(client) {
     client.id = this.clientId++;
     client.hilightController = new qwebirc.ui.HilightController(client);
-    
+    client.addEvent("signedOn", function() {
+      this.fireEvent("signedOn", client);
+    }.bind(this));
     this.windows[client.id] = {}
     this.clients[client.id] = client;
     var w = this.newWindow(client, qwebirc.ui.WINDOW_STATUS, "Status");
index 5369d1a63a97b6fc42e2b2542d756c9c69c5b333..f348beb27281e141280f149000dd6c5becf2517a 100644 (file)
@@ -140,8 +140,12 @@ qwebirc.ui.Window = new Class({
   errorMessage: function(message) {
     this.addLine("", message, "warncolour");
   },
-  infoMessage: function(message) {
-    this.addLine("", message, "infocolour");
+  infoMessage: function(type, message) {
+    if(message === undefined) {
+      this.addLine("", type, "infocolour");
+    } else {
+      this.addLine(type, message, "infocolour");
+    }
   },
   setHilighted: function(state) {
     if(state == qwebirc.ui.HILIGHT_NONE || state >= this.hilighted)
index bbbe19204711dc648026b4e62bca24c131b6df2c..a1af4cfd23b642aa1f2c63ed3a0170647eccf676 100644 (file)
@@ -146,6 +146,19 @@ qwebirc.ui.QUI = new Class({
     form.addClass("input");
     
     var inputbox = new Element("input");
+    this.addEvent("signedOn", function() {
+      inputbox.placeholder = "type commands here, for example: /JOIN #channel";
+      inputbox.addClass("input-flash");
+      var d = function() {
+        inputbox.removeClass("input-flash");
+      }.delay(250);
+      var d = function() {
+        inputbox.addClass("input-flash");
+      }.delay(500);
+      var d = function() {
+        inputbox.removeClass("input-flash");
+      }.delay(1250);
+    });
     form.appendChild(inputbox);
     this.inputbox = inputbox;
     this.inputbox.maxLength = 470;
@@ -157,6 +170,7 @@ qwebirc.ui.QUI = new Class({
       this.resetTabComplete();
       this.getActiveWindow().historyExec(inputbox.value);
       inputbox.value = "";
+      inputbox.placeholder = "";
     }.bind(this);
 
     if(!qwebirc.util.deviceHasKeyboard()) {
index b8b6db3b2873322159d64bf85a3562a4be323473..3a87fd0d37017445d99a596966e29395c3844a3a 100644 (file)
@@ -13,7 +13,9 @@ qwebirc.ui.themes.ThemeControlCodeMap = {
 qwebirc.ui.themes.Default = {
   "PREFIX": ["$C4==$O "],
   "SIGNON": ["Signed on!", true],
-  "CONNECT": ["Connected to server.", true],
+  "CONNECTING": ["Connecting to server, please wait...", true],
+  "CONNECT": ["Logging in, please wait...", true],
+  "CONNECTED": ["Connected and logged in -- ready to go!", true],
   "RAW": ["$m", true],
   "DISCONNECT": ["Disconnected from server: $m", true],
   "ERROR": ["ERROR: $m", true],