From 441ca409175f5fe205cd702e5e532ad9e13bb566 Mon Sep 17 00:00:00 2001 From: Mavis Ou Date: Thu, 21 Mar 2024 17:14:48 -0700 Subject: [PATCH] fix linting errors --- copy-db.js | 6 ++--- source/js/buyers-guide/analytics-events.js | 8 +++---- source/js/buyers-guide/bg-main.js | 2 +- .../creepiness-chart/creepiness-chart.jsx | 2 +- .../components/creepometer/creepometer.jsx | 2 +- .../components/product-quiz/product-quiz.jsx | 4 ++-- .../product-quiz-share-buttons.jsx | 10 ++++---- .../components/social-share/social-share.jsx | 2 +- source/js/buyers-guide/homepage-c-slider.js | 16 ++++++------- .../buyers-guide/inject-react/creep-vote.js | 4 ++-- .../buyers-guide/inject-react/product-quiz.js | 4 ++-- source/js/buyers-guide/newsletter-box.js | 6 ++--- source/js/buyers-guide/product-tab.js | 2 +- source/js/buyers-guide/search/history.js | 14 +++++------ .../buyers-guide/search/member-functions.js | 14 +++++------ .../buyers-guide/search/pni-sort-dropdown.js | 14 +++++------ source/js/buyers-guide/search/pni-toggle.js | 2 +- .../js/buyers-guide/search/search-filter.js | 24 +++++++++---------- source/js/buyers-guide/search/slider-area.js | 4 ++-- source/js/buyers-guide/search/utils.js | 24 +++++++++---------- .../template-js-handler/desktop-search-bar.js | 2 +- .../mobile-nav-stickiness-handler.js | 2 +- .../template-js-handler/mobile-search-bar.js | 4 ++-- .../pni-category-dropdown.js | 14 +++++------ .../product-page-comment-handler.js | 2 +- source/js/common/google-analytics.js | 2 +- .../inject-react/newsletter-signup-module.js | 4 ++-- .../common/inject-react/petition-thank-you.js | 4 ++-- .../header-donate-button.js | 2 +- .../common/template-js-handles/sticky-cta.js | 2 +- .../newsletter-signup/atoms/button-quit.jsx | 2 +- .../newsletter-signup/atoms/select.jsx | 2 +- .../organisms/default-layout-signup.jsx | 4 ++-- .../petition/petition-thank-you.jsx | 4 ++-- .../pulse-project-list/pulse-project-list.jsx | 2 +- .../tabbed-profile-directory.jsx | 4 ++-- source/js/donate-banner.js | 4 ++-- source/js/dropdowns.js | 4 ++-- source/js/embed-typeform.js | 4 ++-- .../inject-react/pulse-project-list.js | 4 ++-- .../pulse-tabbed-profile-filters.js | 14 +++++------ source/js/foundation/pages/callpower.js | 4 ++-- .../template-js-handler/plane.js | 6 ++--- .../pages/directory-listing-filters.js | 2 +- .../pages/libraries-library-page.js | 4 ++-- .../template-js-handler/home-banner.js | 6 ++--- .../mozfest/template-js-handler/video.js | 2 +- .../pages/youtube-regrets/accordion.js | 2 +- .../youtube-regrets/browser-extension.js | 2 +- .../pages/youtube-regrets/count-up.js | 2 +- .../pages/youtube-regrets/intro-tunnel.js | 12 +++++----- .../youtube-regrets/read-more-categories.js | 10 ++++---- .../youtube-regrets/regret-rates-chart.js | 2 +- .../regrets-reporter/share-buttons.js | 12 +++++----- .../template-js-handler/cta-button.js | 6 ++--- .../regrets-reporter/utm-buttons.js | 4 ++-- .../audio-player-handler.js | 6 ++--- .../continuous-scrolling-box.js | 4 ++-- .../featured-blog-video-handler.js | 4 ++-- .../template-js-handler/homepage.js | 8 +++---- .../template-js-handler/load-more-entries.js | 2 +- .../looping-video-handler.js | 2 +- .../participate-page-donate.js | 2 +- .../publication-summary-bar.js | 10 ++++---- .../template-js-handler/pulse-profile-card.js | 4 ++-- .../pulse-profile-list-filter.js | 2 +- .../template-js-handler/share-button-group.js | 2 +- .../window/sticky-share-button-group.js | 4 ++-- source/js/main.js | 2 +- source/js/multipage-nav.js | 4 ++-- source/js/nav-newsletter.js | 2 +- 71 files changed, 192 insertions(+), 192 deletions(-) diff --git a/copy-db.js b/copy-db.js index c584760d88d..0484cb81f31 100644 --- a/copy-db.js +++ b/copy-db.js @@ -9,7 +9,7 @@ const APP = process.argv.includes(`--prod`) ? PROD_APP : STAGE_APP; if (APP === STAGE_APP) { console.log( - `Running db copy for staging, run with --prod to run for production` + `Running db copy for staging, run with --prod to run for production`, ); } @@ -100,7 +100,7 @@ postgres(`createdb ${DB_FLAGS} wagtail`); console.log(`Building user roles...`); [ROLE, `datastudio`, `datagrip-cade`].forEach((role) => - postgres(`createuser ${DB_FLAGS} -s ${role}`, true) + postgres(`createuser ${DB_FLAGS} -s ${role}`, true), ); console.log(`Importing database snapshot...`); @@ -117,7 +117,7 @@ run(`inv createsuperuser`, true, silent); console.log(`Migrating database to match current branch migrations...`); run( - `docker exec ${IMAGE_NAMES.BACKEND} ./dockerpythonvenv/bin/python network-api/manage.py migrate` + `docker exec ${IMAGE_NAMES.BACKEND} ./dockerpythonvenv/bin/python network-api/manage.py migrate`, ); console.log(`Stopping docker images...`); diff --git a/source/js/buyers-guide/analytics-events.js b/source/js/buyers-guide/analytics-events.js index d4c5c70e301..50b77b99cc8 100644 --- a/source/js/buyers-guide/analytics-events.js +++ b/source/js/buyers-guide/analytics-events.js @@ -123,7 +123,7 @@ function bindCheckboxCheckedGA(selector, eventData) { ReactGA.event(eventData); } }, - true + true, ); } @@ -156,7 +156,7 @@ function trackSearchBoxUsage() { sessionStorage.setItem(SESSION_KEY, true); }, - true + true, ); } @@ -166,7 +166,7 @@ function trackSearchBoxUsage() { function trackGoBackToAllProductsLink() { const link = document.querySelector("body.catalog .go-back-to-all-link"); const searchBox = document.querySelector( - "body.catalog input#product-filter-search-input" + "body.catalog input#product-filter-search-input", ); if (!(link && searchBox)) { @@ -183,7 +183,7 @@ function trackGoBackToAllProductsLink() { label: `All link tap for ${searchBox.value}`, }); }, - true + true, ); } diff --git a/source/js/buyers-guide/bg-main.js b/source/js/buyers-guide/bg-main.js index 261224db371..832edeb50d4 100644 --- a/source/js/buyers-guide/bg-main.js +++ b/source/js/buyers-guide/bg-main.js @@ -48,7 +48,7 @@ let main = { initializeSentry( env.SENTRY_DSN, env.RELEASE_VERSION, - env.SENTRY_ENVIRONMENT + env.SENTRY_ENVIRONMENT, ); } diff --git a/source/js/buyers-guide/components/creepiness-chart/creepiness-chart.jsx b/source/js/buyers-guide/components/creepiness-chart/creepiness-chart.jsx index 70f7fda50f3..92d1e20e80d 100644 --- a/source/js/buyers-guide/components/creepiness-chart/creepiness-chart.jsx +++ b/source/js/buyers-guide/components/creepiness-chart/creepiness-chart.jsx @@ -63,7 +63,7 @@ class CreepChart extends Component { {this.state.creepinessData.map((data, index) => { let percent = Math.round( - (100 * data.value) / this.state.totalCreepiness + (100 * data.value) / this.state.totalCreepiness, ); let voteColumn = this.props.userVoteGroup === index ? `your-vote` : ``; diff --git a/source/js/buyers-guide/components/creepometer/creepometer.jsx b/source/js/buyers-guide/components/creepometer/creepometer.jsx index 6c459bfa08d..06722230316 100644 --- a/source/js/buyers-guide/components/creepometer/creepometer.jsx +++ b/source/js/buyers-guide/components/creepometer/creepometer.jsx @@ -181,7 +181,7 @@ class Creepometer extends Component { */ render() { let frameOffset = Math.round( - (this.state.percentage * (this.faceCount - 1)) / 100 + (this.state.percentage * (this.faceCount - 1)) / 100, ); let trackheadOpts = { diff --git a/source/js/buyers-guide/components/product-quiz/product-quiz.jsx b/source/js/buyers-guide/components/product-quiz/product-quiz.jsx index 56893bb3e43..31f82833e37 100644 --- a/source/js/buyers-guide/components/product-quiz/product-quiz.jsx +++ b/source/js/buyers-guide/components/product-quiz/product-quiz.jsx @@ -28,7 +28,7 @@ class ProductQuiz extends Component { componentDidMount() { this.setState({ numBad: this.state.selectedChoices.filter( - (choice) => choice.points === POINTS.bad + (choice) => choice.points === POINTS.bad, ).length, score: this.state.selectedChoices.reduce((acc, choice) => { return acc + choice.points; @@ -41,7 +41,7 @@ class ProductQuiz extends Component { this.setState({ // find out how many "bad" products are selected numBad: this.state.selectedChoices.filter( - (choice) => choice.points === POINTS.bad + (choice) => choice.points === POINTS.bad, ).length, // calculate the score score: this.state.selectedChoices.reduce((acc, choice) => { diff --git a/source/js/buyers-guide/components/social-share/product-quiz-share-buttons.jsx b/source/js/buyers-guide/components/social-share/product-quiz-share-buttons.jsx index 346f1b8b2ee..cfd0bb5edac 100644 --- a/source/js/buyers-guide/components/social-share/product-quiz-share-buttons.jsx +++ b/source/js/buyers-guide/components/social-share/product-quiz-share-buttons.jsx @@ -55,7 +55,7 @@ class ProductQuizShareButtons extends Component { shareButtonClicked(event, shareProgressButtonId) { if (shareProgressButtonId) { const shareProgressButton = document.querySelector( - `#${shareProgressButtonId} a` + `#${shareProgressButtonId} a`, ); if (shareProgressButton) { @@ -81,18 +81,18 @@ class ProductQuizShareButtons extends Component {
{this.renderFacebookButton( - Share on Facebook + Share on Facebook, )} {this.renderTwitterButton( - Share on Twitter + Share on Twitter, )}
{this.renderEmailButton( - Share by Email + Share by Email, )} {this.renderCopyLinkButton( - Copy to clipboard + Copy to clipboard, )}
diff --git a/source/js/buyers-guide/components/social-share/social-share.jsx b/source/js/buyers-guide/components/social-share/social-share.jsx index 20df6cc2d48..87726bdf1d7 100644 --- a/source/js/buyers-guide/components/social-share/social-share.jsx +++ b/source/js/buyers-guide/components/social-share/social-share.jsx @@ -33,7 +33,7 @@ const SocialShareLink = (props) => { srLabel = `Twitter`; shareEvent.label += `to twitter`; link = `https://twitter.com/intent/tweet?text=${encodeURIComponent( - shareText + shareText, )}`; } diff --git a/source/js/buyers-guide/homepage-c-slider.js b/source/js/buyers-guide/homepage-c-slider.js index fe139c21532..f4b64616838 100644 --- a/source/js/buyers-guide/homepage-c-slider.js +++ b/source/js/buyers-guide/homepage-c-slider.js @@ -72,7 +72,7 @@ export default { // Figure out which face to show while scrolling: let dingFilter = !!document.querySelector(`body.show-ding-only`); let visible = Array.from(products).filter((v) => - isElementInViewport(v, dingFilter) + isElementInViewport(v, dingFilter), ); let n = visible.length; @@ -96,16 +96,16 @@ export default { MINIMUM_HAPPINESS_RATING, MAXIMUM_CREEPINESS_RATING, 0, - 100 + 100, ), 1, - 100 + 100, ); // The averageCreepiness will be in range [1,100] so we can dec1 the // valueto make sure we're in frame range [0,frames.length-1]: let frame = Math.round( - ((SPRITE_FRAME_COUNT - 1) * (mappedAverageCreepiness - 1)) / 100 + ((SPRITE_FRAME_COUNT - 1) * (mappedAverageCreepiness - 1)) / 100, ); face.style.backgroundPositionY = `${-frame * EMOJI_FRAME_HEIGHT}px`; @@ -120,19 +120,19 @@ export default { } else { let format = pgettext( "Creepiness label followed by an exclamation mark", - "%(label)s!" + "%(label)s!", ); bubbleText.textContent = interpolate( format, { label: CREEPINESS_LABELS[bin] }, - true + true, ); bubble.classList.remove(`d-none`); } }, { passive: true, // remember not to bog down the UI thread. - } + }, ); /** @@ -196,7 +196,7 @@ export default { }, { passive: true, // remember not to bog down the UI thread. - } + }, ); } }, diff --git a/source/js/buyers-guide/inject-react/creep-vote.js b/source/js/buyers-guide/inject-react/creep-vote.js index 80648c19a1c..c1f1be16c7b 100644 --- a/source/js/buyers-guide/inject-react/creep-vote.js +++ b/source/js/buyers-guide/inject-react/creep-vote.js @@ -42,9 +42,9 @@ export default (apps, siteUrl) => { votes={votes} whenLoaded={() => resolve()} joinUsApiUrl={`${siteUrl}/api/campaign/signups/0/`} - /> + />, ); - }) + }), ); }); }; diff --git a/source/js/buyers-guide/inject-react/product-quiz.js b/source/js/buyers-guide/inject-react/product-quiz.js index a91f5bf4012..8f04e8ef68b 100644 --- a/source/js/buyers-guide/inject-react/product-quiz.js +++ b/source/js/buyers-guide/inject-react/product-quiz.js @@ -17,9 +17,9 @@ export default (apps, siteUrl) => { whenLoaded={() => resolve()} joinUsApiUrl={`${siteUrl}/api/campaign/signups/0/`} pniHomeUrl={`${siteUrl}/privacynotincluded/`} - /> + />, ); - }) + }), ); }); }; diff --git a/source/js/buyers-guide/newsletter-box.js b/source/js/buyers-guide/newsletter-box.js index 20a35569972..1ff00917f00 100644 --- a/source/js/buyers-guide/newsletter-box.js +++ b/source/js/buyers-guide/newsletter-box.js @@ -6,18 +6,18 @@ const NewsletterBox = { toggleVisibilityClasses: () => { const buyersGuideNewsletterBox = document.querySelectorAll( - ".buyersguide-newsletter-box" + ".buyersguide-newsletter-box", ); // Used for toggle visibility for buyersguide newsletter container if (buyersGuideNewsletterBox.length > 0) { buyersGuideNewsletterBox.forEach((box) => - box.classList.remove("tw-hidden") + box.classList.remove("tw-hidden"), ); } // Used for buyersguide product review grid toggle visibility const buyersGuideGridContainer = document.querySelector( - "#product-grid-newsletter-signup" + "#product-grid-newsletter-signup", ); if (buyersGuideGridContainer) { buyersGuideGridContainer.classList.add("tw-flex"); diff --git a/source/js/buyers-guide/product-tab.js b/source/js/buyers-guide/product-tab.js index 45ddb8c13b4..4daf391d2b8 100644 --- a/source/js/buyers-guide/product-tab.js +++ b/source/js/buyers-guide/product-tab.js @@ -10,7 +10,7 @@ function setHighlight(target) { button.classList.remove( "tw-bg-white", "tw-text-black", - "hover:tw-text-blue-80" + "hover:tw-text-blue-80", ); button.classList.add("tw-bg-black", "tw-text-white"); button.setAttribute("aria-selected", "true"); diff --git a/source/js/buyers-guide/search/history.js b/source/js/buyers-guide/search/history.js index 54bfaffa240..642d7f159a1 100644 --- a/source/js/buyers-guide/search/history.js +++ b/source/js/buyers-guide/search/history.js @@ -16,21 +16,21 @@ export function setupHistoryManagement( searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ) { setupPopStateHandler( instance, searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ); performInitialHistoryReplace( instance, searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ); } @@ -45,7 +45,7 @@ export function performInitialHistoryReplace( searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ) { history.replaceState( { @@ -57,7 +57,7 @@ export function performInitialHistoryReplace( sort: history.state?.sort ?? "ASCENDING", }, Utils.getTitle(categoryTitle.value.trim()), - location.href + location.href, ); if (history.state?.search) { @@ -86,7 +86,7 @@ export function performInitialHistoryReplace( sort: history.state?.sort, }, Utils.getTitle(categoryTitle.value.trim()), - location.href + location.href, ); searchBar.classList.add(`has-content`); @@ -130,7 +130,7 @@ export function setupPopStateHandler( searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ) { window.addEventListener(`popstate`, (event) => { const { state } = event; diff --git a/source/js/buyers-guide/search/member-functions.js b/source/js/buyers-guide/search/member-functions.js index 924ad16571f..8921dce48c9 100644 --- a/source/js/buyers-guide/search/member-functions.js +++ b/source/js/buyers-guide/search/member-functions.js @@ -10,7 +10,7 @@ const subcategories = document.querySelectorAll(`.subcategories`); */ export function setupNavLinks(instance) { const navLinks = document.querySelectorAll( - `#multipage-nav a,.category-header,#pni-nav-mobile a` + `#multipage-nav a,.category-header,#pni-nav-mobile a`, ); for (const nav of navLinks) { @@ -45,7 +45,7 @@ export function setupNavLinks(instance) { sort: history.state?.sort, }, Utils.getTitle(categoryName), - evt.target.href + evt.target.href, ); document.title = Utils.getTitle(categoryName); @@ -84,7 +84,7 @@ export function setupNavLinks(instance) { categoryTitle.value = evt.target.dataset.parent; parentTitle.value = ""; href = document.querySelector( - `#multipage-nav a[data-name="${evt.target.dataset.parent}"],.category-header` + `#multipage-nav a[data-name="${evt.target.dataset.parent}"],.category-header`, ).href; instance.toggleSubcategory(true); } @@ -99,18 +99,18 @@ export function setupNavLinks(instance) { sort: history.state?.sort, }, Utils.getTitle(subcategoryName), - href + href, ); document.title = Utils.getTitle(categoryTitle.value.trim()); Utils.updateHeader( categoryTitle.value.trim(), - parentTitle.value.trim() + parentTitle.value.trim(), ); instance.filterCategory(categoryTitle.value.trim()); } }, - true + true, ); } } @@ -142,7 +142,7 @@ export function setupGoBackToAll(instance) { sort: history.state?.sort, }, Utils.getTitle(evt.target.dataset.name), - evt.target.href + evt.target.href, ); Utils.setActiveCatNavLink("None"); diff --git a/source/js/buyers-guide/search/pni-sort-dropdown.js b/source/js/buyers-guide/search/pni-sort-dropdown.js index 154ec8305fd..9307fa0d2cb 100644 --- a/source/js/buyers-guide/search/pni-sort-dropdown.js +++ b/source/js/buyers-guide/search/pni-sort-dropdown.js @@ -10,26 +10,26 @@ export class PNISortDropdown { this.dropdown = document.querySelector("[data-pni-sort-dropdown]"); this.dropdownButton = document.querySelector( - "[data-pni-sort-dropdown-button]" + "[data-pni-sort-dropdown-button]", ); this.dropdownButtonContent = document.querySelector( - "[data-pni-sort-dropdown-button-content]" + "[data-pni-sort-dropdown-button-content]", ); this.dropdownButtonArrow = document.querySelector( - "[data-pni-sort-dropdown-button-arrow]" + "[data-pni-sort-dropdown-button-arrow]", ); this.listContainer = document.querySelector( - "[data-pni-sort-dropdown-list-container]" + "[data-pni-sort-dropdown-list-container]", ); this.listItems = document.querySelectorAll( - "[data-pni-sort-dropdown-list-item]" + "[data-pni-sort-dropdown-list-item]", ); this.listItemIds = []; if (!this.dropdown) { return console.error( - `Could not find the PNI Creepiness Dropdown. PNI Creepiness Dropdown will not be available.` + `Could not find the PNI Creepiness Dropdown. PNI Creepiness Dropdown will not be available.`, ); } @@ -75,7 +75,7 @@ export class PNISortDropdown { if (history.state?.sort && !searchParameter) { document .querySelector( - `[data-pni-sort-dropdown-list-item][data-value=${history.state.sort}]` + `[data-pni-sort-dropdown-list-item][data-value=${history.state.sort}]`, ) .click(); } diff --git a/source/js/buyers-guide/search/pni-toggle.js b/source/js/buyers-guide/search/pni-toggle.js index b5c3a47b576..03e91a122f4 100644 --- a/source/js/buyers-guide/search/pni-toggle.js +++ b/source/js/buyers-guide/search/pni-toggle.js @@ -13,7 +13,7 @@ export class PNIToggle { // we can be confident that any page that should have it, has it, // failing our tests on pages that should but don't. return console.warn( - `Could not find the PNI filter checkbox. PNI filtering will not be available.` + `Could not find the PNI filter checkbox. PNI filtering will not be available.`, ); } diff --git a/source/js/buyers-guide/search/search-filter.js b/source/js/buyers-guide/search/search-filter.js index b8033f29d87..a7cf170bff2 100644 --- a/source/js/buyers-guide/search/search-filter.js +++ b/source/js/buyers-guide/search/search-filter.js @@ -42,7 +42,7 @@ export class SearchFilter { searchBar, searchInput, mobileSearchBar, - mobileSearchInput + mobileSearchInput, ); setupReviewLinks(this); @@ -59,7 +59,7 @@ export class SearchFilter { // we want the animation to start when the first eight products images are loaded Promise.allSettled( Array.from( - document.querySelectorAll(".product-box.d-flex img.product-thumbnail") + document.querySelectorAll(".product-box.d-flex img.product-thumbnail"), ) .slice(0, 8) .filter((img) => !img.complete) @@ -68,8 +68,8 @@ export class SearchFilter { new Promise((resolve, reject) => { img.onload = resolve; img.onerror = reject; - }) - ) + }), + ), ).then(() => { if (this.categoryTitle.value === "None") { Utils.toggleScrollAnimation(); @@ -86,16 +86,16 @@ export class SearchFilter { */ setupSearchBar() { const searchBar = (this.searchBar = document.querySelector( - `#product-filter-search` + `#product-filter-search`, )); const mobileSearchBar = (this.mobileSearchBar = document.querySelector( - `#pni-mobile-search-container` + `#pni-mobile-search-container`, )); if (!searchBar || !mobileSearchBar) { return console.warn( - `Could not find the PNI search bar. Search will not be available.` + `Could not find the PNI search bar. Search will not be available.`, ); } @@ -126,7 +126,7 @@ export class SearchFilter { this.clearText(); applyHistory(this); } - }, 500) + }, 500), ); mobileSearchInput.addEventListener( @@ -141,14 +141,14 @@ export class SearchFilter { this.clearText(); applyHistory(this); } - }, 500) + }, 500), ); const clear = searchBar.querySelector(`.clear-icon`); const mobileClear = mobileSearchBar.querySelector(`.clear-icon`); if (!clear || !mobileClear) { return console.warn( - `Could not find the PNI search input clear icon. Search will work, but clearing will not.` + `Could not find the PNI search input clear icon. Search will work, but clearing will not.`, ); } @@ -269,7 +269,7 @@ export class SearchFilter { updateSubCatLinkClass( document.querySelector(`a.subcategories.active`), defaultClasses, - activeClasses + activeClasses, ); if (clear === true) return; @@ -283,7 +283,7 @@ export class SearchFilter { updateSubCatLinkClass( document.querySelector(`a.subcategories[data-name="${categoryName}"]`), activeClasses, - defaultClasses + defaultClasses, ); Utils.scrollToSubCategory(categoryName); diff --git a/source/js/buyers-guide/search/slider-area.js b/source/js/buyers-guide/search/slider-area.js index 524d14323cc..6b2cc1a3194 100644 --- a/source/js/buyers-guide/search/slider-area.js +++ b/source/js/buyers-guide/search/slider-area.js @@ -45,10 +45,10 @@ function markScrollEnd(event) { subClasses.remove("cursor-grabbing", "select-none"); [`mousemove`].forEach((type) => - document.removeEventListener(type, markScrollMove) + document.removeEventListener(type, markScrollMove), ); [`mouseup`].forEach((type) => - document.removeEventListener(type, markScrollEnd) + document.removeEventListener(type, markScrollEnd), ); } diff --git a/source/js/buyers-guide/search/utils.js b/source/js/buyers-guide/search/utils.js index 1fb32af50e0..827c7dcc83d 100644 --- a/source/js/buyers-guide/search/utils.js +++ b/source/js/buyers-guide/search/utils.js @@ -5,10 +5,10 @@ const FILTERS = [`company`, `name`, `blurb`, `worst-case`]; const ALL_PRODUCTS = document.querySelectorAll(`figure.product-box`); const SUBMIT_PRODUCT = document.querySelector(".recommend-product"); const NO_RESULTS_NOTICE = document.getElementById( - `product-filter-no-results-notice` + `product-filter-no-results-notice`, ); const ALL_CATEGORY_LABEL = document.querySelector( - `#multipage-nav .multipage-link[data-name="None"]` + `#multipage-nav .multipage-link[data-name="None"]`, ).textContent; const PARENT_TITLE = document.querySelector(`.parent-title`); @@ -42,7 +42,7 @@ export class Utils { if (document.querySelector(`#multipage-nav a[data-name="${parent}"]`)) { document.querySelector(".category-header").href = document.querySelector( - `#multipage-nav a[data-name="${parent}"]` + `#multipage-nav a[data-name="${parent}"]`, ).href; } document.querySelector(`#pni-nav-mobile .active-link-label`).textContent = @@ -54,7 +54,7 @@ export class Utils { if (document.querySelector(`#multipage-nav a[data-name="${category}"]`)) { document.querySelector(".category-header").href = document.querySelector( - `#multipage-nav a[data-name="${category}"]` + `#multipage-nav a[data-name="${category}"]`, ).href; } document.querySelector(`#pni-nav-mobile .active-link-label`).textContent = @@ -89,10 +89,10 @@ export class Utils { */ static activateCatNav(category = "None") { const linkForLarge = document.querySelector( - `#multipage-nav a[data-name="${category}"]` + `#multipage-nav a[data-name="${category}"]`, ); const linkForMobile = document.querySelector( - `#pni-nav-mobile a[data-name="${category}"]` + `#pni-nav-mobile a[data-name="${category}"]`, ); // for larger screens @@ -194,7 +194,7 @@ export class Utils { y: 0, stagger: 0.1, overwrite: true, - } + }, ); } @@ -269,7 +269,7 @@ export class Utils { } const productCategories = Array.from( - product.querySelectorAll(".product-categories") + product.querySelectorAll(".product-categories"), ); return productCategories.map((c) => c.value.trim()).includes(category); @@ -301,8 +301,8 @@ export class Utils { return propertyNameA < propertyNameB ? -1 : propertyNameA > propertyNameB - ? 1 - : 0; + ? 1 + : 0; } } }); @@ -333,7 +333,7 @@ export class Utils { static moveCreepyFace() { const CREEPINESS_FACE = document.querySelector( - ".creep-o-meter-information" + ".creep-o-meter-information", ); // When searching, check to see how many products are still visible // If there are no visible products, there are "no search results" @@ -382,7 +382,7 @@ export class Utils { */ static scrollToSubCategory(category) { const subcatLink = document.querySelector( - `a.subcategories[data-name="${category}"]` + `a.subcategories[data-name="${category}"]`, ); if (!category || !subcatLink) return; diff --git a/source/js/buyers-guide/template-js-handler/desktop-search-bar.js b/source/js/buyers-guide/template-js-handler/desktop-search-bar.js index 47dad6609f2..78ae599d416 100644 --- a/source/js/buyers-guide/template-js-handler/desktop-search-bar.js +++ b/source/js/buyers-guide/template-js-handler/desktop-search-bar.js @@ -10,6 +10,6 @@ export default () => { setupSearchBar( "#product-filter-search-input", "#product-filter-search-input + .clear-icon", - `#product-filter-search` + `#product-filter-search`, ); }; diff --git a/source/js/buyers-guide/template-js-handler/mobile-nav-stickiness-handler.js b/source/js/buyers-guide/template-js-handler/mobile-nav-stickiness-handler.js index 03b99c22985..e501f5d762f 100644 --- a/source/js/buyers-guide/template-js-handler/mobile-nav-stickiness-handler.js +++ b/source/js/buyers-guide/template-js-handler/mobile-nav-stickiness-handler.js @@ -9,7 +9,7 @@ export default () => { const menuBurger = document.querySelector(".burger"); const primaryNavContainer = document.querySelector( - ".primary-nav-container-wrapper" + ".primary-nav-container-wrapper", ); if (!menuBurger || !primaryNavContainer) return; diff --git a/source/js/buyers-guide/template-js-handler/mobile-search-bar.js b/source/js/buyers-guide/template-js-handler/mobile-search-bar.js index cdb8a6a55fa..fe770d750d5 100644 --- a/source/js/buyers-guide/template-js-handler/mobile-search-bar.js +++ b/source/js/buyers-guide/template-js-handler/mobile-search-bar.js @@ -3,7 +3,7 @@ import setupSearchBar from "./search-bar"; export default () => { const mobileSearch = document.querySelector("#mobile-search"); const searchContainer = document.querySelector( - "#pni-mobile-search-container" + "#pni-mobile-search-container", ); const mobileCatNav = document.querySelector("#pni-nav-mobile"); @@ -28,7 +28,7 @@ export default () => { setupSearchBar( "#pni-mobile-bar", "#pni-mobile-search-container .clear-icon", - `#pni-mobile-search-container` + `#pni-mobile-search-container`, ); } else { const input = document.querySelector("#pni-mobile-bar"); diff --git a/source/js/buyers-guide/template-js-handler/pni-category-dropdown.js b/source/js/buyers-guide/template-js-handler/pni-category-dropdown.js index 9198ea89990..a7685ff5897 100644 --- a/source/js/buyers-guide/template-js-handler/pni-category-dropdown.js +++ b/source/js/buyers-guide/template-js-handler/pni-category-dropdown.js @@ -1,12 +1,12 @@ export default () => { const dropdown = document.querySelector(".pni-category-dropdown"); const dropdownButton = dropdown.querySelector( - ".pni-category-dropdown-button" + ".pni-category-dropdown-button", ); const dropdownButtonContent = dropdownButton.querySelector("span"); const dropdownButtonChevron = dropdownButton.querySelector("svg"); const dropdownSelect = dropdown.querySelector( - "#pni-category-dropdown-select" + "#pni-category-dropdown-select", ); let defaultDropdownHeaderText; // Keep track of dropdown button's default text for different locales @@ -21,7 +21,7 @@ export default () => { const resizeCategoryNavigation = () => { const categoryLinks = [ ...document.querySelectorAll( - "#buyersguide-category-link-container > .multipage-link" + "#buyersguide-category-link-container > .multipage-link", ), ].reverse(); @@ -52,7 +52,7 @@ export default () => { "tw-bg-white", "tw-text-gray-40", "hover:tw-text-black", - "tw-mb-0" + "tw-mb-0", ); category.classList.add( "tw-w-full", @@ -60,7 +60,7 @@ export default () => { "tw-font-sans", "tw-font-bold", "tw-p-8", - "tw-text-right" + "tw-text-right", ); category.classList.remove("tw-block"); el.append(category); @@ -70,7 +70,7 @@ export default () => { // Highlight selected category const highlightSelectedCategory = () => { const activeCategory = document.querySelector( - "#pni-category-dropdown-select .active" + "#pni-category-dropdown-select .active", ); const dropdownHeaderText = dropdownButtonContent.querySelector("span"); @@ -117,7 +117,7 @@ export default () => { "tw-w-full", "large:tw-w-4/5", "tw-overflow-x-auto", - "tw-mr-8" + "tw-mr-8", ); defaultDropdownHeaderText = diff --git a/source/js/buyers-guide/template-js-handler/product-page-comment-handler.js b/source/js/buyers-guide/template-js-handler/product-page-comment-handler.js index 943f6d85e1c..0c07871408d 100644 --- a/source/js/buyers-guide/template-js-handler/product-page-comment-handler.js +++ b/source/js/buyers-guide/template-js-handler/product-page-comment-handler.js @@ -6,7 +6,7 @@ export default () => { // Commento's parent div, in which it loads all of its content through JS. const commentoContainer = document.querySelector( - "#view-product-page #commento" + "#view-product-page #commento", ); if (!commentoContainer) { diff --git a/source/js/common/google-analytics.js b/source/js/common/google-analytics.js index f3889a6fcdf..8e9908fe913 100644 --- a/source/js/common/google-analytics.js +++ b/source/js/common/google-analytics.js @@ -36,7 +36,7 @@ const getIdentifier = (type = "ga") => { if (!identifier) { console.warn( - `No ${type.toUpperCase()} identifier found: skipping bootstrap step` + `No ${type.toUpperCase()} identifier found: skipping bootstrap step`, ); } diff --git a/source/js/common/inject-react/newsletter-signup-module.js b/source/js/common/inject-react/newsletter-signup-module.js index 2509122a059..d275e0e4ef5 100644 --- a/source/js/common/inject-react/newsletter-signup-module.js +++ b/source/js/common/inject-react/newsletter-signup-module.js @@ -11,7 +11,7 @@ export default (apps, siteUrl) => { // excluding `.newsletter-signup-module.on-nav` because it's taken care of by nav-newsletter.js document .querySelectorAll( - `.newsletter-signup-module:not(.on-nav):not(.react-rendered)` + `.newsletter-signup-module:not(.on-nav):not(.react-rendered)`, ) .forEach((element) => { const props = element.dataset; @@ -31,7 +31,7 @@ export default (apps, siteUrl) => { new Promise((resolve) => { const root = createRoot(element); root.render(
resolve()} />); - }) + }), ); } }); diff --git a/source/js/common/inject-react/petition-thank-you.js b/source/js/common/inject-react/petition-thank-you.js index d04406361cb..04114ab9ede 100644 --- a/source/js/common/inject-react/petition-thank-you.js +++ b/source/js/common/inject-react/petition-thank-you.js @@ -15,9 +15,9 @@ export default (apps) => { new Promise((resolve) => { const root = createRoot(element); root.render( - resolve()} /> + resolve()} />, ); - }) + }), ); }); }; diff --git a/source/js/common/template-js-handles/header-donate-button.js b/source/js/common/template-js-handles/header-donate-button.js index 4e95d3928ef..232a5fbbcf6 100644 --- a/source/js/common/template-js-handles/header-donate-button.js +++ b/source/js/common/template-js-handles/header-donate-button.js @@ -6,7 +6,7 @@ import { ReactGA } from "../../common"; */ export default () => { const donateHeaderBtn = document.querySelectorAll( - "[data-donate-header-button]" + "[data-donate-header-button]", ); if (donateHeaderBtn.length > 0) { donateHeaderBtn.forEach((element) => { diff --git a/source/js/common/template-js-handles/sticky-cta.js b/source/js/common/template-js-handles/sticky-cta.js index 06a7d36b52a..978de18a33b 100644 --- a/source/js/common/template-js-handles/sticky-cta.js +++ b/source/js/common/template-js-handles/sticky-cta.js @@ -16,7 +16,7 @@ export default () => { let elCtaAnchor = document.querySelector(`#cta-anchor`); let elStickyButton = document.querySelector( - `.narrow-sticky-button-container` + `.narrow-sticky-button-container`, ); let noopCtaButton = () => {}; let adjustCtaButton = noopCtaButton; diff --git a/source/js/components/newsletter-signup/atoms/button-quit.jsx b/source/js/components/newsletter-signup/atoms/button-quit.jsx index 45c6afecaaa..e41594a1de9 100644 --- a/source/js/components/newsletter-signup/atoms/button-quit.jsx +++ b/source/js/components/newsletter-signup/atoms/button-quit.jsx @@ -14,7 +14,7 @@ const ButtonQuit = ({ // we are using hardcoded Tailwind classes directly here for now. let classes = classNames( `tw-btn tw-btn-${buttonStyle} btn-dismiss`, - widthClasses + widthClasses, ); return ( diff --git a/source/js/components/newsletter-signup/atoms/select.jsx b/source/js/components/newsletter-signup/atoms/select.jsx index 045cc4721ca..d95b4b7dd47 100644 --- a/source/js/components/newsletter-signup/atoms/select.jsx +++ b/source/js/components/newsletter-signup/atoms/select.jsx @@ -35,7 +35,7 @@ Select.propTypes = { PropTypes.shape({ value: PropTypes.string.isRequired, label: PropTypes.string.isRequired, - }) + }), ).isRequired, onChange: PropTypes.func.isRequired, required: PropTypes.bool, diff --git a/source/js/components/newsletter-signup/organisms/default-layout-signup.jsx b/source/js/components/newsletter-signup/organisms/default-layout-signup.jsx index 46bdeb81e93..8fe484e19cb 100644 --- a/source/js/components/newsletter-signup/organisms/default-layout-signup.jsx +++ b/source/js/components/newsletter-signup/organisms/default-layout-signup.jsx @@ -127,7 +127,7 @@ class DefaultSignupForm extends Component { handlePrivacyChange(event) { this.updateFormFieldValue( event.target.name, - event.target.checked.toString() + event.target.checked.toString(), ); } @@ -259,7 +259,7 @@ class DefaultSignupForm extends Component { id={this.ids[name]} name={name} label={getText( - `I'm okay with Mozilla handling my info as explained in this Privacy Notice` + `I'm okay with Mozilla handling my info as explained in this Privacy Notice`, )} value={this.getFormFieldValue(name)} checked={this.getFormFieldValue(name) === "true"} diff --git a/source/js/components/petition/petition-thank-you.jsx b/source/js/components/petition/petition-thank-you.jsx index bfe3452f23c..6f4effa3e07 100644 --- a/source/js/components/petition/petition-thank-you.jsx +++ b/source/js/components/petition/petition-thank-you.jsx @@ -52,7 +52,7 @@ class PetitionThankYou extends Component { if (shareProgressButtonId) { let shareProgressButton = document.querySelector( - `#${shareProgressButtonId} a` + `#${shareProgressButtonId} a`, ); if (shareProgressButton) { @@ -62,7 +62,7 @@ class PetitionThankYou extends Component { // copying current page URL (without query param or hash) to clipboard copyToClipboard( event.target, - window.location.href.split("?")[0].split("#")[0] + window.location.href.split("?")[0].split("#")[0], ); } } diff --git a/source/js/components/pulse-project-list/pulse-project-list.jsx b/source/js/components/pulse-project-list/pulse-project-list.jsx index 376548b32b8..0d2ea88616f 100644 --- a/source/js/components/pulse-project-list/pulse-project-list.jsx +++ b/source/js/components/pulse-project-list/pulse-project-list.jsx @@ -30,7 +30,7 @@ class PulseProjectList extends Component { if (this.props.whenLoaded) { this.props.whenLoaded(); } - } + }, ); }); diff --git a/source/js/components/tabbed-profile-directory/tabbed-profile-directory.jsx b/source/js/components/tabbed-profile-directory/tabbed-profile-directory.jsx index 9f68ae377db..f95ab818787 100644 --- a/source/js/components/tabbed-profile-directory/tabbed-profile-directory.jsx +++ b/source/js/components/tabbed-profile-directory/tabbed-profile-directory.jsx @@ -16,7 +16,7 @@ const TabbedProfileFilters = ({ profiles, }) => { const filterOptionsList = JSON.parse(filterOptions).map( - (filterOption) => filterOption.fields + (filterOption) => filterOption.fields, ); const subfilterOptionsList = JSON.parse(subFilters).map((option) => ({ ...option.fields, @@ -124,7 +124,7 @@ const TabbedProfileFilters = ({ useEffect(() => { // Get array of subfilters let subfilters = Object.keys(selectedSubfilters).filter( - (key) => selectedSubfilters[key] + (key) => selectedSubfilters[key], ); // filter profiles based on subfilter key if (filteredProfiles) { diff --git a/source/js/donate-banner.js b/source/js/donate-banner.js index c22aca4ae93..6a66a2fa3d4 100644 --- a/source/js/donate-banner.js +++ b/source/js/donate-banner.js @@ -40,7 +40,7 @@ const DonateBanner = { marginTop: 0, }, ], - animationOptions + animationOptions, ); const closeAnimation = banner.animate( @@ -53,7 +53,7 @@ const DonateBanner = { transform: `translateY(-100%)`, }, ], - animationOptions + animationOptions, ); closeAnimation.onfinish = () => { diff --git a/source/js/dropdowns.js b/source/js/dropdowns.js index 85b5ded4bad..8fc481fcb6a 100644 --- a/source/js/dropdowns.js +++ b/source/js/dropdowns.js @@ -5,7 +5,7 @@ const Dropdowns = { element.addEventListener("click", (_) => { element.classList.toggle("show"); const target = document.querySelector( - `[aria-labelledby="${element.id}"]` + `[aria-labelledby="${element.id}"]`, ); target.classList.toggle("d-block"); @@ -19,7 +19,7 @@ const Dropdowns = { } else { toggleText.innerText = toggleText.getAttribute("data-open"); } - }) + }), ); // Close dropdowns when item is clicked diff --git a/source/js/embed-typeform.js b/source/js/embed-typeform.js index 252c9aa58f1..053cdeb0db9 100644 --- a/source/js/embed-typeform.js +++ b/source/js/embed-typeform.js @@ -2,7 +2,7 @@ const EmbedTypeform = { init: function () { if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", () => - EmbedTypeform.setup() + EmbedTypeform.setup(), ); } else { EmbedTypeform.setup(); @@ -34,7 +34,7 @@ const EmbedTypeform = { const open = () => popup.open(); ["touchstart", "click"].forEach((evtType) => - typeformButton.addEventListener(evtType, open) + typeformButton.addEventListener(evtType, open), ); }, }; diff --git a/source/js/foundation/inject-react/pulse-project-list.js b/source/js/foundation/inject-react/pulse-project-list.js index d68d826a0f9..04a197f8c96 100644 --- a/source/js/foundation/inject-react/pulse-project-list.js +++ b/source/js/foundation/inject-react/pulse-project-list.js @@ -22,9 +22,9 @@ export default (apps, env) => { reverseChronological={target.dataset.reversed === `True`} whenLoaded={() => resolve()} directLink={target.dataset.directLink === `True`} - /> + />, ); - }) + }), ); }); }; diff --git a/source/js/foundation/inject-react/pulse-tabbed-profile-filters.js b/source/js/foundation/inject-react/pulse-tabbed-profile-filters.js index 6803d6f6bcb..d4c2660b624 100644 --- a/source/js/foundation/inject-react/pulse-tabbed-profile-filters.js +++ b/source/js/foundation/inject-react/pulse-tabbed-profile-filters.js @@ -8,27 +8,27 @@ import TabbedProfileFilters from "../../components/tabbed-profile-directory/tabb */ export default (apps) => { const domContainers = document.querySelectorAll( - "[data-tabbed-profile-filters-block]" + "[data-tabbed-profile-filters-block]", ); // Init Tabbed Profile Filters with properties domContainers.forEach((target) => { // Get options for filters const contentArea = target.querySelector( - "[data-tabbed-profile-filters-content]" + "[data-tabbed-profile-filters-content]", ); let profiles; let filterOptions; let subFilters; try { profiles = JSON.parse( - target.querySelector("#pulse-profiles").textContent + target.querySelector("#pulse-profiles").textContent, ); filterOptions = JSON.parse( - target.querySelector("#pulse-profile-filter-options").textContent + target.querySelector("#pulse-profile-filter-options").textContent, ); subFilters = JSON.parse( - target.querySelector("#pulse-profile-subfilters").textContent + target.querySelector("#pulse-profile-subfilters").textContent, ); } catch (err) { console.error(err); @@ -47,9 +47,9 @@ export default (apps) => { subfiltersKey={contentArea.dataset.subfiltersKey} whenLoaded={() => resolve} profiles={profiles} - /> + />, ); - }) + }), ); }); }; diff --git a/source/js/foundation/pages/callpower.js b/source/js/foundation/pages/callpower.js index 5453cb6407e..8343617ca7b 100644 --- a/source/js/foundation/pages/callpower.js +++ b/source/js/foundation/pages/callpower.js @@ -119,7 +119,7 @@ import copyToClipboard from "../../copy-to-clipboard.js"; if (shareProgressButtonId) { let shareProgressButton = document.querySelector( - `#${shareProgressButtonId} a` + `#${shareProgressButtonId} a`, ); if (shareProgressButton) { @@ -204,7 +204,7 @@ import copyToClipboard from "../../copy-to-clipboard.js"; .forEach((element) => { const { target } = element.dataset; element.addEventListener(`click`, (evt) => - shareButtonClicked(evt, target) + shareButtonClicked(evt, target), ); }); }, diff --git a/source/js/foundation/pages/dear-internet/template-js-handler/plane.js b/source/js/foundation/pages/dear-internet/template-js-handler/plane.js index d5bc75cd210..2b125b9e44e 100644 --- a/source/js/foundation/pages/dear-internet/template-js-handler/plane.js +++ b/source/js/foundation/pages/dear-internet/template-js-handler/plane.js @@ -29,7 +29,7 @@ class Plane { // get the position of a point slightly ahead so we can calculate the angle we want the plane to rotate let pointAhead = PATH.getPointAtLength( - (scrollPercentage + 0.0001) * pathLen + (scrollPercentage + 0.0001) * pathLen, ); // find rotating angle @@ -42,7 +42,7 @@ class Plane { "transform", `translate(${point.x}, ${point.y}) rotate(${ angleDeg + this.defaultPlaneRotation - } 0 0)` + } 0 0)`, ); this.revealPath(scrollPercentage); @@ -52,7 +52,7 @@ class Plane { // revealing/hiding PATH by adjusting the dash gap size PATH.setAttribute( "stroke-dashoffset", - (1 - scrollPercentage) * PATH.getTotalLength() + (1 - scrollPercentage) * PATH.getTotalLength(), ); } diff --git a/source/js/foundation/pages/directory-listing-filters.js b/source/js/foundation/pages/directory-listing-filters.js index fe678f07d79..d263f521446 100644 --- a/source/js/foundation/pages/directory-listing-filters.js +++ b/source/js/foundation/pages/directory-listing-filters.js @@ -7,7 +7,7 @@ const profileCache = {}; const labels = document.querySelectorAll( - `.fellowships-directory-filter .filter-option button` + `.fellowships-directory-filter .filter-option button`, ); const profileContainer = document.querySelector(`.profiles .tw-row`); const { profileType, programType } = diff --git a/source/js/foundation/pages/libraries-library-page.js b/source/js/foundation/pages/libraries-library-page.js index 395b421b21d..a9fcf56dc52 100644 --- a/source/js/foundation/pages/libraries-library-page.js +++ b/source/js/foundation/pages/libraries-library-page.js @@ -13,13 +13,13 @@ function initializeJS() { const filterJumpLink = document.getElementById("filter-section-jump-link"); filterJumpLink.classList.add("tw-hidden"); const filterShowButton = document.getElementById( - "filter-section-show-button" + "filter-section-show-button", ); filterShowButton.classList.remove("tw-hidden"); filterShowButton.addEventListener("click", showFilterModal); const filterHideButton = document.getElementById( - "filter-section-hide-button" + "filter-section-hide-button", ); filterHideButton.classList.remove("tw-hidden"); filterHideButton.addEventListener("click", hideFilterModal); diff --git a/source/js/foundation/pages/mozfest/template-js-handler/home-banner.js b/source/js/foundation/pages/mozfest/template-js-handler/home-banner.js index 52b7f6a9c5d..87e9fe904c7 100644 --- a/source/js/foundation/pages/mozfest/template-js-handler/home-banner.js +++ b/source/js/foundation/pages/mozfest/template-js-handler/home-banner.js @@ -8,7 +8,7 @@ import { ReactGA } from "../../../../common"; // For the featured banner type on mozefest homepage const watchFeaturedVideoHandler = () => { const watchVideoButton = document.querySelector( - `#mozfest-home-watch-featured-video-button` + `#mozfest-home-watch-featured-video-button`, ); const externalVideo = document.querySelector(`#mozfest-hero-video iframe`); const internalVideo = document.querySelector(`#mozfest-hero-video video`); @@ -51,7 +51,7 @@ const fadeOutOverlay = (overlay) => { const backgroundHardcodedVideoHandler = () => { let homepageBanner = document.querySelector( - "#view-mozfest-home #hero .banner" + "#view-mozfest-home #hero .banner", ); if (!homepageBanner) { @@ -60,7 +60,7 @@ const backgroundHardcodedVideoHandler = () => { let video = homepageBanner.querySelector("video.banner-video"); let pauseButton = homepageBanner.querySelector( - ".btn-video-control.btn-pause" + ".btn-video-control.btn-pause", ); let playButton = homepageBanner.querySelector(".btn-video-control.btn-play"); diff --git a/source/js/foundation/pages/mozfest/template-js-handler/video.js b/source/js/foundation/pages/mozfest/template-js-handler/video.js index 962cd3ff547..2846cb1d1fe 100644 --- a/source/js/foundation/pages/mozfest/template-js-handler/video.js +++ b/source/js/foundation/pages/mozfest/template-js-handler/video.js @@ -11,7 +11,7 @@ const watchVideoHandler = () => { videoContainers.forEach((videoContainer) => { const watchVideoButton = videoContainer.querySelector( - "[data-mozfest-video-button]" + "[data-mozfest-video-button]", ); const externalVideo = videoContainer.querySelector(`iframe`); diff --git a/source/js/foundation/pages/youtube-regrets/accordion.js b/source/js/foundation/pages/youtube-regrets/accordion.js index 72646303e09..f0202399eb4 100644 --- a/source/js/foundation/pages/youtube-regrets/accordion.js +++ b/source/js/foundation/pages/youtube-regrets/accordion.js @@ -76,7 +76,7 @@ class Accordion { const content = drawer.querySelector("[data-accordion-content]"); const button = drawer.querySelector("[data-accordion-button]"); const closeButton = drawer.querySelector( - "[data-accordion-close-button]" + "[data-accordion-close-button]", ); closeButton.classList.add("d-none"); closeButton.classList.remove("d-flex"); diff --git a/source/js/foundation/pages/youtube-regrets/browser-extension.js b/source/js/foundation/pages/youtube-regrets/browser-extension.js index ab799c31def..084ab9f432e 100644 --- a/source/js/foundation/pages/youtube-regrets/browser-extension.js +++ b/source/js/foundation/pages/youtube-regrets/browser-extension.js @@ -11,7 +11,7 @@ class BrowserExtension { checkForMobile() { if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( - navigator.userAgent + navigator.userAgent, ) ) { document diff --git a/source/js/foundation/pages/youtube-regrets/count-up.js b/source/js/foundation/pages/youtube-regrets/count-up.js index a28e9fa0fd9..c6b4cb409f7 100644 --- a/source/js/foundation/pages/youtube-regrets/count-up.js +++ b/source/js/foundation/pages/youtube-regrets/count-up.js @@ -60,7 +60,7 @@ export const initYoutubeRegretsResearchCountUp = () => { } }); }, - { rootMargin: "0px 0px -10% 0px" } + { rootMargin: "0px 0px -10% 0px" }, ); stats.forEach((stat) => { diff --git a/source/js/foundation/pages/youtube-regrets/intro-tunnel.js b/source/js/foundation/pages/youtube-regrets/intro-tunnel.js index 2fe5a90a9d5..3f54ebe1cc6 100644 --- a/source/js/foundation/pages/youtube-regrets/intro-tunnel.js +++ b/source/js/foundation/pages/youtube-regrets/intro-tunnel.js @@ -26,7 +26,7 @@ let elements = { class YouTubeRegretsTunnel { constructor() { this.includeNewsletterButtons = !!document.querySelector( - "#view-youtube-regrets" + "#view-youtube-regrets", ); this.introScrollHeight = 0; this.sceneDepth = 0; @@ -63,7 +63,7 @@ class YouTubeRegretsTunnel { 1 - (this.lastPageYOffset - positionToShow) / (positionToHide - positionToShow), - 1 + 1, ); } else { item.style.opacity = 0; @@ -135,13 +135,13 @@ class YouTubeRegretsTunnel { this.updateCSSCustomProperty( `--blockZTranslate`, ((this.lastPageYOffset * blocksSpeedFactor) / ZOOM_FACTOR) * - BLOCK_SPEED_FACTOR + BLOCK_SPEED_FACTOR, ); this.updateCSSCustomProperty( `--ringZTranslate`, ((this.lastPageYOffset * RING_DEPTH_FACTOR * blocksSpeedFactor) / ZOOM_FACTOR) * - RING_SPEED_FACTOR + RING_SPEED_FACTOR, ); } @@ -173,7 +173,7 @@ class YouTubeRegretsTunnel { setSceneDepth() { const scenePerspective = parseFloat( - this.getCSSCustomPropertyValue(`--scenePerspective`) + this.getCSSCustomPropertyValue(`--scenePerspective`), ); this.scenePerspective = scenePerspective; @@ -255,7 +255,7 @@ class YouTubeRegretsTunnel { this.setObjectsOpacity(); this.toggleScrollHint(); }, - { passive: true } + { passive: true }, ); } } diff --git a/source/js/foundation/pages/youtube-regrets/read-more-categories.js b/source/js/foundation/pages/youtube-regrets/read-more-categories.js index 03285e8972c..585f9340607 100644 --- a/source/js/foundation/pages/youtube-regrets/read-more-categories.js +++ b/source/js/foundation/pages/youtube-regrets/read-more-categories.js @@ -11,19 +11,19 @@ class ReadMoreCategories { constructor(node) { this.readMore = node; this.toggleButton = this.readMore.querySelector( - "[data-yt-categories-toggle]" + "[data-yt-categories-toggle]", ); this.readMoreText = this.readMore.querySelector( - "[data-yt-categories-toggle-more]" + "[data-yt-categories-toggle-more]", ); this.readLessText = this.readMore.querySelector( - "[data-yt-categories-toggle-less]" + "[data-yt-categories-toggle-less]", ); this.plusIcon = this.readMore.querySelector( - "[data-yt-categories-plus-icon]" + "[data-yt-categories-plus-icon]", ); this.minusIcon = this.readMore.querySelector( - "[data-yt-categories-minus-icon]" + "[data-yt-categories-minus-icon]", ); this.content = this.readMore.querySelector("[data-yt-categories-reveal]"); this.animateSpeed = 0.5; diff --git a/source/js/foundation/pages/youtube-regrets/regret-rates-chart.js b/source/js/foundation/pages/youtube-regrets/regret-rates-chart.js index 6a419e4905b..19fc8888527 100644 --- a/source/js/foundation/pages/youtube-regrets/regret-rates-chart.js +++ b/source/js/foundation/pages/youtube-regrets/regret-rates-chart.js @@ -72,7 +72,7 @@ export const initYouTubeRegretsRegretRatesChart = () => { { data, backgroundColor: labels.map((label) => - primaryEnglish.includes(label) ? bgColors.dark : bgColors.light + primaryEnglish.includes(label) ? bgColors.dark : bgColors.light, ), }, ], diff --git a/source/js/foundation/pages/youtube-regrets/regrets-reporter/share-buttons.js b/source/js/foundation/pages/youtube-regrets/regrets-reporter/share-buttons.js index 557e35c7581..d3732d77a39 100644 --- a/source/js/foundation/pages/youtube-regrets/regrets-reporter/share-buttons.js +++ b/source/js/foundation/pages/youtube-regrets/regrets-reporter/share-buttons.js @@ -59,7 +59,7 @@ class regretsReporterShareButtons { duration: 0.5, ease: "bounce.out", y: 0, - } + }, ); } @@ -68,7 +68,7 @@ class regretsReporterShareButtons { shareButtonClicked(event, shareProgressButtonId) { if (shareProgressButtonId) { let shareProgressButton = document.querySelector( - `#${shareProgressButtonId} a` + `#${shareProgressButtonId} a`, ); if (shareProgressButton) { @@ -77,10 +77,10 @@ class regretsReporterShareButtons { } else { navigator.clipboard.writeText(window.location.href); event.target.classList.remove( - "before:tw-bg-[url('../_images/youtube-regrets/regrets-reporter/landing-page/share-link.svg')]" + "before:tw-bg-[url('../_images/youtube-regrets/regrets-reporter/landing-page/share-link.svg')]", ); event.target.classList.add( - "before:tw-bg-[url('../_images/youtube-regrets/regrets-reporter/landing-page/share-link-copied.svg')]" + "before:tw-bg-[url('../_images/youtube-regrets/regrets-reporter/landing-page/share-link-copied.svg')]", ); } } @@ -100,8 +100,8 @@ class regretsReporterShareButtons { tl.eventCallback( "onStart", Array.from(document.querySelectorAll(".btn-share")).forEach((el) => - el.classList.remove("tw-hidden") - ) + el.classList.remove("tw-hidden"), + ), ); tl.play(); } diff --git a/source/js/foundation/pages/youtube-regrets/regrets-reporter/template-js-handler/cta-button.js b/source/js/foundation/pages/youtube-regrets/regrets-reporter/template-js-handler/cta-button.js index 51f5b88d2a6..92a430fdd87 100644 --- a/source/js/foundation/pages/youtube-regrets/regrets-reporter/template-js-handler/cta-button.js +++ b/source/js/foundation/pages/youtube-regrets/regrets-reporter/template-js-handler/cta-button.js @@ -7,7 +7,7 @@ import { ReactGA } from "../../../../../common"; export default () => { const regretsReporter = document.querySelector( - `#view-youtube-regrets-reporter` + `#view-youtube-regrets-reporter`, ); const addGATracking = (elements, browserName) => { @@ -29,11 +29,11 @@ export default () => { addGATracking( regretsReporter.querySelectorAll(`.btn-download.btn-firefox-download`), - `Firefox` + `Firefox`, ); addGATracking( regretsReporter.querySelectorAll(`.btn-download.btn-chrome-download`), - `Chrome` + `Chrome`, ); }; diff --git a/source/js/foundation/pages/youtube-regrets/regrets-reporter/utm-buttons.js b/source/js/foundation/pages/youtube-regrets/regrets-reporter/utm-buttons.js index e8556e96cd8..07c7e5f4d92 100644 --- a/source/js/foundation/pages/youtube-regrets/regrets-reporter/utm-buttons.js +++ b/source/js/foundation/pages/youtube-regrets/regrets-reporter/utm-buttons.js @@ -26,10 +26,10 @@ class regretsReporterUtmButtons { updateButtonURLs(params) { const downloadExtensionButtons = document.querySelectorAll( - `.download-link-button--firefox, .download-link-button--chrome` + `.download-link-button--firefox, .download-link-button--chrome`, ); const emailReminderButton = document.querySelector( - `.download-link-button--email` + `.download-link-button--email`, ); downloadExtensionButtons.forEach(function (downloadBtn) { diff --git a/source/js/foundation/template-js-handler/audio-player-handler.js b/source/js/foundation/template-js-handler/audio-player-handler.js index fb69299d716..2b47a03e1f7 100644 --- a/source/js/foundation/template-js-handler/audio-player-handler.js +++ b/source/js/foundation/template-js-handler/audio-player-handler.js @@ -20,7 +20,7 @@ const audioBlockHandler = () => { for (const audioPlayer of pageAudioBlocks) { const audio = audioPlayer.querySelector("audio.embedded-audio"); const pauseButton = audioPlayer.querySelector( - ".btn-audio-control.btn-pause" + ".btn-audio-control.btn-pause", ); const playButton = audioPlayer.querySelector(".btn-audio-control.btn-play"); const durationContainer = audioPlayer.querySelector("#duration"); @@ -70,7 +70,7 @@ const audioBlockHandler = () => { const updateProgressBar = () => { seekSlider.style.setProperty( "--seek-before-width", - (seekSlider.value / seekSlider.max) * 100 + "%" + (seekSlider.value / seekSlider.max) * 100 + "%", ); }; @@ -95,7 +95,7 @@ const audioBlockHandler = () => { seekSlider.value = Math.floor(audio.currentTime); updateProgressBar(); currentTimeContainer.textContent = calculateTime( - Math.floor(audio.currentTime) + Math.floor(audio.currentTime), ); }); diff --git a/source/js/foundation/template-js-handler/continuous-scrolling-box.js b/source/js/foundation/template-js-handler/continuous-scrolling-box.js index 8c9e72adeac..26d10162b99 100644 --- a/source/js/foundation/template-js-handler/continuous-scrolling-box.js +++ b/source/js/foundation/template-js-handler/continuous-scrolling-box.js @@ -75,7 +75,7 @@ export default () => { }); [ ...document.querySelectorAll( - "main > div:not(.cont-scrolling),.primary-nav-container,.article-navbar-container" + "main > div:not(.cont-scrolling),.primary-nav-container,.article-navbar-container", ), ].forEach((q) => q.classList.add("tw-hidden")); @@ -97,7 +97,7 @@ export default () => { "tw-sticky", "tw-absolute", "tw-top-0", - "tw-left-0" + "tw-left-0", ); const loadIndicator = document.querySelector(".article-loading"); if (loadIndicator) { diff --git a/source/js/foundation/template-js-handler/featured-blog-video-handler.js b/source/js/foundation/template-js-handler/featured-blog-video-handler.js index 57b172b488a..e68073f63d1 100644 --- a/source/js/foundation/template-js-handler/featured-blog-video-handler.js +++ b/source/js/foundation/template-js-handler/featured-blog-video-handler.js @@ -4,7 +4,7 @@ export default function blogIndexFeaturedVideoHandler() { const featuredVideoPostContainer = document.querySelector( - "#featured-video-container" + "#featured-video-container", ); if (!featuredVideoPostContainer) { @@ -12,7 +12,7 @@ export default function blogIndexFeaturedVideoHandler() { } const video = featuredVideoPostContainer.querySelector( - "video.featured-video" + "video.featured-video", ); const playButton = featuredVideoPostContainer.querySelector(".play-button"); diff --git a/source/js/foundation/template-js-handler/homepage.js b/source/js/foundation/template-js-handler/homepage.js index e00b76358cd..6007063e025 100644 --- a/source/js/foundation/template-js-handler/homepage.js +++ b/source/js/foundation/template-js-handler/homepage.js @@ -21,25 +21,25 @@ export default () => { // Hero CTA button bindCtaGA( document.querySelector(`#homepage-hero-cta`), - `read more hero button tap` + `read more hero button tap`, ); // Cause Statement CTA link bindCtaGA( document.querySelector(`#homepage-cause-statement-cta`), - `more about our work link tap` + `more about our work link tap`, ); // News You Can Use CTA link bindCtaGA( document.querySelector(`#news-you-can-use-cta`), - `read news link tap` + `read news link tap`, ); // Partner CTA link bindCtaGA( document.querySelector(`#partner-cta`), - `let's work together link tap` + `let's work together link tap`, ); // Donate Banner CTA diff --git a/source/js/foundation/template-js-handler/load-more-entries.js b/source/js/foundation/template-js-handler/load-more-entries.js index a419e67f055..95888b7e6fb 100644 --- a/source/js/foundation/template-js-handler/load-more-entries.js +++ b/source/js/foundation/template-js-handler/load-more-entries.js @@ -27,7 +27,7 @@ export default () => { const entriesURL = new URL(`entries/`, currentURL); const searchParams = new URLSearchParams( - currentURL.searchParams.toString() + currentURL.searchParams.toString(), ); searchParams.set(`page`, page++); searchParams.set(`page_size`, pageSize); diff --git a/source/js/foundation/template-js-handler/looping-video-handler.js b/source/js/foundation/template-js-handler/looping-video-handler.js index f59f7205074..05bd3050c7c 100644 --- a/source/js/foundation/template-js-handler/looping-video-handler.js +++ b/source/js/foundation/template-js-handler/looping-video-handler.js @@ -13,7 +13,7 @@ const loopingVideoHandler = () => { for (const loopingVideo of loopingVideoBlocks) { let video = loopingVideo.querySelector("video.banner-video"); let pauseButton = loopingVideo.querySelector( - ".btn-video-control.btn-pause" + ".btn-video-control.btn-pause", ); let playButton = loopingVideo.querySelector(".btn-video-control.btn-play"); diff --git a/source/js/foundation/template-js-handler/participate-page-donate.js b/source/js/foundation/template-js-handler/participate-page-donate.js index ac7a7aa6877..7f13d88c757 100644 --- a/source/js/foundation/template-js-handler/participate-page-donate.js +++ b/source/js/foundation/template-js-handler/participate-page-donate.js @@ -6,7 +6,7 @@ import { ReactGA } from "../../common"; */ export default () => { let participateDonateBtn = document.querySelector( - `#view-participate .card-cta .btn[href*="donate.mozilla.org"]` + `#view-participate .card-cta .btn[href*="donate.mozilla.org"]`, ); if (participateDonateBtn) { diff --git a/source/js/foundation/template-js-handler/publication-summary-bar.js b/source/js/foundation/template-js-handler/publication-summary-bar.js index 0f2cdb3908f..01c297af308 100644 --- a/source/js/foundation/template-js-handler/publication-summary-bar.js +++ b/source/js/foundation/template-js-handler/publication-summary-bar.js @@ -9,7 +9,7 @@ export default () => { button.addEventListener("click", () => { document .querySelector( - `.article-child-menu[data-expand="${button.dataset.expand}"]` + `.article-child-menu[data-expand="${button.dataset.expand}"]`, ) .classList.toggle("tw-hidden"); button @@ -37,7 +37,7 @@ export default () => { document .querySelector( - `.article-child-container[data-child="${button.dataset.expand}"]` + `.article-child-container[data-child="${button.dataset.expand}"]`, ) .classList.remove("tw-hidden"); document @@ -67,14 +67,14 @@ export default () => { const title = entry.target.innerText.trim(); if (entry.intersectionRatio > 0) { document.querySelector( - ".dropdown-toggle.article-summary-toggle span" + ".dropdown-toggle.article-summary-toggle span", ).innerText = title; } }); }); const heroContainer = document.querySelector( - ".publication-hero-container,.article-hero,#custom-hero" + ".publication-hero-container,.article-hero,#custom-hero", ); if (heroContainer) { @@ -92,7 +92,7 @@ export default () => { */ function calcSummaryMenuHeight() { const stickyContent = document.querySelector( - ".wrapper > .sticky-top.d-print-none" + ".wrapper > .sticky-top.d-print-none", ); if (!dropDownMenu) return; diff --git a/source/js/foundation/template-js-handler/pulse-profile-card.js b/source/js/foundation/template-js-handler/pulse-profile-card.js index 76384afbf04..f8308474068 100644 --- a/source/js/foundation/template-js-handler/pulse-profile-card.js +++ b/source/js/foundation/template-js-handler/pulse-profile-card.js @@ -9,7 +9,7 @@ export default () => { function profileCardSocialAnalytics( socialTwitter, socialLinkedIn, - profileName + profileName, ) { if (socialTwitter) { socialTwitter.addEventListener(`click`, () => { @@ -56,7 +56,7 @@ export default () => { let profileName = profileNameElement?.textContent.trim(); [(profileNameElement, profileHeadshotElement)].forEach((target) => - bindAnalytics(target, profileName) + bindAnalytics(target, profileName), ); let socialTwitter = card.querySelector(`.twitter`); diff --git a/source/js/foundation/template-js-handler/pulse-profile-list-filter.js b/source/js/foundation/template-js-handler/pulse-profile-list-filter.js index 7db48fdd8b1..3e8c08a23d8 100644 --- a/source/js/foundation/template-js-handler/pulse-profile-list-filter.js +++ b/source/js/foundation/template-js-handler/pulse-profile-list-filter.js @@ -8,7 +8,7 @@ import { ReactGA } from "../../common"; export default () => { document .querySelectorAll( - `.profile-directory .fellowships-directory-filter .filter-option button` + `.profile-directory .fellowships-directory-filter .filter-option button`, ) .forEach((filter) => { let year = filter.textContent.trim(); diff --git a/source/js/foundation/template-js-handler/share-button-group.js b/source/js/foundation/template-js-handler/share-button-group.js index d41665cdc5f..d75d172efe1 100644 --- a/source/js/foundation/template-js-handler/share-button-group.js +++ b/source/js/foundation/template-js-handler/share-button-group.js @@ -3,7 +3,7 @@ import copyToClipboard from "../../copy-to-clipboard"; export default () => { const shareButtonGroups = document.querySelectorAll( - ".share-button-group-wrapper" + ".share-button-group-wrapper", ); if (!shareButtonGroups) { diff --git a/source/js/foundation/template-js-handler/window/sticky-share-button-group.js b/source/js/foundation/template-js-handler/window/sticky-share-button-group.js index 624efcce57f..0c0a98663c5 100644 --- a/source/js/foundation/template-js-handler/window/sticky-share-button-group.js +++ b/source/js/foundation/template-js-handler/window/sticky-share-button-group.js @@ -3,10 +3,10 @@ */ export default () => { let blogPageStickyButtons = document.querySelector( - `#view-blog .blog-sticky-side .share-button-group` + `#view-blog .blog-sticky-side .share-button-group`, ); let blogPageFullButtons = document.querySelector( - `.bottom-share-button-container .share-button-group` + `.bottom-share-button-container .share-button-group`, ); if (blogPageStickyButtons && blogPageFullButtons) { diff --git a/source/js/main.js b/source/js/main.js index bd3e0ce3c2e..9fe90ccfd2e 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -71,7 +71,7 @@ let main = { initializeSentry( env.SENTRY_DSN, env.RELEASE_VERSION, - env.SENTRY_ENVIRONMENT + env.SENTRY_ENVIRONMENT, ); } diff --git a/source/js/multipage-nav.js b/source/js/multipage-nav.js index 803860e16f7..fd7de3c672e 100644 --- a/source/js/multipage-nav.js +++ b/source/js/multipage-nav.js @@ -3,7 +3,7 @@ */ export default () => { const targetNode = document.querySelector( - `#multipage-nav-mobile .container .row .col-12` + `#multipage-nav-mobile .container .row .col-12`, ); const multipageLinks = document.querySelectorAll(`#multipage-nav a`); @@ -56,7 +56,7 @@ export default () => { - ` + `, ); targetNode.innerHTML = ``; diff --git a/source/js/nav-newsletter.js b/source/js/nav-newsletter.js index 0401ae357bb..14b63181b99 100644 --- a/source/js/nav-newsletter.js +++ b/source/js/nav-newsletter.js @@ -38,7 +38,7 @@ class NavNewsletter { let handleTransitionend = () => { elements.container.removeEventListener( "transitionend", - handleTransitionend + handleTransitionend, ); elements.buttonDismiss.textContent = "No thanks"; };