Skip to content

Commit

Permalink
Add installation instructions to readme when using modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne authored Feb 5, 2024
1 parent ada6553 commit 2f34f9f
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,49 @@ The pre Solr 1.4 now deprecated sint or slong types should work fine too.

# Installation

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.
Current 8.x version of `blacklight_range_limit` works with `blacklight` 7 or 8.

Add

gem "blacklight_range_limit"

to your Gemfile. Run "bundle install".

Then run
## Using sprockets

rails generate blacklight_range_limit:install
Run
```shell
rails generate blacklight_range_limit:install
```

This will install some asset references in your application.js and application.css.

## Using node modules
If you wish to manually install add this to your `app/javascript/application.js` with a builder that relies on node modules, then you can do this (for Blacklight 7):

```javascript
import "blacklight-frontend/app/assets/javascripts/blacklight/blacklight";

import BlacklightRangeLimit from "blacklight-range-limit/app/assets/javascripts/blacklight_range_limit/blacklight_range_limit.esm";
import "blacklight-range-limit/vendor/assets/javascripts/bootstrap-slider"
// jquery.canvaswrapper must come before the rest of Flot.
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.canvaswrapper"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.colorhelpers"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.event.drag"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.browser"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.drawSeries"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.hover"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.saturated"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.selection"
import "blacklight-range-limit/vendor/assets/javascripts/flot/jquery.flot.uiConstants"

Blacklight.onLoad(function() {
modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector;
BlacklightRangeLimit.initialize(modalSelector);
});
```
# Configuration
You have at least one solr field you want to display as a range limit, that's why you've installed this plugin. In your CatalogController, the facet configuration should look like:
Expand Down

0 comments on commit 2f34f9f

Please sign in to comment.