Add link to Alarm Clock

This commit is contained in:
Davis Mosenkovs 2015-05-30 01:05:42 +03:00
parent be769dc479
commit 287995110b
3 changed files with 20 additions and 2 deletions

View File

@ -9,7 +9,8 @@
<script>
//configuration
var isMusicBox = {{musicbox}}; // Remove MusicBox only content (e.g. settings, system pages)
var websocketUrl = '{{websocket_url}}'
var websocketUrl = '{{websocket_url}}';
var hasAlarmClock = {{alarmclock}}; // Add Alarm Clock icons
$(document).bind("mobileinit", function () {
$.extend($.mobile, {
@ -96,6 +97,10 @@
<a href="#search" onclick="switchContent('search' ); return false;">
<span class="navtxt">Search </span><i class="fa fa-search"></i></a>
</li>
<li id="navAlarmClock" data-icon="false">
<a href="/alarmclock/">
<span class="navtxt"> Alarm Clock </span><i class="fa fa-clock-o"></i></a>
</li>
<li id="navEnterFullscreen" data-icon="false">
<a href="#">
<span class="navtxt"> Fullscreen </span><i class="fa fa-desktop"></i></a>
@ -266,6 +271,12 @@
<h4>Search</h4>
</div>
</a>
<a id="homeAlarmClock" href="/alarmclock/">
<div class="ui-block-a">
<i class="fa fa-clock-o"></i>
<h4>Alarm Clock</h4>
</div>
</a>
<a id="homesettings" href="/settings/">
<div class="ui-block-a">
<i class="fa fa-gear"></i>

View File

@ -521,6 +521,12 @@ $(document).ready(function(event) {
$('#homeshutdown').hide();
}
// remove Alarm Clock if it is not present
if (!hasAlarmClock) {
$('#navAlarmClock').hide();
$('#homeAlarmClock').hide();
}
//navigation stuff
$(document).keypress( function (event) {

View File

@ -44,7 +44,8 @@ class IndexHandler(tornado.web.RequestHandler):
self.__dict = {
'version': MusicBoxExtension.version,
'musicbox': int(ext_config['musicbox'] or False),
'websocket_url': ws_url
'websocket_url': ws_url,
'alarmclock': int(config['alarmclock']['enabled'])
}
self.__path = path