Example #1
0
    def vendor_js_dependencies():
        """
        Returns list of vendor JS files that this XBlock depends on.

        The helper function that it uses to obtain the list of vendor JS files
        works in conjunction with the Django pipeline to ensure that in development mode
        the files are loaded individually, but in production just the single bundle is loaded.
        """
        return get_js_dependencies('discussion_vendor')
    def vendor_js_dependencies():
        """
        Returns list of vendor JS files that this XBlock depends on.

        The helper function that it uses to obtain the list of vendor JS files
        works in conjunction with the Django pipeline to ensure that in development mode
        the files are loaded individually, but in production just the single bundle is loaded.
        """
        return get_js_dependencies('discussion_vendor')
Example #3
0
 def test_get_js_dependencies(self, pipeline_enabled, expected_js_dependencies):
     """
     Verify that `get_js_dependencies` returns correct list of files.
     """
     pipeline_js = {
         'js-group': {
             'source_filenames': ["a.js", "b.js", "c.js"],
             'output_filename': "combined.js"
         }
     }
     with self.settings(PIPELINE_ENABLED=pipeline_enabled, PIPELINE_JS=pipeline_js):
         js_dependencies = get_js_dependencies("js-group")
         self.assertEqual(js_dependencies, expected_js_dependencies)
Example #4
0
 def test_get_js_dependencies(self, pipeline_enabled,
                              expected_js_dependencies):
     """
     Verify that `get_js_dependencies` returns correct list of files.
     """
     pipeline_js = {
         'js-group': {
             'source_filenames': ["a.js", "b.js", "c.js"],
             'output_filename': "combined.js"
         }
     }
     with self.settings(PIPELINE_ENABLED=pipeline_enabled,
                        PIPELINE_JS=pipeline_js):
         js_dependencies = get_js_dependencies("js-group")
         self.assertEqual(js_dependencies, expected_js_dependencies)
Example #5
0
 def test_get_js_dependencies(self, pipeline_enabled, expected_js_dependencies):
     """
     Verify that `get_js_dependencies` returns correct list of files.
     """
     pipeline = settings.PIPELINE.copy()
     pipeline['PIPELINE_ENABLED'] = pipeline_enabled
     pipeline['JAVASCRIPT'] = {
         'js-group': {
             'source_filenames': ["a.js", "b.js", "c.js"],
             'output_filename': "combined.js"
         }
     }
     with self.settings(PIPELINE=pipeline):
         js_dependencies = get_js_dependencies("js-group")
         assert js_dependencies == expected_js_dependencies
Example #6
0
    def vendor_js_dependencies():
        """
        Returns list of vendor JS files that this XBlock depends on.

        The helper function that it uses to obtain the list of vendor JS files
        works in conjunction with the Django pipeline to ensure that in development mode
        the files are loaded individually, but in production just the single bundle is loaded.
        """
        vendor_dependencies = get_js_dependencies('discussion_vendor')
        base_vendor_dependencies = [
            'edx-ui-toolkit/js/utils/global-loader.js',
            'edx-ui-toolkit/js/utils/string-utils.js',
            'edx-ui-toolkit/js/utils/html-utils.js', 'js/vendor/URI.min.js',
            'js/vendor/jquery.leanModal.js'
        ]
        return base_vendor_dependencies + vendor_dependencies