Skip to content

Commit

Permalink
Merge branch 'blacklight_advanced_and_range' into adventist_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Oct 1, 2023
2 parents 6126bf6 + 205e86c commit 49ce124
Show file tree
Hide file tree
Showing 22 changed files with 473 additions and 335 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_portile2 (2.8.4)
minitest (5.18.1)
minitest (5.20.0)
mods (2.4.1)
edtf
iso-639
Expand Down Expand Up @@ -917,7 +917,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 @@ -958,7 +958,7 @@ GEM
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.1.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
Expand Down Expand Up @@ -1092,7 +1092,7 @@ GEM
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (5.1.2)
Expand All @@ -1105,7 +1105,7 @@ GEM
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.12.0)
rspec-support (3.12.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.52.1)
Expand Down Expand Up @@ -1373,7 +1373,7 @@ DEPENDENCIES
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
2 changes: 1 addition & 1 deletion app/assets/javascripts/admin_color_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ $(document).on('turbolinks:load', 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 49ce124

Please sign in to comment.