liquid_feedback_frontend
changeset 868:2aa8c9f925f4
Made debug trace configurable and disabled it by default
author | bsw |
---|---|
date | Fri Aug 17 20:40:51 2012 +0200 (2012-08-17) |
parents | c85f17285a94 |
children | ef266d313c85 |
files | app/main/_layout/default.html config/example.lua config/init.lua static/trace.css |
line diff
1.1 --- a/app/main/_layout/default.html Fri Aug 17 20:32:22 2012 +0200 1.2 +++ b/app/main/_layout/default.html Fri Aug 17 20:40:51 2012 +0200 1.3 @@ -50,15 +50,13 @@ 1.4 <div class="footer" id="footer"> 1.5 <!-- WEBMCP SLOT footer --> 1.6 </div> 1.7 - <div class="layout_trace" id="layout_trace" style="xdisplay: none"> 1.8 - <div id="trace_show" onclick="document.getElementById('trace_content').style.display='block';this.style.display='none';">TRACE</div> 1.9 - <div id="trace_content" style="display: none;"> 1.10 - <tt id="system_error"><!-- WEBMCP SLOT system_error --></tt> 1.11 - <div id="trace"> </div><hr /> 1.12 - <!-- WEBMCP SLOT trace --> 1.13 - <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';"> 1.14 - close 1.15 - </div> 1.16 + <!-- WEBMCP SLOT trace_button --> 1.17 + <div id="trace_content" style="display: none;"> 1.18 + <tt id="system_error"><!-- WEBMCP SLOT system_error --></tt> 1.19 + <div id="trace"> </div><hr /> 1.20 + <!-- WEBMCP SLOT trace --> 1.21 + <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';"> 1.22 + close 1.23 </div> 1.24 </div> 1.25 <script type="text/javascript">
2.1 --- a/config/example.lua Fri Aug 17 20:32:22 2012 +0200 2.2 +++ b/config/example.lua Fri Aug 17 20:40:51 2012 +0200 2.3 @@ -147,6 +147,9 @@ 2.4 -- require 'webmcp_accelerator' 2.5 -- if cgi then collectgarbage("stop") end 2.6 2.7 +-- Trace debug 2.8 +-- uncomment the following line to enable debug trace 2.9 +-- config.enable_debug_trace = true 2.10 2.11 -- ======================================================================== 2.12 -- Do main initialisation (DO NOT REMOVE FOLLOWING SECTION)
3.1 --- a/config/init.lua Fri Aug 17 20:32:22 2012 +0200 3.2 +++ b/config/init.lua Fri Aug 17 20:40:51 2012 +0200 3.3 @@ -36,6 +36,13 @@ 3.4 config.database = { engine='postgresql', dbname='liquid_feedback' } 3.5 end 3.6 3.7 +if not config.enable_debug_trace then 3.8 + trace.disable() 3.9 +else 3.10 + slot.put_into('trace_button', '<div id="trace_show" onclick="document.getElementById(\'trace_content\').style.display=\'block\';this.style.display=\'none\';">TRACE</div>') 3.11 +end 3.12 + 3.13 + 3.14 request.set_404_route{ module = 'index', view = '404' } 3.15 3.16 -- open and set default database handle
4.1 --- a/static/trace.css Fri Aug 17 20:32:22 2012 +0200 4.2 +++ b/static/trace.css Fri Aug 17 20:40:51 2012 +0200 4.3 @@ -1,15 +1,6 @@ 4.4 -.layout_trace { 4.5 - position: absolute; 4.6 - right: 0; 4.7 - margin-top: 20px; 4.8 - border: 1px solid #404040; 4.9 - font-size: 70%; 4.10 - padding: 5px; 4.11 - background: #ffe0c0; 4.12 -} 4.13 - 4.14 #trace_show { 4.15 cursor: pointer; 4.16 + float: right; 4.17 } 4.18 4.19 .trace_list {