Skip to content

Serve CodeMirror CSS and JS locally. #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BasementCat
Copy link

Add a configuration option (CODEMIRROR_SERVE_LOCAL, inspired by
flask-boostrap's BOOTSTRAP_SERVE_LOCAL) to serve CodeMirror files from
flask (they must be placed in /codemirror//...)

Add a configuration option (CODEMIRROR_SERVE_LOCAL, inspired by
flask-boostrap's BOOTSTRAP_SERVE_LOCAL) to serve CodeMirror files from
flask (they must be placed in <app-static-dir>/codemirror/<version>/...)
Copy link
Owner

@j0ack j0ack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just few comments but thx for the work anyway !

CDN_URL = '//cdnjs.cloudflare.com/ajax/libs/codemirror/{0}/'
LOCAL_PATH = '/codemirror/{0}'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be better if there was a config key for this path, since it's local users could host the scripts where they want.

if self.serve_local:
self.base_url = None
else:
self.base_url = self.__class__.CDN_URL.format(self.version)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not mandatory since you check self.serve_local later

@j0ack j0ack self-assigned this Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants