mirror of https://github.com/zulip/zulip.git
Add client-side debugging tools
(imported from commit faa87e85f366e91fe33e0f24e00ae1197403605d)
This commit is contained in:
parent
72b98d1d01
commit
af5282abd4
|
@ -7,6 +7,9 @@ deployed = (platform.node() == 'humbug-dev')
|
|||
DEBUG = not deployed
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
if DEBUG:
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
|
||||
ADMINS = (
|
||||
('Jessica McKellar', 'jessica.mckellar@gmail.com'),
|
||||
)
|
||||
|
|
|
@ -29,6 +29,11 @@
|
|||
<script type="text/javascript" src="/static/third/jquery/jquery.form.js"></script>
|
||||
<script type="text/javascript" src="/static/third/ich/ICanHaz.min.js"></script>
|
||||
<script type="text/javascript" src="/static/js/zephyr.js"></script>
|
||||
|
||||
{% if debug %}
|
||||
<script type="text/javascript" src="/static/js/debug.js"></script>
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript">
|
||||
var initial_zephyr_array = {{ zephyr_array }};
|
||||
var initial_pointer = {{ user_profile.pointer }};
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/* WARNING:
|
||||
|
||||
This file is only included when Django's DEBUG = True and your
|
||||
host is in INTERNAL_IPS.
|
||||
|
||||
Do not commit any code to zephyr.js which uses these functions.
|
||||
They are for debugging use only.
|
||||
|
||||
The file may still be accessible under other circumstances, so do
|
||||
not put sensitive information here. */
|
||||
|
||||
/*
|
||||
print_elapsed_time("foo", foo)
|
||||
|
||||
evaluates to foo() and prints the elapsed time
|
||||
to the console along with the name "foo". */
|
||||
|
||||
function print_elapsed_time(name, fun) {
|
||||
var t0 = new Date().getTime();
|
||||
var out = fun();
|
||||
var t1 = new Date().getTime();
|
||||
console.log(name + ': ' + (t1 - t0) + ' ms');
|
||||
return out;
|
||||
}
|
Loading…
Reference in New Issue