blacklight-spotlight 5.3.0 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/app/assets/javascripts/spotlight/spotlight.esm.js +1696 -1229
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
- data/app/assets/javascripts/spotlight/spotlight.js +1718 -1232
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
- data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +1 -10
- data/app/assets/stylesheets/spotlight/_nestable.scss +18 -1
- data/app/assets/stylesheets/spotlight/_pages.scss +3 -3
- data/app/components/spotlight/analytics/aggregation_component.html.erb +1 -1
- data/app/components/spotlight/document_admin_table_component.html.erb +2 -2
- data/app/components/spotlight/edit_view_links_component.html.erb +1 -1
- data/app/components/spotlight/header_component.html.erb +1 -1
- data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
- data/app/components/spotlight/tag_selector_component.html.erb +2 -2
- data/app/components/spotlight/translations/subheading_component.html.erb +1 -1
- data/app/controllers/spotlight/resources_controller.rb +1 -1
- data/app/javascript/spotlight/admin/add_another.js +22 -15
- data/app/javascript/spotlight/admin/add_image_selector.js +27 -25
- data/app/javascript/spotlight/admin/add_new_button.js +47 -43
- data/app/javascript/spotlight/admin/blacklight_configuration.js +52 -38
- data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +68 -60
- data/app/javascript/spotlight/admin/block_mixins/formable.js +55 -47
- data/app/javascript/spotlight/admin/block_mixins/plustextable.js +19 -20
- data/app/javascript/spotlight/admin/blocks/block.js +20 -16
- data/app/javascript/spotlight/admin/blocks/browse_block.js +42 -37
- data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +33 -31
- data/app/javascript/spotlight/admin/blocks/iframe_block.js +14 -11
- data/app/javascript/spotlight/admin/blocks/link_to_search_block.js +4 -7
- data/app/javascript/spotlight/admin/blocks/oembed_block.js +13 -10
- data/app/javascript/spotlight/admin/blocks/pages_block.js +20 -13
- data/app/javascript/spotlight/admin/blocks/resources_block.js +150 -117
- data/app/javascript/spotlight/admin/blocks/rule_block.js +11 -10
- data/app/javascript/spotlight/admin/blocks/search_result_block.js +16 -17
- data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +123 -64
- data/app/javascript/spotlight/admin/blocks/solr_documents_block.js +8 -8
- data/app/javascript/spotlight/admin/blocks/solr_documents_carousel_block.js +63 -43
- data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +9 -9
- data/app/javascript/spotlight/admin/blocks/solr_documents_features_block.js +17 -16
- data/app/javascript/spotlight/admin/blocks/solr_documents_grid_block.js +6 -7
- data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +84 -64
- data/app/javascript/spotlight/admin/crop.js +203 -156
- data/app/javascript/spotlight/admin/croppable.js +4 -4
- data/app/javascript/spotlight/admin/croppable_modal.js +59 -37
- data/app/javascript/spotlight/admin/edit_in_place.js +50 -47
- data/app/javascript/spotlight/admin/exhibits.js +52 -41
- data/app/javascript/spotlight/admin/form_observer.js +59 -53
- data/app/javascript/spotlight/admin/iiif.js +26 -25
- data/app/javascript/spotlight/admin/index.js +44 -47
- data/app/javascript/spotlight/admin/locks.js +14 -14
- data/app/javascript/spotlight/admin/multi_image_selector.js +127 -111
- data/app/javascript/spotlight/admin/pages.js +21 -21
- data/app/javascript/spotlight/admin/progress_monitor.js +67 -65
- data/app/javascript/spotlight/admin/readonly_checkbox.js +3 -3
- data/app/javascript/spotlight/admin/search_typeahead.js +55 -43
- data/app/javascript/spotlight/admin/select_related_input.js +17 -17
- data/app/javascript/spotlight/admin/sir-trevor/block_controls.js +100 -84
- data/app/javascript/spotlight/admin/sir-trevor/block_limits.js +36 -31
- data/app/javascript/spotlight/admin/sir-trevor/locales.js +52 -39
- data/app/javascript/spotlight/admin/spotlight_nestable.js +126 -91
- data/app/javascript/spotlight/admin/tabs.js +19 -3
- data/app/javascript/spotlight/admin/translation_progress.js +13 -7
- data/app/javascript/spotlight/admin/users.js +41 -41
- data/app/javascript/spotlight/admin/visibility_toggle.js +4 -4
- data/app/javascript/spotlight/controllers/clipboard_controller.js +14 -0
- data/app/javascript/spotlight/controllers/index.js +4 -2
- data/app/javascript/spotlight/controllers/tag_selector_controller.js +116 -79
- data/app/javascript/spotlight/core.js +18 -15
- data/app/javascript/spotlight/index.js +4 -4
- data/app/javascript/spotlight/user/browse_group_categories.js +24 -22
- data/app/javascript/spotlight/user/carousel.js +23 -19
- data/app/javascript/spotlight/user/clear_form_button.js +15 -15
- data/app/javascript/spotlight/user/index.js +4 -4
- data/app/javascript/spotlight/user/zpr_links.js +18 -18
- data/app/models/spotlight/analytics/ga.rb +0 -1
- data/app/models/spotlight/resources/iiif_manifest_v3.rb +2 -2
- data/app/services/spotlight/exhibit_import_export_service.rb +0 -2
- data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
- data/app/views/catalog/_remove_tags.html.erb +1 -1
- data/app/views/layouts/spotlight/base.html.erb +1 -1
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/app/views/shared/_masthead.html.erb +2 -2
- data/app/views/shared/_site_sidebar.html.erb +1 -1
- data/app/views/shared/_user_util_links.html.erb +2 -2
- data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
- data/app/views/spotlight/accessibility/alt_text.html.erb +1 -1
- data/app/views/spotlight/admin_users/index.html.erb +11 -9
- data/app/views/spotlight/appearances/edit.html.erb +1 -1
- data/app/views/spotlight/browse/_search_box.html.erb +1 -1
- data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
- data/app/views/spotlight/bulk_updates/_progress_panel.html.erb +6 -6
- data/app/views/spotlight/bulk_updates/edit.html.erb +1 -1
- data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
- data/app/views/spotlight/catalog/_admin_index_header_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_document.html.erb +2 -2
- data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
- data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
- data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +6 -6
- data/app/views/spotlight/catalog/select_image.html.erb +1 -1
- data/app/views/spotlight/contact_mailer/report_problem.html.erb +2 -2
- data/app/views/spotlight/exhibits/_contact.html.erb +2 -2
- data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
- data/app/views/spotlight/exhibits/_exhibit_card.html.erb +1 -1
- data/app/views/spotlight/exhibits/_export.html.erb +1 -1
- data/app/views/spotlight/exhibits/_form.html.erb +2 -2
- data/app/views/spotlight/exhibits/_languages.html.erb +7 -7
- data/app/views/spotlight/exhibits/_missing_exhibits.html.erb +1 -1
- data/app/views/spotlight/locks/_lock.html.erb +2 -2
- data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -1
- data/app/views/spotlight/pages/_order_pages.html.erb +3 -3
- data/app/views/spotlight/pages/preview.html.erb +1 -1
- data/app/views/spotlight/pages/show.html.erb +2 -2
- data/app/views/spotlight/resources/_form.html.erb +1 -1
- data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
- data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
- data/app/views/spotlight/roles/index.html.erb +5 -5
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
- data/app/views/spotlight/search_configurations/edit.html.erb +1 -1
- data/app/views/spotlight/searches/index.html.erb +2 -2
- data/app/views/spotlight/shared/_configuration_sidebar.html.erb +1 -1
- data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
- data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +2 -2
- data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +1 -1
- data/app/views/spotlight/sites/edit_exhibits.html.erb +3 -3
- data/app/views/spotlight/translations/_browse_categories.html.erb +2 -2
- data/app/views/spotlight/translations/_general.html.erb +21 -21
- data/app/views/spotlight/translations/_groups.html.erb +1 -1
- data/app/views/spotlight/translations/_metadata.html.erb +8 -8
- data/app/views/spotlight/translations/_pages_table.html.erb +2 -2
- data/app/views/spotlight/translations/_search_fields.html.erb +13 -13
- data/app/views/spotlight/translations/edit.html.erb +5 -5
- data/config/importmap.rb +0 -1
- data/lib/generators/spotlight/assets/propshaft_generator.rb +0 -1
- data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -31
- data/lib/spotlight/version.rb +1 -1
- data/spec/factories/contact_images.rb +1 -1
- data/spec/factories/exhibit_thumbnails.rb +1 -1
- data/spec/factories/featured_images.rb +1 -1
- data/spec/support/features/test_features_helpers.rb +41 -1
- metadata +4 -61
- data/app/javascript/spotlight/admin/copy_email_addresses.js +0 -7
- data/vendor/assets/javascripts/jquery.waitforimages.min.js +0 -2
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import Iiif from
|
|
2
|
-
import Core from
|
|
3
|
-
|
|
4
|
-
SirTrevor.Blocks.SolrDocumentsBase = (function(){
|
|
1
|
+
import Iiif from "spotlight/admin/iiif"
|
|
2
|
+
import Core from "spotlight/core"
|
|
5
3
|
|
|
4
|
+
SirTrevor.Blocks.SolrDocumentsBase = (function () {
|
|
6
5
|
return Core.Block.Resources.extend({
|
|
7
6
|
plustextable: true,
|
|
8
|
-
autocomplete_url: function() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
autocomplete_url: function () {
|
|
8
|
+
return this.$instance()
|
|
9
|
+
.closest("form[data-autocomplete-exhibit-catalog-path]")
|
|
10
|
+
.data("autocomplete-exhibit-catalog-path")
|
|
11
|
+
},
|
|
12
|
+
autocomplete_template: function (obj) {
|
|
13
|
+
const thumbnail = obj.thumbnail
|
|
14
|
+
? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail}" /></div>`
|
|
15
|
+
: ""
|
|
16
|
+
return `<div class="autocomplete-item${obj.private ? " blacklight-private" : ""}">${thumbnail}
|
|
12
17
|
<span class="autocomplete-title">${this.highlight(obj.title)}</span><br/><small> ${this.highlight(obj.description)}</small></div>`
|
|
13
18
|
},
|
|
14
|
-
transform_autocomplete_results: function(response) {
|
|
15
|
-
return $.map(response[
|
|
16
|
-
return doc
|
|
19
|
+
transform_autocomplete_results: function (response) {
|
|
20
|
+
return $.map(response["docs"], function (doc) {
|
|
21
|
+
return doc
|
|
17
22
|
})
|
|
18
23
|
},
|
|
19
24
|
|
|
20
|
-
caption_option_values: function() {
|
|
21
|
-
var fields = $(
|
|
25
|
+
caption_option_values: function () {
|
|
26
|
+
var fields = $("[data-blacklight-configuration-index-fields]").data(
|
|
27
|
+
"blacklight-configuration-index-fields",
|
|
28
|
+
)
|
|
22
29
|
|
|
23
|
-
return $.map(fields, function(field) {
|
|
24
|
-
return $(
|
|
25
|
-
}).join("\n")
|
|
30
|
+
return $.map(fields, function (field) {
|
|
31
|
+
return $("<option />").val(field.key).text(field.label)[0].outerHTML
|
|
32
|
+
}).join("\n")
|
|
26
33
|
},
|
|
27
34
|
|
|
28
|
-
item_options: function() {
|
|
35
|
+
item_options: function () {
|
|
36
|
+
return this.caption_options()
|
|
37
|
+
},
|
|
29
38
|
|
|
30
|
-
caption_options: function() {
|
|
39
|
+
caption_options: function () {
|
|
40
|
+
return `
|
|
31
41
|
<div class="field-select primary-caption" data-behavior="item-caption-admin">
|
|
32
42
|
<input name="${this.show_primary_field_key}" type="hidden" value="false" />
|
|
33
43
|
<input data-input-select-target="#${this.formId(this.primary_field_key)}" name="${this.show_primary_field_key}" id="${this.formId(this.show_primary_field_key)}" type="checkbox" value="true" />
|
|
@@ -46,76 +56,125 @@ SirTrevor.Blocks.SolrDocumentsBase = (function(){
|
|
|
46
56
|
${this.caption_option_values()}
|
|
47
57
|
</select>
|
|
48
58
|
</div>
|
|
49
|
-
`
|
|
59
|
+
`
|
|
60
|
+
},
|
|
50
61
|
|
|
51
62
|
// Sets the first version of the IIIF information from autocomplete data.
|
|
52
|
-
_itemPanelIiifFields: function(index, autocomplete_data) {
|
|
63
|
+
_itemPanelIiifFields: function (index, autocomplete_data) {
|
|
53
64
|
var iiifFields = [
|
|
54
|
-
'<input type="hidden" name="item[' +
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
'<input type="hidden" name="item[' +
|
|
66
|
+
index +
|
|
67
|
+
'][thumbnail_image_url]" value="' +
|
|
68
|
+
(autocomplete_data.thumbnail_image_url ||
|
|
69
|
+
autocomplete_data.thumbnail ||
|
|
70
|
+
"") +
|
|
71
|
+
'"/>',
|
|
72
|
+
'<input type="hidden" name="item[' +
|
|
73
|
+
index +
|
|
74
|
+
'][full_image_url]" value="' +
|
|
75
|
+
(autocomplete_data.full_image_url ||
|
|
76
|
+
autocomplete_data.thumbnail_image_url ||
|
|
77
|
+
autocomplete_data.thumbnail ||
|
|
78
|
+
"") +
|
|
79
|
+
'"/>',
|
|
80
|
+
'<input type="hidden" name="item[' +
|
|
81
|
+
index +
|
|
82
|
+
'][iiif_tilesource]" value="' +
|
|
83
|
+
(autocomplete_data.iiif_tilesource || "") +
|
|
84
|
+
'"/>',
|
|
85
|
+
'<input type="hidden" name="item[' +
|
|
86
|
+
index +
|
|
87
|
+
'][iiif_manifest_url]" value="' +
|
|
88
|
+
(autocomplete_data.iiif_manifest_url || "") +
|
|
89
|
+
'"/>',
|
|
90
|
+
'<input type="hidden" name="item[' +
|
|
91
|
+
index +
|
|
92
|
+
'][iiif_canvas_id]" value="' +
|
|
93
|
+
(autocomplete_data.iiif_canvas_id || "") +
|
|
94
|
+
'"/>',
|
|
95
|
+
'<input type="hidden" name="item[' +
|
|
96
|
+
index +
|
|
97
|
+
'][iiif_image_id]" value="' +
|
|
98
|
+
(autocomplete_data.iiif_image_id || "") +
|
|
99
|
+
'"/>',
|
|
100
|
+
]
|
|
61
101
|
|
|
62
102
|
// The region input is required for widgets that enable image cropping but not otherwise
|
|
63
|
-
if(this.show_image_selection) {
|
|
64
|
-
iiifFields.push(
|
|
103
|
+
if (this.show_image_selection) {
|
|
104
|
+
iiifFields.push(
|
|
105
|
+
'<input type="hidden" name="item[' +
|
|
106
|
+
index +
|
|
107
|
+
'][iiif_region]" value="' +
|
|
108
|
+
(autocomplete_data.iiif_region || "") +
|
|
109
|
+
'"/>',
|
|
110
|
+
)
|
|
65
111
|
}
|
|
66
112
|
|
|
67
|
-
return iiifFields.join("\n")
|
|
113
|
+
return iiifFields.join("\n")
|
|
68
114
|
},
|
|
69
115
|
// Overwrites the hidden inputs from _itemPanelIiifFields with data from the
|
|
70
116
|
// manifest. Called by afterPanelRender - the manifest_data here is built
|
|
71
117
|
// from canvases in the manifest, transformed by spotlight/admin/iiif.js in
|
|
72
118
|
// the #images method.
|
|
73
|
-
setIiifFields: function(panel, manifest_data, initialize) {
|
|
74
|
-
var legacyThumbnailField = $(panel).find(
|
|
119
|
+
setIiifFields: function (panel, manifest_data, initialize) {
|
|
120
|
+
var legacyThumbnailField = $(panel).find(
|
|
121
|
+
'[name$="[thumbnail_image_url]"]',
|
|
122
|
+
)
|
|
75
123
|
var legacyFullField = $(panel).find('[name$="[full_image_url]"]')
|
|
76
124
|
|
|
77
125
|
if (initialize && legacyThumbnailField.val().length > 0) {
|
|
78
|
-
return
|
|
126
|
+
return
|
|
79
127
|
}
|
|
80
128
|
|
|
81
|
-
legacyThumbnailField.val("")
|
|
82
|
-
legacyFullField.val("")
|
|
83
|
-
$(panel).find('[name$="[iiif_image_id]"]').val(manifest_data.imageId)
|
|
84
|
-
$(panel).find('[name$="[iiif_tilesource]"]').val(manifest_data.tilesource)
|
|
85
|
-
$(panel).find('[name$="[iiif_manifest_url]"]').val(manifest_data.manifest)
|
|
86
|
-
$(panel).find('[name$="[iiif_canvas_id]"]').val(manifest_data.canvasId)
|
|
87
|
-
$(panel)
|
|
129
|
+
legacyThumbnailField.val("")
|
|
130
|
+
legacyFullField.val("")
|
|
131
|
+
$(panel).find('[name$="[iiif_image_id]"]').val(manifest_data.imageId)
|
|
132
|
+
$(panel).find('[name$="[iiif_tilesource]"]').val(manifest_data.tilesource)
|
|
133
|
+
$(panel).find('[name$="[iiif_manifest_url]"]').val(manifest_data.manifest)
|
|
134
|
+
$(panel).find('[name$="[iiif_canvas_id]"]').val(manifest_data.canvasId)
|
|
135
|
+
$(panel)
|
|
136
|
+
.find("img.img-thumbnail")
|
|
137
|
+
.attr(
|
|
138
|
+
"src",
|
|
139
|
+
manifest_data.thumbnail_image_url ||
|
|
140
|
+
manifest_data.tilesource.replace(
|
|
141
|
+
"/info.json",
|
|
142
|
+
"/full/100,100/0/default.jpg",
|
|
143
|
+
),
|
|
144
|
+
)
|
|
88
145
|
},
|
|
89
|
-
afterPanelRender: function(data, panel) {
|
|
90
|
-
var context = this
|
|
91
|
-
var manifestUrl = data.iiif_manifest || data.iiif_manifest_url
|
|
146
|
+
afterPanelRender: function (data, panel) {
|
|
147
|
+
var context = this
|
|
148
|
+
var manifestUrl = data.iiif_manifest || data.iiif_manifest_url
|
|
92
149
|
|
|
93
150
|
if (!manifestUrl) {
|
|
94
|
-
$(panel)
|
|
95
|
-
|
|
151
|
+
$(panel)
|
|
152
|
+
.find('[name$="[thumbnail_image_url]"]')
|
|
153
|
+
.val(data.thumbnail_image_url || data.thumbnail)
|
|
154
|
+
$(panel).find('[name$="[full_image_url]"]').val(data.full_image_url)
|
|
96
155
|
|
|
97
|
-
return
|
|
156
|
+
return
|
|
98
157
|
}
|
|
99
158
|
|
|
100
|
-
$.ajax(manifestUrl).done(
|
|
101
|
-
|
|
102
|
-
var iiifManifest = new Iiif(manifestUrl, manifest);
|
|
103
|
-
|
|
104
|
-
var thumbs = iiifManifest.imagesArray();
|
|
159
|
+
$.ajax(manifestUrl).done(function (manifest) {
|
|
160
|
+
var iiifManifest = new Iiif(manifestUrl, manifest)
|
|
105
161
|
|
|
106
|
-
|
|
107
|
-
context.setIiifFields(panel, thumbs[0], !!data.iiif_manifest_url);
|
|
108
|
-
}
|
|
162
|
+
var thumbs = iiifManifest.imagesArray()
|
|
109
163
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
panel.multiImageSelector(thumbs, function(selectorImage) {
|
|
113
|
-
context.setIiifFields(panel, selectorImage, false);
|
|
114
|
-
}, data.iiif_image_id);
|
|
115
|
-
}
|
|
164
|
+
if (!data.iiif_image_id) {
|
|
165
|
+
context.setIiifFields(panel, thumbs[0], !!data.iiif_manifest_url)
|
|
116
166
|
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
167
|
|
|
121
|
-
|
|
168
|
+
if (thumbs.length > 1) {
|
|
169
|
+
panel.multiImageSelector(
|
|
170
|
+
thumbs,
|
|
171
|
+
function (selectorImage) {
|
|
172
|
+
context.setIiifFields(panel, selectorImage, false)
|
|
173
|
+
},
|
|
174
|
+
data.iiif_image_id,
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
})()
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
SirTrevor.Blocks.SolrDocuments = (function(){
|
|
2
|
-
|
|
1
|
+
SirTrevor.Blocks.SolrDocuments = (function () {
|
|
3
2
|
return SirTrevor.Blocks.SolrDocumentsBase.extend({
|
|
4
3
|
type: "solr_documents",
|
|
5
4
|
|
|
6
5
|
icon_name: "items",
|
|
7
6
|
|
|
8
|
-
item_options: function() {
|
|
7
|
+
item_options: function () {
|
|
8
|
+
return this.caption_options() + this.zpr_option()
|
|
9
|
+
},
|
|
9
10
|
|
|
10
|
-
zpr_option: function() {
|
|
11
|
+
zpr_option: function () {
|
|
11
12
|
return `
|
|
12
13
|
<div>
|
|
13
14
|
<input name="${this.zpr_key}" type="hidden" value="false" />
|
|
@@ -17,7 +18,6 @@ SirTrevor.Blocks.SolrDocuments = (function(){
|
|
|
17
18
|
`
|
|
18
19
|
},
|
|
19
20
|
|
|
20
|
-
zpr_key:
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
})();
|
|
21
|
+
zpr_key: "zpr_link",
|
|
22
|
+
})
|
|
23
|
+
})()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
|
|
2
|
-
|
|
1
|
+
SirTrevor.Blocks.SolrDocumentsCarousel = (function () {
|
|
3
2
|
return SirTrevor.Blocks.SolrDocumentsBase.extend({
|
|
4
3
|
plustextable: false,
|
|
5
4
|
type: "solr_documents_carousel",
|
|
@@ -11,16 +10,16 @@ SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
|
|
|
11
10
|
max_height_key: "max-height",
|
|
12
11
|
|
|
13
12
|
carouselCycleTimesInSeconds: {
|
|
14
|
-
values: [
|
|
15
|
-
selected: 5
|
|
13
|
+
values: [3, 5, 8, 12, 20],
|
|
14
|
+
selected: 5,
|
|
16
15
|
},
|
|
17
16
|
|
|
18
17
|
carouselMaxHeights: {
|
|
19
|
-
values: {
|
|
20
|
-
selected:
|
|
18
|
+
values: { Small: "small", Medium: "medium", Large: "large" },
|
|
19
|
+
selected: "Medium",
|
|
21
20
|
},
|
|
22
21
|
|
|
23
|
-
item_options: function() {
|
|
22
|
+
item_options: function () {
|
|
24
23
|
return `${this.caption_options()}
|
|
25
24
|
<div class="field-select auto-cycle-images" data-behavior="auto-cycle-images">
|
|
26
25
|
<input name="${this.auto_play_images_key}" type="hidden" value="false" />
|
|
@@ -37,62 +36,83 @@ SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
|
|
|
37
36
|
</div>`
|
|
38
37
|
},
|
|
39
38
|
|
|
40
|
-
addCarouselCycleOptions: function(options) {
|
|
41
|
-
var html =
|
|
39
|
+
addCarouselCycleOptions: function (options) {
|
|
40
|
+
var html = ""
|
|
42
41
|
|
|
43
|
-
$.each(options.values, function(index, interval) {
|
|
44
|
-
var selected =
|
|
45
|
-
|
|
42
|
+
$.each(options.values, function (index, interval) {
|
|
43
|
+
var selected = interval === options.selected ? "selected" : "",
|
|
44
|
+
intervalInMilliSeconds = parseInt(interval, 10) * 1000
|
|
46
45
|
|
|
47
|
-
html +=
|
|
48
|
-
|
|
46
|
+
html +=
|
|
47
|
+
'<option value="' +
|
|
48
|
+
intervalInMilliSeconds +
|
|
49
|
+
'" ' +
|
|
50
|
+
selected +
|
|
51
|
+
">" +
|
|
52
|
+
interval +
|
|
53
|
+
" seconds</option>"
|
|
54
|
+
})
|
|
49
55
|
|
|
50
|
-
return html
|
|
56
|
+
return html
|
|
51
57
|
},
|
|
52
58
|
|
|
53
|
-
addCarouselMaxHeightOptions: function(options) {
|
|
54
|
-
var html =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
$.each(options.values, function(size, px) {
|
|
58
|
-
var checked =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
html +=
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
addCarouselMaxHeightOptions: function (options) {
|
|
60
|
+
var html = "",
|
|
61
|
+
_this = this
|
|
62
|
+
|
|
63
|
+
$.each(options.values, function (size, px) {
|
|
64
|
+
var checked = size === options.selected ? "checked" : "",
|
|
65
|
+
id = _this.formId(_this.max_height_key)
|
|
66
|
+
|
|
67
|
+
html +=
|
|
68
|
+
'<input data-key="' +
|
|
69
|
+
_this.max_height_key +
|
|
70
|
+
'" type="radio" name="' +
|
|
71
|
+
id +
|
|
72
|
+
'" value="' +
|
|
73
|
+
px +
|
|
74
|
+
'" id="' +
|
|
75
|
+
id +
|
|
76
|
+
'" ' +
|
|
77
|
+
checked +
|
|
78
|
+
">"
|
|
79
|
+
html +=
|
|
80
|
+
'<label class="carousel-size" for="' + id + '">' + size + "</label>"
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
return html
|
|
66
84
|
},
|
|
67
85
|
|
|
68
|
-
afterPreviewLoad: function(
|
|
69
|
-
$(this.inner).find(
|
|
86
|
+
afterPreviewLoad: function (_options) {
|
|
87
|
+
$(this.inner).find(".carousel").carousel()
|
|
70
88
|
|
|
71
89
|
// the bootstrap carousel only initializes data-bs-slide widgets on page load, so we need
|
|
72
90
|
// to initialize them ourselves..
|
|
73
91
|
var clickHandler = function (e) {
|
|
74
92
|
var href
|
|
75
|
-
var $this
|
|
76
|
-
var $target = $(
|
|
77
|
-
|
|
93
|
+
var $this = $(this)
|
|
94
|
+
var $target = $(
|
|
95
|
+
$this.attr("data-bs-target") ||
|
|
96
|
+
((href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "")),
|
|
97
|
+
) // strip for ie7
|
|
98
|
+
if (!$target.hasClass("carousel")) return
|
|
78
99
|
var options = $.extend({}, $target.data(), $this.data())
|
|
79
|
-
var slideIndex = $this.attr(
|
|
100
|
+
var slideIndex = $this.attr("data-bs-slide-to")
|
|
80
101
|
if (slideIndex) options.interval = false
|
|
81
102
|
|
|
82
103
|
$.fn.carousel.call($target, options)
|
|
83
104
|
|
|
84
105
|
if (slideIndex) {
|
|
85
|
-
$target.data(
|
|
106
|
+
$target.data("bs.carousel").to(slideIndex)
|
|
86
107
|
}
|
|
87
108
|
|
|
88
109
|
e.preventDefault()
|
|
89
110
|
}
|
|
90
111
|
|
|
91
|
-
$(this.inner)
|
|
92
|
-
.
|
|
93
|
-
.on(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
})();
|
|
112
|
+
$(this.inner)
|
|
113
|
+
.find(".carousel")
|
|
114
|
+
.on("click.bs.carousel.data-api", "[data-bs-slide]", clickHandler)
|
|
115
|
+
.on("click.bs.carousel.data-api", "[data-bs-slide-to]", clickHandler)
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
})()
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
SirTrevor.Blocks.SolrDocumentsEmbed = (function(){
|
|
2
|
-
|
|
1
|
+
SirTrevor.Blocks.SolrDocumentsEmbed = (function () {
|
|
3
2
|
return SirTrevor.Blocks.SolrDocumentsBase.extend({
|
|
4
3
|
type: "solr_documents_embed",
|
|
5
4
|
icon_name: "item_embed",
|
|
6
5
|
show_image_selection: false,
|
|
7
6
|
|
|
8
|
-
item_options: function() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
$(this.inner).find('picture[data-openseadragon]').openseadragon();
|
|
12
|
-
}
|
|
13
|
-
});
|
|
7
|
+
item_options: function () {
|
|
8
|
+
return ""
|
|
9
|
+
},
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
afterPreviewLoad: function (_options) {
|
|
12
|
+
this.inner.querySelector("picture[data-openseadragon]").openseadragon()
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
})()
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
SirTrevor.Blocks.SolrDocumentsFeatures = (function(){
|
|
2
|
-
|
|
1
|
+
SirTrevor.Blocks.SolrDocumentsFeatures = (function () {
|
|
3
2
|
return SirTrevor.Blocks.SolrDocumentsBase.extend({
|
|
4
3
|
plustextable: false,
|
|
5
4
|
type: "solr_documents_features",
|
|
6
5
|
|
|
7
6
|
icon_name: "item_features",
|
|
8
7
|
|
|
9
|
-
afterPreviewLoad: function(
|
|
10
|
-
$(this.inner).find(
|
|
8
|
+
afterPreviewLoad: function (_options) {
|
|
9
|
+
$(this.inner).find(".carousel").carousel()
|
|
11
10
|
|
|
12
11
|
// the bootstrap carousel only initializes data-bs-slide widgets on page load, so we need
|
|
13
12
|
// to initialize them ourselves..
|
|
14
13
|
var clickHandler = function (e) {
|
|
15
14
|
var href
|
|
16
|
-
var $this
|
|
17
|
-
var $target = $(
|
|
18
|
-
|
|
15
|
+
var $this = $(this)
|
|
16
|
+
var $target = $(
|
|
17
|
+
$this.attr("data-bs-target") ||
|
|
18
|
+
((href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "")),
|
|
19
|
+
) // strip for ie7
|
|
20
|
+
if (!$target.hasClass("carousel")) return
|
|
19
21
|
var options = $.extend({}, $target.data(), $this.data())
|
|
20
|
-
var slideIndex
|
|
22
|
+
var slideIndex = $this.attr("data-bs-slide-to")
|
|
21
23
|
if (slideIndex) options.interval = false
|
|
22
24
|
|
|
23
25
|
$.fn.carousel.call($target, options)
|
|
24
26
|
|
|
25
27
|
if (slideIndex) {
|
|
26
|
-
$target.data(
|
|
28
|
+
$target.data("bs.carousel").to(slideIndex)
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
e.preventDefault()
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
$(this.inner)
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
})();
|
|
34
|
+
$(this.inner)
|
|
35
|
+
.find(".carousel")
|
|
36
|
+
.on("click.bs.carousel.data-api", "[data-bs-slide-to]", clickHandler)
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
})()
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
SirTrevor.Blocks.SolrDocumentsGrid = (function(){
|
|
2
|
-
|
|
1
|
+
SirTrevor.Blocks.SolrDocumentsGrid = (function () {
|
|
3
2
|
return SirTrevor.Blocks.SolrDocumentsBase.extend({
|
|
4
3
|
type: "solr_documents_grid",
|
|
5
4
|
|
|
6
5
|
icon_name: "item_grid",
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})()
|
|
7
|
+
item_options: function () {
|
|
8
|
+
return ""
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
})()
|