Skip to content

Commit

Permalink
Ω7: hover over issue ids in message log to see details
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hirtle committed Jun 4, 2012
1 parent 95569d5 commit 7151357
Show file tree
Hide file tree
Showing 9 changed files with 459 additions and 18 deletions.
134 changes: 134 additions & 0 deletions public/css/bootstrap.css
@@ -0,0 +1,134 @@
/*!
* Bootstrap v2.0.4
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.tooltip {
position: absolute;
z-index: 1020;
display: block;
visibility: visible;
padding: 5px;
font-size: 11px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
.tooltip.top {
margin-top: -2px;
}
.tooltip.right {
margin-left: 2px;
}
.tooltip.bottom {
margin-top: 2px;
}
.tooltip.left {
margin-left: -2px;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #000000;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
}
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-ms-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
-moz-transition: height 0.35s ease;
-ms-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease;
}
.collapse.in {
height: auto;
}
3 changes: 3 additions & 0 deletions public/css/omega.css
Expand Up @@ -269,4 +269,7 @@ input[type='text']:focus {
padding: 0.3em;
}

.tooltip {
font-size: 0.9em !important;
}

2 changes: 1 addition & 1 deletion public/js/MessageList.js
Expand Up @@ -52,7 +52,7 @@ define(['ko', 'underscore', 'util', 'flavour'], function (ko, _, util, flavour)
};

MessageList.prototype.append = function (event) {
var text = flavour(event.type.name, util.addHtmlLinks(event.message));
var text = flavour(event.type.name, util.addHtml(event.message));
this.messages.push(new Message(text, event.speaker, event.timestamp));
scrollToBottom(this.$element.get(0));
};
Expand Down
21 changes: 19 additions & 2 deletions public/js/ProjectView.js
@@ -1,10 +1,10 @@
/* global window */

define([
'jquery', 'underscore', 'ko', 'timeago',
'jquery', 'underscore', 'ko', 'timeago', 'tooltips',
'util', 'Issue', 'Notifier', 'UserManager', 'MessageList', 'IssueManager', 'error/NoSuchIssueError'
],
function ($, _, ko, timeago, util, Issue, Notifier, UserManager, MessageList, IssueManager, NoSuchIssueError) {
function ($, _, ko, timeago, tooltips, util, Issue, Notifier, UserManager, MessageList, IssueManager, NoSuchIssueError) {

var BAD_COMMAND_RESPONSES = [
'Oops.', 'This is not a Turing test.',
Expand All @@ -27,6 +27,8 @@ function ($, _, ko, timeago, util, Issue, Notifier, UserManager, MessageList, Is
this.disconnected = ko.observable();
this.loading = ko.observable(true);

this.initTooltips();

$(window).bind('hashchange', _.bind(this.checkHashForBookmark, this));

this.hideClosed = ko.observable(true);
Expand All @@ -50,6 +52,21 @@ function ($, _, ko, timeago, util, Issue, Notifier, UserManager, MessageList, Is
that.checkHashForBookmark();
});
};

ProjectView.prototype.initTooltips = function () {
var that = this;
$('#messages').tooltip({
selector: '.id',
placement: 'right',
delay: 0,
title: function () {
var issue = that.issueManager.findIssue($(this).data('id'));
var assignee = issue.assigneeLabel();
var tooltip = assignee ? assignee + ' ' : '';
return tooltip + issue.description();
}
});
};

function isCommand(input) {
return input.trim().charAt(0) === "/";
Expand Down

0 comments on commit 7151357

Please sign in to comment.