blacklight_range_limit 7.7.0 → 7.8.0
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 +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight_range_limit/range_limit_distro_facets.js +5 -5
- data/app/assets/javascripts/blacklight_range_limit/range_limit_slider.js +4 -4
- data/app/helpers/range_limit_helper.rb +20 -3
- data/app/views/blacklight_range_limit/_range_limit_panel.html.erb +1 -1
- data/app/views/blacklight_range_limit/_range_segments.html.erb +4 -2
- data/config/locales/blacklight_range_limit.ar.yml +2 -2
- data/config/locales/blacklight_range_limit.en.yml +2 -2
- data/spec/test_app_templates/Gemfile.extra +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c31bc65d3f409a118dffda97b7b744f1d846151e57e7c64b3757660fb2af23c
|
4
|
+
data.tar.gz: baf34fb3d88a9f0d438b3689dfd51aa1ec3dfc4e5636ef654bc414a46ff17646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c4dd6d2ce9248b5587687d3b2f56db705ebb2915e1e6772e799493bad5c1bb4d47a822eeb5319c3daba2f88d7f60b62188f9856cb0dbbd16feb2c9e4f78294d
|
7
|
+
data.tar.gz: b08cc82a380cedb3ed79122c5dd92a21e0232c6e6fa5644b66cb82e67787e71126c382be80bab556786fb852e40c4557cb2524242af58877048fe89f7a134f03
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ config.add_facet_field 'pub_date', label: 'Publication Year', range: true
|
|
52
52
|
You should now get range limit display. More complicated configuration is available if desired, see Range Facet Configuration below.
|
53
53
|
|
54
54
|
|
55
|
-
You can also configure the look and feel of the Flot chart using the jQuery .data() method. On the `.facet-limit` container you want to configure, add a Flot options associative array (documented at http://people.iola.dk/olau/flot/API.txt) as the `plot-config` key. The `plot-config` key to set the `plot-config` key on the appropriate `.facet-limit` container. In order to customize the plot colors, for example, you could use this code:
|
55
|
+
You can also configure the look and feel of the Flot chart using the jQuery .data() method. On the `.blrl-plot-config` or `.facet-limit` container you want to configure, add a Flot options associative array (documented at http://people.iola.dk/olau/flot/API.txt) as the `plot-config` key. The `plot-config` key to set the `plot-config` key on the appropriate `.blrl-plot-config` or `.facet-limit` container. In order to customize the plot colors, for example, you could use this code:
|
56
56
|
|
57
57
|
```javascript
|
58
58
|
$('.blacklight-year_i').data('plot-config', {
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.8.0
|
@@ -166,12 +166,12 @@ Blacklight.onLoad(function() {
|
|
166
166
|
var series_data = new Array();
|
167
167
|
var pointer_lookup = new Array();
|
168
168
|
var x_ticks = new Array();
|
169
|
-
var min = BlacklightRangeLimit.parseNum($(container).find("ul li:first-child span.from").
|
170
|
-
var max = BlacklightRangeLimit.parseNum($(container).find("ul li:last-child span.to").
|
169
|
+
var min = BlacklightRangeLimit.parseNum($(container).find("ul li:first-child span.from").first().data('blrlBegin'));
|
170
|
+
var max = BlacklightRangeLimit.parseNum($(container).find("ul li:last-child span.to").first().data('blrlEnd'));
|
171
171
|
|
172
172
|
$(container).find("ul li").each(function() {
|
173
|
-
var from = BlacklightRangeLimit.parseNum($(this).find("span.from").
|
174
|
-
var to = BlacklightRangeLimit.parseNum($(this).find("span.to").
|
173
|
+
var from = BlacklightRangeLimit.parseNum($(this).find("span.from").first().data('blrlBegin'));
|
174
|
+
var to = BlacklightRangeLimit.parseNum($(this).find("span.to").first().data('blrlEnd'));
|
175
175
|
var count = BlacklightRangeLimit.parseNum($(this).find("span.count").text());
|
176
176
|
var avg = (count / (to - from + 1));
|
177
177
|
|
@@ -191,7 +191,7 @@ Blacklight.onLoad(function() {
|
|
191
191
|
|
192
192
|
|
193
193
|
var plot;
|
194
|
-
var config = $(container).closest('.facet-limit').data('plot-config') || {};
|
194
|
+
var config = $(container).closest('.blrl-plot-config').data('plot-config') || $(container).closest('.facet-limit').data('plot-config') || {};
|
195
195
|
|
196
196
|
try {
|
197
197
|
plot = $.plot($(container), [series_data],
|
@@ -33,10 +33,10 @@ function min_max(range_element) {
|
|
33
33
|
|
34
34
|
|
35
35
|
|
36
|
-
var min = max = BlacklightRangeLimit.parseNum(current_limit.find(".single").
|
36
|
+
var min = max = BlacklightRangeLimit.parseNum(current_limit.find(".single").data('blrlSingle'))
|
37
37
|
if ( isNaN(min)) {
|
38
|
-
min = BlacklightRangeLimit.parseNum(current_limit.find(".from").first().
|
39
|
-
max = BlacklightRangeLimit.parseNum(current_limit.find(".to").first().
|
38
|
+
min = BlacklightRangeLimit.parseNum(current_limit.find(".from").first().data('blrlBegin'));
|
39
|
+
max = BlacklightRangeLimit.parseNum(current_limit.find(".to").first().data('blrlEnd'));
|
40
40
|
}
|
41
41
|
|
42
42
|
if (isNaN(min) || isNaN(max)) {
|
@@ -44,7 +44,7 @@ function min_max(range_element) {
|
|
44
44
|
min = BlacklightRangeLimit.parseNum($(range_element).find(".min").first().text());
|
45
45
|
max = BlacklightRangeLimit.parseNum($(range_element).find(".max").first().text());
|
46
46
|
}
|
47
|
-
|
47
|
+
console.log(min, max)
|
48
48
|
return [min, max]
|
49
49
|
}
|
50
50
|
|
@@ -42,13 +42,30 @@ module RangeLimitHelper
|
|
42
42
|
return t('blacklight.range_limit.missing')
|
43
43
|
elsif hash["begin"] || hash["end"]
|
44
44
|
if hash["begin"] == hash["end"]
|
45
|
-
return t(
|
45
|
+
return t(
|
46
|
+
'blacklight.range_limit.single_html',
|
47
|
+
begin: format_range_display_value(hash['begin'], solr_field),
|
48
|
+
begin_value: hash['begin']
|
49
|
+
)
|
46
50
|
else
|
47
|
-
return t(
|
51
|
+
return t(
|
52
|
+
'blacklight.range_limit.range_html',
|
53
|
+
begin: format_range_display_value(hash['begin'], solr_field),
|
54
|
+
begin_value: hash['begin'],
|
55
|
+
end: format_range_display_value(hash['end'], solr_field),
|
56
|
+
end_value: hash['end']
|
57
|
+
)
|
48
58
|
end
|
49
59
|
end
|
50
60
|
|
51
|
-
|
61
|
+
''
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# A method that is meant to be overridden downstream to format how a range
|
66
|
+
# label might be displayed to a user. By default it just returns the value.
|
67
|
+
def format_range_display_value(value, _solr_field)
|
68
|
+
value
|
52
69
|
end
|
53
70
|
|
54
71
|
# Show the limit area if:
|
@@ -7,7 +7,7 @@
|
|
7
7
|
maxlength = field_config[:maxlength]
|
8
8
|
-%>
|
9
9
|
|
10
|
-
<div class="limit_content range_limit">
|
10
|
+
<div class="limit_content range_limit <%= field_name %>-config blrl-plot-config">
|
11
11
|
<% if has_selected_range_limit?(field_name) %>
|
12
12
|
<ul class="current list-unstyled facet-values">
|
13
13
|
<li class="selected">
|
@@ -7,8 +7,10 @@
|
|
7
7
|
<span class="facet-label">
|
8
8
|
<%= link_to(
|
9
9
|
t('blacklight.range_limit.range_html',
|
10
|
-
begin: facet_display_value(solr_field, hash[:from]),
|
11
|
-
|
10
|
+
begin: format_range_display_value(facet_display_value(solr_field, hash[:from]), solr_field),
|
11
|
+
begin_value: facet_display_value(solr_field, hash[:from]),
|
12
|
+
end: format_range_display_value(facet_display_value(solr_field, hash[:to]), solr_field),
|
13
|
+
end_value: facet_display_value(solr_field, hash[:to])),
|
12
14
|
search_action_url(add_range(solr_field, hash[:from], hash[:to]).except(:controller, :action)),
|
13
15
|
class: 'facet_select'
|
14
16
|
) %>
|
@@ -9,5 +9,5 @@ ar:
|
|
9
9
|
view_distribution: 'عرض التوزيع'
|
10
10
|
view_larger: 'عرض بحجم أكبر »'
|
11
11
|
results_range_html: 'تمتد النتائج الحالية من <span class="min">%{min}</span> إلى<span class="max">%{max}</span>'
|
12
|
-
single_html: '<span class="single">%{begin}</span>'
|
13
|
-
range_html: '<span class="from">%{begin}</span> إلى<span class="to">%{end}</span>'
|
12
|
+
single_html: '<span class="single" data-blrl-single="%{begin_value}">%{begin}</span>'
|
13
|
+
range_html: '<span class="from" data-blrl-begin="%{begin_value}">%{begin}</span> إلى<span class="to" data-blrl-end="%{end_value}">%{end}</span>'
|
@@ -9,5 +9,5 @@ en:
|
|
9
9
|
view_distribution: 'View distribution'
|
10
10
|
view_larger: 'View larger »'
|
11
11
|
results_range_html: 'Current results range from <span class="min">%{min}</span> to <span class="max">%{max}</span>'
|
12
|
-
single_html: '<span class="single">%{begin}</span>'
|
13
|
-
range_html: '<span class="from">%{begin}</span> to <span class="to">%{end}</span>'
|
12
|
+
single_html: '<span class="single" data-blrl-single="%{begin_value}">%{begin}</span>'
|
13
|
+
range_html: '<span class="from" data-blrl-begin="%{begin_value}">%{begin}</span> to <span class="to" data-blrl-end="%{end_value}">%{end}</span>'
|
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: 7.
|
4
|
+
version: 7.8.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: 2020-04-
|
12
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|