Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export initializer for module context #234

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
env:
BLACKLIGHT_VERSION: "~> 7.0" # only test on BL 7 for now
RAILS_VERSION: ${{ matrix.rails_version }}
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test ${{ matrix.engine_cart_rails_options }}"
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-coffee --skip-test ${{ matrix.engine_cart_rails_options }}"
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ Gemfile.lock
/pkg
/tmp
/.bundle
/node_modules
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ Once you are done iterating on your test you will need to stop the application s

# Publishing Javascript

run `npm run prepare` to build the javascript

run `npm publish` to push the javascript package to https://npmjs.org/package/blacklight-range-limit

# Possible future To Do
Expand Down
9 changes: 5 additions & 4 deletions app/assets/javascripts/blacklight_range_limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
//= require 'bootstrap-slider'

// Ensure that range_limit_shared is loaded first
//= require 'blacklight_range_limit/range_limit_shared'
//= require 'blacklight_range_limit/range_limit_plotting'
//= require 'blacklight_range_limit/range_limit_slider'
//= require 'blacklight_range_limit/range_limit_distro_facets'
//= require 'blacklight_range_limit/blacklight_range_limit.umd'

// Blacklight will only be defined if you aren't using this in a module context
if (Blacklight)
Blacklight.onLoad(() => BlacklightRangeLimit.initialize())
42 changes: 42 additions & 0 deletions app/assets/javascripts/blacklight_range_limit.old.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Master manifest file for engine, so local app can require
// this one file, but get all our files -- and local app
// require does not need to change if we change file list.
//
// Note JQuery is required to be loaded for flot and blacklight_range_limit
// JS to work, expect host app to load it.


//= require 'flot/jquery.canvaswrapper.js'
//= require 'flot/jquery.colorhelpers.js'
//= require 'flot/jquery.flot.js'
//= require 'flot/jquery.flot.browser.js'
//= require 'flot/jquery.flot.saturated.js'
//= require 'flot/jquery.flot.drawSeries.js'
//= require 'flot/jquery.event.drag.js'
//= require 'flot/jquery.flot.hover.js'
//= require 'flot/jquery.flot.uiConstants.js'
//= require 'flot/jquery.flot.selection.js'
//= require 'bootstrap-slider'

// Ensure that range_limit_shared is loaded first
//= require 'blacklight_range_limit/range_limit_shared'
//= require 'blacklight_range_limit/range_limit_plotting'
//= require 'blacklight_range_limit/range_limit_slider'
//= require 'blacklight_range_limit/range_limit_distro_facets'

BlacklightRangeLimit.initialize = function() {
// Support for Blacklight 7 and 8:
const modalSelector = Blacklight.modal?.modalSelector || Blacklight.Modal.modalSelector

RangeLimitDistroFacet.initialize(modalSelector)
RangeLimitSlider.initialize(modalSelector)
}

// Blacklight will only be defined if you aren't using this in a module context
if (Blacklight)
Blacklight.onLoad(() => BlacklightRangeLimit.initialize())

// In a module context you can do:
// import BlacklightRangeLimit from 'blacklight_range_limit'
// Blacklight.onLoad(() => BlacklightRangeLimit.initialize())
export default BlacklightRangeLimit
Loading
Loading