Skip to content

Commit

Permalink
Merge branch 'blacklight_advanced_and_range' of https://github.com/sa…
Browse files Browse the repository at this point in the history
…mvera/hyku into blacklight_advanced_and_range
  • Loading branch information
orangewolf committed Oct 1, 2023
2 parents 2a80187 + 057e77d commit 205e86c
Show file tree
Hide file tree
Showing 10 changed files with 424 additions and 333 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ gem 'parser', '~> 2.5.3'
gem 'pg'
gem 'postrank-uri', '>= 1.0.24'
gem 'pry-byebug', group: %i[development test]
gem 'puma', '~> 4.3' # Use Puma as the app server
gem 'puma', '~> 5.6' # Use Puma as the app server
gem 'rack-test', '0.7.0', group: %i[test] # rack-test >= 0.71 does not work with older Capybara versions (< 2.17). See #214 for more details
gem 'rails-controller-testing', group: %i[test]
gem 'rdf', '~> 3.1.15' # rdf 3.2.0 removed SerializedTransaction which ldp requires
Expand Down
16 changes: 14 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,20 @@ GEM
bootstrap-sass (~> 3.0)
openseadragon (>= 0.2.0)
rails
blacklight_advanced_search (6.4.1)
blacklight (~> 6.0, >= 6.0.1)
parslet
blacklight_iiif_search (1.0.0)
blacklight (~> 6.0)
iiif-presentation
rails (>= 4.2, < 6)
blacklight_oai_provider (6.1.1)
blacklight (~> 6.0)
oai (~> 1.0)
blacklight_range_limit (6.5.0)
blacklight (~> 6.10)
jquery-rails
rails (>= 4.2, < 6)
bolognese (1.11.0)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
Expand Down Expand Up @@ -871,6 +878,8 @@ GEM
openseadragon (0.6.0)
rails (> 3.2.0)
optimist (3.0.1)
order_already (0.3.1)
rails-html-sanitizer (~> 1.4)
orm_adapter (0.5.0)
os (1.1.4)
parallel (1.23.0)
Expand All @@ -893,7 +902,7 @@ GEM
pry (>= 0.13, < 0.15)
psych (3.3.4)
public_suffix (4.0.7)
puma (4.3.12)
puma (5.6.7)
nio4r (~> 2.0)
qa (5.10.0)
activerecord-import
Expand Down Expand Up @@ -1296,7 +1305,9 @@ DEPENDENCIES
apartment
aws-sdk-sqs
blacklight (~> 6.7)
blacklight_advanced_search
blacklight_oai_provider (~> 6.1, >= 6.1.1)
blacklight_range_limit (= 6.5.0)
bolognese (>= 1.9.10)
bootstrap-datepicker-rails
bulkrax (~> 5.3)
Expand Down Expand Up @@ -1338,11 +1349,12 @@ DEPENDENCIES
omniauth-rails_csrf_protection (~> 1.0)
omniauth-saml (~> 2.1)
omniauth_openid_connect
order_already
parser (~> 2.5.3)
pg
postrank-uri (>= 1.0.24)
pry-byebug
puma (~> 4.3)
puma (~> 5.6)
rack-test (= 0.7.0)
rails (~> 5.2.5)
rails-controller-testing
Expand Down
20 changes: 20 additions & 0 deletions app/assets/javascripts/admin_color_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).on("turbolinks:load", function () {
$("div.defaultable-colors a.restore-default-color").click(function (e) {
e.preventDefault();

var defaultTarget = $(e.target).data("default-target");
var input = $("input[name='admin_appearance[" + defaultTarget + "]']");

input.val(input.data("default-value"));
});

$(".panel-footer a.restore-all-default-colors").click(function (e) {
e.preventDefault();

var allColorInputs = $("input[name*='color']");

allColorInputs.each(function () {
$(this).val($(this).data("default-value"));
});
});
});
54 changes: 29 additions & 25 deletions app/assets/javascripts/admin_font_select.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
Blacklight.onLoad(function() {
if($("#admin_appearance_body_font").length > 0){
$("#admin_appearance_body_font").fontselect({lookahead: 20})
$("#admin_appearance_headline_font").fontselect({lookahead: 20})
Blacklight.onLoad(function () {
if ($("#admin_appearance_body_font").length > 0) {
$("#admin_appearance_body_font").fontselect({ lookahead: 20 });
$("#admin_appearance_headline_font").fontselect({ lookahead: 20 });
}
});

$('div.defaultable-fonts a.restore-default-font').click(function(e) {
e.preventDefault()
var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")
var defaultValue = input.data('default-value').replace(';', '')
var inputDisplay = $("div[class$='"+ defaultTarget +"']").find('div.font-select span')
$("div.defaultable-fonts a.restore-default-font").click(function (e) {
e.preventDefault();
var defaultTarget = $(e.target).data("default-target");
var input = $("input[name='admin_appearance[" + defaultTarget + "]']");
var defaultValue = input.data("default-value").replace(";", "");
var inputDisplay = $("div[class$='" + defaultTarget + "']").find(
"div.font-select span"
);

input.val(defaultValue)
inputDisplay.css("font-family", defaultValue)
inputDisplay.text(defaultValue)
})
input.val(defaultValue);
inputDisplay.css("font-family", defaultValue);
inputDisplay.text(defaultValue);
});

$('.panel-footer a.restore-all-default-fonts').click(function(e) {
e.preventDefault()
$(".panel-footer a.restore-all-default-fonts").click(function (e) {
e.preventDefault();

var allFontInputs = $("input[name*='font']")
var allFontInputs = $("input[name*='font']");

allFontInputs.each(function() {
var thisTarget = $(this).attr('id').replace('admin_appearance_', '')
var defaultValue = $(this).data('default-value').replace(';', '')
var inputDisplay = $("div[class$='"+ thisTarget +"']").find('div.font-select span')
allFontInputs.each(function () {
var thisTarget = $(this).attr("id").replace("admin_appearance_", "");
var defaultValue = $(this).data("default-value").replace(";", "");
var inputDisplay = $("div[class$='" + thisTarget + "']").find(
"div.font-select span"
);

$(this).val(defaultValue)
inputDisplay.css("font-family", defaultValue)
inputDisplay.text(defaultValue)
})
$(this).val(defaultValue);
inputDisplay.css("font-family", defaultValue);
inputDisplay.text(defaultValue);
});
});
Loading

0 comments on commit 205e86c

Please sign in to comment.