blacklight_range_limit 2.3.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -2
- data/.travis.yml +7 -13
- data/Gemfile +8 -34
- data/LICENSE +15 -0
- data/README.rdoc +25 -7
- data/Rakefile +3 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight_range_limit.js +5 -2
- data/app/assets/javascripts/blacklight_range_limit/range_limit_distro_facets.js +144 -68
- data/app/assets/javascripts/blacklight_range_limit/range_limit_slider.js +68 -36
- data/app/assets/stylesheets/blacklight_range_limit.css.scss +1 -46
- data/app/assets/stylesheets/blacklight_range_limit/blacklight_range_limit.css +12 -2
- data/app/helpers/range_limit_helper.rb +7 -1
- data/app/views/blacklight_range_limit/_range_limit_panel.html.erb +27 -11
- data/app/views/blacklight_range_limit/_range_segments.html.erb +13 -8
- data/blacklight_range_limit.gemspec +9 -12
- data/config/jetty.yml +7 -2
- data/lib/blacklight_range_limit/controller_override.rb +4 -13
- data/lib/blacklight_range_limit/route_sets.rb +21 -4
- data/lib/blacklight_range_limit/view_helper_override.rb +27 -11
- data/lib/generators/blacklight_range_limit/assets_generator.rb +9 -2
- data/spec/features/blacklight_range_limit_spec.rb +5 -5
- data/spec/spec_helper.rb +7 -1
- data/spec/test_app_templates/Gemfile.extra +14 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -15
- data/spec/test_app_templates/lib/tasks/blacklight_test_app.rake +0 -6
- data/vendor/assets/javascripts/bootstrap-slider.js +388 -0
- data/vendor/assets/javascripts/flot/excanvas.min.js +1 -1
- data/vendor/assets/javascripts/flot/jquery.flot.js +1328 -790
- data/vendor/assets/javascripts/flot/jquery.flot.selection.js +76 -60
- data/vendor/assets/stylesheets/slider.css +138 -0
- metadata +74 -110
- checksums.yaml +0 -7
- data/.rspec +0 -1
- data/MIT-LICENSE +0 -20
- data/solr/sample_solr_documents.yml +0 -641
- data/vendor/assets/javascripts/jquery-ui-1.9.2.custom.js +0 -1654
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.3.7
|
1
|
+
notifications:
|
2
|
+
email: false
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
env: "RAILS_VERSION=4.0.13"
|
10
|
-
- rvm: 2.3.7
|
11
|
-
env: "RAILS_VERSION=4.1.16"
|
12
|
-
- rvm: 2.3.7
|
13
|
-
env: "RAILS_VERSION=4.2.10"
|
4
|
+
rvm:
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
14
7
|
|
15
8
|
notifications:
|
16
9
|
irc: "irc.freenode.org#blacklight"
|
17
|
-
email:
|
10
|
+
email:
|
11
|
+
- blacklight-commits@googlegroups.com
|
data/Gemfile
CHANGED
@@ -1,42 +1,16 @@
|
|
1
|
-
source '
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
eval_gemfile file
|
13
|
-
rescue Bundler::GemfileError => e
|
14
|
-
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
15
|
-
Bundler.ui.warn e.message
|
16
|
-
end
|
17
|
-
else
|
18
|
-
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
19
|
-
if ENV['RAILS_VERSION']
|
20
|
-
if ENV['RAILS_VERSION'] == 'edge'
|
21
|
-
gem 'rails', github: 'rails/rails'
|
22
|
-
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
|
23
|
-
else
|
24
|
-
gem 'rails', ENV['RAILS_VERSION']
|
25
|
-
end
|
26
|
-
end
|
27
|
-
case ENV['RAILS_VERSION']
|
28
|
-
when /^4.2/
|
29
|
-
gem 'responders', '~> 2.0'
|
30
|
-
gem 'sass-rails', '>= 5.0'
|
31
|
-
gem 'coffee-rails', '~> 4.1.0'
|
32
|
-
when /^4.[01]/
|
33
|
-
gem 'sass-rails', '< 5.0'
|
34
|
-
end
|
5
|
+
gem 'engine_cart'
|
6
|
+
|
7
|
+
group :test do
|
8
|
+
gem 'devise'
|
9
|
+
gem 'devise-guests'
|
10
|
+
gem "bootstrap-sass"
|
11
|
+
gem 'turbolinks'
|
35
12
|
end
|
36
|
-
# END ENGINE_CART BLOCK
|
37
13
|
|
38
14
|
if File.exists?('spec/test_app_templates/Gemfile.extra')
|
39
15
|
eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
|
40
16
|
end
|
41
|
-
|
42
|
-
gem 'json', '~> 1.8'
|
data/LICENSE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
##########################################################################
|
2
|
+
# Copyright 2010-2014 The Board of Trustees of the Leland Stanford Junior University, and Johns Hopkins Universities.
|
3
|
+
# Additional copyright may be held by others, as reflected in the commit log
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
data/README.rdoc
CHANGED
@@ -25,7 +25,7 @@ The pre Solr 1.4 now deprecated sint or slong types should work fine too.
|
|
25
25
|
|
26
26
|
= Installation
|
27
27
|
|
28
|
-
|
28
|
+
Current 5.x version of `blacklight_range_limit` work with `blacklight` 5.x -- we now synchronize the _major version number_ between `blacklight` and `blacklight_range_limit`. `blacklight_range_limit` 2.1 is the last version believed to work with blacklight 4.x or possibly blacklight 3.x.
|
29
29
|
|
30
30
|
Add
|
31
31
|
|
@@ -92,7 +92,7 @@ Instead of simply passing "true", you can pass a hash with additional configurat
|
|
92
92
|
|
93
93
|
== Javascript dependencies
|
94
94
|
|
95
|
-
The selectable histograms/barcharts are done with Javascript, using Flot[http://code.google.com/p/flot/]. Flot requires JQuery, as well as support for the HTML5 canvas element. In IE previous to IE9, canvas element support
|
95
|
+
The selectable histograms/barcharts are done with Javascript, using Flot[http://code.google.com/p/flot/]. Flot requires JQuery, as well as support for the HTML5 canvas element. In IE previous to IE9, canvas element support can be added with excanvas[http://excanvas.sourceforge.net/]. For the slider, [bootstrap-slider](http://www.eyecon.ro/bootstrap-slider/) is used (bootstrap-slider is actually third party, not officially bootstrap). Flot and bootstrap-slider are both directly included in blacklight_range_limit in vendor.
|
96
96
|
|
97
97
|
A `require 'blacklight_range_limit'` in a Rails asset pipeline manifest file will automatically include all of these things. The blacklight_range_limit adds just this line to your `app/assets/application.js`.
|
98
98
|
|
@@ -102,7 +102,28 @@ Note this means a copy of jquery, from the jquery-rails gem, will be included in
|
|
102
102
|
|
103
103
|
If you don't want any of this gem's JS, you can simply remove the `require 'blacklight_range_limit'` line from your application.js, and hack something else together yourself.
|
104
104
|
|
105
|
-
|
105
|
+
== IE8, excanvas
|
106
|
+
|
107
|
+
IE8 and below do not support the 'canvas' element, needed for flot to render the chart.
|
108
|
+
Without canvas, view will cleanly degrade to an ordinary textual listing of range segments
|
109
|
+
as facets.
|
110
|
+
|
111
|
+
Or, you can use excanvas.js to add canvas support to IE. blacklight_range_limit includes
|
112
|
+
the excanvas.js file, but you'll have to manually add a reference to it to your Rails layout
|
113
|
+
template -- if you were previously using the stock Blacklight layout, you'll have to add a
|
114
|
+
local custom layout instead. Then add this to the html <head> section:
|
115
|
+
|
116
|
+
<!--[if lte IE 8]><%= javascript_include_tag 'flot/excanvas.min' %><![endif]-->
|
117
|
+
|
118
|
+
== Touch?
|
119
|
+
|
120
|
+
For touch screens, one wants the UI to work well. The slider used is
|
121
|
+
[bootstrap_slider](http://www.eyecon.ro/bootstrap-slider/), which says if you add
|
122
|
+
Modernizr to your page, touch events will be supported. We haven't tested it
|
123
|
+
ourselves yet.
|
124
|
+
|
125
|
+
Also not sure how well the flot select UI works on a touch screen. The slider
|
126
|
+
is probably the best touch UI anyway, if it can be made to work well.
|
106
127
|
|
107
128
|
|
108
129
|
== Injection
|
@@ -122,8 +143,7 @@ You can also turn off injection of individual components, which could be more us
|
|
122
143
|
BlacklightRangeLimit.omit_inject = {
|
123
144
|
:view_helpers => false,
|
124
145
|
:controller_mixin => false,
|
125
|
-
:routes => false
|
126
|
-
:excanvas => false
|
146
|
+
:routes => false
|
127
147
|
}
|
128
148
|
[:view_helpers]
|
129
149
|
Set to false and the plugin will not insert it's own rails view helpers into the app. It will raise lots of errors if you do this, you probably don't want to.
|
@@ -131,8 +151,6 @@ You can also turn off injection of individual components, which could be more us
|
|
131
151
|
The plugin mixes some methods into CatalogController, both over-riding Blacklight methods, and providing a new action of it's own. Set to false, and the plugin won't. You've basically disabled the plugin if you do this.
|
132
152
|
[:routes]
|
133
153
|
Disable automatic routes loading
|
134
|
-
[:excanvas]
|
135
|
-
Disables injection of a conditionally-commented script tag to load the excanvas library for supporting 'canvas' on IE. blacklight_range_limit does this in the controller mixin, using Blacklight's "extra_head_content" feature to add actual conditional script tag for IE in html <head>.
|
136
154
|
|
137
155
|
See Javascript Dependencies above for disabling injection of gem's js.
|
138
156
|
|
data/Rakefile
CHANGED
@@ -24,8 +24,7 @@ RSpec::Core::RakeTask.new do |t|
|
|
24
24
|
end
|
25
25
|
|
26
26
|
task :ci => ['jetty:clean', 'engine_cart:generate'] do
|
27
|
-
|
28
|
-
jetty_params = Jettywrapper.load_config
|
27
|
+
jetty_params = Jettywrapper.load_config('test')
|
29
28
|
jetty_params[:startup_wait]= 60
|
30
29
|
error = Jettywrapper.wrap(jetty_params) do
|
31
30
|
Rake::Task["test:seed"].invoke
|
@@ -38,9 +37,9 @@ namespace :test do
|
|
38
37
|
|
39
38
|
desc "Put sample data into solr"
|
40
39
|
task :seed => ['engine_cart:generate'] do
|
41
|
-
docs = File.join(APP_ROOT, 'solr', 'sample_solr_documents.yml')
|
42
40
|
within_test_app do
|
43
|
-
|
41
|
+
ENV['RAILS_ENV'] ||= 'test'
|
42
|
+
system "rake blacklight:solr:seed"
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5.0.0
|
@@ -3,8 +3,11 @@
|
|
3
3
|
// require does not need to change if we change file list.
|
4
4
|
|
5
5
|
//= require 'jquery'
|
6
|
-
|
6
|
+
|
7
7
|
//= require 'flot/jquery.flot.js'
|
8
8
|
//= require 'flot/jquery.flot.selection.js'
|
9
|
-
//= require bootstrap-
|
9
|
+
//= require 'bootstrap-slider'
|
10
|
+
|
11
|
+
//= require bootstrap/tooltip
|
12
|
+
|
10
13
|
//= require_tree './blacklight_range_limit'
|
@@ -1,4 +1,18 @@
|
|
1
|
-
|
1
|
+
// for Blacklight.onLoad:
|
2
|
+
//= require blacklight/core
|
3
|
+
|
4
|
+
/* A custom event "plotDrawn.blacklight.rangeLimit" will be sent when flot plot
|
5
|
+
is (re-)drawn on screen possibly with a new size. target of event will be the DOM element
|
6
|
+
containing the plot. Used to resize slider to match. */
|
7
|
+
|
8
|
+
Blacklight.onLoad(function() {
|
9
|
+
// ratio of width to height for desired display, multiply width by this ratio
|
10
|
+
// to get height. hard-coded in for now.
|
11
|
+
var display_ratio = 1/(1.618 * 2); // half a golden rectangle, why not
|
12
|
+
var redrawnEvent = "plotDrawn.blacklight.rangeLimit";
|
13
|
+
|
14
|
+
|
15
|
+
|
2
16
|
// Facets already on the page? Turn em into a chart.
|
3
17
|
$(".range_limit .profile .distribution.chart_js ul").each(function() {
|
4
18
|
turnIntoPlot($(this).parent());
|
@@ -16,13 +30,118 @@ jQuery(document).ready(function($) {
|
|
16
30
|
});
|
17
31
|
});
|
18
32
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
33
|
+
// Listen for twitter bootstrap collapsible open events, to render flot
|
34
|
+
// in previously hidden divs on open, if needed.
|
35
|
+
$("body").on("show.bs.collapse", function(event) {
|
36
|
+
// Was the target a .facet-content including a .chart-js?
|
37
|
+
var container = $(event.target).filter(".facet-content").find(".chart_js");
|
38
|
+
|
39
|
+
// only if it doesn't already have a canvas, it isn't already drawn
|
40
|
+
if (container && container.find("canvas").size() == 0) {
|
41
|
+
// be willing to wait up to 1100ms for container to
|
42
|
+
// have width -- right away on show.bs is too soon, but
|
43
|
+
// shown.bs is later than we want, we want to start rendering
|
44
|
+
// while animation is still in progress.
|
45
|
+
turnIntoPlot(container, 1100);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// after a collapsible facet contents is fully shown,
|
52
|
+
// resize the flot chart to current conditions. This way, if you change
|
53
|
+
// browser window size, you can get chart resized to fit by closing and opening
|
54
|
+
// again, if needed.
|
55
|
+
|
56
|
+
function redrawPlot(container) {
|
57
|
+
if (container && container.width() > 0) {
|
58
|
+
// resize the container's height, since width may have changed.
|
59
|
+
container.height( container.width() * display_ratio );
|
60
|
+
|
61
|
+
// redraw the chart.
|
62
|
+
var plot = container.data("plot");
|
63
|
+
if (plot) {
|
64
|
+
// how to redraw after possible resize?
|
65
|
+
// Cribbed from https://github.com/flot/flot/blob/master/jquery.flot.resize.js
|
66
|
+
plot.resize();
|
67
|
+
plot.setupGrid();
|
68
|
+
plot.draw();
|
69
|
+
// plus trigger redraw of the selection, which otherwise ain't always right
|
70
|
+
// we'll trigger a fake event on one of the boxes
|
71
|
+
var form = $(container).closest(".limit_content").find("form.range_limit");
|
72
|
+
form.find("input.range_begin").trigger("change");
|
73
|
+
|
74
|
+
// send our custom event to trigger redraw of slider
|
75
|
+
$(container).trigger(redrawnEvent);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
$("body").on("shown.bs.collapse", function(event) {
|
81
|
+
var container = $(event.target).filter(".facet-content").find(".chart_js");
|
82
|
+
redrawPlot(container);
|
83
|
+
});
|
84
|
+
|
85
|
+
// debouce borrowed from underscore
|
86
|
+
// Returns a function, that, as long as it continues to be invoked, will not
|
87
|
+
// be triggered. The function will be called after it stops being called for
|
88
|
+
// N milliseconds. If `immediate` is passed, trigger the function on the
|
89
|
+
// leading edge, instead of the trailing.
|
90
|
+
debounce = function(func, wait, immediate) {
|
91
|
+
var timeout;
|
92
|
+
return function() {
|
93
|
+
var context = this, args = arguments;
|
94
|
+
var later = function() {
|
95
|
+
timeout = null;
|
96
|
+
if (!immediate) func.apply(context, args);
|
97
|
+
};
|
98
|
+
var callNow = immediate && !timeout;
|
99
|
+
clearTimeout(timeout);
|
100
|
+
timeout = setTimeout(later, wait);
|
101
|
+
if (callNow) func.apply(context, args);
|
102
|
+
};
|
103
|
+
};
|
104
|
+
|
105
|
+
$(window).on("resize", debounce(function() {
|
106
|
+
$(".chart_js").each(function(i, container) {
|
107
|
+
redrawPlot($(container));
|
108
|
+
});
|
109
|
+
}, 350));
|
110
|
+
|
111
|
+
// second arg, if provided, is a number of ms we're willing to
|
112
|
+
// wait for the container to have width before giving up -- we'll
|
113
|
+
// set 50ms timers to check back until timeout is expired or the
|
114
|
+
// container is finally visible. The timeout is used when we catch
|
115
|
+
// bootstrap show event, but the animation hasn't barely begun yet -- but
|
116
|
+
// we don't want to wait until it's finished, we want to start rendering
|
117
|
+
// as soon as we can.
|
118
|
+
//
|
119
|
+
// We also will
|
120
|
+
function turnIntoPlot(container, wait_for_visible) {
|
121
|
+
// flot can only render in a a div with a defined width.
|
122
|
+
// for instance, a hidden div can't generally be rendered in (although if you set
|
123
|
+
// an explicit width on it, it might work)
|
124
|
+
//
|
125
|
+
// We'll count on later code that catch bootstrap collapse open to render
|
126
|
+
// on show, for currently hidden divs.
|
127
|
+
|
128
|
+
// for some reason width sometimes return negative, not sure
|
129
|
+
// why but it's some kind of hidden.
|
130
|
+
if (container.width() > 0) {
|
131
|
+
var height = container.width() * display_ratio;
|
132
|
+
|
133
|
+
// Need an explicit height to make flot happy.
|
134
|
+
container.height( height )
|
135
|
+
|
136
|
+
areaChart($(container));
|
137
|
+
|
138
|
+
$(container).trigger(redrawnEvent);
|
139
|
+
}
|
140
|
+
else if (wait_for_visible > 0) {
|
141
|
+
setTimeout(function() {
|
142
|
+
turnIntoPlot(container, wait_for_visible - 50);
|
143
|
+
}, 50);
|
144
|
+
}
|
26
145
|
}
|
27
146
|
|
28
147
|
// Takes a div holding a ul of distribution segments produced by
|
@@ -78,28 +197,24 @@ jQuery(document).ready(function($) {
|
|
78
197
|
alert(err);
|
79
198
|
}
|
80
199
|
|
81
|
-
// Div initially hidden to show hover mouseover legend for
|
82
|
-
// each segment.
|
83
|
-
$('<div class="subsection hover_legend ui-corner-all"></div>').css('display', 'block').insertAfter(container);
|
84
|
-
|
85
200
|
find_segment_for = function_for_find_segment(pointer_lookup);
|
86
201
|
var last_segment = null;
|
87
202
|
|
88
203
|
$(container).bind("plothover", function (event, pos, item) {
|
89
|
-
|
204
|
+
segment = find_segment_for(pos.x);
|
90
205
|
|
91
|
-
|
206
|
+
if(segment != last_segment) {
|
92
207
|
$('.distribution').tooltip('destroy');
|
93
208
|
$('.distribution').tooltip({'title': function() { return find_segment_for(pos.x).label + ' (' + segment.count + ')' }, 'placement': 'bottom', 'trigger': 'manual', 'delay': { show: 0, hide: 100}});
|
209
|
+
$('.distribution').tooltip('show');
|
94
210
|
|
95
|
-
|
211
|
+
last_segment = segment;
|
96
212
|
}
|
97
|
-
$('.distribution').tooltip('show');
|
98
|
-
// showHoverLegend(container, segment.label + '<span class="count">(' + segment.count + ')</span>');
|
99
213
|
});
|
214
|
+
|
100
215
|
$(container).bind("mouseout", function() {
|
101
|
-
|
102
|
-
|
216
|
+
last_segment = null;
|
217
|
+
$('.distribution').tooltip('hide');
|
103
218
|
});
|
104
219
|
$(container).bind("plotclick", function (event, pos, item) {
|
105
220
|
if ( plot.getSelection() == null) {
|
@@ -107,7 +222,7 @@ jQuery(document).ready(function($) {
|
|
107
222
|
plot.setSelection( normalized_selection(segment.from, segment.to));
|
108
223
|
}
|
109
224
|
});
|
110
|
-
$(container).bind("plotselected plotselecting", function(event, ranges) {
|
225
|
+
$(container).bind("plotselected plotselecting", function(event, ranges) {
|
111
226
|
if (ranges != null ) {
|
112
227
|
var from = Math.floor(ranges.xaxis.from);
|
113
228
|
var to = Math.floor(ranges.xaxis.to);
|
@@ -116,11 +231,10 @@ jQuery(document).ready(function($) {
|
|
116
231
|
form.find("input.range_begin").val(from);
|
117
232
|
form.find("input.range_end").val(to);
|
118
233
|
|
119
|
-
var
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
});
|
234
|
+
var slider_placeholder = $(container).closest(".limit_content").find("[data-slider-placeholder]");
|
235
|
+
if (slider_placeholder) {
|
236
|
+
slider_placeholder.slider("setValue", [from, to+1]);
|
237
|
+
}
|
124
238
|
}
|
125
239
|
});
|
126
240
|
|
@@ -128,24 +242,15 @@ jQuery(document).ready(function($) {
|
|
128
242
|
form.find("input.range_begin, input.range_end").change(function () {
|
129
243
|
plot.setSelection( form_selection(form, min, max) , true );
|
130
244
|
});
|
131
|
-
$(container).closest(".limit_content").find(".profile .range").
|
132
|
-
|
245
|
+
$(container).closest(".limit_content").find(".profile .range").on("slide", function(event, ui) {
|
246
|
+
var values = $(event.target).data("slider").getValue();
|
247
|
+
form.find("input.range_begin").val(values[0]);
|
248
|
+
form.find("input.range_end").val(values[1]);
|
249
|
+
plot.setSelection( normalized_selection(values[0], Math.max(values[0], values[1]-1)), true);
|
133
250
|
});
|
134
251
|
|
135
252
|
// initially entirely selected, to match slider
|
136
253
|
plot.setSelection( {xaxis: { from:min, to:max+0.9999}} );
|
137
|
-
|
138
|
-
// try to make slider width/orientation match chart's
|
139
|
-
var slider_container = $(container).closest(".limit_content").find(".profile .range");
|
140
|
-
slider_container.width(plot.width());
|
141
|
-
slider_container.css('margin-right', 'auto');
|
142
|
-
slider_container.css('margin-left', 'auto');
|
143
|
-
// And set slider min/max to match charts, for sure
|
144
|
-
$(document).ready(function() {
|
145
|
-
slider_container.slider("option", "min", min);
|
146
|
-
slider_container.slider("option", "max", max+1);
|
147
|
-
});
|
148
|
-
|
149
254
|
}
|
150
255
|
}
|
151
256
|
|
@@ -184,13 +289,6 @@ jQuery(document).ready(function($) {
|
|
184
289
|
};
|
185
290
|
}
|
186
291
|
|
187
|
-
function showHoverLegend(container, contents) {
|
188
|
-
var el = $(container).next(".hover_legend");
|
189
|
-
|
190
|
-
el.html(contents);
|
191
|
-
el.show();
|
192
|
-
}
|
193
|
-
|
194
292
|
// Check if Flot is loaded, and if browser has support for
|
195
293
|
// canvas object, either natively or via IE excanvas.
|
196
294
|
function domDependenciesMet() {
|
@@ -199,26 +297,4 @@ jQuery(document).ready(function($) {
|
|
199
297
|
|
200
298
|
return (flotLoaded && canvasAvailable);
|
201
299
|
}
|
202
|
-
|
203
|
-
/* Set up dom for flot rendering: flot needs to render in a non-hidden
|
204
|
-
div with explicitly set width and height. The non-hidden thing
|
205
|
-
is annoying to us, since it might be in a hidden facet limit.
|
206
|
-
Can we get away with moving it off-screen? Not JUST the flot
|
207
|
-
container, or it will render weird. But the whole parent
|
208
|
-
limit content, testing reveals we can. */
|
209
|
-
function wrapPrepareForFlot(container, parent_section, widthToHeight, call_block) {
|
210
|
-
var c = $(parent_section).closest(".panel-collapse.collapse");
|
211
|
-
var parent_originally_hidden = c != [];
|
212
|
-
if (parent_originally_hidden) {
|
213
|
-
c.collapse('show');
|
214
|
-
}
|
215
|
-
$(container).width( $(parent_section).width() );
|
216
|
-
$(container).height( $(parent_section).width() * widthToHeight );
|
217
|
-
|
218
|
-
call_block(container);
|
219
|
-
|
220
|
-
if (parent_originally_hidden) {
|
221
|
-
c.collapse('hide');
|
222
|
-
}
|
223
|
-
}
|
224
300
|
});
|