6 changed files with 560 additions and 478 deletions
@ -0,0 +1 @@
|
||||
{"php":"8.5.4","version":"3.94.2","indent":" ","lineEnding":"\n","rules":{"nullable_type_declaration":true,"operator_linebreak":true,"ordered_types":{"null_adjustment":"always_last","sort_algorithm":"none"},"single_class_element_per_statement":true,"types_spaces":true,"array_indentation":true,"array_syntax":true,"attribute_block_no_spaces":true,"cast_spaces":true,"concat_space":{"spacing":"one"},"function_declaration":{"closure_fn_spacing":"none"},"method_argument_space":{"after_heredoc":false},"new_with_parentheses":{"anonymous_class":false},"single_line_empty_body":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const","const_import","do","else","elseif","enum","final","finally","for","foreach","function","function_import","if","insteadof","interface","match","named_argument","namespace","new","private","protected","public","readonly","static","switch","trait","try","type_colon","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"trailing_comma_in_multiline":{"after_heredoc":true,"elements":["arguments","array_destructuring","arrays","match","parameters"]},"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_anonymous_functions":false,"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"modifier_keywords":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"ruleCustomisationPolicyVersion":"null-policy","hashes":{".conform.8290495.olivesnews.theme":"ba279df37643b4e7b3b1d36edca92d5a",".conform.9049921.olivesnews.theme":"ba279df37643b4e7b3b1d36edca92d5a",".conform.4231873.olivesnews.theme":"e576b2c4cb832ca7a39815102ad561ab"}} |
||||
@ -0,0 +1,28 @@
|
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
use PhpCsFixer\Config; |
||||
use PhpCsFixer\Finder; |
||||
|
||||
return (new Config()) |
||||
->setRiskyAllowed(false) |
||||
->setRules([ |
||||
'@auto' => true |
||||
]) |
||||
// 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config |
||||
->setFinder( |
||||
(new Finder()) |
||||
// 💡 root folder to check |
||||
->in(__DIR__) |
||||
// 💡 additional files, eg bin entry file |
||||
// ->append([__DIR__.'/bin-entry-file']) |
||||
// 💡 folders to exclude, if any |
||||
// ->exclude([/* ... */]) |
||||
// 💡 path patterns to exclude, if any |
||||
// ->notPath([/* ... */]) |
||||
// 💡 extra configs |
||||
// ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode |
||||
// ->ignoreVCS(true) // true by default |
||||
) |
||||
; |
||||
@ -0,0 +1,45 @@
|
||||
(function (Drupal) { |
||||
"use strict"; |
||||
|
||||
Drupal.behaviors.nouisliderYearFormat = { |
||||
attach: function (context, settings) { |
||||
// Target the slider directly by its rendered ID.
|
||||
// Your facet renders the slider as <div id="year" class="facet-slider noUi-target">
|
||||
const sliderEl = context.querySelector("#year.noUi-target"); |
||||
|
||||
if (!sliderEl || !sliderEl.noUiSlider) return; |
||||
|
||||
const integerFormat = { |
||||
to: function (value) { |
||||
return String(Math.round(value)); |
||||
}, |
||||
from: function (value) { |
||||
return Math.round(Number(value)); |
||||
}, |
||||
}; |
||||
|
||||
// Override format and tooltips together
|
||||
sliderEl.noUiSlider.updateOptions({ |
||||
format: integerFormat, |
||||
tooltips: [integerFormat, integerFormat], |
||||
}); |
||||
|
||||
// Also fix the input fields — they get their initial value from the slider's
|
||||
// 'update' event, but that fires before our override. Re-trigger manually:
|
||||
const inputFrom = document.getElementById("nouislider-input-from"); |
||||
const inputTo = document.getElementById("nouislider-input-to"); |
||||
|
||||
if (inputFrom && inputTo) { |
||||
const values = sliderEl.noUiSlider.get(); |
||||
inputFrom.value = Math.round(Number(values[0])); |
||||
inputTo.value = Math.round(Number(values[1])); |
||||
|
||||
// Keep inputs in sync going forward
|
||||
sliderEl.noUiSlider.on("update", function (values) { |
||||
inputFrom.value = Math.round(Number(values[0])); |
||||
inputTo.value = Math.round(Number(values[1])); |
||||
}); |
||||
} |
||||
}, |
||||
}; |
||||
})(Drupal); |
||||
Loading…
Reference in new issue