Mercurial Hosting > sceditor
diff src/minified/plugins/plaintext.js @ 0:4c4fc447baea
start with sceditor-3.1.1
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 04 Aug 2022 15:21:29 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/minified/plugins/plaintext.js Thu Aug 04 15:21:29 2022 -0600 @@ -0,0 +1,3 @@ +/* SCEditor v3.1.1 | (C) 2017, Sam Clarke | sceditor.com/license */ + +!function(t){"use strict";var i=t.utils,l=t.dom;t.plugins.plaintext=function(){var n=!0;this.init=function(){var t=this.commands,e=this.opts;e&&e.plaintext&&e.plaintext.addButton&&(n=e.plaintext.enabled,t.pastetext=i.extend(t.pastetext||{},{state:function(){return n?1:0},exec:function(){n=!n}}))},this.signalPasteRaw=function(t){var e;n&&(t.html&&!t.text&&((e=document.createElement("div")).innerHTML=t.html,i.each(e.querySelectorAll("p"),function(t,e){l.convertElement(e,"div")}),i.each(e.querySelectorAll("br"),function(t,e){e.nextSibling&&l.isInline(e.nextSibling,!0)||e.parentNode.removeChild(e)}),document.body.appendChild(e),t.text=e.innerText,document.body.removeChild(e)),t.html=null)}}}(sceditor); \ No newline at end of file