-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3590 from sul-dlss/jsbundling
Bundle javascript with Jsbundling
- Loading branch information
Showing
56 changed files
with
394 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,5 @@ gem 'global_alerts' | |
gem 'view_component', '< 2.75' | ||
|
||
gem "parslet", "~> 2.0" | ||
|
||
gem "jsbundling-rails", "~> 1.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: env RUBY_DEBUG_OPEN=true bin/rails server | ||
js: yarn build --watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
//= link application.js | ||
//= link application.css | ||
//= link print.css | ||
//= link_tree ../builds |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Entry point for the build script in your packageon | ||
|
||
import "rails-ujs"; | ||
import "turbolinks"; | ||
import "./vendor/responsiveTruncator"; | ||
import "./vendor/trunk8"; | ||
import "./vendor/jquery-scrollspy"; | ||
import "leaflet"; | ||
// import "popper.js"; | ||
// import "bootstrap"; | ||
import "blacklight-frontend/app/assets/javascripts/blacklight/blacklight"; | ||
import "blacklight-range-limit"; | ||
import "blacklight-range-limit/vendor/assets/javascripts/bootstrap-slider" | ||
|
||
import "./alternate_catalog"; | ||
import "./analytics"; | ||
import "./article"; | ||
import "./async_collection_members"; | ||
import "./backend_lookup"; | ||
import "./blacklight_hierarchy"; | ||
import "./bootstrap-modal-addon"; | ||
import "./course_reserves"; | ||
import "./eds_range_limit"; | ||
import "./embedded-call-number-browse"; | ||
import "./exhibitPanel"; | ||
import "./facet-options-checkboxes"; | ||
import "./feedback_form"; | ||
import "./home_page_facet_collapse"; | ||
import "./jquery.accordion-section"; | ||
import "./jquery.clear-input-text"; | ||
import "./jquery.libraryh3lp"; | ||
import "./jquery.live-lookup"; | ||
import "./jquery.long-lists"; | ||
import "./jquery.managed-purl"; | ||
import "./jquery.plug-google-content"; | ||
import "./jquery.preview-brief"; | ||
import "./jquery.preview-embed-browse"; | ||
import "./jquery.preview-filmstrip"; | ||
import "./jquery.preview-gallery"; | ||
import "./jquery.purl-embed"; | ||
import "./jquery.side-nav-minimap"; | ||
import "./jquery.stackmap"; | ||
import "./jquery.turbolinks-cursor"; | ||
import "./location-hours"; | ||
import "./preview-content"; | ||
import "./recent-selections"; | ||
import "./search-context"; | ||
import "./select-all"; | ||
import "./sfx-panel"; | ||
import "./skip-to-nav"; | ||
import "./tooltip"; | ||
import "./truncate"; | ||
import "./update-hidden-inputs-by-checkbox"; | ||
|
||
// Prevent the back-button from trying to add a second instance of recaptcha | ||
// See https://github.com/ambethia/recaptcha/issues/217#issuecomment-615221808 | ||
document.addEventListener("turbolinks:before-cache", function () { | ||
// On the articles page there is a feedback and a connection form. | ||
// Both have a recaptcha that needs clearing. | ||
document.querySelectorAll(".g-recaptcha").forEach((elem) => elem.innerHTML = ""); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const EdsRangeLimit = { | ||
init: function(el) { | ||
var $el = $(el); | ||
var data = $el.data(); | ||
var $begin = $el.find('input.range_begin'); | ||
var $end = $el.find('input.range_end'); | ||
var min = data.edsDateMin; | ||
var max = data.edsDateMax; | ||
var begin = data.edsDateBegin; | ||
var end = data.edsDateEnd; | ||
var $target = $($el.find('.eds-slider')[0]); | ||
|
||
// Much of this is a copy from BlacklightRangeLimit so that the experience | ||
// stays consistant | ||
var placeholder_input = $('<input type="text" data-slider-placeholder="true" style="width:100%;">').appendTo($target); | ||
|
||
if (placeholder_input.slider !== undefined) { | ||
placeholder_input.slider({ | ||
min: data.edsDateMin, | ||
max: data.edsDateMax, | ||
value: [begin, end], | ||
tooltip: 'hide' | ||
}); | ||
} | ||
|
||
// Update css to 100% | ||
$target.find('.slider').css('width', '100%'); | ||
|
||
$begin.val(begin); | ||
$end.val(end); | ||
|
||
// Handle slider changes | ||
placeholder_input.slider().on('slide', function(e) { | ||
$begin.val(e.value[0]) | ||
$end.val(e.value[1]) | ||
}); | ||
|
||
// Handle when form updates | ||
$begin.change(function() { | ||
var val = BlacklightRangeLimit.parseNum($(this).val()); | ||
if ( isNaN(val) || val < min) { | ||
//for weird data, set slider at min | ||
val = min; | ||
} | ||
var values = placeholder_input.data('slider').getValue(); | ||
values[0] = val; | ||
placeholder_input.slider('setValue', values); | ||
}); | ||
|
||
$end.change(function() { | ||
var val = BlacklightRangeLimit.parseNum($(this).val()); | ||
if ( isNaN(val) || val > max) { | ||
//for weird data, set slider at max | ||
val = max; | ||
} | ||
var values = placeholder_input.data('slider').getValue(); | ||
values[1] = val; | ||
placeholder_input.slider('setValue', values); | ||
}); | ||
} | ||
} | ||
|
||
Blacklight.onLoad(function() { | ||
$('.eds_range_slider').each(function(i, element) { | ||
EdsRangeLimit.init(element); | ||
}) | ||
}); |
2 changes: 2 additions & 0 deletions
2
...avascripts/embedded-call-number-browse.js → ...javascript/embedded-call-number-browse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import PreviewContent from './preview-content' | ||
|
||
(function($) { | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...ssets/javascripts/jquery.preview-brief.js → app/javascript/jquery.preview-brief.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import PreviewContent from './preview-content' | ||
|
||
(function($) { | ||
|
||
/* | ||
|
2 changes: 2 additions & 0 deletions
2
...avascripts/jquery.preview-embed-browse.js → ...javascript/jquery.preview-embed-browse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import PreviewContent from './preview-content' | ||
|
||
(function($) { | ||
|
||
/* | ||
|
2 changes: 2 additions & 0 deletions
2
...s/javascripts/jquery.preview-filmstrip.js → app/javascript/jquery.preview-filmstrip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import PreviewContent from './preview-content' | ||
|
||
(function($) { | ||
|
||
/* | ||
|
2 changes: 2 additions & 0 deletions
2
...ets/javascripts/jquery.preview-gallery.js → app/javascript/jquery.preview-gallery.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import PreviewContent from './preview-content' | ||
|
||
(function($) { | ||
|
||
/* | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.