Skip to content

Commit

Permalink
chore: replace 'Boosted mod' by 'OUDS mod' (#2590)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond authored Jun 28, 2024
1 parent 9829d96 commit b1f8039
Show file tree
Hide file tree
Showing 141 changed files with 1,526 additions and 1,526 deletions.
2 changes: 1 addition & 1 deletion build/vnu-jar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ execFile('java', ['-version'], (error, stdout, stderr) => {
// NOT RECOMMENDED, but it's still valid - we explain in the docs that it's not ideal,
// and offer more robust alternatives, but also need to show a less-than-ideal example
'An “aria-disabled” attribute whose value is “true” should not be specified on an “a” element that has an “href” attribute.',
// Boosted mod: `role="img"` is needed for `<img "src=.svg" alt="">`
// OUDS mod: `role="img"` is needed for `<img "src=.svg" alt="">`
'The “img” role is unnecessary for element “img”.',
'.*Consider using the “h1” element as a top-level heading only.*'
// End mod
Expand Down
2 changes: 1 addition & 1 deletion hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module:
- source: site/static/docs/5.3/assets/img/favicons/favicon.ico
target: static/favicon.ico

# Boosted mod
# OUDS mod
- source: node_modules/tarteaucitronjs/tarteaucitron.min.js
target: static/docs/5.3/assets/js/tarteaucitron.min.js
- source: node_modules/tarteaucitronjs/lang
Expand Down
6 changes: 3 additions & 3 deletions js/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* --------------------------------------------------------------------------
*/

import '../node_modules/focus-visible/dist/focus-visible.js' /* eslint-disable-line import/no-unassigned-import */ // Boosted mod
import '../node_modules/focus-visible/dist/focus-visible.js' /* eslint-disable-line import/no-unassigned-import */ // OUDS mod

export { default as Alert } from './src/alert.js'
export { default as Button } from './src/button.js'
Expand All @@ -14,9 +14,9 @@ export { default as Collapse } from './src/collapse.js'
export { default as Dropdown } from './src/dropdown.js'
export { default as Modal } from './src/modal.js'
export { default as Offcanvas } from './src/offcanvas.js'
export { default as OrangeNavbar } from './src/orange-navbar.js' // Boosted mod
export { default as OrangeNavbar } from './src/orange-navbar.js' // OUDS mod
export { default as Popover } from './src/popover.js'
export { default as QuantitySelector } from './src/quantity-selector.js' // Boosted mod
export { default as QuantitySelector } from './src/quantity-selector.js' // OUDS mod
export { default as ScrollSpy } from './src/scrollspy.js'
export { default as Tab } from './src/tab.js'
export { default as Toast } from './src/toast.js'
Expand Down
10 changes: 5 additions & 5 deletions js/index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import Collapse from './src/collapse.js'
import Dropdown from './src/dropdown.js'
import Modal from './src/modal.js'
import Offcanvas from './src/offcanvas.js'
import OrangeNavbar from './src/orange-navbar.js' // Boosted mod
import OrangeNavbar from './src/orange-navbar.js' // OUDS mod
import Popover from './src/popover.js'
import QuantitySelector from './src/quantity-selector.js' // Boosted mod
import QuantitySelector from './src/quantity-selector.js' // OUDS mod
import ScrollSpy from './src/scrollspy.js'
import Tab from './src/tab.js'
import Toast from './src/toast.js'
import Tooltip from './src/tooltip.js'
import '../node_modules/focus-visible/dist/focus-visible.js' /* eslint-disable-line import/no-unassigned-import */ // Boosted mod
import '../node_modules/focus-visible/dist/focus-visible.js' /* eslint-disable-line import/no-unassigned-import */ // OUDS mod

export default {
Alert,
Expand All @@ -29,9 +29,9 @@ export default {
Dropdown,
Modal,
Offcanvas,
OrangeNavbar, // Boosted mod
OrangeNavbar, // OUDS mod
Popover,
QuantitySelector, // Boosted mod
QuantitySelector, // OUDS mod
ScrollSpy,
Tab,
Toast,
Expand Down
52 changes: 26 additions & 26 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const CLASS_NAME_END = 'carousel-item-end'
const CLASS_NAME_START = 'carousel-item-start'
const CLASS_NAME_NEXT = 'carousel-item-next'
const CLASS_NAME_PREV = 'carousel-item-prev'
const CLASS_NAME_PAUSED = 'is-paused' // Boosted mod: used for progress indicators
const CLASS_NAME_DONE = 'is-done' // Boosted mod: used for progress indicators
const CLASS_NAME_PAUSE = 'pause' // Boosted mod: used for pause button
const CLASS_NAME_PLAY = 'play' // Boosted mod: used for play button
const CLASS_NAME_PAUSED = 'is-paused' // OUDS mod: used for progress indicators
const CLASS_NAME_DONE = 'is-done' // OUDS mod: used for progress indicators
const CLASS_NAME_PAUSE = 'pause' // OUDS mod: used for pause button
const CLASS_NAME_PLAY = 'play' // OUDS mod: used for play button

const SELECTOR_ACTIVE = '.active'
const SELECTOR_ITEM = '.carousel-item'
Expand All @@ -65,16 +65,16 @@ const SELECTOR_ITEM_IMG = '.carousel-item img'
const SELECTOR_INDICATORS = '.carousel-indicators'
const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'
const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'
const SELECTOR_CONTROL_PREV = '.carousel-control-prev' // Boosted mod
const SELECTOR_CONTROL_NEXT = '.carousel-control-next' // Boosted mod
const SELECTOR_CONTROL_PAUSE = '.carousel-control-play-pause' // Boosted mod
const SELECTOR_CAROUSEL_TO_PAUSE = 'data-bs-target' // Boosted mod
const SELECTOR_CAROUSEL_PLAY_TEXT = 'data-bs-play-text' // Boosted mod
const SELECTOR_CAROUSEL_PAUSE_TEXT = 'data-bs-pause-text' // Boosted mod
const SELECTOR_CAROUSEL_DEFAULT_PLAY_TEXT = 'Play Carousel' // Boosted mod
const SELECTOR_CAROUSEL_DEFAULT_PAUSE_TEXT = 'Pause Carousel' // Boosted mod
const SELECTOR_CONTROL_PREV = '.carousel-control-prev' // OUDS mod
const SELECTOR_CONTROL_NEXT = '.carousel-control-next' // OUDS mod
const SELECTOR_CONTROL_PAUSE = '.carousel-control-play-pause' // OUDS mod
const SELECTOR_CAROUSEL_TO_PAUSE = 'data-bs-target' // OUDS mod
const SELECTOR_CAROUSEL_PLAY_TEXT = 'data-bs-play-text' // OUDS mod
const SELECTOR_CAROUSEL_PAUSE_TEXT = 'data-bs-pause-text' // OUDS mod
const SELECTOR_CAROUSEL_DEFAULT_PLAY_TEXT = 'Play Carousel' // OUDS mod
const SELECTOR_CAROUSEL_DEFAULT_PAUSE_TEXT = 'Pause Carousel' // OUDS mod

const PREFIX_CUSTOM_PROPS = 'bs-' // Boosted mod: should match `$prefix` in scss/_variables.scss
const PREFIX_CUSTOM_PROPS = 'bs-' // OUDS mod: should match `$prefix` in scss/_variables.scss

const KEY_TO_DIRECTION = {
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
Expand Down Expand Up @@ -115,13 +115,13 @@ class Carousel extends BaseComponent {

this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)

this._playPauseButton = SelectorEngine.findOne(`${SELECTOR_CONTROL_PAUSE}[${SELECTOR_CAROUSEL_TO_PAUSE}="#${this._element.id}"]`) // Boosted mod
this._playPauseButton = SelectorEngine.findOne(`${SELECTOR_CONTROL_PAUSE}[${SELECTOR_CAROUSEL_TO_PAUSE}="#${this._element.id}"]`) // OUDS mod

this._addEventListeners()

if (this._config.ride === CLASS_NAME_CAROUSEL) {
this.cycle()
} else if (this._indicatorsElement) { // Boosted mod: set the animation properly on progress indicator
} else if (this._indicatorsElement) { // OUDS mod: set the animation properly on progress indicator
this._element.classList.add(CLASS_NAME_PAUSED)
}
// End mod
Expand Down Expand Up @@ -159,13 +159,13 @@ class Carousel extends BaseComponent {
}

pause() {
// Boosted mod: reset the animation on progress indicator
// OUDS mod: reset the animation on progress indicator
if (this._indicatorsElement) {
this._element.classList.add(CLASS_NAME_PAUSED)
}
// End mod

// Boosted mod: if a play-pause button is present, set the button to play
// OUDS mod: if a play-pause button is present, set the button to play
if (this._playPauseButton !== null && this._playPauseButton.classList.contains(CLASS_NAME_PAUSE)) {
this._playPauseButton.classList.remove(CLASS_NAME_PAUSE)
this._playPauseButton.classList.add(CLASS_NAME_PLAY)
Expand All @@ -190,13 +190,13 @@ class Carousel extends BaseComponent {
}

cycle() {
// Boosted mod: restart the animation on progress indicator
// OUDS mod: restart the animation on progress indicator
if (this._indicatorsElement) {
this._element.classList.remove(CLASS_NAME_PAUSED)
}
// End mod

// Boosted mod: if a play-pause button is present, reset the button to pause
// OUDS mod: if a play-pause button is present, reset the button to pause
if (this._playPauseButton !== null && this._playPauseButton.classList.contains(CLASS_NAME_PLAY)) {
this._playPauseButton.classList.remove(CLASS_NAME_PLAY)
this._playPauseButton.classList.add(CLASS_NAME_PAUSE)
Expand Down Expand Up @@ -233,7 +233,7 @@ class Carousel extends BaseComponent {
}

to(index) {
// Boosted mod: restart the animation on progress indicator
// OUDS mod: restart the animation on progress indicator
if (this._indicatorsElement) {
this._element.classList.remove(CLASS_NAME_DONE)
}
Expand Down Expand Up @@ -335,7 +335,7 @@ class Carousel extends BaseComponent {
}
}

// Boosted mod: handle prev/next controls states
// OUDS mod: handle prev/next controls states
_disableControl(element) {
if (element.nodeName === 'BUTTON') {
element.disabled = true
Expand Down Expand Up @@ -388,7 +388,7 @@ class Carousel extends BaseComponent {

this._config.interval = elementInterval || this._config.defaultInterval

// Boosted mod: set progress indicator's interval as custom property
// OUDS mod: set progress indicator's interval as custom property
if (this._indicatorsElement && this._config.interval !== Default.interval) {
const currentIndex = this._getItemIndex(element)
const currentIndicator = SelectorEngine.findOne(`:nth-child(${currentIndex + 1})`, this._indicatorsElement)
Expand All @@ -405,7 +405,7 @@ class Carousel extends BaseComponent {
const activeElement = this._getActive()
const isNext = order === ORDER_NEXT

// Boosted mod: progress indicators animation when wrapping is disabled
// OUDS mod: progress indicators animation when wrapping is disabled
if (!this._config.wrap) {
const isPrev = order === ORDER_PREV
const activeIndex = this._getItemIndex(activeElement)
Expand Down Expand Up @@ -465,7 +465,7 @@ class Carousel extends BaseComponent {
this._setActiveIndicatorElement(nextElementIndex)
this._activeElement = nextElement

// Boosted mod: enable/disable prev/next controls when wrap=false
// OUDS mod: enable/disable prev/next controls when wrap=false
if (!this._config.wrap) {
const prevControl = SelectorEngine.findOne(SELECTOR_CONTROL_PREV, this._element)
const nextControl = SelectorEngine.findOne(SELECTOR_CONTROL_NEXT, this._element)
Expand Down Expand Up @@ -545,7 +545,7 @@ class Carousel extends BaseComponent {
}

// Static
// Boosted mod: add pause button
// OUDS mod: add pause button
static PauseCarousel(event) {
const pauseButton = event.target
const pauseButtonAttribute = pauseButton.getAttribute(SELECTOR_CAROUSEL_TO_PAUSE)
Expand Down Expand Up @@ -610,7 +610,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (e
carousel._maybeEnableCycle()
})

EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_CONTROL_PAUSE, Carousel.PauseCarousel) // Boosted mod
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_CONTROL_PAUSE, Carousel.PauseCarousel) // OUDS mod

EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
Expand Down
2 changes: 1 addition & 1 deletion js/src/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Collapse extends BaseComponent {
this._element.classList.remove(CLASS_NAME_COLLAPSING)
this._element.classList.add(CLASS_NAME_COLLAPSE)

// Boosted mod: Change the moment of the appliance of .collapsed
// OUDS mod: Change the moment of the appliance of .collapsed
for (const trigger of this._triggerArray) {
const element = SelectorEngine.getElementFromSelector(trigger)

Expand Down
2 changes: 1 addition & 1 deletion js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const Default = {
autoClose: true,
boundary: 'clippingParents',
display: 'dynamic',
offset: [0, 0], // Boosted mod
offset: [0, 0], // OUDS mod
popperConfig: null,
reference: 'toggle'
}
Expand Down
2 changes: 1 addition & 1 deletion js/src/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SELECTOR_CONTENT = '.popover-body'
const Default = {
...Tooltip.Default,
content: '',
offset: [0, 15], // Boosted mod: instead of `offset: [0, 8],`
offset: [0, 15], // OUDS mod: instead of `offset: [0, 8],`
placement: 'right',
template: '<div class="popover" role="tooltip">' +
'<div class="popover-arrow"></div>' +
Expand Down
2 changes: 1 addition & 1 deletion js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Default = {
delay: 0,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
html: false,
offset: [0, 10], // Boosted mod: instead of `offset: [0, 6],`
offset: [0, 10], // OUDS mod: instead of `offset: [0, 6],`
placement: 'top',
popperConfig: null,
sanitize: true,
Expand Down
2 changes: 1 addition & 1 deletion js/tests/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const browsers = {
browser: 'Firefox',
browser_version: '60'
},
// Boosted mod: ESR Firefox used inside Orange
// OUDS mod: ESR Firefox used inside Orange
EsrWin10: {
base: 'BrowserStack',
os: 'Windows',
Expand Down
12 changes: 6 additions & 6 deletions js/tests/unit/carousel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Carousel', () => {
expect(carousel._interval).toBeNull()
})

// Boosted mod
// OUDS mod
it('should add class if `ride`!==`carousel`', () => {
fixtureEl.innerHTML = '<div id="myCarousel" class="carousel slide" data-bs-ride="true"><ol class="carousel-indicators"></ol></div>'

Expand Down Expand Up @@ -357,7 +357,7 @@ describe('Carousel', () => {
})
})

// Boosted mod
// OUDS mod
it('should stay at the end when the next method is called and wrap is false', () => {
return new Promise((resolve, reject) => {
fixtureEl.innerHTML = [
Expand Down Expand Up @@ -1153,7 +1153,7 @@ describe('Carousel', () => {
})

describe('pause', () => {
// Boosted mod
// OUDS mod
it('should add paused class', () => {
fixtureEl.innerHTML = [
'<div id="myCarousel" class="carousel slide">',
Expand All @@ -1179,7 +1179,7 @@ describe('Carousel', () => {
})
// End mod

// Boosted mod: tests for Play/Pause button
// OUDS mod: tests for Play/Pause button
it('should add pause class on click on Play/Pause button when pause is on', () => {
fixtureEl.innerHTML = [
'<div id="myCarousel" class="carousel is-paused"></div>',
Expand Down Expand Up @@ -1527,7 +1527,7 @@ describe('Carousel', () => {
})

describe('cycle', () => {
// Boosted mod
// OUDS mod
it('should remove the paused class', () => {
fixtureEl.innerHTML = [
'<div id="myCarousel" class="carousel slide">',
Expand Down Expand Up @@ -1629,7 +1629,7 @@ describe('Carousel', () => {
expect(carousel._config.interval).toEqual(9385)
})

// Boosted mod
// OUDS mod
it('should set --bs-carousel-interval custom property on indicator if data-bs-interval is provided', () => {
fixtureEl.innerHTML = [
'<div id="myCarousel" class="carousel slide">',
Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/toast.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Toast', () => {
return new Promise(resolve => {
fixtureEl.innerHTML = [
'<div class="toast" data-bs-delay="1" data-bs-autohide="false" data-bs-animation="false">',
' <button type="button" class="ms-2 mb-1 btn-close" data-bs-dismiss="toast"><span class="visually-hidden">Close</span></button>', // Boosted mod: replace aria-label="Close" with a visually hidden span (a11y)
' <button type="button" class="ms-2 mb-1 btn-close" data-bs-dismiss="toast"><span class="visually-hidden">Close</span></button>', // OUDS mod: replace aria-label="Close" with a visually hidden span (a11y)
'</div>'
].join('')

Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Toast', () => {

fixtureEl.innerHTML = [
'<div class="toast" data-bs-autohide="false" data-bs-animation="false">',
' <button type="button" class="ms-2 mb-1 btn-close" data-bs-dismiss="toast"><span class="visually-hidden">Close</span></button>', // Boosted mod: replace aria-label="Close" with a visually hidden span (a11y)
' <button type="button" class="ms-2 mb-1 btn-close" data-bs-dismiss="toast"><span class="visually-hidden">Close</span></button>', // OUDS mod: replace aria-label="Close" with a visually hidden span (a11y)
'</div>'
].join('')

Expand Down
8 changes: 4 additions & 4 deletions js/tests/visual/alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<h1>Alert <small>Bootstrap Visual Test</small></h1>

<div class="alert alert-warning alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--Boosted mod: a11y-->
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--OUDS mod: a11y-->
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
</div>

<div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--Boosted mod: a11y-->
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--OUDS mod: a11y-->
<p>
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again.
</p>
Expand All @@ -27,7 +27,7 @@ <h1>Alert <small>Bootstrap Visual Test</small></h1>
</div>

<div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--Boosted mod: a11y-->
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--OUDS mod: a11y-->
<p>
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
</p>
Expand All @@ -38,7 +38,7 @@ <h1>Alert <small>Bootstrap Visual Test</small></h1>
</div>

<div class="alert alert-warning alert-dismissible fade show" role="alert" style="transition-duration: 5s;">
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--Boosted mod: a11y-->
<button type="button" class="btn-close" data-bs-dismiss="alert"><span class="visually-hidden">Close</span></button><!--OUDS mod: a11y-->
This alert will take 5 seconds to fade out.
</div>
</div>
Expand Down
Loading

0 comments on commit b1f8039

Please sign in to comment.