From ff19dc74a6a92eede05e3f6ec9aaccf2885c8169 Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 27 Aug 2011 14:26:41 +0100 Subject: [PATCH] Link tooltips + in-kiwi web browser --- css/default.css | 37 ++++++++++++++++++++++++++++++--- css/ui.css | 3 ++- js/front.js | 41 +++++++++++++++++++++++++++++++++++-- js/util.js | 9 +------- node/client/index.html.jade | 4 ---- 5 files changed, 76 insertions(+), 18 deletions(-) diff --git a/css/default.css b/css/default.css index 541c68d..184cf36 100644 --- a/css/default.css +++ b/css/default.css @@ -22,12 +22,12 @@ body, html { /* The main app container */ #kiwi { - overflow:hidden; - position:relative; + overflow:hidden; position:relative; height:100%; - font-family:monospace; font-size:1em; + font-family:Arial, Helvetica, sans-serif; font-size:1em; background:#EBEBEB; } +#kiwi .messages { font-family:monospace; } #kiwi.small_kiwi .userlist { right:-100px; } #kiwi.small_kiwi .messages { right:10px; } @@ -160,6 +160,37 @@ body, html { } +/* + * Link tooltips + */ +#kiwi .messages a { position: relative; } +#kiwi .messages a .tt { + position: absolute; display:none; + padding: 1em 1.5em; + /*background-image: -webkit-gradient( + linear, + left bottom, + left top, + color-stop(0.04, rgb(164,200,126)), + color-stop(0.52, rgb(197,240,164)) + ); + background-image: -moz-linear-gradient( + center bottom, + rgb(164,200,126) 4%, + rgb(197,240,164) 52% + ); + border: 1px solid #444; + border-radius:5px; + -moz-border-radius:5px; + -webkit-border-radius:5px;*/ + font-size: 0.9em; +} +#kiwi .messages a:hover .tt { display:inline; cursor:default; } +#kiwi .messages a:hover .tt a { cursor:pointer; color:inherit; } +#kiwi .messages a:active .tt a { color:inherit; } + + + #kiwi .control { position: absolute; diff --git a/css/ui.css b/css/ui.css index 838cc40..4382d90 100644 --- a/css/ui.css +++ b/css/ui.css @@ -68,7 +68,6 @@ - #kiwi .about { top: 100px; left: 200px; @@ -79,6 +78,7 @@ #kiwi .about button { float:right; } #kiwi .box { + color:#eee; min-width:150px; background: url(../img/trans_back.png) repeat; border-radius:5px; @@ -104,6 +104,7 @@ } .box .boxarea { + color:black; padding:15px !important; background-color:#D4D4D4; border-radius:3px; diff --git a/js/front.js b/js/front.js index a90dc78..5e7f328 100644 --- a/js/front.js +++ b/js/front.js @@ -146,9 +146,44 @@ var front = { gateway.setTopic(chan, text); } }); + + + $('#windows a.chan').live('click', function() { + front.joinChannel($(this).text()); + return false; + }); + + $('#windows a.link_ext').live('mouseover', function () { + var a = $(this); + var tt = $('.tt', a); + + if (tt.text() === '') { + var tooltip = $('Open in Kiwi..'); + tt.append(tooltip); + } + + tt.css('top', -tt.outerHeight()+'px'); + tt.css('left', (a.outerWidth() / 2) - (tt.outerWidth() / 2)); + }); + $('#windows a.link_ext').live('mouseout', function () { + var a = $(this); + var tt = $('.tt', a); + }); + $('#windows a.link_ext').live('click', function (e) { + var a = $(this); + + switch (e.target.className) { + case 'link_ext': + return true; + break; + case 'link_ext_browser': + var t = new Utilityview('Browser', a.attr('href')); + t.show(); + break; + } + return false; + }); - //gateway.start(); - //front.sync(); }, doLayoutSize: function () { @@ -1298,6 +1333,8 @@ Tabview.prototype.addMsg = function (time, nick, msg, type, style) { }); line_msg = $('
' + time + '
' + html_nick + '
' + msg + '
'); + //$('a.link_ext', line_msg).tooltip({ tip : $('#tooltip_link'), effect : 'toggle', offset : [2, 0] }); + this.div.append(line_msg); if (!touchscreen) { diff --git a/js/util.js b/js/util.js index b441fff..a0906e7 100644 --- a/js/util.js +++ b/js/util.js @@ -116,7 +116,7 @@ plugins.privmsg = [ url = 'http://'+url; } - return ''+ nice +''; + return ''+ nice +'
'; }); return text; @@ -148,13 +148,6 @@ plugins.privmsg = [ - - - - - - - /* * jQuery Templates Plugin 1.0.0pre * http://github.com/jquery/jquery-tmpl diff --git a/node/client/index.html.jade b/node/client/index.html.jade index fb87c53..c27f451 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -63,10 +63,6 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") return false; }); $('a.connect').click(function(){ $('.formconnectwindow').submit(); return false; }); - $('a.chan').live('click', function() { - front.joinChannel($(this).text()); - return false; - }); } -- 2.25.1