diff --git a/django_usta/settings.py b/django_usta/settings.py index 32fe1fe3ee45b083cb0cfb70d044f0509cb67bf5..2eee424eea226571ada7bb48698accd11b6c0ec6 100644 --- a/django_usta/settings.py +++ b/django_usta/settings.py @@ -293,7 +293,7 @@ CKEDITOR_CONFIGS = { ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'NodeLink'], ], - 'extraPlugins': 'youtube,nodelink,tickets,hotels', + 'extraPlugins': 'youtube,nodelink,tickets,hotels,tabindent', 'removePlugins': 'iframe', 'stylesSet': [ {'name': 'Boys 16', 'element': 'span', 'attributes': { diff --git a/static/ckeditor/ckeditor/plugins/tabindent/plugin.js b/static/ckeditor/ckeditor/plugins/tabindent/plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..666ff99fbfc5f8e19fc2ae0f485c8c506655f3bb --- /dev/null +++ b/static/ckeditor/ckeditor/plugins/tabindent/plugin.js @@ -0,0 +1,17 @@ +/** + * Created by Steven H Johnson - June 23, 2016 + * + * Sets TAB and SHIFT + TAB keys to Indent and OutDent respectively. + */ +CKEDITOR.plugins.add('tabindent', { + requires: 'indent', + init: function(editor) { + editor.on('key', function(ev) { + // keyCode 9 = TAB + if (ev.data.keyCode == 9 && editor.execCommand('indent') || + ev.data.keyCode == (CKEDITOR.SHIFT + 9) && editor.execCommand('outdent')) { + ev.cancel(); + } + }); + } +});