Sha256: ba9db5ea82899135314f617a651d13c3b4b78cf54339606d1a3f51eb2f638045

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 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);
      }
    },
    toolbar: [
      ['headline', ['style']],
      ['style', ['bold', 'italic']],
      ['alignment', ['ul', 'ol', 'paragraph']],
      ['code', ['codeview']]
    ],
    styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
  });
</script>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
promethee-1.11.8 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.7 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.6 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.5 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.4 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.3 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.2 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.1 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.11.0 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.10.9 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.10.8 app/views/promethee/utils/_summernote-config.html.erb
promethee-1.10.7 app/views/promethee/utils/_summernote-config.html.erb