~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/media.py

  • Committer: William Grant
  • Date: 2010-07-02 13:17:16 UTC
  • mto: This revision was merged to the branch mainline in revision 1825.
  • Revision ID: grantw@unimelb.edu.au-20100702131716-hdnktq7drf615puj
Add external CodeMirror dep, and use it instead of the embedded copy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
# This maps a media namespace to an external dependency directory (in this
35
35
# case specified by the configuration option media/externals/jquery) and a
36
36
# list of permitted subpaths.
37
 
EXTERNAL_MEDIA_MAP = {'jquery': ('jquery', ['jquery.js'])}
 
37
EXTERNAL_MEDIA_MAP = {'jquery': ('jquery', ['jquery.js']),
 
38
                      'codemirror': ('codemirror', None),
 
39
                      }
38
40
 
39
41
def media_url(req, plugin, path):
40
42
    '''Generates a URL to a media file.
69
71
            except KeyError:
70
72
                return None
71
73
 
72
 
            # Unless it's a whitelisted path, we don't want to hear about it.
73
 
            if self.path not in extern[1]:
 
74
            # If the whitelist is None (not []), we allow all.
 
75
            if extern[1] is not None and self.path not in extern[1]:
74
76
                return None
75
77
 
76
78
            # Grab the admin-configured path for this particular external dep.