Change time indicator

This commit is contained in:
Lance Stout 2013-12-19 23:49:23 -08:00
parent 02983e2bfd
commit 753983a373
4 changed files with 51 additions and 31 deletions

View File

@ -75,18 +75,40 @@ module.exports = HumanModel.define({
} }
}, },
formattedTZO: { formattedTZO: {
deps: ['timezoneOffset', 'displayName'], deps: ['timezoneOffset'],
fn: function () { fn: function () {
if (this.timezoneOffset !== undefined) { if (!this.timezoneOffset) return '';
var localTZO = (new Date()).getTimezoneOffset();
var diff = Math.abs(localTZO % (24 * 60) - this.timezoneOffset % (24 * 60)) / 60; var localTime = new Date();
if (diff === 0) { var localTZO = localTime.getTimezoneOffset();
return this.displayName + ' is in the same timezone as you'; var diff = Math.abs(localTZO % (24 * 60) - this.timezoneOffset % (24 * 60));
} var remoteTime = new Date(Date.now() + diff * 60000);
var dir = (localTZO > this.timezoneOffset) ? 'ahead of' : 'behind';
return this.displayName + ' is ' + diff + 'hrs ' + dir + ' you';
var day = remoteTime.getDate();
var hour = remoteTime.getHours();
var minutes = remoteTime.getMinutes();
var days = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
var dow = days[remoteTime.getDay()];
var localDow = days[localTime.getDay()];
var m = (hour >= 12) ? ' PM' : ' AM';
hour = hour % 12;
if (hour === 0) {
hour = 12;
}
var strDay = (day < 10) ? '0' + day : day;
var strHour = (hour < 10) ? '0' + hour : hour;
var strMin = (minutes < 10) ? '0' + minutes: minutes;
if (localDow == dow) {
return strHour + ':' + strMin + m;
} else { } else {
return ''; return dow + ' ' + strHour + ':' + strMin + m;
} }
} }
}, },

View File

@ -879,7 +879,7 @@ button.secondary:hover:not(:disabled) {
} }
.conversation header { .conversation header {
padding: 0px; padding: 0px;
padding-left: 8px; padding-left: 6px;
border-bottom: 2px solid #eee; border-bottom: 2px solid #eee;
position: fixed; position: fixed;
right: 0px; right: 0px;
@ -898,9 +898,9 @@ button.secondary:hover:not(:disabled) {
content: ''; content: '';
position: absolute; position: absolute;
top: 50%; top: 50%;
height: 8px; height: 6px;
width: 8px; width: 6px;
margin-top: -4px; margin-top: -3px;
-moz-border-radius: 10px; -moz-border-radius: 10px;
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
-khtml-border-radius: 10px; -khtml-border-radius: 10px;
@ -953,7 +953,7 @@ button.secondary:hover:not(:disabled) {
display: block; display: block;
} }
.conversation header .controls button { .conversation header .controls button {
margin-top: 4px; margin-top: 5px;
} }
.conversation header .controls.joined .joinRoom { .conversation header .controls.joined .joinRoom {
display: none; display: none;
@ -982,19 +982,17 @@ button.secondary:hover:not(:disabled) {
} }
.conversation header .name { .conversation header .name {
margin: 10px; margin: 10px;
margin-left: 15px; margin-left: 10px;
margin-right: 5px; margin-right: 5px;
padding: 0px; padding: 0px;
font-size: 14px; font-size: 14px;
line-height: 14px;
max-width: 50%; max-width: 50%;
} }
.conversation header .status { .conversation header .status {
margin: 10px; margin: 10px;
margin-left: 0px; margin-left: 0px;
padding: 0px; padding: 0px;
font-size: 14px; font-size: 12px;
line-height: 14px;
max-width: 75%; max-width: 75%;
float: left; float: left;
overflow: hidden; overflow: hidden;
@ -1022,13 +1020,14 @@ button.secondary:hover:not(:disabled) {
line-height: 20px; line-height: 20px;
color: #898989; color: #898989;
background: #eee; background: #eee;
border: 1px solid #d6d6d6;
} }
.conversation header .tzo:not(:empty):before { .conversation header .tzo:not(:empty):before {
content: 'Current Time: '; content: 'Current Time: ';
font-weight: bold; font-weight: bold;
} }
.conversation header .call { .conversation header .call {
margin-top: 4px; margin-top: 5px;
text-transform: capitalize; text-transform: capitalize;
} }
.conversation header .activeCall { .conversation header .activeCall {

View File

@ -17,7 +17,7 @@
header header
padding: 0px padding: 0px
padding-left: 8px padding-left: 6px
border-bottom: 2px solid $gray-lighter border-bottom: 2px solid $gray-lighter
position: fixed position: fixed
right: 0px right: 0px
@ -31,9 +31,9 @@
content: '' content: ''
position: absolute position: absolute
top: 50% top: 50%
height: 8px height: 6px
width: 8px width: 6px
margin-top: -4px margin-top: -3px
roundall(10px) roundall(10px)
&.online, &.online,
@ -86,7 +86,7 @@
display: block display: block
button button
margin-top: 4px margin-top: 5px
&.joined &.joined
.joinRoom .joinRoom
@ -108,19 +108,17 @@
.name .name
margin: 10px margin: 10px
margin-left: 15px margin-left: 10px
margin-right: 5px margin-right: 5px
padding: 0px padding: 0px
font-size: $font-size-base font-size: $font-size-base
line-height: 14px
max-width: 50% max-width: 50%
.status .status
margin: 10px margin: 10px
margin-left: 0px margin-left: 0px
padding: 0px padding: 0px
font-size: $font-size-base font-size: $font-size-small
line-height: 14px
max-width: 75% max-width: 75%
float: left float: left
overflow: hidden overflow: hidden
@ -143,13 +141,14 @@
line-height: 20px line-height: 20px
color: lighten($gray, 30%) color: lighten($gray, 30%)
background: $gray-lighter background: $gray-lighter
border: 1px solid darken($gray-lighter, 10%)
&:before &:before
content: 'Current Time: ' content: 'Current Time: '
font-weight: bold font-weight: bold
.call .call
margin-top: 4px margin-top: 5px
text-transform: capitalize text-transform: capitalize
.activeCall .activeCall

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# 0.0.1 1387522881010 # 0.0.1 1387525625986
CACHE: CACHE:
/app.js /app.js