summaryrefslogtreecommitdiff
path: root/public/editor/editor.js
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2015-05-10 14:05:06 +0200
committerAaron Parecki <aaron@parecki.com>2015-05-10 14:05:06 +0200
commit4898ed74a57b6d14cbcd962e967111adffd4595d (patch)
tree5eec23250a6eff45d6b694b880120f84a3ebb073 /public/editor/editor.js
parentfb6d4181e429833f083ddd7e1770ed99a70949db (diff)
set up medium-style editor with image embedding and appcache
Diffstat (limited to 'public/editor/editor.js')
-rw-r--r--public/editor/editor.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/editor/editor.js b/public/editor/editor.js
new file mode 100644
index 0000000..bdf0580
--- /dev/null
+++ b/public/editor/editor.js
@@ -0,0 +1,29 @@
+var editor = new MediumEditor('.editable', {
+ buttons: ['bold', 'italic', 'header1', 'header2', 'quote', 'unorderedlist', 'pre'],
+ paste: {
+ // This example includes the default options for paste, if nothing is passed this is what it used
+ forcePlainText: false,
+ cleanPastedHTML: true,
+ cleanReplacements: [],
+ cleanAttrs: ['class', 'style', 'dir'],
+ cleanTags: ['meta']
+ }
+});
+
+$(function () {
+ $('.editable').mediumInsert({
+ editor: editor,
+ beginning: true,
+ addons: {
+ images: {
+ deleteScript: '/editor/delete-file',
+ fileUploadOptions: {
+ url: '/editor/upload'
+ }
+ },
+ embeds: {
+ oembedProxy: '/editor/oembed'
+ }
+ }
+ });
+});