Skip to content

Commit

Permalink
Support for bootstrap 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bogushov committed May 27, 2020
1 parent 4ce91c1 commit 9d09d34
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 309 deletions.
9 changes: 4 additions & 5 deletions django_admin_json_editor/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, schema, collapsed=True, sceditor=False, editor_options=None):
self._sceditor = sceditor

self._editor_options = {
'theme': 'bootstrap3',
'theme': 'bootstrap4',
'iconlib': 'fontawesome4',
}
self._editor_options.update(editor_options or {})
Expand All @@ -35,7 +35,6 @@ def render(self, name, value, attrs=None, renderer=None):
context = {
'name': name,
'data': value,
'sceditor': int(self._sceditor),
'editor_options': json.dumps(editor_options),
}
return mark_safe(render_to_string(self.template_name, context))
Expand All @@ -52,10 +51,10 @@ def media(self):
'django_admin_json_editor/jsoneditor/jsoneditor.min.js',
]

if self._editor_options['theme'] == 'bootstrap3':
if self._editor_options['theme'] == 'bootstrap4':
css['all'].append('django_admin_json_editor/bootstrap/css/bootstrap.min.css')
js.append('django_admin_json_editor/jquery/jquery.min.js')
js.append('django_admin_json_editor/bootstrap/js/bootstrap.min.js')
js.append('django_admin_json_editor/jquery/jquery-3.5.1.slim.min.js')
js.append('django_admin_json_editor/bootstrap/js/bootstrap.bundle.min.js')

if self._sceditor:
css['all'].append('django_admin_json_editor/sceditor/themes/default.min.css')
Expand Down

Large diffs are not rendered by default.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
var container = document.getElementById("{{ name }}_editor");
var options = {{ editor_options|safe }};
var {{ name }}_editor = new JSONEditor(container, options);
JSONEditor.plugins.sceditor.emoticonsEnabled = {{ sceditor }};
{{ name }}_editor.on('change', function () {
var errors = {{ name }}_editor.validate();
if (errors.length) {
Expand Down

0 comments on commit 9d09d34

Please sign in to comment.