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 e9b79288f9b8789b5921e348d36ed080e2352ee9
parent 83f3fbd0eec0ff715355c93ac34a72bf35813229
Author: unitehenry <unitehenry@gmail.com>
Date:   Fri, 30 Oct 2020 13:00:37 -0400

firefox support

Diffstat:
Msrc/striveneditor.js | 22+---------------------
1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -1351,7 +1351,7 @@ export default class StrivenEditor { const linkValue = linkMenuFormInput.value; se.body.focus(); se.setRange(); - + if (linkValue) { const linkToEdit = se.body.querySelector('.se-link-to-edit'); @@ -1381,25 +1381,6 @@ export default class StrivenEditor { }); } - // insert link on no selection - if (se.browser.isFirefox() || se.browser.isEdge()) { - if (se.range.startOffset === se.range.endOffset) { - const link = document.createElement('a'); - link.href = linkValue; - link.textContent = linkValue; - - se.range.insertNode(link); - se.range.selectNode(link); - se.range.collapse(); - } - } - - // Remove contenteditable for firefox - if (!se.browser.isFirefox()) { - const bodyLinks = se.body.querySelectorAll('a'); - [...bodyLinks].forEach(link => (link.contentEditable = 'false')); - } - // trigger input event if (se.body.oninput) { se.body.oninput(); @@ -3325,7 +3306,6 @@ export default class StrivenEditor { } } - debugger const r = se.getRange(); if(r) {