]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add timestamps.
authorChris Porter <redacted>
Sun, 15 Jun 2008 02:45:40 +0000 (03:45 +0100)
committerChris Porter <redacted>
Sun, 15 Jun 2008 02:45:40 +0000 (03:45 +0100)
static/js/irc/baseirc.js
static/js/irc/irclib.js
static/js/jslib.js
static/js/ui/uglyui.js
static/js/version.js [new file with mode: 0644]

index f5f2a258bd8b6ea80baca6be82b8b3d93ac8fdcb..f1905ef51570d662974f5858459cfe77b374af8d 100644 (file)
@@ -1,11 +1,19 @@
 Numerics = {"001": "RPL_WELCOME", "433": "ERR_NICKNAMEINUSE", "004": "RPL_MYINFO", "005": "RPL_ISUPPORT", "353": "RPL_NAMREPLY", "366": "RPL_ENDOFNAMES", "331": "RPL_NOTOPIC", "332": "RPL_TOPIC", "333": "RPL_TOPICWHOTIME"};\r
 \r
 registeredCTCPs = {\r
-  "VERSION": function(x) { return "qwebirc v" + QWEBIRC_VERSION + ", copyright (C) Chris Porter 2008."; },\r
+  "VERSION": function(x) {\r
+    return "qwebirc v" + QWEBIRC_VERSION + ", copyright (C) Chris Porter 2008 -- user agent: " + getBrowserDetails();\r
+  },\r
   "USERINFO": function(x) { return "qwebirc"; },\r
-  "TIME": function(x) { function pad(x) { x = "" + x; if(x.length == 1) x = "0" + x; return x; }var d = new Date(); return DaysOfWeek[d.getDay()] + " " + MonthsOfYear[d.getMonth()] + " " + pad(d.getDate()) + " "  + pad(d.getHours()) + ":" + pad(d.getMinutes()) + ":" + pad(d.getSeconds()) + " " + d.getFullYear() },\r
+  "TIME": function(x) {\r
+    function pad(x) { x = "" + x; if(x.length == 1) x = "0" + x; return x; }\r
+    \r
+    var d = new Date();\r
+    \r
+    return DaysOfWeek[d.getDay()] + " " + MonthsOfYear[d.getMonth()] + " " + pad(d.getDate()) + " "  + pad(d.getHours()) + ":" + pad(d.getMinutes()) + ":" + pad(d.getSeconds()) + " " + d.getFullYear()\r
+  },\r
   "PING": function(x) { return x; },\r
-  "CLIENTINFO": function(x) { return "PING VERSION TIME USERINFO CLIENTINFO"; },\r
+  "CLIENTINFO": function(x) { return "PING VERSION TIME USERINFO CLIENTINFO"; }\r
 };\r
 \r
 function BaseIRCClient(nickname, view) {\r
index e83c7a243a3326603d168756cb35a0ff96288635..f41a01cbe03def161e80d6088b166e6e3bc64078 100644 (file)
@@ -50,4 +50,16 @@ function hosttonick(user) {
 \r
 function hosttohost(user) {\r
   return user.split("!", 2)[1];\r
-}
\ No newline at end of file
+}\r
+\r
+function timestamp() {\r
+  var d = new Date();\r
+  function pad(x) {\r
+    x = "" + x;\r
+    if(x.length == 1)\r
+      return "0" + x;\r
+    return x\r
+  }\r
+  \r
+  return "[" + pad(d.getHours()) + ":" + pad(d.getMinutes()) + "]";\r
+}\r
index 65e88fef6c391d1674be8dcda4755309f19c6ae0..d80ccae91e96d477588391fce5f1ed71906914bc 100644 (file)
@@ -73,7 +73,7 @@ DaysOfWeek = {
   4: "Thu",\r
   5: "Fri",\r
   6: "Sat"\r
-}\r
+};\r
 \r
 MonthsOfYear = {\r
   0: "Jan",\r
@@ -88,5 +88,8 @@ MonthsOfYear = {
   9: "Oct",\r
   10: "Nov",\r
   11: "Dec"\r
-}\r
+};\r
 \r
+function getBrowserDetails() {\r
+  return navigator.appName + " " + parseFloat(navigator.appVersion);\r
+}\r
index 423254b192364b14c58bc7d12ddcfe4bc1a9305d..33eb505682665915023f09da37e0b73d2d1be91a 100644 (file)
@@ -153,7 +153,7 @@ function UglyUI(parent, theme) {
     if(type)\r
       line = theme.message(type, line);\r
     \r
-    colourise(line, e);\r
+    colourise(timestamp() + " " + line, e);\r
     \r
     wx.lastcolour = !wx.lastcolour;\r
 \r
diff --git a/static/js/version.js b/static/js/version.js
new file mode 100644 (file)
index 0000000..5f092b9
--- /dev/null
@@ -0,0 +1 @@
+QWEBIRC_VERSION = "0.01"\r