Sha256: f1c39ec8827bdcff1851a15289cc4a11ff01ba8cc8ce8379931d18a16288bbee

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
Spotlight.onLoad(function(){
  // Set a ujs adapter to support both rails-ujs and jquery-ujs
  var ujs = typeof Rails === 'undefined' ? $.rails : Rails;
  SirTrevor.setDefaults({
    iconUrl: <%= asset_path('spotlight/blocks/sir-trevor-icons.svg').to_json %>,
    uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'),
    ajaxOptions: {
      headers: {
        'X-CSRF-Token': ujs.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() {
        serializeObservedForms(observedForms());
      },
      blockTypeLimits: {
        "SearchResults": 1
      }
    });

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

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

  $('.carousel').carousel();
});

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.0.rc4 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-2.0.0.rc3 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-2.0.0.rc2 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-2.0.0.rc1 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.5.1 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.4.1 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.4.0 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.3.0 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.2.0 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-1.1.0 app/assets/javascripts/spotlight/pages.js.erb