Sha256: e69b17f46e4531565a17db05e2cdd56207c580f7a7b97467e07f2c0be55c3195
Contents?: true
Size: 1.53 KB
Versions: 53
Compression:
Stored size: 1.53 KB
Contents
<script> promethee.constant('summernoteConfig', { disableDragAndDrop: true, callbacks: { // Remove text styles on paste onPaste: function(event) { event.preventDefault(); // Get and trim clipboard content as paragraph var paragraph = document.createElement('p'); paragraph.textContent = ((event.originalEvent || event).clipboardData || window.clipboardData).getData('Text').trim(); // Delete selection if anything is selected (expected behaviour on paste) if((window.getSelection !== undefined ? window.getSelection() : document.selection.createRange()).toString().length > 0) { document.execCommand('delete', false); } // Insert trimmed clipboard content as paragraph document.execCommand('insertHTML', false, paragraph.outerHTML); }, onInit: function() { $(this).summernote('removeModule', 'autoLink'); }, onApplyCustomStyle: function($target, context, onFormatBlock) { if ($target.hasClass('dropdown-item')) { $target = $target.children().first(); } onFormatBlock($target.prop('tagName'), $target); } }, toolbar: [ ['headline', ['style']], ['style', ['bold', 'italic']], ['font', ['superscript', 'subscript']], ['alignment', ['ul', 'ol', 'paragraph']], ['insert', ['hr']], ['link', ['linkDialogShow', 'unlink']], ['code', ['codeview']] ], styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] }); </script>
Version data entries
53 entries across 53 versions & 1 rubygems