blacklight_range_limit 8.4.0 → 8.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blacklight_range_limit.umd.js","sources":["../../../javascript/blacklight_range_limit/range_limit_shared.js","../../../javascript/blacklight_range_limit/range_limit_plotting.js","../../../javascript/blacklight_range_limit/range_limit_distro_facets.js","../../../javascript/blacklight_range_limit/range_limit_slider.js","../../../javascript/blacklight_range_limit/index.js"],"sourcesContent":["/**\n * BlacklightRangeLimit module setup.\n */\n'use strict';\n\nconst BlacklightRangeLimit = function (options) {\n this.options = options || {};\n}\n\nBlacklightRangeLimit.display_ratio = 1/(1.618 * 2); // half a golden rectangle, why not\n/* A custom event \"plotDrawn.blacklight.rangeLimit\" will be sent when flot plot\n is (re-)drawn on screen possibly with a new size. target of event will be the DOM element\n containing the plot. Used to resize slider to match. */\nBlacklightRangeLimit.redrawnEvent = \"plotDrawn.blacklight.rangeLimit\";\n\n// takes a string and parses into an integer, but throws away commas first, to avoid truncation when there is a comma\n// use in place of javascript's native parseInt\nBlacklightRangeLimit.parseNum = function parseNum(str) {\n str = String(str).replace(/[^0-9-]/g, '');\n return parseInt(str, 10);\n};\n\nBlacklightRangeLimit.form_selection = function form_selection(form, min, max) {\n var begin_val = BlacklightRangeLimit.parseNum($(form).find(\"input.range_begin\").val());\n if (isNaN(begin_val) || begin_val < min) {\n begin_val = min;\n }\n var end_val = BlacklightRangeLimit.parseNum($(form).find(\"input.range_end\").val());\n if (isNaN(end_val) || end_val > max) {\n end_val = max;\n }\n\n return BlacklightRangeLimit.normalized_selection(begin_val, end_val);\n}\n\n// Add AJAX fetched range facets if needed, and add a chart to em\nBlacklightRangeLimit.checkForNeededFacetsToFetch = function checkForNeededFacetsToFetch() {\n $(\".range_limit .profile .distribution a.load_distribution\").each(function() {\n var container = $(this).parent('div.distribution');\n\n $(container).load($(this).attr('href'), function(response, status) {\n if ($(container).hasClass(\"chart_js\") && status == \"success\" ) {\n BlacklightRangeLimit.turnIntoPlot(container);\n }\n });\n });\n}\n\nBlacklightRangeLimit.function_for_find_segment = function function_for_find_segment(pointer_lookup_arr) {\n return function(x_coord) {\n for (var i = pointer_lookup_arr.length-1 ; i >= 0 ; i--) {\n var hash = pointer_lookup_arr[i];\n if (x_coord >= hash.from)\n return hash;\n }\n return pointer_lookup_arr[0];\n };\n}\n\n// Send endpoint to endpoint+0.99999 to have display\n// more closely approximate limiting behavior esp\n// at small resolutions. (Since we search on whole numbers,\n// inclusive, but flot chart is decimal.)\nBlacklightRangeLimit.normalized_selection = function normalized_selection(min, max) {\n max += 0.99999;\n\n return {xaxis: { 'from':min, 'to':max}}\n}\n\n// Check if Flot is loaded\nBlacklightRangeLimit.domDependenciesMet = function domDependenciesMet() {\n return typeof $.plot != \"undefined\"\n}\n\nBlacklightRangeLimit.modalObserverConfig = {\n attributes: true,\n}\n\nBlacklightRangeLimit.initSliderModalObserver = function(modalSelector) {\n // Use a mutation observer to detect when the modal dialog is open\n const modalObserver = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if (mutation.attributeName !== 'open') {return;}\n if (mutation.target.hasAttribute('open')) {\n $(modalSelector).find(\".range_limit .profile .range.slider_js\").each(function() {\n BlacklightRangeLimit.buildSlider(this);\n });\n }\n });\n });\n modalObserver.observe(document.querySelector(modalSelector), BlacklightRangeLimit.modalObserverConfig);\n}\n\nBlacklightRangeLimit.initPlotModalObserver = function(modalSelector) {\n // Use a mutation observer to detect when the modal dialog is open\n const modalObserver = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if (mutation.attributeName !== 'open') {return;}\n if (mutation.target.hasAttribute('open')) {\n $(modalSelector).find(\".range_limit .profile .distribution.chart_js ul\").each(function() {\n BlacklightRangeLimit.turnIntoPlot($(this).parent());\n });\n\n // Case when there is no currently selected range\n BlacklightRangeLimit.checkForNeededFacetsToFetch();\n }\n });\n });\n modalObserver.observe(document.querySelector(modalSelector), BlacklightRangeLimit.modalObserverConfig);\n}\n\nexport default BlacklightRangeLimit","// second arg, if provided, is a number of ms we're willing to\n// wait for the container to have width before giving up -- we'll\n// set 50ms timers to check back until timeout is expired or the\n// container is finally visible. The timeout is used when we catch\n// bootstrap show event, but the animation hasn't barely begun yet -- but\n// we don't want to wait until it's finished, we want to start rendering\n// as soon as we can.\n\nimport BlacklightRangeLimit from 'range_limit_shared'\n\nBlacklightRangeLimit.turnIntoPlot = function turnIntoPlot(container, wait_for_visible) {\n // flot can only render in a a div with a defined width.\n // for instance, a hidden div can't generally be rendered in (although if you set\n // an explicit width on it, it might work)\n //\n // We'll count on later code that catch bootstrap collapse open to render\n // on show, for currently hidden divs.\n\n // for some reason width sometimes return negative, not sure\n // why but it's some kind of hidden.\n if (container.width() > 0) {\n var height = container.width() * BlacklightRangeLimit.display_ratio;\n\n // Need an explicit height to make flot happy.\n container.height( height )\n\n BlacklightRangeLimit.areaChart($(container));\n\n $(container).trigger(BlacklightRangeLimit.redrawnEvent);\n }\n else if (wait_for_visible > 0) {\n setTimeout(function() {\n BlacklightRangeLimit.turnIntoPlot(container, wait_for_visible - 50);\n }, 50);\n }\n}\n\nBlacklightRangeLimit.parseSegment = function parseSegment(el) {\n if ($(el).find(\"span.single\").first().data('blrlSingle')) {\n var val = BlacklightRangeLimit.parseNum($(el).find(\"span.single\").first().data('blrlSingle'));\n\n return [val, val];\n } else {\n var from = BlacklightRangeLimit.parseNum($(el).find(\"span.from\").first().data('blrlBegin'));\n var to = BlacklightRangeLimit.parseNum($(el).find(\"span.to\").first().data('blrlEnd'));\n\n return [from, to];\n }\n}\n\n// Takes a div holding a ul of distribution segments produced by\n// blacklight_range_limit/_range_facets and makes it into\n// a flot area chart.\nBlacklightRangeLimit.areaChart = function areaChart(container) {\n //flot loaded? And canvas element supported.\n if ( BlacklightRangeLimit.domDependenciesMet() ) {\n\n // Grab the data from the ul div\n var series_data = new Array();\n var pointer_lookup = new Array();\n var x_ticks = new Array();\n var min = BlacklightRangeLimit.parseSegment($(container).find(\"ul li:first-child\").first())[0];\n var max = BlacklightRangeLimit.parseSegment($(container).find(\"ul li:last-child\").first())[1];\n\n $(container).find(\"ul li\").each(function() {\n var segment = BlacklightRangeLimit.parseSegment(this);\n var from = segment[0];\n var to = segment[1];\n\n var count = BlacklightRangeLimit.parseNum($(this).find(\"span.facet-count,span.count\").text());\n var avg = (count / (to - from + 1));\n\n //We use the avg as the y-coord, to make the area of each\n //segment proportional to how many documents it holds.\n series_data.push( [from, avg ] );\n series_data.push( [to+1, avg] );\n\n x_ticks.push(from);\n\n pointer_lookup.push({'from': from, 'to': to, 'count': count, 'label': $(this).find(\".facet-select,.facet_select\").html() });\n });\n\n x_ticks.push( max + 1 );\n\n var plot;\n var config = $(container).closest('.blrl-plot-config').data('plot-config') || $(container).closest('.facet-limit').data('plot-config') || {};\n\n try {\n plot = $.plot($(container), [series_data],\n $.extend(true, config, {\n yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1},\n //xaxis: { ticks: x_ticks },\n xaxis: { tickDecimals: 0 }, // force integer ticks\n series: { lines: { fill: true, steps: true }},\n grid: {clickable: true, hoverable: true, autoHighlight: false, margin: { left: 0, right: 0 }},\n selection: {mode: \"x\"}\n }));\n }\n catch(err) {\n alert(err);\n }\n\n var find_segment_for = BlacklightRangeLimit.function_for_find_segment(pointer_lookup);\n var last_segment = null;\n $(container).tooltip({'html': true, 'placement': 'bottom', 'trigger': 'manual', 'delay': { show: 0, hide: 100}});\n\n $(container).bind(\"plothover\", function (event, pos, item) {\n var segment = find_segment_for(pos.x);\n\n if(segment != last_segment) {\n var title = find_segment_for(pos.x).label + ' (' + BlacklightRangeLimit.parseNum(segment.count) + ')';\n $(container).attr(\"title\", title).tooltip(\"_fixTitle\").tooltip(\"show\");\n\n last_segment = segment;\n }\n });\n\n $(container).bind(\"mouseout\", function() {\n last_segment = null;\n $(container).tooltip('hide');\n });\n $(container).bind(\"plotclick\", function (event, pos, item) {\n if ( plot.getSelection() == null) {\n segment = find_segment_for(pos.x);\n plot.setSelection(BlacklightRangeLimit.normalized_selection(segment.from, segment.to));\n }\n });\n $(container).bind(\"plotselected plotselecting\", function(event, ranges) {\n if (ranges != null ) {\n var from = Math.floor(ranges.xaxis.from);\n var to = Math.floor(ranges.xaxis.to);\n\n var form = $(container).closest(\".limit_content\").find(\"form.range_limit\");\n form.find(\"input.range_begin\").val(from);\n form.find(\"input.range_end\").val(to);\n\n var slider_placeholder = $(container).closest(\".limit_content\").find(\"[data-slider-placeholder]\");\n if (slider_placeholder) {\n slider_placeholder.slider(\"setValue\", [from, to]);\n }\n }\n });\n\n var form = $(container).closest(\".limit_content\").find(\"form.range_limit\");\n form.find(\"input.range_begin, input.range_end\").on('input', function () {\n plot.setSelection( BlacklightRangeLimit.form_selection(form, min, max), true );\n });\n $(container).closest(\".limit_content\").find(\".profile .range\").on(\"slide\", function(event, ui) {\n var values = $(event.target).data(\"slider\").getValue();\n form.find(\"input.range_begin\").val(values[0]);\n form.find(\"input.range_end\").val(values[1]);\n plot.setSelection(BlacklightRangeLimit.normalized_selection(values[0], Math.max(values[0], values[1])), true);\n });\n\n // initially entirely selected, to match slider\n plot.setSelection(BlacklightRangeLimit.normalized_selection(min, max));\n }\n}\n\n// after a collapsible facet contents is fully shown,\n// resize the flot chart to current conditions. This way, if you change\n// browser window size, you can get chart resized to fit by closing and opening\n// again, if needed.\nBlacklightRangeLimit.redrawPlot = function redrawPlot(container) {\n if (container && container.width() > 0) {\n // resize the container's height, since width may have changed.\n container.height( container.width() * BlacklightRangeLimit.display_ratio );\n\n // redraw the chart.\n var plot = container.data(\"plot\");\n if (plot) {\n // how to redraw after possible resize?\n // Cribbed from https://github.com/flot/flot/blob/master/jquery.flot.resize.js\n plot.resize();\n plot.setupGrid();\n plot.draw();\n // plus trigger redraw of the selection, which otherwise ain't always right\n // we'll trigger a fake event on one of the boxes\n var form = $(container).closest(\".limit_content\").find(\"form.range_limit\");\n form.find(\"input.range_begin\").trigger(\"change\");\n\n // send our custom event to trigger redraw of slider\n $(container).trigger(BlacklightRangeLimit.redrawnEvent);\n }\n }\n}\n","/**\n * Closure functions in this file are mainly concerned with initializing, resizing, and updating\n * range limit functionality based off of page load, facet opening, page resizing, and otherwise\n * events.\n */\n\nimport BlacklightRangeLimit from 'range_limit_shared'\n\nBlacklightRangeLimit.initializeDistroFacets = function(modalSelector) {\n // Facets already on the page? Turn em into a chart.\n $(\".range_limit .profile .distribution.chart_js ul\").each(function() {\n BlacklightRangeLimit.turnIntoPlot($(this).parent());\n });\n\n BlacklightRangeLimit.checkForNeededFacetsToFetch();\n\n // Listen for twitter bootstrap collapsible open events, to render flot\n // in previously hidden divs on open, if needed.\n $(\"body\").on(\"show.bs.collapse\", function(event) {\n // Was the target a .facet-content including a .chart-js?\n var container = $(event.target).filter(\".facet-content\").find(\".chart_js\");\n\n // only if it doesn't already have a canvas, it isn't already drawn\n if (container && container.find(\"canvas\").length == 0) {\n // be willing to wait up to 1100ms for container to\n // have width -- right away on show.bs is too soon, but\n // shown.bs is later than we want, we want to start rendering\n // while animation is still in progress.\n BlacklightRangeLimit.turnIntoPlot(container, 1100);\n }\n });\n\n // For Blacklight version < 8, when loaded in a modal\n $(modalSelector).on('shown.bs.modal', function() {\n $(this).find(\".range_limit .profile .distribution.chart_js ul\").each(function() {\n BlacklightRangeLimit.turnIntoPlot($(this).parent());\n });\n\n // Case when there is no currently selected range\n BlacklightRangeLimit.checkForNeededFacetsToFetch();\n });\n\n // Use a mutation observer to detect when the HTML dialog is open\n BlacklightRangeLimit.initPlotModalObserver(modalSelector);\n\n $(\"body\").on(\"shown.bs.collapse\", function(event) {\n var container = $(event.target).filter(\".facet-content\").find(\".chart_js\");\n BlacklightRangeLimit.redrawPlot(container);\n });\n\n // debouce borrowed from underscore\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n const debounce = function(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n };\n\n $(window).on(\"resize\", debounce(function() {\n $(\".chart_js\").each(function(i, container) {\n BlacklightRangeLimit.redrawPlot($(container));\n });\n }, 350));\n}","// for Blacklight.onLoad:\nimport BlacklightRangeLimit from 'range_limit_shared'\n\nBlacklightRangeLimit.initializeSlider = function(modalSelector) {\n\n $(\".range_limit .profile .range.slider_js\").each(function() {\n BlacklightRangeLimit.buildSlider(this);\n });\n\n // For Blacklight < 8, when loaded in a modal\n $(modalSelector).on('shown.bs.modal', function() {\n $(this).find(\".range_limit .profile .range.slider_js\").each(function() {\n BlacklightRangeLimit.buildSlider(this);\n });\n });\n\n // For Blacklight 8, use a mutation observer to detect when the HTML dialog is open\n BlacklightRangeLimit.initSliderModalObserver(modalSelector);\n\n // catch event for redrawing chart, to redraw slider to match width\n $(\"body\").on(\"plotDrawn.blacklight.rangeLimit\", function(event) {\n var area = $(event.target).closest(\".limit_content.range_limit\");\n var plot = area.find(\".chart_js\").data(\"plot\");\n var slider_el = area.find(\".slider\");\n\n if (plot && slider_el) {\n slider_el.width(plot.width());\n slider_el.css(\"display\", \"block\")\n }\n });\n}\n\n// returns two element array min/max as numbers. If there is a limit applied,\n// it's boundaries are are limits. Otherwise, min/max in current result\n// set as sniffed from HTML. Pass in a DOM element for a div.range\n// Will return NaN as min or max in case of error or other weirdness.\nBlacklightRangeLimit.min_max = function min_max(range_element) {\n var current_limit = $(range_element).closest(\".limit_content.range_limit\").find(\".current\")\n let min, max\n min = max = BlacklightRangeLimit.parseNum(current_limit.find(\".single\").data('blrlSingle'))\n if ( isNaN(min)) {\n min = BlacklightRangeLimit.parseNum(current_limit.find(\".from\").first().data('blrlBegin'));\n max = BlacklightRangeLimit.parseNum(current_limit.find(\".to\").first().data('blrlEnd'));\n }\n\n if (isNaN(min) || isNaN(max)) {\n //no current limit, take from results min max included in spans\n min = BlacklightRangeLimit.parseNum($(range_element).find(\".min\").first().text());\n max = BlacklightRangeLimit.parseNum($(range_element).find(\".max\").first().text());\n }\n return [min, max]\n}\n\n\n// Check to see if a value is an Integer\n// see: http://stackoverflow.com/questions/3885817/how-to-check-if-a-number-is-float-or-integer\nBlacklightRangeLimit.isInt = function isInt(n) {\n return n % 1 === 0;\n}\n\nBlacklightRangeLimit.buildSlider = function buildSlider(thisContext) {\n var range_element = $(thisContext);\n\n var boundaries = BlacklightRangeLimit.min_max(thisContext);\n var min = boundaries[0];\n var max = boundaries[1];\n\n if (BlacklightRangeLimit.isInt(min) && BlacklightRangeLimit.isInt(max)) {\n $(thisContext).contents().wrapAll('<div class=\"sr-only visually-hidden\" />');\n\n var range_element = $(thisContext);\n var form = $(range_element).closest(\".range_limit\").find(\"form.range_limit\");\n var begin_el = form.find(\"input.range_begin\");\n var end_el = form.find(\"input.range_end\");\n\n var placeholder_input = $('<input type=\"hidden\" data-slider-placeholder=\"true\" />').appendTo(range_element);\n\n // make sure slider is loaded\n if (placeholder_input.slider !== undefined) {\n placeholder_input.slider({\n min: min,\n max: max,\n value: [min, max],\n tooltip: \"hide\"\n });\n\n // try to make slider width/orientation match chart's\n var container = range_element.closest(\".range_limit\");\n var plot_el = container.find(\".chart_js\");\n var plot = plot_el.data(\"plot\");\n var slider_el = container.find(\".slider\");\n\n if (plot_el) {\n plot_el.attr('aria-hidden', 'true');\n }\n\n if (slider_el) {\n slider_el.attr('aria-hidden', 'true');\n }\n\n if (plot && slider_el) {\n slider_el.width(plot.width());\n slider_el.css(\"display\", \"block\")\n } else if (slider_el) {\n slider_el.css(\"width\", \"100%\");\n }\n }\n\n // Slider change should update text input values.\n var parent = $(thisContext).parent();\n var form = $(parent).closest(\".limit_content\").find(\"form.range_limit\");\n $(parent).closest(\".limit_content\").find(\".profile .range\").on(\"slide\", function(event, ui) {\n var values = $(event.target).data(\"slider\").getValue();\n form.find(\"input.range_begin\").val(values[0]);\n form.find(\"input.range_end\").val(values[1]);\n });\n }\n\n begin_el.val(min);\n end_el.val(max);\n\n begin_el.on('input', function() {\n var val = BlacklightRangeLimit.parseNum(this.value);\n if (isNaN(val) || val < min) {\n //for weird data, set slider at min\n val = min;\n }\n var values = placeholder_input.data(\"slider\").getValue();\n values[0] = val;\n placeholder_input.slider(\"setValue\", values);\n });\n\n end_el.on('input', function() {\n var val = BlacklightRangeLimit.parseNum(this.value);\n if (isNaN(val) || val > max) {\n //weird entry, set slider to max\n val = max;\n }\n var values = placeholder_input.data(\"slider\").getValue();\n values[1] = val;\n placeholder_input.slider(\"setValue\", values);\n });\n\n begin_el.change(function() {\n var val1 = BlacklightRangeLimit.parseNum(begin_el.val());\n var val2 = BlacklightRangeLimit.parseNum(end_el.val());\n\n if (val2 < val1) {\n begin_el.val(val2);\n end_el.val(val1);\n }\n });\n\n end_el.change(function() {\n var val1 = BlacklightRangeLimit.parseNum(begin_el.val());\n var val2 = BlacklightRangeLimit.parseNum(end_el.val());\n\n if (val2 < val1) {\n begin_el.val(val2);\n end_el.val(val1);\n }\n });\n }\n","import BlacklightRangeLimit from 'range_limit_shared'\nimport 'range_limit_plotting'\nimport 'range_limit_distro_facets'\nimport 'range_limit_slider'\n\nBlacklightRangeLimit.initialize = function(modalSelector) {\n BlacklightRangeLimit.initializeDistroFacets(modalSelector)\n BlacklightRangeLimit.initializeSlider(modalSelector)\n}\n\nexport default BlacklightRangeLimit"],"names":[],"mappings":";;;;;;EAAA;EACA;EACA;AAEA;AACK,QAAC,oBAAoB,GAAG,UAAU,OAAO,EAAE;EAChD,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;EAC/B,EAAC;AACD;EACA,oBAAoB,CAAC,aAAa,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;EACnD;EACA;EACA;EACA,oBAAoB,CAAC,YAAY,GAAG,iCAAiC,CAAC;AACtE;EACA;EACA;EACA,oBAAoB,CAAC,QAAQ,G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,MAAM,IAAI,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AAC7D;EACA,MAAM,IAAI,IAAI,GAAG,IAAI,EAAE;EACvB,QAAQ,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;EAC3B,QAAQ,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;EACzB,OAAO;EACP,KAAK,CAAC,CAAC;AACP;EACA,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW;EAC7B,MAAM,IAAI,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;EAC/D,MAAM,IAAI,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AAC7D;EACA,MAAM,IAAI,IAAI,GAAG,IAAI,EAAE;EACvB,QAAQ,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;EAC3B,QAAQ,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;EACzB,OAAO;EACP,KAAK,CAAC,CAAC;EACP;;EC7JA,oBAAoB,CAAC,UAAU,GAAG,SAAS,aAAa,EAAE;EAC1D,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,aAAa,EAAC;EAC5D,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,aAAa,EAAC;EACtD;;;;;;;;"}
@@ -18,8 +18,10 @@
18
18
  //= require 'flot/jquery.flot.selection.js'
19
19
  //= require 'bootstrap-slider'
20
20
 
21
- // Ensure that range_limit_shared is loaded first
22
- //= require 'blacklight_range_limit/range_limit_shared'
23
- //= require 'blacklight_range_limit/range_limit_plotting'
24
- //= require 'blacklight_range_limit/range_limit_slider'
25
- //= require 'blacklight_range_limit/range_limit_distro_facets'
21
+ //= require 'blacklight_range_limit/blacklight_range_limit.umd'
22
+
23
+ Blacklight.onLoad(function() {
24
+ // Support for Blacklight 7 and 8:
25
+ modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector
26
+ BlacklightRangeLimit.initialize(modalSelector)
27
+ })
@@ -0,0 +1,11 @@
1
+ import BlacklightRangeLimit from 'range_limit_shared'
2
+ import 'range_limit_plotting'
3
+ import 'range_limit_distro_facets'
4
+ import 'range_limit_slider'
5
+
6
+ BlacklightRangeLimit.initialize = function(modalSelector) {
7
+ BlacklightRangeLimit.initializeDistroFacets(modalSelector)
8
+ BlacklightRangeLimit.initializeSlider(modalSelector)
9
+ }
10
+
11
+ export default BlacklightRangeLimit
@@ -1,13 +1,12 @@
1
- // for Blacklight.onLoad:
2
-
3
1
  /**
4
2
  * Closure functions in this file are mainly concerned with initializing, resizing, and updating
5
3
  * range limit functionality based off of page load, facet opening, page resizing, and otherwise
6
4
  * events.
7
5
  */
8
6
 
9
- Blacklight.onLoad(function() {
7
+ import BlacklightRangeLimit from 'range_limit_shared'
10
8
 
9
+ BlacklightRangeLimit.initializeDistroFacets = function(modalSelector) {
11
10
  // Facets already on the page? Turn em into a chart.
12
11
  $(".range_limit .profile .distribution.chart_js ul").each(function() {
13
12
  BlacklightRangeLimit.turnIntoPlot($(this).parent());
@@ -31,10 +30,7 @@ Blacklight.onLoad(function() {
31
30
  }
32
31
  });
33
32
 
34
- // Support for Blacklight 7 and 8:
35
- const modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector
36
-
37
- // When loaded in a modal
33
+ // For Blacklight version < 8, when loaded in a modal
38
34
  $(modalSelector).on('shown.bs.modal', function() {
39
35
  $(this).find(".range_limit .profile .distribution.chart_js ul").each(function() {
40
36
  BlacklightRangeLimit.turnIntoPlot($(this).parent());
@@ -44,6 +40,9 @@ Blacklight.onLoad(function() {
44
40
  BlacklightRangeLimit.checkForNeededFacetsToFetch();
45
41
  });
46
42
 
43
+ // Use a mutation observer to detect when the HTML dialog is open
44
+ BlacklightRangeLimit.initPlotModalObserver(modalSelector);
45
+
47
46
  $("body").on("shown.bs.collapse", function(event) {
48
47
  var container = $(event.target).filter(".facet-content").find(".chart_js");
49
48
  BlacklightRangeLimit.redrawPlot(container);
@@ -74,4 +73,4 @@ Blacklight.onLoad(function() {
74
73
  BlacklightRangeLimit.redrawPlot($(container));
75
74
  });
76
75
  }, 350));
77
- });
76
+ }
@@ -5,8 +5,9 @@
5
5
  // bootstrap show event, but the animation hasn't barely begun yet -- but
6
6
  // we don't want to wait until it's finished, we want to start rendering
7
7
  // as soon as we can.
8
- //
9
- // We also will
8
+
9
+ import BlacklightRangeLimit from 'range_limit_shared'
10
+
10
11
  BlacklightRangeLimit.turnIntoPlot = function turnIntoPlot(container, wait_for_visible) {
11
12
  // flot can only render in a a div with a defined width.
12
13
  // for instance, a hidden div can't generally be rendered in (although if you set
@@ -70,4 +70,43 @@ BlacklightRangeLimit.normalized_selection = function normalized_selection(min, m
70
70
  // Check if Flot is loaded
71
71
  BlacklightRangeLimit.domDependenciesMet = function domDependenciesMet() {
72
72
  return typeof $.plot != "undefined"
73
- }
73
+ }
74
+
75
+ BlacklightRangeLimit.modalObserverConfig = {
76
+ attributes: true,
77
+ }
78
+
79
+ BlacklightRangeLimit.initSliderModalObserver = function(modalSelector) {
80
+ // Use a mutation observer to detect when the modal dialog is open
81
+ const modalObserver = new MutationObserver(function(mutations) {
82
+ mutations.forEach(function(mutation) {
83
+ if (mutation.attributeName !== 'open') {return;}
84
+ if (mutation.target.hasAttribute('open')) {
85
+ $(modalSelector).find(".range_limit .profile .range.slider_js").each(function() {
86
+ BlacklightRangeLimit.buildSlider(this);
87
+ });
88
+ }
89
+ });
90
+ });
91
+ modalObserver.observe(document.querySelector(modalSelector), BlacklightRangeLimit.modalObserverConfig);
92
+ }
93
+
94
+ BlacklightRangeLimit.initPlotModalObserver = function(modalSelector) {
95
+ // Use a mutation observer to detect when the modal dialog is open
96
+ const modalObserver = new MutationObserver(function(mutations) {
97
+ mutations.forEach(function(mutation) {
98
+ if (mutation.attributeName !== 'open') {return;}
99
+ if (mutation.target.hasAttribute('open')) {
100
+ $(modalSelector).find(".range_limit .profile .distribution.chart_js ul").each(function() {
101
+ BlacklightRangeLimit.turnIntoPlot($(this).parent());
102
+ });
103
+
104
+ // Case when there is no currently selected range
105
+ BlacklightRangeLimit.checkForNeededFacetsToFetch();
106
+ }
107
+ });
108
+ });
109
+ modalObserver.observe(document.querySelector(modalSelector), BlacklightRangeLimit.modalObserverConfig);
110
+ }
111
+
112
+ export default BlacklightRangeLimit
@@ -1,20 +1,22 @@
1
1
  // for Blacklight.onLoad:
2
+ import BlacklightRangeLimit from 'range_limit_shared'
2
3
 
3
- Blacklight.onLoad(function() {
4
+ BlacklightRangeLimit.initializeSlider = function(modalSelector) {
4
5
 
5
6
  $(".range_limit .profile .range.slider_js").each(function() {
6
7
  BlacklightRangeLimit.buildSlider(this);
7
8
  });
8
9
 
9
- // Support for Blacklight 7 and 8:
10
- const modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector
11
-
10
+ // For Blacklight < 8, when loaded in a modal
12
11
  $(modalSelector).on('shown.bs.modal', function() {
13
12
  $(this).find(".range_limit .profile .range.slider_js").each(function() {
14
13
  BlacklightRangeLimit.buildSlider(this);
15
14
  });
16
15
  });
17
16
 
17
+ // For Blacklight 8, use a mutation observer to detect when the HTML dialog is open
18
+ BlacklightRangeLimit.initSliderModalObserver(modalSelector);
19
+
18
20
  // catch event for redrawing chart, to redraw slider to match width
19
21
  $("body").on("plotDrawn.blacklight.rangeLimit", function(event) {
20
22
  var area = $(event.target).closest(".limit_content.range_limit");
@@ -26,7 +28,7 @@ Blacklight.onLoad(function() {
26
28
  slider_el.css("display", "block")
27
29
  }
28
30
  });
29
- });
31
+ }
30
32
 
31
33
  // returns two element array min/max as numbers. If there is a limit applied,
32
34
  // it's boundaries are are limits. Otherwise, min/max in current result
@@ -0,0 +1,13 @@
1
+ import BlacklightRangeLimit from 'range_limit_shared'
2
+ import RangeLimitDistroFacet from 'range_limit_distro_facets'
3
+ import RangeLimitSlider from 'range_limit_slider'
4
+
5
+ BlacklightRangeLimit.initialize = function() {
6
+ // Support for Blacklight 7 and 8:
7
+ const modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector
8
+
9
+ RangeLimitDistroFacet.initialize(modalSelector)
10
+ RangeLimitSlider.initialize(modalSelector)
11
+ }
12
+
13
+ export default BlacklightRangeLimit
data/package-lock.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "blacklight-range-limit",
3
+ "version": "8.3.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "blacklight-range-limit",
9
+ "version": "8.3.0",
10
+ "license": "Apache-2.0",
11
+ "devDependencies": {
12
+ "rollup": "^2.60.0",
13
+ "rollup-plugin-includepaths": "^0.2.4"
14
+ }
15
+ },
16
+ "node_modules/fsevents": {
17
+ "version": "2.3.3",
18
+ "dev": true,
19
+ "license": "MIT",
20
+ "optional": true,
21
+ "os": [
22
+ "darwin"
23
+ ],
24
+ "engines": {
25
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
26
+ }
27
+ },
28
+ "node_modules/rollup": {
29
+ "version": "2.79.1",
30
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
31
+ "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
32
+ "dev": true,
33
+ "bin": {
34
+ "rollup": "dist/bin/rollup"
35
+ },
36
+ "engines": {
37
+ "node": ">=10.0.0"
38
+ },
39
+ "optionalDependencies": {
40
+ "fsevents": "~2.3.2"
41
+ }
42
+ },
43
+ "node_modules/rollup-plugin-includepaths": {
44
+ "version": "0.2.4",
45
+ "resolved": "https://registry.npmjs.org/rollup-plugin-includepaths/-/rollup-plugin-includepaths-0.2.4.tgz",
46
+ "integrity": "sha512-iZen+XKVExeCzk7jeSZPJKL7B67slZNr8GXSC5ROBXtDGXDBH8wdjMfdNW5hf9kPt+tHyIvWh3wlE9bPrZL24g==",
47
+ "dev": true
48
+ }
49
+ }
50
+ }
data/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "blacklight-range-limit",
3
- "version": "8.3.0",
3
+ "version": "8.5.0",
4
4
  "description": "A range facet UI component plugin for blacklight",
5
5
  "main": "app/assets/javascripts/blacklight_range_limit",
6
+ "type": "module",
6
7
  "scripts": {
8
+ "prepare": "rollup --config rollup.config.js --sourcemap && ESM=true rollup --config rollup.config.js --sourcemap"
7
9
  },
8
10
  "repository": {
9
11
  "type": "git",
10
12
  "url": "git+https://github.com/projectblacklight/blacklight_range_limit.git"
11
13
  },
12
14
  "files": [
13
- "app/assets", "vendor/assets"
15
+ "app/assets",
16
+ "vendor/assets"
14
17
  ],
15
18
  "author": "",
16
19
  "license": "Apache-2.0",
@@ -18,12 +21,12 @@
18
21
  "url": "https://github.com/projectblacklight/blacklight_range_limit/issues"
19
22
  },
20
23
  "homepage": "https://github.com/projectblacklight/blacklight_range_limit#readme",
21
- "devDependencies": {
22
- },
23
24
  "browserslist": [
24
25
  "defaults",
25
26
  "not IE 11"
26
27
  ],
27
- "dependencies": {
28
+ "devDependencies": {
29
+ "rollup": "^2.60.0",
30
+ "rollup-plugin-includepaths": "^0.2.4"
28
31
  }
29
32
  }
data/rollup.config.js ADDED
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import includePaths from 'rollup-plugin-includepaths';
4
+
5
+ const path = require('path')
6
+
7
+ const BUNDLE = process.env.BUNDLE === 'true'
8
+ const ESM = process.env.ESM === 'true'
9
+
10
+ const fileDest = `blacklight_range_limit${ESM ? '.esm' : '.umd'}`
11
+ const external = []
12
+ const globals = {}
13
+
14
+ let includePathOptions = {
15
+ include: {},
16
+ paths: ['app/javascript'],
17
+ external: [],
18
+ extensions: ['.js']
19
+ };
20
+
21
+ const rollupConfig = {
22
+ input: path.resolve(__dirname, `app/javascript/blacklight_range_limit/index.js`),
23
+ output: {
24
+ file: path.resolve(__dirname, `app/assets/javascripts/blacklight_range_limit/${fileDest}.js`),
25
+ format: ESM ? 'esm' : 'umd',
26
+ globals,
27
+ generatedCode: 'es2015'
28
+ },
29
+ external,
30
+ plugins: [includePaths(includePathOptions)]
31
+ }
32
+
33
+ if (!ESM) {
34
+ rollupConfig.output.name = 'BlacklightRangeLimit'
35
+ }
36
+
37
+ module.exports = rollupConfig
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_range_limit
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-02 00:00:00.000000000 Z
12
+ date: 2024-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -194,10 +194,10 @@ files:
194
194
  - Rakefile
195
195
  - VERSION
196
196
  - app/assets/javascripts/blacklight_range_limit.js
197
- - app/assets/javascripts/blacklight_range_limit/range_limit_distro_facets.js
198
- - app/assets/javascripts/blacklight_range_limit/range_limit_plotting.js
199
- - app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
200
- - app/assets/javascripts/blacklight_range_limit/range_limit_slider.js
197
+ - app/assets/javascripts/blacklight_range_limit/blacklight_range_limit.esm.js
198
+ - app/assets/javascripts/blacklight_range_limit/blacklight_range_limit.esm.js.map
199
+ - app/assets/javascripts/blacklight_range_limit/blacklight_range_limit.umd.js
200
+ - app/assets/javascripts/blacklight_range_limit/blacklight_range_limit.umd.js.map
201
201
  - app/assets/stylesheets/blacklight_range_limit.css
202
202
  - app/assets/stylesheets/blacklight_range_limit/blacklight_range_limit.css
203
203
  - app/components/blacklight_range_limit/range_facet_component.html.erb
@@ -207,6 +207,12 @@ files:
207
207
  - app/components/blacklight_range_limit/range_segments_component.html.erb
208
208
  - app/components/blacklight_range_limit/range_segments_component.rb
209
209
  - app/helpers/range_limit_helper.rb
210
+ - app/javascript/blacklight_range_limit/index.js
211
+ - app/javascript/blacklight_range_limit/range_limit_distro_facets.js
212
+ - app/javascript/blacklight_range_limit/range_limit_plotting.js
213
+ - app/javascript/blacklight_range_limit/range_limit_shared.js
214
+ - app/javascript/blacklight_range_limit/range_limit_slider.js
215
+ - app/javascripts/blacklight_range_limit/index.js
210
216
  - app/presenters/blacklight_range_limit/facet_field_presenter.rb
211
217
  - app/presenters/blacklight_range_limit/facet_item_presenter.rb
212
218
  - app/presenters/blacklight_range_limit/filter_field.rb
@@ -235,7 +241,9 @@ files:
235
241
  - lib/generators/blacklight_range_limit/assets_generator.rb
236
242
  - lib/generators/blacklight_range_limit/install_generator.rb
237
243
  - lib/tasks/blacklight_range_limit.rake
244
+ - package-lock.json
238
245
  - package.json
246
+ - rollup.config.js
239
247
  - solr/conf/_rest_managed.json
240
248
  - solr/conf/admin-extra.html
241
249
  - solr/conf/elevate.xml
@@ -299,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
307
  - !ruby/object:Gem::Version
300
308
  version: '0'
301
309
  requirements: []
302
- rubygems_version: 3.4.21
310
+ rubygems_version: 3.5.4
303
311
  signing_key:
304
312
  specification_version: 4
305
313
  summary: Blacklight Range Limit plugin