summaryrefslogtreecommitdiff
path: root/static-files/journal/wymeditor/plugins/list
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2018-06-09 19:25:33 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2018-06-09 19:25:33 +0200
commitaca28de01e7327a45ce025303fc2acc5c3813406 (patch)
treead576b08f361675ee0d4a9eae73b400450431980 /static-files/journal/wymeditor/plugins/list
parent9d5115e52c4c42af8249d8eb6f0ad3b8030f7c8d (diff)
Use WYMeditor as the article text editor.
WYMeditor produces much better XHTML than Trumbowyg.
Diffstat (limited to 'static-files/journal/wymeditor/plugins/list')
-rw-r--r--static-files/journal/wymeditor/plugins/list/jquery.wymeditor.list.js44
1 files changed, 44 insertions, 0 deletions
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;
+ }
+ );
+};