Minify our JS and CSS with third-party JS and CSS

(imported from commit e08d54c0ce09baff1f88db6b0c22386a556bc2df)
This commit is contained in:
Zev Benjamin 2013-05-28 15:46:16 -04:00
parent 0df77527f1
commit 4cd194ec6a
7 changed files with 38 additions and 65 deletions

View File

@ -238,6 +238,7 @@ PIPELINE_CSS = {
},
'portico': {
'source_filenames': (
'third/zocial/zocial.css',
'styles/portico.css',
'styles/pygments.css',
'styles/fonts.css',
@ -246,44 +247,44 @@ PIPELINE_CSS = {
},
'app': {
'source_filenames': (
'third/spectrum/spectrum.css',
'styles/zephyr.css',
'styles/pygments.css',
'styles/fonts.css',
),
'output_filename': 'min/app.css'
},
'third_common': {
'common': {
'source_filenames': (
'third/bootstrap/css/bootstrap.css',
'third/bootstrap/css/bootstrap-responsive.css',
),
'output_filename': 'min/third_common.css'
},
'third_portico': {
'source_filenames': (
'third/zocial/zocial.css',
),
'output_filename': 'min/third_portico.css'
},
'third_app': {
'source_filenames': (
'third/spectrum/spectrum.css',
),
'output_filename': 'min/third_app.css'
'output_filename': 'min/common.css'
},
}
PIPELINE_JS = {
'common': {
'source_filenames': ('js/common.js',),
'source_filenames': (
'third/jquery/jquery-1.7.2.js',
'js/blueslip.js',
'third/bootstrap/js/bootstrap.js',
'js/common.js',
),
'output_filename': 'min/common.js'
},
'landing-page': {
'source_filenames': ('js/landing-page.js',),
'source_filenames': (
'third/jquery-form/jquery.form.js',
'js/landing-page.js',
),
'output_filename': 'min/landing-page.js'
},
'signup': {
'source_filenames': ('js/signup.js',),
'source_filenames': (
'js/signup.js',
'third/jquery-validate/jquery.validate.js',
),
'output_filename': 'min/signup.js'
},
'api': {
@ -296,6 +297,22 @@ PIPELINE_JS = {
},
'app': {
'source_filenames': [
'third/jquery-validate/jquery.validate.js',
'third/jquery-form/jquery.form.js',
'third/jquery-highlight/jquery.highlight.js',
'third/jquery-filedrop/jquery.filedrop.js',
'third/jquery-caret/jquery.caret.1.02.js',
'third/xdate/xdate.dev.js',
'third/spin/spin.js',
'third/jquery-mousewheel/jquery.mousewheel.js',
'third/jquery-throttle-debounce/jquery.ba-throttle-debounce.js',
'third/jquery-idle/jquery.idle.js',
'third/jquery-autosize/jquery.autosize.js',
'third/spectrum/spectrum.js',
('third/handlebars/handlebars.runtime.js'
if PIPELINE
else 'third/handlebars/handlebars.js'),
'js/util.js',
'js/setup.js',
'js/viewport.js',
@ -330,48 +347,11 @@ PIPELINE_JS = {
],
'output_filename': 'min/app.js'
},
'blueslip': {
'source_filenames': ('js/blueslip.js',),
'output_filename': 'min/blueslip.js'
},
'third_common': {
'source_filenames': (
'third/jquery/jquery-1.7.2.js',
'third/bootstrap/js/bootstrap.js',
),
'output_filename': 'min/third_common.js'
},
'third_signup': {
'source_filenames': (
'third/jquery-validate/jquery.validate.js',
),
'output_filename': 'min/third_signup.js'
},
'third_activity': {
'activity': {
'source_filenames': (
'third/sorttable/sorttable.js',
),
'output_filename': 'min/third_activity.js'
},
'third_app': {
'source_filenames': (
'third/jquery-validate/jquery.validate.js',
'third/jquery-form/jquery.form.js',
'third/jquery-highlight/jquery.highlight.js',
'third/jquery-filedrop/jquery.filedrop.js',
'third/jquery-caret/jquery.caret.1.02.js',
'third/xdate/xdate.dev.js',
'third/spin/spin.js',
'third/jquery-mousewheel/jquery.mousewheel.js',
'third/jquery-throttle-debounce/jquery.ba-throttle-debounce.js',
'third/jquery-idle/jquery.idle.js',
'third/jquery-autosize/jquery.autosize.js',
'third/spectrum/spectrum.js',
('third/handlebars/handlebars.runtime.js'
if PIPELINE
else 'third/handlebars/handlebars.js'),
),
'output_filename': 'min/third_app.js'
'output_filename': 'min/activity.js'
},
}

View File

@ -6,7 +6,7 @@
{% block customhead %}
{{ block.super }}
{% compressed_js 'third_activity' %}
{% compressed_js 'activity' %}
{% compressed_css 'activity' %}
{% endblock %}

View File

@ -63,15 +63,13 @@ mixpanel.init("{{ mixpanel_token }}", {verbose: true});
{# We need to import jQuery before Bootstrap #}
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
{% compressed_css 'third_common' %}
{% compressed_js 'third_common' %}
{% compressed_css 'common' %}
{% block page_params %}
{# blueslip needs page_params.debug_mode. Set it to false by default. #}
<script type="text/javascript">
var page_params = {debug_mode: false};
</script>
{% endblock %}
{% compressed_js 'blueslip' %}
{% compressed_js 'common' %}
{% block customhead %}
{% endblock %}

View File

@ -17,9 +17,7 @@ var page_params = {{ page_params }};
{% block customhead %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% compressed_css 'third_app' %}
{% compressed_css 'app' %}
{% compressed_js 'third_app' %}
{% compressed_js 'app' %}
{% if debug %}

View File

@ -10,7 +10,6 @@ hence the name.
{% endcomment %}
{% block customhead %}
{% compressed_css 'third_portico' %}
{% compressed_css 'portico' %}
{% endblock %}

View File

@ -6,6 +6,5 @@
{% block customhead %}
{{ block.super }}
{% compressed_js 'third_signup' %}
{% compressed_js 'signup' %}
{% endblock %}

View File

@ -3,7 +3,6 @@
{% block customhead %}
{% compressed_css 'portico' %}
<script type="text/javascript" src="/static/third/jquery/jquery.form.js"></script>
{% compressed_js 'landing-page' %}
{% endblock %}