editor.py 751 B

12345678910111213141516171819202122
  1. class Editor(object):
  2. """
  3. Misago editor class
  4. """
  5. def __init__(self, field, body_template='misago/editor/body.html',
  6. js_template='misago/editor/js.html', allow_mentions=True,
  7. allow_links=True, allow_images=True, allow_blocks=True,
  8. has_preview=False, uploads_url=None):
  9. self.field = field
  10. self.auto_id = 'misago-editor-%s' % field.auto_id
  11. self.body_template = body_template
  12. self.js_template = js_template
  13. self.uploads_url = uploads_url
  14. self.allow_mentions = allow_mentions
  15. self.allow_links = allow_links
  16. self.allow_images = allow_images
  17. self.allow_blocks = allow_blocks
  18. self.has_preview = has_preview