Static client support. (Fixes #105).

This commit is contained in:
Nick Steel 2015-06-23 16:30:47 +01:00
parent c8e5160bd6
commit 43c7733e73
2 changed files with 6 additions and 7 deletions

View File

@ -8,9 +8,9 @@
<!-- <script type='application/javascript' src='js/fastclick.js'></script> -->
<script>
//configuration
var isMusicBox = {{musicbox}}; // Remove MusicBox only content (e.g. settings, system pages)
var websocketUrl = '{{websocket_url}}';
var hasAlarmClock = {{alarmclock}}; // Add Alarm Clock icons
var isMusicBox = '{{musicbox}}' == 'True'; // Remove MusicBox only content (e.g. settings, system pages)
var websocketUrl = ('{{useWebsocketUrl}}' == 'True') ? '{{websocket_url}}' : ''
var hasAlarmClock = '{{alarmclock}}' == 'True'; // Add Alarm Clock icons
$(document).bind("mobileinit", function () {
$.extend($.mobile, {

View File

@ -43,11 +43,10 @@ class IndexHandler(tornado.web.RequestHandler):
self.__dict = {
'version': MusicBoxExtension.version,
'musicbox': int(ext_config['musicbox'] or False),
'musicbox': ext_config.get('musicbox', False),
'useWebsocketUrl': ws_url != '',
'websocket_url': ws_url,
'alarmclock': int('alarmclock' in config and
'enabled' in config['alarmclock'] and
config['alarmclock']['enabled'])
'alarmclock': config.get('alarmclock', {}).get('enabled', False),
}
self.__path = path