Sha256: 5958e666cede72d557f0a197b7397723c276f7064a1eb3507c31d07bcf1ffa59

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
import Core from 'spotlight/core'

export default class {
  connect(){
    SirTrevor.setDefaults({
      iconUrl: Spotlight.sirTrevorIcon || window.sirTrevorIcon,
      uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'),
      ajaxOptions: {
        headers: {
          'X-CSRF-Token': Core.csrfToken() || ''
        },
        credentials: 'same-origin'
      }
    });

    SirTrevor.Blocks.Heading.prototype.toolbarEnabled = true;
    SirTrevor.Blocks.Quote.prototype.toolbarEnabled = true;
    SirTrevor.Blocks.Text.prototype.toolbarEnabled = true;

    var instance = $('.js-st-instance').first();

    if (instance.length) {
      var editor = new SirTrevor.Editor({
        el: instance[0],
        blockTypes: instance.data('blockTypes'),
        altTextSettings: instance.data('altTextSettings'),
        defaultType:["Text"],
        onEditorRender: function() {
          $.SerializedForm();
        },
        blockTypeLimits: {
          "SearchResults": 1
        }
      });

      editor.blockControls = Core.BlockControls.create(editor);

      new Core.BlockLimits(editor).enforceLimits(editor);
    }
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-4.7.0 app/javascript/spotlight/admin/pages.js