Skip to content

Commit

Permalink
Added Clock to menu bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Eruyome committed Aug 22, 2016
1 parent c94e78c commit 29bffc6
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 13 deletions.
18 changes: 14 additions & 4 deletions dist/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -5945,13 +5945,13 @@ body {

.menu-bar .disclaimerTitle {
position: absolute;
top: 0px;
right: 0px; }
right: 63px;
top: 0; }

.menu-bar .scheduleTitle {
position: absolute;
top: 8px;
right: 75px; }
right: 128px; }
.menu-bar .scheduleTitle a.schedule {
display: inline-block;
background: url("../img/calendar-small.png") no-repeat center center;
Expand All @@ -5968,7 +5968,7 @@ body {

.menu-bar .optionsTitle {
position: absolute;
right: 130px;
right: 181px;
top: 11px; }
.menu-bar .optionsTitle img, .menu-bar .optionsTitle a {
margin: 0;
Expand All @@ -5990,6 +5990,13 @@ body {
.menu-bar .openModal:hover {
background: transparent !important; }

.menu-bar .clock {
position: absolute;
right: 0;
top: 0; }
.menu-bar .clock a {
cursor: default !important; }

.grid-container {
max-width: 93rem;
padding: 1rem; }
Expand Down Expand Up @@ -6384,3 +6391,6 @@ body {
.footer a {
padding: 1rem;
font-size: 0.75rem; }

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important; }
24 changes: 24 additions & 0 deletions dist/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10698,6 +10698,30 @@ return jQuery;
updateStreamInfo();
$interval(function() {updateStreamInfo();}, $scope.intervals.viewCount);

// Create and update Clock
function getTimeFromDate(date) {
function pad(n){return n<10 ? '0'+n : n;}
var newDate = new Date();
var h = pad(newDate.getHours());
var m = pad(newDate.getMinutes());
var time = h + ':' + m;

return time;
}

$scope.clock = {
clock : getTimeFromDate(new Date())
};
var updateClock = function () {
$scope.clock.now = getTimeFromDate(new Date());
};

setInterval(function () {
$scope.$apply(updateClock);
}, 1000);

updateClock();

/* Gets called to get video list data in intervals */
function reloadVListData() {
$scope.getData("vList");
Expand Down
5 changes: 4 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
type="image/png"
href="./assets/img/favicon.ico">
</head>
<body zf-close-all>
<body zf-esc-close zf-close-all>
<div class="grid-frame vertical" ng-controller="mainController">
<div class="grid-content shrink" style="padding: 0;">
<ul class="primary condense menu-bar">
Expand Down Expand Up @@ -45,6 +45,9 @@
Forum
</a>
</li>
<li class="clock">
<a ng-cloak title="Clock">{{clock.now}}</a>
</li>

<li class="optionsTitle" >
<a zf-open="optionsModal" class="button openModal"></a>
Expand Down
24 changes: 24 additions & 0 deletions src/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,30 @@
updateStreamInfo();
$interval(function() {updateStreamInfo();}, $scope.intervals.viewCount);

// Create and update Clock
function getTimeFromDate(date) {
function pad(n){return n<10 ? '0'+n : n;}
var newDate = new Date();
var h = pad(newDate.getHours());
var m = pad(newDate.getMinutes());
var time = h + ':' + m;

return time;
}

$scope.clock = {
clock : getTimeFromDate(new Date())
};
var updateClock = function () {
$scope.clock.now = getTimeFromDate(new Date());
};

setInterval(function () {
$scope.$apply(updateClock);
}, 1000);

updateClock();

/* Gets called to get video list data in intervals */
function reloadVListData() {
$scope.getData("vList");
Expand Down
25 changes: 18 additions & 7 deletions src/assets/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,15 @@ body {
}
}

.disclaimer {
}
.disclaimerTitle {
position: absolute;
top: 0px;
right: 0px;
right: 63px;
top: 0;
}
.scheduleTitle {
position: absolute;
top: 8px;
right: 75px;
right: 128px;
a.schedule {
display: inline-block;
background: url('../img/calendar-small.png') no-repeat center center;
Expand All @@ -108,7 +106,7 @@ body {
}
.optionsTitle {
position: absolute;
right: 130px;
right: 181px;
top: 11px;
img, a {
margin: 0;
Expand All @@ -133,6 +131,15 @@ body {
background: transparent !important;
}
}
.clock {
position: absolute;
right: 0;
top: 0;
a {
cursor: default !important;
}

}
}

.grid-container {
Expand Down Expand Up @@ -659,4 +666,8 @@ body {
padding: 1rem;
font-size: rem-calc(12px);
}
}
}

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
5 changes: 4 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
type="image/png"
href="./assets/img/favicon.ico">
</head>
<body zf-close-all>
<body zf-esc-close zf-close-all>
<div class="grid-frame vertical" ng-controller="mainController">
<div class="grid-content shrink" style="padding: 0;">
<ul class="primary condense menu-bar">
Expand Down Expand Up @@ -45,6 +45,9 @@
Forum
</a>
</li>
<li class="clock">
<a ng-cloak title="Clock">{{clock.now}}</a>
</li>

<li class="optionsTitle" >
<a zf-open="optionsModal" class="button openModal"></a>
Expand Down

0 comments on commit 29bffc6

Please sign in to comment.