Specifying server in URI, Firefox Utilityview css fix
authorDarren <darren@darrenwhitlen.com>
Sun, 4 Sep 2011 12:25:56 +0000 (13:25 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 4 Sep 2011 12:25:56 +0000 (13:25 +0100)
css/default.css
js/front.js
node/app.js
node/client/index.html.jade

index a91d9360932418442c8cf5f595cda73ec136bccd..456b0cd06d99318ada5cfbd935a64ccb9b85142e 100644 (file)
@@ -149,6 +149,7 @@ background-image: -moz-linear-gradient(
        overflow-x:wrap;\r
        border:none;\r
        display: none;\r
+       height: 100%;\r
 }\r
 #kiwi .messages a {\r
        text-decoration:none;\r
index 1a49d7e7f4adb0e5959930beca18b9f17359f5a2..8f9ff05f5aa70e129bf02b9c8b41096dca6556f6 100644 (file)
@@ -1172,7 +1172,7 @@ Utilityview.prototype.addPartImage = function () {
         return;
     }
 
-    var del_html = '<img src="img/redcross.png" class="tab_part" />';
+    var del_html = '<img src="/img/redcross.png" class="tab_part" />';
     this.tab.append(del_html);
     
     $('.tab_part', this.tab).click(function () {
@@ -1268,7 +1268,7 @@ Tabview.prototype.addPartImage = function () {
         return;
     }
 
-    var del_html = '<img src="img/redcross.png" class="tab_part" />';
+    var del_html = '<img src="/img/redcross.png" class="tab_part" />';
     this.tab.append(del_html);
     
     $('.tab_part', this.tab).click(function () {
index 88ac244c28f2197357cc745e0de53f127c22d15c..6ef776b61d98ce92bbe19df1ed16f330f6212587 100644 (file)
@@ -451,10 +451,12 @@ this.ircSocketDataHandler = function (data, websocket, ircSocket) {
 
 
 this.httpHandler = function (request, response) {
-    var uri, subs, useragent, agent, server_set, server, nick, debug, touchscreen, hash,
+    var uri, uri_parts, subs, useragent, agent, server_set, server, nick, debug, touchscreen, hash,
         min = {}, public_http_path;
     if (kiwi.config.handle_http) {
         uri = url.parse(request.url, true);
+        uri_parts = uri.pathname.split('/');
+        
         subs = uri.pathname.substr(0, 4);
         if (uri.pathname === '/js/all.js') {
             if (kiwi.cache.alljs === '') {
@@ -483,7 +485,7 @@ this.httpHandler = function (request, response) {
             request.addListener('end', function () {
                 kiwi.fileServer.serve(request, response);
             });
-        } else if (uri.pathname === '/') {
+        } else if (uri.pathname === '/' || uri_parts[1] === 'client') {
             useragent = (request.headers) ? request.headers['user-agent'] : '';
             if (useragent.match(/android/i) !== -1) {
                 agent = 'android';
@@ -504,16 +506,23 @@ this.httpHandler = function (request, response) {
             agent = 'normal';
             touchscreen = false;
             
-            if (uri.query) {
-                server_set = ((typeof uri.query.server !== 'undefined') && (uri.query.server !== ''));
-                server = uri.query.server || 'irc.anonnet.org';
-                nick = uri.query.nick || '';
-                debug = (uri.query.debug !== '');
+            if (uri_parts[1] !== 'client') {
+                if (uri.query) {
+                    server_set = ((typeof uri.query.server !== 'undefined') && (uri.query.server !== ''));
+                    server = uri.query.server || 'irc.anonnet.org';
+                    nick = uri.query.nick || '';
+                    debug = (uri.query.debug !== '');
+                } else {
+                    server_set = false;
+                    server = 'irc.anonnet.org';
+                    nick = '';
+                }
             } else {
-                server_set = false;
-                server = 'irc.anonnet.org';
-                nick = '';
+                server_set = ((typeof uri_parts[2] !== 'undefined') && (uri_parts[2] !== ''));
+                server = server_set ? uri_parts[2] : 'irc.anonnet.org';
+                nick = uri.query.nick || '';
             }
+
             response.setHeader('X-Generated-By', 'KiwiIRC');
             hash = crypto.createHash('md5').update(touchscreen ? 't' : 'f').update(debug ? 't' : 'f').update(server_set ? 't' : 'f').update(server).update(nick).update(agent).update(JSON.stringify(kiwi.config)).digest('base64');
             if (kiwi.cache.html[hash]) {
@@ -657,7 +666,7 @@ this.websocketIRCConnect = function (websocket, nick, host, port, ssl, callback)
         }
         websocket.sendServerLine('CAP LS');
         websocket.sendServerLine('NICK ' + nick);
-        websocket.sendServerLine('USER ' + nick.replace(/[^0-9a-zA-Z\-_.]/, '') + '_kiwi 0 0 :' + nick);
+        websocket.sendServerLine('USER kiwi_' + nick.replace(/[^0-9a-zA-Z\-_.]/, '') + ' 0 0 :' + nick);
 
         if ((callback) && (typeof (callback) === 'function')) {
             callback();
index 28e1c98660ce31400222ef02ca6574b6ac4a005f..f34bcc4a30114c75259fa2c3a8337998419f2a16 100644 (file)
@@ -7,8 +7,8 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
             meta(name="viewport", content="width=device-width,user-scalable=no")
 
         title Kiwi IRC
-        link(rel="stylesheet", type="text/css", href="css/default.css")
-        link(rel="stylesheet", type="text/css", href="css/ui.css")
+        link(rel="stylesheet", type="text/css", href="/css/default.css")
+        link(rel="stylesheet", type="text/css", href="/css/ui.css")
 
         - if (touchscreen)
             link(rel="stylesheet", type="text/css", href="css/touchscreen_tweaks.css")
@@ -16,16 +16,16 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
         script(type="text/javascript", src="/socket.io/socket.io.js")
         script(type="text/javascript", src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js")
         script(type="text/javascript", src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js")
-        script(type="text/javascript", src="js/jquery.json-2.2.min.js")
-        //script(type="text/javascript", src="js/util.js")
-        //script(type="text/javascript", src="js/gateway.js")
-        //script(type="text/javascript", src="js/front.js")
-        //script(type="text/javascript", src="js/iscroll.js")
-        script(type="text/javascript", src="js/all.js")
-        //script(type="text/javascript", src="js/plugins.js")
+        script(type="text/javascript", src="/js/jquery.json-2.2.min.js")
+        //script(type="text/javascript", src="/js/util.js")
+        //script(type="text/javascript", src="/js/gateway.js")
+        //script(type="text/javascript", src="/js/front.js")
+        //script(type="text/javascript", src="/js/iscroll.js")
+        script(type="text/javascript", src="/js/all.js")
+        //script(type="text/javascript", src="/js/plugins.js")
 
         - if (touchscreen)
-            script(type="text/javascript", src="js/touchscreen_tweaks.js")
+            script(type="text/javascript", src="/js/touchscreen_tweaks.js")
 
         - var proto
         - if (config.listen_ssl)
@@ -78,7 +78,7 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
         
         script#tmpl_change_nick(type="text/x-jquery-tmpl")
             |    <div class="newnick box">
-            |        Your new nick:<br />
+            |        Your new nickname:<br />
             |        <form class="form_newnick">
             |            <input type="text" class="txtnewnick" /><br />
             |            <button class="butnewnick" type="submit">Change</button> <a class="link cancelnewnick">Cancel</a>
@@ -106,8 +106,8 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
         script#tmpl_user_box(type="text/x-jquery-tmpl")
             |    <div class="userbox">
             |        <input type="hidden" class="userbox_nick" value="${nick}" />
-            |        <a href="#" class="userbox_query">Message</a>
-            |        <a href="#" class="userbox_whois">Info</a>
+            |        <a class="userbox_query">Message</a>
+            |        <a class="userbox_whois">Info</a>
             |    </div>
 
     body
@@ -166,7 +166,7 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
                 ul
 
             div#windows.windows
-                div.scroller(style="width:100%")
+                div.scroller(style="width:100%;height:100%;")
 
             div.control
                 div.msginput