1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

cleanup helper functions

This commit is contained in:
Luke Pulverenti 2013-06-07 13:29:33 -04:00
parent 356217a9b6
commit 4cdfe410b2
9 changed files with 56 additions and 1034 deletions

View file

@ -206,9 +206,9 @@
html += "<div>";
if (item.RunTimeTicks) {
html += DashboardPage.getDisplayText(connection.NowPlayingPositionTicks || 0) + " / ";
html += Dashboard.getDisplayTime(connection.NowPlayingPositionTicks || 0) + " / ";
html += DashboardPage.getDisplayText(item.RunTimeTicks);
html += Dashboard.getDisplayTime(item.RunTimeTicks);
}
html += "</div>";
@ -217,46 +217,6 @@
return html;
},
getDisplayText: function (ticks) {
var ticksPerHour = 36000000000;
var parts = [];
var hours = ticks / ticksPerHour;
hours = parseInt(hours);
if (hours) {
parts.push(hours);
}
ticks -= (hours * ticksPerHour);
var ticksPerMinute = 600000000;
var minutes = ticks / ticksPerMinute;
minutes = parseInt(minutes);
ticks -= (minutes * ticksPerMinute);
if (minutes < 10 && hours) {
minutes = '0' + minutes;
}
parts.push(minutes);
var ticksPerSecond = 10000000;
var seconds = ticks / ticksPerSecond;
seconds = parseInt(seconds);
if (seconds < 10) {
seconds = '0' + seconds;
}
parts.push(seconds);
return parts.join(':');
},
renderRunningTasks: function (dashboardInfo) {
var page = $.mobile.activePage;