Merge pull request #104 from DavisNT/develop

Add link to Alarm Clock extension if it's installed.
This commit is contained in:
Nick Steel 2015-06-01 12:27:01 +01:00
commit 79e9581bb1
4 changed files with 26 additions and 4 deletions

View File

@ -58,6 +58,7 @@ v2.0.1 (UNRELEASED)
- Added optional websocket_host and websocket_port config settings.
- Support for Mopidy-Grooveshark.
- Fixed slow to start playing from a large tracklist of browsed tracks.
- Added link to `Alarm Clock <https://pypi.python.org/pypi/Mopidy-AlarmClock/>`_ (if present).
v2.0.0 (26-3-2015)
------------------

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,14 +271,20 @@
<h4>Search</h4>
</div>
</a>
<a id="homesettings" href="/settings/">
<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-b">
<i class="fa fa-gear"></i>
<h4>Settings</h4>
</div>
</a>
<a id="homeshutdown" href="system.html">
<div class="ui-block-b">
<div class="ui-block-a">
<i class="fa fa-power-off"></i>
<h4>System</h4>
</div>

View File

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

View File

@ -44,7 +44,10 @@ 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('alarmclock' in config and
'enabled' in config['alarmclock'] and
config['alarmclock']['enabled'])
}
self.__path = path