summaryrefslogtreecommitdiff
path: root/static-files/js/article-editing.js
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2017-05-15 20:54:44 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2017-05-15 21:04:41 +0200
commit6a0674dc4ed77245441aaf31e0b102c00b50f8bb (patch)
tree10d257a17b568f653ae3022af8c00821731ca4b7 /static-files/js/article-editing.js
parent2f41dd86c826c3754f49a55a5fd87c5e924417cc (diff)
Use Trumbowyg to edit articles.
This patch also updates jQuery to v3.2.1.
Diffstat (limited to 'static-files/js/article-editing.js')
-rw-r--r--static-files/js/article-editing.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/static-files/js/article-editing.js b/static-files/js/article-editing.js
new file mode 100644
index 0000000..9922429
--- /dev/null
+++ b/static-files/js/article-editing.js
@@ -0,0 +1,24 @@
+// Copyright 2017, Matthias Andreas Benkard.
+
+"use strict";
+
+jQuery(function($) {
+ $.trumbowyg.svgPath = '/journal/trumbowyg/icons.svg';
+ $('#content-field').trumbowyg({
+ btns: [
+ ['viewHTML'],
+ ['formatting'],
+ 'btnGrp-semantic',
+ ['superscript', 'subscript'],
+ ['link'],
+ ['base64'],
+ 'btnGrp-lists',
+ ['horizontalRule'],
+ ['removeformat'],
+ ['preformatted'],
+ ['table', 'tableAddRow', 'tableAddColumn'],
+ ['fullscreen']
+ ],
+ autogrow: true
+ });
+});