From aca28de01e7327a45ce025303fc2acc5c3813406 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 9 Jun 2018 19:25:33 +0200 Subject: Use WYMeditor as the article text editor. WYMeditor produces much better XHTML than Trumbowyg. --- .../plugins/list/jquery.wymeditor.list.js | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js (limited to 'static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js') diff --git a/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js b/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js new file mode 100644 index 0000000..b009e25 --- /dev/null +++ b/static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2011 PolicyStat LLC. + * MIT licensed (MIT-license.txt) + * + * This plugin adds the ability to use tab and shift+tab to indent/outdent + * lists, mimicking a user's expected behavior when inside an editor. + * + * @author Wes Winham (winhamwr@gmail.com) + */ + +function ListPlugin(options, wym) { + var listPlugin = this; + ListPlugin._options = jQuery.extend({}, options); + listPlugin._wym = wym; + + listPlugin.init(); +} + +ListPlugin.prototype.init = function() { + var listPlugin = this; + listPlugin._wym.listPlugin = listPlugin; + + listPlugin.bindEvents(); +}; + +ListPlugin.prototype.bindEvents = function() { + var listPlugin = this, + wym = listPlugin._wym; + + wym.keyboard.combokeys.bind( + "tab", + function () { + wym.indent(); + return false; + } + ); + wym.keyboard.combokeys.bind( + "shift+tab", + function () { + wym.outdent(); + return false; + } + ); +}; -- cgit v1.2.3