This commit is contained in:
Tim Bentley 2016-03-19 18:49:55 +00:00
parent dc6a9b6d86
commit ec0379ea44
17 changed files with 27 additions and 23 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,11 +18,11 @@
******************************************************************************/
.ui-icon-blank {
background-image: url(images/ui-icon-blank.png);
background-image: url(../images/ui-icon-blank.png);
}
.ui-icon-unblank {
background-image: url(images/ui-icon-unblank.png);
background-image: url(../images/ui-icon-unblank.png);
}
/* Overwrite style from jquery-mobile.min.css */

View File

@ -24,12 +24,12 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<title>${app_title}</title>
<link rel="stylesheet" href="/files/jquery.mobile.min.css" />
<link rel="stylesheet" href="/files/openlp.css" />
<link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico">
<script type="text/javascript" src="/files/jquery.min.js"></script>
<script type="text/javascript" src="/files/openlp.js"></script>
<script type="text/javascript" src="/files/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="/assets/jquery.mobile.min.css" />
<link rel="stylesheet" href="/css/openlp.css" />
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<script type="text/javascript" src="/assets/jquery.min.js"></script>
<script type="text/javascript" src="/js/openlp.js"></script>
<script type="text/javascript" src="/assets/jquery.mobile.min.js"></script>
<script type="text/javascript">
translationStrings = {
"go_live": "${go_live}",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -23,10 +23,10 @@
<head>
<meta charset="utf-8" />
<title>${live_title}</title>
<link rel="stylesheet" href="/files/main.css" />
<link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico">
<script type="text/javascript" src="/files/jquery.min.js"></script>
<script type="text/javascript" src="/files/main.js"></script>
<link rel="stylesheet" href="/css/main.css" />
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<script type="text/javascript" src="/assets/jquery.min.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
</head>
<body>
<img id="image" class="size"/>

View File

@ -23,10 +23,10 @@
<head>
<meta charset="utf-8" />
<title>${stage_title}</title>
<link rel="stylesheet" href="/files/stage.css" />
<link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico">
<script type="text/javascript" src="/files/jquery.min.js"></script>
<script type="text/javascript" src="/files/stage.js"></script>
<link rel="stylesheet" href="/css/stage.css" />
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<script type="text/javascript" src="/assets/jquery.min.js"></script>
<script type="text/javascript" src="/js/stage.js"></script>
</head>
<body>
<input type="hidden" id="next-text" value="${next}" />

View File

@ -146,12 +146,13 @@ class HttpRouter(RegistryProperties):
self.auth = base64.b64encode(auth_code)
except TypeError:
self.auth = base64.b64encode(auth_code.encode()).decode()
self.default_route = {'function': self.serve_file, 'secure': False}
self.routes = [
('^/$', {'function': self.serve_file, 'secure': False}),
('^/(stage)$', {'function': self.serve_file, 'secure': False}),
('^/(stage)/(.*)$', {'function': self.stages, 'secure': False}),
('^/(main)$', {'function': self.serve_file, 'secure': False}),
(r'^/files/(.*)$', {'function': self.serve_file, 'secure': False}),
(r'^/files1/(.*)$', {'function': self.serve_file, 'secure': False}),
(r'^/(\w+)/thumbnails([^/]+)?/(.*)$', {'function': self.serve_thumbnail, 'secure': False}),
(r'^/api/poll$', {'function': self.poll, 'secure': False}),
(r'^/main/poll$', {'function': self.main_poll, 'secure': False}),
@ -221,6 +222,7 @@ class HttpRouter(RegistryProperties):
self.request_data = None
url_path_split = urlparse(url_path)
url_query = parse_qs(url_path_split.query)
# GET
if 'data' in url_query.keys():
self.request_data = url_query['data'][0]
for route, func in self.routes:
@ -231,7 +233,7 @@ class HttpRouter(RegistryProperties):
for param in match.groups():
args.append(param)
return func, args
return None, None
return self.default_route, [url_path_split.path]
def set_cache_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
@ -404,6 +406,8 @@ class HttpRouter(RegistryProperties):
file_name = 'stage.html'
elif file_name == 'main':
file_name = 'main.html'
if file_name.startswith('/'):
file_name = file_name[1:]
path = os.path.normpath(os.path.join(self.html_dir, file_name))
if not path.startswith(self.html_dir):
return self.do_not_found()