Sha256: a49a23de9e64946c551a8c0b8e2ededc933e8be50ba63b0621d27487e105c130

Contents?: true

Size: 1.18 KB

Versions: 21

Compression:

Stored size: 1.18 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,
      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'),
        defaultType:["Text"],
        onEditorRender: function() {
          $.SerializedForm();
        },
        blockTypeLimits: {
          "SearchResults": 1
        }
      });

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.5 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.4 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.3 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.2 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.1 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.3.0 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.2.0 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.1.2 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.1.1 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.1.0 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.0.3 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.0.2 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.0.1 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-4.0.0 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-3.6.0.beta10 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-3.6.0.beta9 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-3.6.0.beta8 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-3.6.0.beta7 app/javascript/spotlight/admin/pages.js
blacklight-spotlight-3.6.0.beta6 app/javascript/spotlight/admin/pages.js