44 lines
1.9 KiB
44 lines
1.9 KiB
(function ($, Drupal) { |
|
Drupal.behaviors.robib_solr_alterlBehavior = { |
|
attach: function (context, settings) { |
|
$('#open-modal-link', context).click(function (e) { |
|
e.preventDefault(); |
|
// Create the modal content |
|
var modalContent = '<div id="help-modal" class="modal">' + |
|
'<div class="modal-content">' + |
|
'<span class="close-button">×</span>' + |
|
'<h3>Consolidating existing Solr fields</h3>' + |
|
'<p>The form allows you concatenate two or more existing Solr fields to a new multivalue field. </ br>' + |
|
'Select existing fields from the dropdowns on the left to pair them with a new field</ br> ' + |
|
'entered in the column on the right. </ br>The new field name need not exist in your Solr config already.</p>' + |
|
'<h3>Normalizing Custom Strings</h3>' + |
|
'<p>Create a Custom value string on your Solr index, and populate it with pipe separated tokens ' + |
|
'such as <em>[node:field_country]|[node:field_geo_area]|node:field_geo_city]</em>, ' + |
|
'then select this field in the Normalize selector below. The resulting Solr field will be a comma-separated string, ' + |
|
'allowing multiple values per tokenized Drupal field. </p>' |
|
'</div>' + |
|
'</div>'; |
|
|
|
$('body').append(modalContent); |
|
$('#help-modal').fadeIn(); |
|
$("#open_link-wrapper").fadeOut(); |
|
|
|
$('#help-modal .close-button').click(function () { |
|
$('#help-modal').fadeOut(function () { |
|
$("#open_link-wrapper").fadeIn(); |
|
$('#help-modal').remove(); |
|
}); |
|
}); |
|
|
|
$(window).click(function (event) { |
|
if ($(event.target).is('#help-modal')) { |
|
$("#open_link-wrapper").fadeIn(); |
|
$('#help-modal').fadeOut(function () { |
|
$('#help-modal').remove(); |
|
}); |
|
} |
|
}); |
|
}); |
|
} |
|
}; |
|
})(jQuery, Drupal);
|
|
|