indicate whether the UI is in debug mode via an additional script tag in the index page

This commit is contained in:
Damien Churchill 2009-09-14 16:24:47 +00:00
parent 3c02a499a5
commit 6fc1e23fce
2 changed files with 8 additions and 5 deletions

View File

@ -15,6 +15,9 @@
% for script in scripts: % for script in scripts:
<script type="text/javascript" src="${script}"></script> <script type="text/javascript" src="${script}"></script>
% endfor % endfor
<script type="text/javascript">
Deluge.debug = ${str(debug).lower()};
</script>
</head> </head>
<body> <body>
<div style="background-image: url('/themes/default/tree/loading.gif');"></div> <div style="background-image: url('/themes/default/tree/loading.gif');"></div>

View File

@ -425,7 +425,7 @@ class TopLevel(resource.Resource):
template = Template(filename=rpath("index.html")) template = Template(filename=rpath("index.html"))
request.setHeader("content-type", "text/html; charset=utf-8") request.setHeader("content-type", "text/html; charset=utf-8")
return template.render(scripts=scripts, stylesheets=self.stylesheets) return template.render(scripts=scripts, stylesheets=self.stylesheets, debug=debug)
class ServerContextFactory: class ServerContextFactory: