From: Darren Date: Sun, 4 Sep 2011 12:25:56 +0000 (+0100) Subject: Specifying server in URI, Firefox Utilityview css fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8397d902c33eafa515765943e76bf7b25d75a075;p=KiwiIRC.git Specifying server in URI, Firefox Utilityview css fix --- diff --git a/css/default.css b/css/default.css index a91d936..456b0cd 100644 --- a/css/default.css +++ b/css/default.css @@ -149,6 +149,7 @@ background-image: -moz-linear-gradient( overflow-x:wrap; border:none; display: none; + height: 100%; } #kiwi .messages a { text-decoration:none; diff --git a/js/front.js b/js/front.js index 1a49d7e..8f9ff05 100644 --- a/js/front.js +++ b/js/front.js @@ -1172,7 +1172,7 @@ Utilityview.prototype.addPartImage = function () { return; } - var del_html = ''; + var del_html = ''; this.tab.append(del_html); $('.tab_part', this.tab).click(function () { @@ -1268,7 +1268,7 @@ Tabview.prototype.addPartImage = function () { return; } - var del_html = ''; + var del_html = ''; this.tab.append(del_html); $('.tab_part', this.tab).click(function () { diff --git a/node/app.js b/node/app.js index 88ac244..6ef776b 100644 --- a/node/app.js +++ b/node/app.js @@ -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(); diff --git a/node/client/index.html.jade b/node/client/index.html.jade index 28e1c98..f34bcc4 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -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") |
- | Your new nick:
+ | Your new nickname:
|
|
| Cancel @@ -106,8 +106,8 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") script#tmpl_user_box(type="text/x-jquery-tmpl") |
| - | Message - | Info + | Message + | Info |
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