diff --git a/lms/envs/common.py b/lms/envs/common.py index 336c47f715..db156ef3f2 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -301,11 +301,19 @@ PIPELINE_CSS = { PIPELINE_ALWAYS_RECOMPILE = ['sass/application.scss', 'sass/ie.scss'] +courseware_only_js = [PROJECT_ROOT / 'static/coffee/src/' + pth + '.coffee' for pth in ['courseware', 'histogram', 'navigation', 'time', ] ] +courseware_only_js += [pth for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/src/modules/**/*.coffee') ] + PIPELINE_JS = { 'application': { - 'source_filenames': [pth.replace(PROJECT_ROOT / 'static/', '') for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee')], + # Application will contain all paths not in courseware_only_js + 'source_filenames': [pth.replace(PROJECT_ROOT / 'static/', '') for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee') if pth not in courseware_only_js], 'output_filename': 'js/application.js' }, + 'courseware' : { + 'source_filenames': [pth.replace(PROJECT_ROOT / 'static/', '') for pth in courseware_only_js], + 'output_filename': 'js/courseware.js' + }, 'spec': { 'source_filenames': [pth.replace(PROJECT_ROOT / 'static/', '') for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/spec/**/*.coffee')], 'output_filename': 'js/spec.js' diff --git a/lms/templates/courseware.html b/lms/templates/courseware.html index 599383c3e2..1a72a6eab7 100644 --- a/lms/templates/courseware.html +++ b/lms/templates/courseware.html @@ -4,15 +4,46 @@ <%block name="title">Courseware – MITx 6.002x <%block name="headextra"> - + + + + ## codemirror + + + + ## alternate codemirror + ## + ## + ## + + ## image input: for clicking on images (see imageinput.html) + + + ## TODO (cpennington): Remove this when we have a good way for modules to specify js to load on the page + ## and in the wiki + + + + % if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: + <%static:js group='courseware'/> + % endif + + % if not settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: + % for jsfn in [ '/static/%s' % x.replace('.coffee','.js') for x in settings.PIPELINE_JS['courseware']['source_filenames'] ]: + + % endfor + % endif + + + <%include file="mathjax_include.html" /> <%block name="js_extra"> - - + + <%include file="course_navigation.html" args="active_page='courseware'" /> diff --git a/lms/templates/main.html b/lms/templates/main.html index 245d1b4737..6182ecf1b2 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -7,7 +7,6 @@ - % if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: <%static:css group='application'/> @@ -30,10 +29,6 @@ - ## TODO (cpennington): Remove this when we have a good way for modules to specify js to load on the page - ## and in the wiki - - % if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: <%static:js group='application'/> % endif @@ -44,29 +39,12 @@ % endfor % endif -## codemirror - - - -## alternate codemirror -## -## -## - -## image input: for clicking on images (see imageinput.html) - - -## - <%block name="headextra"/> - <%include file="mathjax_include.html" /> diff --git a/lms/templates/simplewiki/simplewiki_base.html b/lms/templates/simplewiki/simplewiki_base.html index e3da3a754d..b70dab9f40 100644 --- a/lms/templates/simplewiki/simplewiki_base.html +++ b/lms/templates/simplewiki/simplewiki_base.html @@ -11,6 +11,10 @@ <%block name="headextra"> +## TODO (cpennington): Remove this when we have a good way for modules to specify js to load on the page +## and in the wiki + +