Sha256: d54fe8c561181e607810d71bb12635c69a80a3582eb51643dcbffb7b69b7618f
Contents?: true
Size: 1.58 KB
Versions: 4
Compression:
Stored size: 1.58 KB
Contents
!function(e){"use strict";e.extend(!0,e.trumbowyg,{plugins:{cleanPaste:{init:function(t){t.pasteHandlers.push((function(r){setTimeout((function(){try{t.saveRange();var a=(r.originalEvent||r).clipboardData.getData("Text"),n=t.doc.getSelection().focusNode,c=t.doc.createRange(),g=((l=(l=(l=(l=(l=(l=(l=(l=(l=a.trim()).replace(/<[^> ]*/g,(function(e){return e.toLowerCase()})).replace(/<[^>]*>/g,(function(e){return e.replace(/ [^=]+=/g,(function(e){return e.toLowerCase()}))})).replace(/<[^>]*>/g,(function(e){return e.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')}))).replace(/<b(\s+|>)/g,"<strong$1")).replace(/<\/b(\s+|>)/g,"</strong$1")).replace(/<i(\s+|>)/g,"<em$1")).replace(/<\/i(\s+|>)/g,"</em$1")).replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,"")).replace(/ /gi," ")).replace(/ <\//gi,"</")).replace(/\s+/g," "),(l=(l=(l=(l=(l=l.replace(/^\s*|\s*$/g,"")).replace(/<[^>]*>/g,(function(e){return e.replace(/ ([^=]+)="[^"]*"/g,(function(e,t){return-1!==["alt","href","src","title"].indexOf(t)?e:""}))}))).replace(/<\?xml[^>]*>/g,"")).replace(/<[^ >]+:[^>]*>/g,"")).replace(/<\/[^ >]+:[^>]*>/g,"")).replace(/<(div|span|style|meta|link).*?>/gi,"")),o=e(g)[0]||t.doc.createTextNode(g);""===t.$ed.html()?t.$ed[0].appendChild(o):(c.setStartAfter(n),c.setEndAfter(n),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(c),t.range.insertNode(o)),(c=t.doc.createRange()).setStartAfter(o),c.setEndAfter(o),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(c),r.stopPropagation(),r.preventDefault(),t.saveRange(),t.syncCode(),t.$c.trigger("tbwchange")}catch(e){}var l}),0)}))}}}})}(jQuery);
Version data entries
4 entries across 4 versions & 1 rubygems