Sha256: a404deed383ed556865f5afb07f3ca5b09565c556ac00f92d3afb7703538e95c

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 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(){

  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': $.rails.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:["Heading", "Text", "List","Quote","Iframe", "Video", "Oembed", "Rule", "UploadedItems",
                 "Browse", "FeaturedPages", "SolrDocuments",  "SolrDocumentsCarousel", "SolrDocumentsEmbed", "SolrDocumentsFeatures", "SolrDocumentsGrid", "SearchResults"],
      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

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-spotlight-0.34.1 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-0.34.0 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-0.33.3 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-0.33.2 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-0.33.1 app/assets/javascripts/spotlight/pages.js.erb
blacklight-spotlight-0.33.0 app/assets/javascripts/spotlight/pages.js.erb