blacklight-spotlight 3.5.0.4 → 3.6.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/Rakefile +6 -7
- data/app/assets/config/spotlight/manifest.js +1 -0
- data/app/assets/javascripts/spotlight/application.js +14 -14
- data/app/assets/javascripts/spotlight/spotlight.esm.js +7148 -0
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -0
- data/app/assets/javascripts/spotlight/spotlight.js +7148 -15
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -0
- data/app/assets/stylesheets/spotlight/_catalog.scss +16 -0
- data/app/controllers/concerns/spotlight/base.rb +2 -1
- data/app/controllers/concerns/spotlight/controller.rb +10 -0
- data/app/controllers/spotlight/admin_users_controller.rb +4 -4
- data/app/controllers/spotlight/appearances_controller.rb +6 -6
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/catalog_controller.rb +20 -15
- data/app/controllers/spotlight/concerns/application_controller.rb +1 -0
- data/app/controllers/spotlight/concerns/catalog_search_context.rb +2 -2
- data/app/controllers/spotlight/contacts_controller.rb +6 -6
- data/app/controllers/spotlight/dashboards_controller.rb +2 -2
- data/app/controllers/spotlight/exhibits_controller.rb +19 -19
- data/app/controllers/spotlight/featured_images_controller.rb +1 -1
- data/app/controllers/spotlight/home_pages_controller.rb +7 -7
- data/app/controllers/spotlight/lock_controller.rb +1 -1
- data/app/controllers/spotlight/metadata_configurations_controller.rb +2 -2
- data/app/controllers/spotlight/pages_controller.rb +4 -3
- data/app/controllers/spotlight/search_configurations_controller.rb +6 -6
- data/app/controllers/spotlight/searches_controller.rb +22 -22
- data/app/controllers/spotlight/solr_controller.rb +1 -1
- data/app/controllers/spotlight/translations_controller.rb +8 -10
- data/app/controllers/spotlight/versions_controller.rb +2 -1
- data/app/helpers/spotlight/application_helper.rb +33 -17
- data/app/helpers/spotlight/crud_link_helpers.rb +12 -2
- data/app/helpers/spotlight/pages_helper.rb +1 -1
- data/app/helpers/spotlight/roles_helper.rb +2 -2
- data/app/helpers/spotlight/title_helper.rb +1 -1
- data/app/helpers/spotlight/translations_helper.rb +1 -3
- data/app/javascript/spotlight/admin/add_another.es6 +24 -0
- data/app/javascript/spotlight/admin/add_image_selector.es6 +38 -0
- data/app/javascript/spotlight/admin/add_new_button.es6 +77 -0
- data/app/javascript/spotlight/admin/appearance.es6 +22 -0
- data/app/javascript/spotlight/admin/blacklight_configuration.es6 +65 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/block_mixins/autocompleteable.js +8 -8
- data/app/{assets/javascripts → javascript}/spotlight/admin/block_mixins/formable.js +1 -1
- data/app/javascript/spotlight/admin/block_mixins/plustextable.js +58 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/block.js +2 -1
- data/app/javascript/spotlight/admin/blocks/browse_block.js +86 -0
- data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +88 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/iframe_block.js +7 -11
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/link_to_search_block.js +0 -2
- data/app/javascript/spotlight/admin/blocks/oembed_block.js +41 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/pages_block.js +1 -1
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/resources_block.js +45 -42
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/rule_block.js +2 -4
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/search_result_block.js +7 -9
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_base_block.js +22 -22
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_block.js +7 -7
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_carousel_block.js +14 -15
- data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +147 -0
- data/app/javascript/spotlight/admin/checkbox_submit.es6 +75 -0
- data/app/javascript/spotlight/admin/copy_email_addresses.es6 +5 -0
- data/app/{assets/javascripts/spotlight/admin/crop.es6 → javascript/spotlight/admin/crop.js} +5 -4
- data/app/javascript/spotlight/admin/croppable.es6 +10 -0
- data/app/{assets/javascripts/spotlight/admin/edit_in_place.js → javascript/spotlight/admin/edit_in_place.es6} +6 -13
- data/app/javascript/spotlight/admin/exhibit_tag_autocomplete.es6 +39 -0
- data/app/javascript/spotlight/admin/exhibits.es6 +59 -0
- data/app/{assets/javascripts/spotlight/admin/form_observer.js → javascript/spotlight/admin/form_observer.es6} +23 -21
- data/app/javascript/spotlight/admin/index.js +85 -0
- data/app/javascript/spotlight/admin/locks.es6 +12 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/multi_image_selector.js +2 -1
- data/app/javascript/spotlight/admin/pages.es6 +42 -0
- data/app/{assets/javascripts/spotlight/admin/progress_monitor.js → javascript/spotlight/admin/progress_monitor.es6} +5 -9
- data/app/javascript/spotlight/admin/readonly_checkbox.es6 +8 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/search_typeahead.js +3 -46
- data/app/{assets/javascripts/spotlight/admin/select_related_input.js → javascript/spotlight/admin/select_related_input.es6} +6 -3
- data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/block_controls.js +6 -4
- data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/block_limits.js +2 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/spotlight_nestable.js +4 -8
- data/app/javascript/spotlight/admin/tabs.es6 +8 -0
- data/app/{assets/javascripts/spotlight/admin/translation_progress.js → javascript/spotlight/admin/translation_progress.es6} +6 -13
- data/app/{assets/javascripts/spotlight/admin/users.js → javascript/spotlight/admin/users.es6} +7 -17
- data/app/javascript/spotlight/admin/visibility_toggle.es6 +23 -0
- data/app/javascript/spotlight/index.js +10 -0
- data/app/javascript/spotlight/spotlight.js +32 -0
- data/app/{assets/javascripts/spotlight/user/analytics.js → javascript/spotlight/user/analytics.es6} +4 -4
- data/app/{assets/javascripts/spotlight/user/browse_group_categories.js → javascript/spotlight/user/browse_group_categories.es6} +4 -13
- data/app/javascript/spotlight/user/carousel.es6 +5 -0
- data/app/{assets/javascripts/spotlight/user/clear_form_button.js → javascript/spotlight/user/clear_form_button.es6} +5 -9
- data/app/javascript/spotlight/user/index.js +17 -0
- data/app/{assets/javascripts/spotlight/user/report_a_problem.js → javascript/spotlight/user/report_a_problem.es6} +6 -15
- data/app/javascript/spotlight/user/zpr_links.es6 +44 -0
- data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -2
- data/app/models/concerns/spotlight/browse_category_search_builder.rb +1 -10
- data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
- data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
- data/app/models/concerns/spotlight/resources/web.rb +1 -1
- data/app/models/concerns/spotlight/solr_document/atomic_updates.rb +1 -1
- data/app/models/concerns/spotlight/solr_document/finder.rb +2 -2
- data/app/models/concerns/spotlight/solr_document.rb +2 -2
- data/app/models/concerns/spotlight/translatables.rb +1 -1
- data/app/models/sir_trevor_rails/blocks/displayable.rb +2 -2
- data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +17 -6
- data/app/models/spotlight/analytics/ga.rb +5 -5
- data/app/models/spotlight/blacklight_configuration.rb +12 -12
- data/app/models/spotlight/bulk_update.rb +1 -0
- data/app/models/spotlight/contact_email.rb +1 -1
- data/app/models/spotlight/contact_form.rb +1 -1
- data/app/models/spotlight/exhibit.rb +1 -1
- data/app/models/spotlight/featured_image.rb +1 -2
- data/app/models/spotlight/lock.rb +1 -1
- data/app/models/spotlight/main_navigation.rb +1 -5
- data/app/models/spotlight/page.rb +1 -1
- data/app/models/spotlight/resources/iiif_manifest.rb +4 -4
- data/app/models/spotlight/resources/iiif_service.rb +1 -1
- data/app/models/spotlight/resources/upload.rb +3 -6
- data/app/models/spotlight/search.rb +2 -2
- data/app/models/translation.rb +2 -0
- data/app/presenters/spotlight/iiif_manifest_presenter.rb +2 -1
- data/app/services/spotlight/etl/solr_loader.rb +1 -1
- data/app/services/spotlight/iiif_resource_resolver.rb +10 -10
- data/app/uploaders/spotlight/bulk_updates_uploader.rb +1 -0
- data/app/views/layouts/spotlight/base.html.erb +1 -0
- data/app/views/shared/_exhibit_navbar.html.erb +6 -1
- data/app/views/spotlight/admin_users/index.html.erb +9 -3
- data/app/views/spotlight/browse/show.html.erb +2 -2
- data/app/views/spotlight/catalog/_admin_header.html.erb +3 -1
- data/app/views/spotlight/catalog/_document_visibility_control.html.erb +21 -2
- data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
- data/app/views/spotlight/exhibits/_confirmation_status.html.erb +3 -1
- data/app/views/spotlight/exhibits/_contact.html.erb +5 -1
- data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +2 -0
- data/app/views/spotlight/shared/_report_a_problem.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +2 -2
- data/app/views/spotlight/translations/_page.html.erb +6 -1
- data/config/locales/spotlight.en.yml +4 -9
- data/lib/generators/spotlight/install_generator.rb +15 -23
- data/lib/generators/spotlight/scaffold_resource_generator.rb +12 -12
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -0
- data/lib/generators/spotlight/templates/solr/conf/_rest_managed.json +3 -0
- data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -0
- data/lib/generators/spotlight/templates/solr/conf/elevate.xml +36 -0
- data/lib/generators/spotlight/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/generators/spotlight/templates/solr/conf/protwords.txt +21 -0
- data/lib/generators/spotlight/templates/solr/{config → conf}/schema.xml +17 -0
- data/lib/generators/spotlight/templates/solr/conf/scripts.conf +24 -0
- data/lib/generators/spotlight/templates/solr/{config → conf}/solrconfig.xml +55 -24
- data/lib/generators/spotlight/templates/solr/conf/spellings.txt +2 -0
- data/lib/generators/spotlight/templates/solr/conf/stopwords.txt +58 -0
- data/lib/generators/spotlight/templates/solr/conf/stopwords_en.txt +58 -0
- data/lib/generators/spotlight/templates/solr/conf/synonyms.txt +31 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example.xsl +132 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example_atom.xsl +67 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example_rss.xsl +66 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/luke.xsl +337 -0
- data/lib/generators/spotlight/templates/spotlight.js +1 -1
- data/lib/migration/iiif.rb +3 -7
- data/lib/spotlight/engine.rb +18 -16
- data/lib/spotlight/riiif_service.rb +31 -0
- data/lib/spotlight/search_state.rb +19 -0
- data/lib/spotlight/upload_field_config.rb +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +1 -1
- data/spec/factories/searches.rb +0 -12
- data/spec/fixtures/iiif_responses.rb +64 -64
- data/vendor/assets/javascripts/nestable.js +1 -1
- data/vendor/assets/javascripts/parameterize.js +2 -2
- data/vendor/assets/javascripts/sir-trevor.js +22460 -20591
- data/vendor/assets/stylesheets/sir-trevor/_icons.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/_variables.scss +16 -18
- data/vendor/assets/stylesheets/sir-trevor/base.scss +11 -0
- data/vendor/assets/stylesheets/sir-trevor/block-addition-top.scss +4 -1
- data/vendor/assets/stylesheets/sir-trevor/block-addition.scss +3 -2
- data/vendor/assets/stylesheets/sir-trevor/block-controls.scss +4 -0
- data/vendor/assets/stylesheets/sir-trevor/block-positioner.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/block-replacer.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/block-ui.scss +10 -0
- data/vendor/assets/stylesheets/sir-trevor/block.scss +19 -5
- data/vendor/assets/stylesheets/sir-trevor/errors.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/format-bar.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/inputs.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/main.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/patterns/ui-popup.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/utils.scss +0 -0
- metadata +118 -131
- data/app/assets/javascripts/spotlight/admin/add_another.js +0 -22
- data/app/assets/javascripts/spotlight/admin/add_new_button.js +0 -81
- data/app/assets/javascripts/spotlight/admin/appearance.js +0 -24
- data/app/assets/javascripts/spotlight/admin/attachments.js +0 -2
- data/app/assets/javascripts/spotlight/admin/blacklight_configuration.js +0 -63
- data/app/assets/javascripts/spotlight/admin/block_mixins/plustextable.js +0 -57
- data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +0 -87
- data/app/assets/javascripts/spotlight/admin/blocks/browse_group_categories_block.js +0 -88
- data/app/assets/javascripts/spotlight/admin/blocks/oembed_block.js +0 -40
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +0 -145
- data/app/assets/javascripts/spotlight/admin/catalog_edit.js +0 -16
- data/app/assets/javascripts/spotlight/admin/copy_email_addresses.js +0 -9
- data/app/assets/javascripts/spotlight/admin/croppable.js +0 -25
- data/app/assets/javascripts/spotlight/admin/exhibit_tag_autocomplete.js +0 -37
- data/app/assets/javascripts/spotlight/admin/exhibits.js +0 -58
- data/app/assets/javascripts/spotlight/admin/index.js +0 -16
- data/app/assets/javascripts/spotlight/admin/locks.js +0 -12
- data/app/assets/javascripts/spotlight/admin/pages.js.erb +0 -40
- data/app/assets/javascripts/spotlight/admin/readonly_checkbox.js +0 -6
- data/app/assets/javascripts/spotlight/admin/tabs.js +0 -6
- data/app/assets/javascripts/spotlight/user/carousel.js +0 -3
- data/app/assets/javascripts/spotlight/user/index.js +0 -8
- data/app/assets/javascripts/spotlight/user/zpr_links.js.erb +0 -45
- data/vendor/assets/javascripts/MutationObserver.js +0 -625
- data/vendor/assets/javascripts/eventable.js +0 -205
- data/vendor/assets/javascripts/polyfill.min.js +0 -4
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_embed_block.js +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_features_block.js +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_grid_block.js +0 -0
- /data/app/{assets/javascripts/spotlight/admin/iiif.es6 → javascript/spotlight/admin/iiif.js} +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/locales.js +0 -0
@@ -1,37 +0,0 @@
|
|
1
|
-
Spotlight.onLoad(function() {
|
2
|
-
$('[data-autocomplete-tag="true"]').each(function(_i, el) {
|
3
|
-
var $el = $(el);
|
4
|
-
// By default tags input binds on page ready to [data-role=tagsinput],
|
5
|
-
// however, that doesn't work with Turbolinks. So we init manually:
|
6
|
-
$el.tagsinput();
|
7
|
-
|
8
|
-
var tags = new Bloodhound({
|
9
|
-
datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.name); },
|
10
|
-
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
11
|
-
limit: 100,
|
12
|
-
prefetch: {
|
13
|
-
url: $el.data('autocomplete-url'),
|
14
|
-
ttl: 1,
|
15
|
-
filter: function(list) {
|
16
|
-
// Let the dom know that the response has been returned
|
17
|
-
$el.attr('data-autocomplete-fetched', true);
|
18
|
-
return $.map(list, function(tag) { return { name: tag }; });
|
19
|
-
}
|
20
|
-
}
|
21
|
-
});
|
22
|
-
|
23
|
-
tags.initialize();
|
24
|
-
|
25
|
-
$el.tagsinput('input').typeahead({highlight: true, hint: false}, {
|
26
|
-
name: 'tags',
|
27
|
-
displayKey: 'name',
|
28
|
-
source: tags.ttAdapter()
|
29
|
-
}).bind('typeahead:selected', $.proxy(function (obj, datum) {
|
30
|
-
$el.tagsinput('add', datum.name);
|
31
|
-
$el.tagsinput('input').typeahead('val', '');
|
32
|
-
})).bind('blur', function() {
|
33
|
-
$el.tagsinput('add', $el.tagsinput('input').typeahead('val'));
|
34
|
-
$el.tagsinput('input').typeahead('val', '');
|
35
|
-
});
|
36
|
-
});
|
37
|
-
});
|
@@ -1,58 +0,0 @@
|
|
1
|
-
Spotlight.onLoad(function() {
|
2
|
-
|
3
|
-
// auto-fill the exhibit slug on the new exhibit form
|
4
|
-
$('#new_exhibit').each(function() {
|
5
|
-
$('#exhibit_title').on('change keyup', function() {
|
6
|
-
$('#exhibit_slug').attr('placeholder', URLify($(this).val(), $(this).val().length));
|
7
|
-
});
|
8
|
-
|
9
|
-
$('#exhibit_slug').on('focus', function() {
|
10
|
-
if ($(this).val() === '') {
|
11
|
-
$(this).val($(this).attr('placeholder'));
|
12
|
-
}
|
13
|
-
});
|
14
|
-
});
|
15
|
-
|
16
|
-
$("#another-email").on("click", function(e) {
|
17
|
-
e.preventDefault();
|
18
|
-
|
19
|
-
var container = $(this).closest('.form-group');
|
20
|
-
var contacts = container.find('.contact');
|
21
|
-
var inputContainer = contacts.first().clone();
|
22
|
-
|
23
|
-
// wipe out any values from the inputs
|
24
|
-
inputContainer.find('input').each(function() {
|
25
|
-
$(this).val('');
|
26
|
-
$(this).attr('id', $(this).attr('id').replace('0', contacts.length));
|
27
|
-
$(this).attr('name', $(this).attr('name').replace('0', contacts.length));
|
28
|
-
if ($(this).attr('aria-label')) {
|
29
|
-
$(this).attr('aria-label', $(this).attr('aria-label').replace('1', contacts.length + 1));
|
30
|
-
}
|
31
|
-
});
|
32
|
-
|
33
|
-
inputContainer.find('.contact-email-delete-wrapper').remove();
|
34
|
-
inputContainer.find('.confirmation-status').remove();
|
35
|
-
|
36
|
-
// bootstrap does not render input-groups with only one value in them correctly.
|
37
|
-
inputContainer.find('.input-group input:only-child').closest('.input-group').removeClass('input-group');
|
38
|
-
|
39
|
-
$(inputContainer).insertAfter(contacts.last());
|
40
|
-
});
|
41
|
-
|
42
|
-
$('.contact-email-delete').on('ajax:success', function() {
|
43
|
-
$(this).closest('.contact').fadeOut(250, function() { $(this).remove(); });
|
44
|
-
});
|
45
|
-
|
46
|
-
$('.contact-email-delete').on('ajax:error', function(event, _xhr, _status, error) {
|
47
|
-
var errSpan = $(this).closest('.contact').find('.contact-email-delete-error');
|
48
|
-
errSpan.show();
|
49
|
-
errSpan.find('.error-msg').first().text(error || event.detail[1]);
|
50
|
-
});
|
51
|
-
|
52
|
-
$('.btn-with-tooltip').tooltip();
|
53
|
-
|
54
|
-
// Put focus in saved search title input when Save this search modal is shown
|
55
|
-
$('#save-modal').on('shown.bs.modal', function () {
|
56
|
-
$('#search_title').focus();
|
57
|
-
});
|
58
|
-
});
|
@@ -1,16 +0,0 @@
|
|
1
|
-
//= require underscore
|
2
|
-
//= require eventable
|
3
|
-
//= require sir-trevor
|
4
|
-
//= require nestable
|
5
|
-
//= require parameterize
|
6
|
-
//= require bootstrap-tagsinput
|
7
|
-
//= require jquery.serializejson
|
8
|
-
//= require clipboard
|
9
|
-
//= require leaflet
|
10
|
-
//= require leaflet-iiif
|
11
|
-
//= require Leaflet.Editable
|
12
|
-
//= require Path.Drag
|
13
|
-
//= require MutationObserver
|
14
|
-
|
15
|
-
//= require polyfill.min.js
|
16
|
-
//= require_tree .
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Spotlight.onLoad(function(){
|
2
|
-
|
3
|
-
|
4
|
-
function delete_lock(el) {
|
5
|
-
$.ajax({ url: $(el).data('lock'), type: 'POST', data: { _method: "delete" }, async: false});
|
6
|
-
$(el).removeAttr('data-lock');
|
7
|
-
}
|
8
|
-
|
9
|
-
$('[data-lock]').on('click', function(e) {
|
10
|
-
delete_lock(this);
|
11
|
-
});
|
12
|
-
});
|
@@ -1,40 +0,0 @@
|
|
1
|
-
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
-
// All this logic will automatically be available in application.js.
|
3
|
-
Spotlight.onLoad(function(){
|
4
|
-
// Set a ujs adapter to support both rails-ujs and jquery-ujs
|
5
|
-
var ujs = typeof Rails === 'undefined' ? $.rails : Rails;
|
6
|
-
SirTrevor.setDefaults({
|
7
|
-
iconUrl: <%= asset_path('spotlight/blocks/sir-trevor-icons.svg').to_json %>,
|
8
|
-
uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'),
|
9
|
-
ajaxOptions: {
|
10
|
-
headers: {
|
11
|
-
'X-CSRF-Token': ujs.csrfToken() || ''
|
12
|
-
},
|
13
|
-
credentials: 'same-origin'
|
14
|
-
}
|
15
|
-
});
|
16
|
-
|
17
|
-
SirTrevor.Blocks.Heading.prototype.toolbarEnabled = true;
|
18
|
-
SirTrevor.Blocks.Quote.prototype.toolbarEnabled = true;
|
19
|
-
SirTrevor.Blocks.Text.prototype.toolbarEnabled = true;
|
20
|
-
|
21
|
-
var instance = $('.js-st-instance').first();
|
22
|
-
|
23
|
-
if (instance.length) {
|
24
|
-
var editor = new SirTrevor.Editor({
|
25
|
-
el: instance[0],
|
26
|
-
blockTypes: instance.data('blockTypes'),
|
27
|
-
defaultType:["Text"],
|
28
|
-
onEditorRender: function() {
|
29
|
-
$.SerializedForm();
|
30
|
-
},
|
31
|
-
blockTypeLimits: {
|
32
|
-
"SearchResults": 1
|
33
|
-
}
|
34
|
-
});
|
35
|
-
|
36
|
-
editor.blockControls = Spotlight.BlockControls.create(editor);
|
37
|
-
|
38
|
-
new Spotlight.BlockLimits(editor).enforceLimits(editor);
|
39
|
-
}
|
40
|
-
});
|
@@ -1,45 +0,0 @@
|
|
1
|
-
Spotlight.onLoad(function(){
|
2
|
-
$('.zpr-link').on('click', function() {
|
3
|
-
var modalDialog = $('#blacklight-modal .modal-dialog');
|
4
|
-
var modalContent = modalDialog.find('.modal-content')
|
5
|
-
modalDialog.removeClass('modal-lg')
|
6
|
-
modalDialog.addClass('modal-xl')
|
7
|
-
modalContent.html('<div id="osd-modal-container"></div>');
|
8
|
-
var controls = [
|
9
|
-
'<div class="controls d-flex justify-content-center justify-content-md-end">',
|
10
|
-
' <div class="custom-close-controls pr-3 pt-3">',
|
11
|
-
' <button type="button" class="btn btn-dark" data-dismiss="modal" aria-hidden="true"><%= Blacklight::Icon.new('close').file_source.strip %></button>',
|
12
|
-
' </div>',
|
13
|
-
' <div class="zoom-controls mb-3 mr-md-3">',
|
14
|
-
' <button id="osd-zoom-in" type="button" class="btn btn-dark"><%= Blacklight::Icon.new('zoom_in').file_source.strip %></button>',
|
15
|
-
' <button id="osd-zoom-out" type="button" class="btn btn-dark"><%= Blacklight::Icon.new('zoom_out').file_source.strip %></button>',
|
16
|
-
' </div>',
|
17
|
-
' <div id="empty-div-required-by-osd"></div>',
|
18
|
-
'</div>'
|
19
|
-
].join("\n");
|
20
|
-
|
21
|
-
|
22
|
-
$('#osd-modal-container').append('<div id="osd-div"></div>');
|
23
|
-
$('#osd-modal-container').append(controls);
|
24
|
-
|
25
|
-
$('#blacklight-modal').modal('show');
|
26
|
-
|
27
|
-
$('#blacklight-modal').one('hidden.bs.modal', function (event) {
|
28
|
-
modalDialog.removeClass('modal-xl')
|
29
|
-
modalDialog.addClass('modal-lg')
|
30
|
-
});
|
31
|
-
|
32
|
-
OpenSeadragon({
|
33
|
-
id: 'osd-div',
|
34
|
-
zoomInButton: "osd-zoom-in",
|
35
|
-
zoomOutButton: "osd-zoom-out",
|
36
|
-
// This is a hack where OpenSeadragon (if using mapped buttons) requires you
|
37
|
-
// to map all of the buttons.
|
38
|
-
homeButton: "empty-div-required-by-osd",
|
39
|
-
fullPageButton: "empty-div-required-by-osd",
|
40
|
-
nextButton: "empty-div-required-by-osd",
|
41
|
-
previousButton: "empty-div-required-by-osd",
|
42
|
-
tileSources: [$(this).data('iiif-tilesource')]
|
43
|
-
})
|
44
|
-
});
|
45
|
-
});
|