From b46bc6004f5bfda08acc5ea296b16b91b28766d9 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 16 May 2013 16:42:28 -0400 Subject: [PATCH] Load blueslip as early as possible This will help us track down errors in third-party javascript libraries. blueslip needs jQuery and the page_params, so those must come first. (imported from commit f53f67d758298d4e1c2784ec27e09d6abf0b3223) --- humbug/settings.py | 5 ++++- templates/zephyr/base.html | 7 +++++++ templates/zephyr/index.html | 16 +++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/humbug/settings.py b/humbug/settings.py index 2e09891768..8e90b8c663 100644 --- a/humbug/settings.py +++ b/humbug/settings.py @@ -274,7 +274,6 @@ PIPELINE_JS = { }, 'app': { 'source_filenames': [ - 'js/blueslip.js', 'js/util.js', 'js/setup.js', 'js/viewport.js', @@ -305,6 +304,10 @@ PIPELINE_JS = { ], 'output_filename': 'min/app.js' }, + 'blueslip': { + 'source_filenames': ('js/blueslip.js',), + 'output_filename': 'min/blueslip.js' + }, } if PIPELINE: diff --git a/templates/zephyr/base.html b/templates/zephyr/base.html index 7d77ecabdc..fe62584a14 100644 --- a/templates/zephyr/base.html +++ b/templates/zephyr/base.html @@ -21,6 +21,13 @@ {# We need to import jQuery before Bootstrap #} + {% block page_params %} + {# blueslip needs page_params.debug_mode. Set it to false by default. #} + + {% endblock %} + {% compressed_js 'blueslip' %} {% compressed_js 'common' %} {% block customhead %} diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index f572a5d799..f206007e02 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -5,6 +5,15 @@ {% load compressed %} +{% block page_params %} +{# Insert parameters, which have been encoded with JSONEncoderForHTML. #} + +{% endblock %} + {% block customhead %} @@ -30,13 +39,6 @@ {% endif %} -{# Insert parameters, which have been encoded with JSONEncoderForHTML. #} - - {% compressed_js 'app' %} {% if debug %}