striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit 5b872c95e4514cd0cb64555e50a5601878277134
parent 8ec0ebb32f3baf178253689e01863ceea833eec5
Author: unitehenry <unitehenry@gmail.com>
Date:   Fri, 18 Oct 2019 09:04:32 -0400

developer comments

Diffstat:
Mdemo/src/App.vue | 128++-----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 125 deletions(-)

diff --git a/demo/src/App.vue b/demo/src/App.vue @@ -3,7 +3,6 @@ id="app" style="font-family: Segoe UI; color: #2c3e50; margin-top: 20vh; display: flex; justify-content: center; align-items: center; flex-direction: column; padding: 0 1rem;" > - <!-- <h1>Striven Editor</h1> --> <div style="display: flex; padding: 1rem; width: 100%; justify-content: center;"> <div ref="editor" @@ -24,35 +23,22 @@ margin: 0 5px; outline: none;" > - <!-- <i style="color: #fff; font-size: 25px;" class="fas fa-paper-plane" /> --> </button> </div> - <!-- <div id="footer"> --> - <!-- <a style="color: inherit; text-decoration: none;" href="https://github.com/business-by-miles/striven-editor">Find this on GitHub</a> --> - <!-- </div> --> </div> </template> <script> /* eslint-disable */ -// import Tribute from 'tributejs'; -// import { faPaperPlane } from "@fortawesome/free-solid-svg-icons/faPaperPlane"; -// import { dom } from '@fortawesome/fontawesome-svg-core'; -// import { library as faLib } from "@fortawesome/fontawesome-svg-core"; -// import USERS from './users'; - -// faLib.add(faPaperPlane); -// dom.watch(); import { StrivenEditor } from "@striven-erp/striven-editor"; export default { name: "app", mounted() { - // const that = this; const editorOptions = { - // metaUrl: "http://localhost:4200/meta", - // imageUrl: "http://localhost:4200/image", + // metaUrl: "http://localhost:4200/meta", // metaserver.js + // imageUrl: "http://localhost:4200/image", // imageserver.js minimal: true, uploadOnPaste: false, toolbarBottom: true, @@ -82,11 +68,8 @@ export default { this.editor = new StrivenEditor(this.$refs.editor, editorOptions); - // eslint-disable-next-line this.$refs.sendButton.onclick = () => console.log(this.editor.getContent()); - // paperPlane.innerHTML = "<svg width=\"25\" height=\"25\" viewBox=\"0 0 1792 1792\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#fff\" d=\"M1764 11q33 24 27 64l-256 1536q-5 29-32 45-14 8-31 8-11 0-24-5l-453-185-242 295q-18 23-49 23-13 0-22-4-19-7-30.5-23.5t-11.5-36.5v-349l864-1059-1069 925-395-162q-37-14-40-55-2-40 32-59l1664-960q15-9 32-9 20 0 36 11z\"/></svg>"; - const paperPlane = document.createElement("span"); const svg = '<svg width="50%" height="50%" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">'; @@ -99,113 +82,8 @@ export default { (this.$refs.sendButton.style.backgroundColor = "#4cae4c"); this.$refs.sendButton.onmouseleave = () => (this.$refs.sendButton.style.backgroundColor = "#5cb85c"); - - // const tributeOptions = { - // trigger: "@", - // values: (text, cb) => cb(USERS), - // selectTemplate: function(item) { - // const { value } = item.original; - // return `@${value.replace(" ", "").toLowerCase()}`; - // }, - // menuItemTemplate: function(item) { - // const { avatar, value } = item.original; - // return `<span class="menu-item">${ - // avatar ? `<img src="${avatar}" />` : "" - // }<p>${value}</p></span>`; - // }, - // lookup: "value", - // fillAttr: "value", - // allowSpaces: true - // }; - // const tribute = new Tribute(tributeOptions); - // tribute.attach(this.editor.body); - - // this.editor.body.addEventListener("tribute-replaced", function(e) { - // const { value } = e.detail.item.original; - // let content = that.editor.getContent(); - // const mention = `<span class="striven-mention new-mention" contenteditable="false" data-mention="${value}">${value}</span>`; - // content = content.replace( - // "@" + value.replace(" ", "").toLowerCase(), - // mention - // ); - // that.editor.body.innerHTML = content; - // const newMention = that.editor.body.querySelector(".new-mention"); - // const range = that.editor.getRange(); - // range.selectNode(newMention); - // range.collapse(); - // newMention.classList.remove("new-mention"); - // }); } }; </script> -<style> -* { - margin: 0; - padding: 0; - box-align: border-box; -} - -#app { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - color: #2c3e50; - margin-top: 20vh; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - padding: 0 1rem; -} - -#footer { - margin: 25px 0; -} - -#footer a { - color: inherit; - text-decoration: none; -} - -.tribute-container ul { - list-style: none; -} - -.highlight > .menu-item { - display: flex; - justify-content: space-between; - font-family: "Montserrat", sans-serif; - border: 1px solid grey; - padding: 5px; - background-color: #f6f6f6; - width: 15rem; -} - -.menu-item { - display: flex; - justify-content: space-between; - font-family: "Montserrat", sans-serif; - border: 1px solid grey; - padding: 5px; - background-color: #fff; - width: 15rem; -} - -.menu-item img { - border-radius: 1rem; - height: 2rem; - width: 2rem; -} - -.menu-item p { - margin: 0 1rem; - text-align: center; -} - -.striven-mention { - background-color: lightblue; - color: blue; - padding: 1px 5px; - border-radius: 5%; -} -</style> +<style></style>