From a71f5d1ec4d9b595d7cfe234110893a0e4abd9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 19 Mar 2024 20:37:02 +0000 Subject: [PATCH 01/62] Fix typos --- CHANGELOG.md | 16 ++++++++-------- bin/tasks/additions.sh | 2 +- bin/tasks/replaces-wsl.sh | 2 +- bin/tasks/replaces.sh | 2 +- functions.php | 2 +- .../navigation/calculate-burger-menu-position.js | 4 ++-- js/src/modules/top.js | 2 +- sass/gutenberg/blocks/_core-list.scss | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 327d9078..8851ccf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ * Merge pull request #211 from digitoimistodude/dependabot/npm_and_yarn/axios-and-browser-sync--removed * Remove deprecated number-leading-zero rule * Add reset for img -* Fix a regression with anchors not working when target not found, use in all hashs not just with js-trigger class +* Fix a regression with anchors not working when target not found, use in all hashes not just with js-trigger class * Bump WordPress to 6.4.2 ### 9.3.5: 2023-09-12 @@ -182,7 +182,7 @@ * Fix incorrect textdomain in external-link JS module * Simplify CPT and taxonomy registration by using the class name also as a slug (Merge pull request #158 from digitoimistodude/cpt-tax-register-simplification, kudos to @timiwahalahti) -* Remove what-input depenency, use :focus and :focus-within instead, remove forced focus outline-color +* Remove what-input dependency, use :focus and :focus-within instead, remove forced focus outline-color * Bump tested up WordPress version to 6.1 ### 9.2.1: 2022-10-28 @@ -231,10 +231,10 @@ * Fix acf icons visibility issue * Fix link colors in sidebar * Add default font-family for form select items -* Remove opionated label font-weight -* Remove opionated nav default dropshadow from sub menus -* Remove opionated nav default border-color from sub menus -* Remove opionated bubble tip from sub menus +* Remove opinionated label font-weight +* Remove opinionated nav default dropshadow from sub menus +* Remove opinionated nav default border-color from sub menus +* Remove opinionated bubble tip from sub menus ### 9.1.4: 2022-09-07 @@ -503,7 +503,7 @@ * Open submenus on the left if the nav items go over the viewport, Fixes #5 * Added $is_preview and $post_id to be always handed over to block template -* Create empty inc/functions directory for custom funtions +* Create empty inc/functions directory for custom functions ### 8.2.4: 2021-12-03 @@ -578,7 +578,7 @@ * Devpackages 2.3.7: Change back from @ronilaukkarinen/stylelint-declaration-strict-value@1.7.13 to official stylelint-declaration-strict-value@1.8.0 * Devpackages 2.3.7: Fix rule for declaration-strict-value -* Devpackages 2.3.7: Upgade to webpack 5 +* Devpackages 2.3.7: Upgrade to webpack 5 * Devpackages 2.3.7: Update packages ### 8.1.1: 2021-11-05 diff --git a/bin/tasks/additions.sh b/bin/tasks/additions.sh index ebdf4027..acd342b2 100644 --- a/bin/tasks/additions.sh +++ b/bin/tasks/additions.sh @@ -41,7 +41,7 @@ This project is hand made for customer by Dude. ## Getting started -Your local server should be up and running. If you need help, ask your superviser or refer to **[Internal Development Docs](https://app.gitbook.com/o/PedExJWZmbCiZe4gDwKC/s/VVikkYgIZ9miBzwYDCYh/)** → **[Joining the project later on](https://app.gitbook.com/o/PedExJWZmbCiZe4gDwKC/s/VVikkYgIZ9miBzwYDCYh/project-stages/joining-the-project-later-on)**. +Your local server should be up and running. If you need help, ask your supervisor or refer to **[Internal Development Docs](https://app.gitbook.com/o/PedExJWZmbCiZe4gDwKC/s/VVikkYgIZ9miBzwYDCYh/)** → **[Joining the project later on](https://app.gitbook.com/o/PedExJWZmbCiZe4gDwKC/s/VVikkYgIZ9miBzwYDCYh/project-stages/joining-the-project-later-on)**. ### Installation diff --git a/bin/tasks/replaces-wsl.sh b/bin/tasks/replaces-wsl.sh index 1a963acc..f5590544 100644 --- a/bin/tasks/replaces-wsl.sh +++ b/bin/tasks/replaces-wsl.sh @@ -1,5 +1,5 @@ echo "${YELLOW}Generating theme files with theme name and textdomain called ${THEME_NAME}${TXTRESET}" -# THE magical sed command by rolle (goes through every single file in theme folder and searchs and replaces every air instance with THEME_NAME): +# THE magical sed command by rolle (goes through every single file in theme folder and searches and replaces every air instance with THEME_NAME): # WSL/Ubuntu version of sed binary, different format than on macOS # Note: find + -exec sed doesn't work in WSL for some weird reason so we have to use "s;string;replacewith;" format for i in `grep -rl air-light * --exclude-dir=node_modules 2> /dev/null`; do LC_ALL=C sed -i -e "s;air-light;${THEME_NAME};" $i; done diff --git a/bin/tasks/replaces.sh b/bin/tasks/replaces.sh index 787cc1fb..a982a019 100644 --- a/bin/tasks/replaces.sh +++ b/bin/tasks/replaces.sh @@ -4,7 +4,7 @@ # @Last Modified by: Roni Laukkarinen # @Last Modified time: 2021-11-25 12:56:04 echo "${YELLOW}Generating theme files with theme name and textdomain called ${THEME_NAME}${TXTRESET}" -# THE magical sed command by rolle (goes through every single file in theme folder and searchs and replaces every air instance with THEME_NAME): +# THE magical sed command by rolle (goes through every single file in theme folder and searches and replaces every air instance with THEME_NAME): for i in `grep -rl air-light * --exclude-dir=node_modules 2> /dev/null`; do LC_ALL=C sed -i '' -e "s;air-light;${THEME_NAME};" $i $i; done for i in `grep -rl Air-light * --exclude-dir=node_modules 2> /dev/null`; do LC_ALL=C sed -i '' -e "s;Air-light;${THEME_NAME};" $i $i; done for i in `grep -rl air * --exclude-dir=node_modules 2> /dev/null`; do LC_ALL=C sed -i '' -e "s;air-light;${THEME_NAME};" $i $i; done diff --git a/functions.php b/functions.php index c045685a..7695c6aa 100644 --- a/functions.php +++ b/functions.php @@ -63,7 +63,7 @@ ], /** - * All links are cheked with JS, if those direct to external site and if, + * All links are checked with JS, if those direct to external site and if, * indicator of that is included. Exclude domains from that check in this array. */ 'external_link_domains_exclude' => [ diff --git a/js/src/modules/navigation/calculate-burger-menu-position.js b/js/src/modules/navigation/calculate-burger-menu-position.js index 9c3c139f..e7f06678 100644 --- a/js/src/modules/navigation/calculate-burger-menu-position.js +++ b/js/src/modules/navigation/calculate-burger-menu-position.js @@ -47,10 +47,10 @@ function calculateBurgerMenuPosition() { // When air-notification is closed, recalculate the height of menu-items-wrapper airNotifications.forEach((airNotification) => { const button = airNotification.querySelector('button'); - const currenNotificationHeight = airNotification.offsetHeight; + const currentNotificationHeight = airNotification.offsetHeight; if (button) { button.addEventListener('click', () => { - airNotificationsHeight -= currenNotificationHeight; + airNotificationsHeight -= currentNotificationHeight; document.getElementById('menu-items-wrapper').style.height = `calc(100vh - ${siteHeaderHeight + airNotificationsHeight}px)`; document.getElementById('menu-items-wrapper').style.top = `${siteHeaderHeight + airNotificationsHeight}px`; }); diff --git a/js/src/modules/top.js b/js/src/modules/top.js index fa4487b1..f3b28845 100644 --- a/js/src/modules/top.js +++ b/js/src/modules/top.js @@ -54,7 +54,7 @@ const backToTop = () => { // Don't add hash in the end of the url event.preventDefault(); - // Focus without visiblity (as user is not using keyboard) + // Focus without visibility (as user is not using keyboard) scroll(false); }); diff --git a/sass/gutenberg/blocks/_core-list.scss b/sass/gutenberg/blocks/_core-list.scss index b18322d4..5c2cd6ec 100644 --- a/sass/gutenberg/blocks/_core-list.scss +++ b/sass/gutenberg/blocks/_core-list.scss @@ -17,7 +17,7 @@ ol { // Colorized markers li::marker { color: var(--color-link-text); - // Reseting the font in numbering magically removes the gap + // Resetting the font in numbering magically removes the gap font-family: system-ui, sans-serif; font-size: inherit; } From 94b3f007b6cde78ba2dc5576340645e9816d717d Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:39:48 +0300 Subject: [PATCH 02/62] Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) --- CHANGELOG.md | 6 ++++-- README.md | 4 ++-- bin/newtheme.sh | 2 +- bin/tasks/additions.sh | 4 ++-- bin/tasks/project.sh | 1 + functions.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 4 ++-- style.css | 8 ++++---- 10 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 327d9078..5e2118be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -### 9.4.1rc: 2024-03-13 +### 9.4.1: 2024-04-18 * Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) +* Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) +* Bump tested WordPress version to 6.5.2 ### 9.4.0: 2024-02-26 @@ -1032,7 +1034,7 @@ This release includes only form style and accessibility improvements. * Add Laragon support #92 (thank you @divn!) * New theme script dependencies partial: Gulp styles to later stage -* Release version 1.0.5 of newtheme starting scripts +* Release version 1.0.5 of newtheme starting scripts ### 7.1.3: 2021-04-15 diff --git a/README.md b/README.md index 86ead040..43c13535 100644 --- a/README.md +++ b/README.md @@ -249,9 +249,9 @@ Starting from v2.6.0 WooCommerce support comes with [Air helper](https://github. ### Requirements -* PHP >= 7.4 +* PHP >= 8.3 * Requires at least: WordPress 4.7.1 -* Tested up to WordPress 6.4.3 +* Tested up to WordPress 6.5.2 ### Recommendations for development diff --git a/bin/newtheme.sh b/bin/newtheme.sh index 6306f5f5..bc123869 100644 --- a/bin/newtheme.sh +++ b/bin/newtheme.sh @@ -7,7 +7,7 @@ # Script specific vars SCRIPT_LABEL='for macOS' -SCRIPT_VERSION='1.1.3 (2023-09-12)' +SCRIPT_VERSION='1.1.4 (2024-04-18)' # Vars needed for this file to function globally CURRENTFILE=`basename $0` diff --git a/bin/tasks/additions.sh b/bin/tasks/additions.sh index ebdf4027..fb126b41 100644 --- a/bin/tasks/additions.sh +++ b/bin/tasks/additions.sh @@ -10,8 +10,8 @@ chmod 777 ${PROJECT_PATH}/media echo "${YELLOW}Generating default README.md...${TXTRESET}" -NEWEST_AIR_VERSION="9.4.0" -NEWEST_WORDPRESS_VERSION="6.4.3" +NEWEST_AIR_VERSION="9.4.1" +NEWEST_WORDPRESS_VERSION="6.5.2" NEWEST_PHP_VERSION="8.3" CURRENT_DATE=$(LC_TIME=en_US date '+%d %b %Y' |tr ' ' '_'); echo "# ${PROJECT_NAME} diff --git a/bin/tasks/project.sh b/bin/tasks/project.sh index 0fc96535..70819566 100644 --- a/bin/tasks/project.sh +++ b/bin/tasks/project.sh @@ -17,3 +17,4 @@ sed -e "s/\THEMENAME/${THEME_NAME}/" -e "s/\THEMENAME/${THEME_NAME}/" -e "s/\THE rm ${PROJECT_PATH}/gulp/config.js sed -e "s/\PROJECTNAME/${PROJECT_NAME}/" -e "s/\PROJECTNAME/${PROJECT_NAME}/" -e "s/\PROJECTNAME/${PROJECT_NAME}/" ${PROJECT_PATH}/gulp/config2.js > ${PROJECT_PATH}/gulp/config.js rm ${PROJECT_PATH}/gulp/config2.js +sed -e "s/\PROJECTNAME/${PROJECT_NAME}/" ${PROJECT_PATH}/devpackages/phpcs.xml > ${PROJECT_PATH}/phpcs.xml diff --git a/functions.php b/functions.php index c045685a..c8bfa4eb 100644 --- a/functions.php +++ b/functions.php @@ -17,7 +17,7 @@ /** * The current version of the theme. */ -define( 'AIR_LIGHT_VERSION', '9.4.0' ); +define( 'AIR_LIGHT_VERSION', '9.4.1' ); // We need to have some defaults as comments or empties so let's allow this: // phpcs:disable Squiz.Commenting.InlineComment.SpacingBefore, WordPress.Arrays.ArrayDeclarationSpacing.SpaceInEmptyArray diff --git a/package-lock.json b/package-lock.json index a6b210a0..da968676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "air-light", - "version": "9.4.0", + "version": "9.4.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 5750aa5e..7d793415 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "air-light", - "version": "9.4.0", + "version": "9.4.1", "description": "A minimalist WordPress starter theme.", "author": "Digitoimisto Dude Oy (moro@dude.fi)", "devDependencies": { diff --git a/readme.txt b/readme.txt index b61677ec..3ba2e13b 100644 --- a/readme.txt +++ b/readme.txt @@ -11,8 +11,8 @@ Contributors: Digitoimisto Dude Oy Tags: one-column, accessibility-ready, translation-ready Requires at least: 5.0 -Tested up to: 6.4.3 -Stable tag: 9.3.5 +Tested up to: 6.5.2 +Stable tag: 9.4.1 License: MIT License License URI: https://opensource.org/licenses/MIT diff --git a/style.css b/style.css index 164f4060..dd0f256b 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air-light Author: Digitoimisto Dude Oy Author URI: https://www.dude.fi Description: Hi. I'm a starter theme called Air-light, or air, if you like. I'm a theme based on Automattic's underscores and I'm meant for hacking so don't use me as a Parent Theme as-is. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for. -Version: 9.4.0 +Version: 9.4.1 ------8<---------- Please do this before your actual theme is ready to go live: @@ -20,11 +20,11 @@ If you see this, contact the site admin. /*--------------------------------------------------------------- >>> Air-light theme version information, only for AIR developers ----------------------------------------------------------------- -@version 2024-02-26 +@version 2024-04-18 @since 2016-01-28 -Tested up to: 6.4.3 -Requires PHP: 7.4 +Tested up to: 6.5.2 +Requires PHP: 8.3 License: MIT License License URI: LICENSE Text Domain: air-light From eefa91b0c6a9ac9af404ff4c379c638e44099a6e Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:42:37 +0300 Subject: [PATCH 03/62] Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e2118be..854e5e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ### 9.4.1: 2024-04-18 * Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) -* Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) +* Release version 1.1.4 of the `newtheme` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) * Bump tested WordPress version to 6.5.2 ### 9.4.0: 2024-02-26 From 3e60bcb1552e32c1989fbc16f35e17324ca4ea49 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:45:58 +0300 Subject: [PATCH 04/62] Fix js unit tests --- .github/workflows/js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 364d57d0..bd3015b7 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -41,4 +41,4 @@ jobs: run: | npm ci npm link eslint --ignore-scripts - npx eslint . + npx eslint -c .eslintrc.js js/src/ From 57e3301816eb7753d86d22469aff50d44fec367b Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:23:39 +0300 Subject: [PATCH 05/62] Add correct version for eslint unit tests --- .github/workflows/js.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index bd3015b7..dfa555e5 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -39,6 +39,5 @@ jobs: - name: Run eslint run: | - npm ci - npm link eslint --ignore-scripts - npx eslint -c .eslintrc.js js/src/ + npm i eslint@8.18.0 --save-dev + eslint -c .eslintrc.js js/src/ From 60e6f547c8e03cdde8bedad0eae557b00269a68d Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:30:59 +0300 Subject: [PATCH 06/62] Fix workflow for JS --- .github/workflows/js.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index dfa555e5..8e2af864 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -24,20 +24,14 @@ jobs: with: node-version: '${{ steps.nvm.outputs.NVMRC }}' - - name: Install packages + - name: Install packages and test JS run: | rm package.json wget https://raw.githubusercontent.com/digitoimistodude/devpackages/master/package.json sed -i 's/PROJECTNAME/air-light/g' package.json - npm i - - - name: Install air-light related packages - run: | npm i airbnb-browser-shims@^3.3.0 --save npm i moveto@^1.8.2 --save npm i reframe.js@^4.0.0 --save - - - name: Run eslint - run: | + npm i npm i eslint@8.18.0 --save-dev eslint -c .eslintrc.js js/src/ From 42bb27af0989c5b0aa28ceb8c6983ae28a0b221f Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:36:18 +0300 Subject: [PATCH 07/62] Fix eslint command for GitHub Actions --- .github/workflows/js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 8e2af864..48d6f021 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -34,4 +34,4 @@ jobs: npm i reframe.js@^4.0.0 --save npm i npm i eslint@8.18.0 --save-dev - eslint -c .eslintrc.js js/src/ + npx eslint -c .eslintrc.js js/src/ From 6275ab6e05257a8af280295a71340f6f2c1522ab Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:39:48 +0300 Subject: [PATCH 08/62] Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) --- CHANGELOG.md | 6 ++++-- README.md | 4 ++-- bin/newtheme.sh | 2 +- bin/tasks/additions.sh | 4 ++-- bin/tasks/project.sh | 1 + functions.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 4 ++-- style.css | 8 ++++---- 10 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8851ccf8..67266b2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -### 9.4.1rc: 2024-03-13 +### 9.4.1: 2024-04-18 * Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) +* Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) +* Bump tested WordPress version to 6.5.2 ### 9.4.0: 2024-02-26 @@ -1032,7 +1034,7 @@ This release includes only form style and accessibility improvements. * Add Laragon support #92 (thank you @divn!) * New theme script dependencies partial: Gulp styles to later stage -* Release version 1.0.5 of newtheme starting scripts +* Release version 1.0.5 of newtheme starting scripts ### 7.1.3: 2021-04-15 diff --git a/README.md b/README.md index 86ead040..43c13535 100644 --- a/README.md +++ b/README.md @@ -249,9 +249,9 @@ Starting from v2.6.0 WooCommerce support comes with [Air helper](https://github. ### Requirements -* PHP >= 7.4 +* PHP >= 8.3 * Requires at least: WordPress 4.7.1 -* Tested up to WordPress 6.4.3 +* Tested up to WordPress 6.5.2 ### Recommendations for development diff --git a/bin/newtheme.sh b/bin/newtheme.sh index 6306f5f5..bc123869 100644 --- a/bin/newtheme.sh +++ b/bin/newtheme.sh @@ -7,7 +7,7 @@ # Script specific vars SCRIPT_LABEL='for macOS' -SCRIPT_VERSION='1.1.3 (2023-09-12)' +SCRIPT_VERSION='1.1.4 (2024-04-18)' # Vars needed for this file to function globally CURRENTFILE=`basename $0` diff --git a/bin/tasks/additions.sh b/bin/tasks/additions.sh index acd342b2..7bcb1a06 100644 --- a/bin/tasks/additions.sh +++ b/bin/tasks/additions.sh @@ -10,8 +10,8 @@ chmod 777 ${PROJECT_PATH}/media echo "${YELLOW}Generating default README.md...${TXTRESET}" -NEWEST_AIR_VERSION="9.4.0" -NEWEST_WORDPRESS_VERSION="6.4.3" +NEWEST_AIR_VERSION="9.4.1" +NEWEST_WORDPRESS_VERSION="6.5.2" NEWEST_PHP_VERSION="8.3" CURRENT_DATE=$(LC_TIME=en_US date '+%d %b %Y' |tr ' ' '_'); echo "# ${PROJECT_NAME} diff --git a/bin/tasks/project.sh b/bin/tasks/project.sh index 0fc96535..70819566 100644 --- a/bin/tasks/project.sh +++ b/bin/tasks/project.sh @@ -17,3 +17,4 @@ sed -e "s/\THEMENAME/${THEME_NAME}/" -e "s/\THEMENAME/${THEME_NAME}/" -e "s/\THE rm ${PROJECT_PATH}/gulp/config.js sed -e "s/\PROJECTNAME/${PROJECT_NAME}/" -e "s/\PROJECTNAME/${PROJECT_NAME}/" -e "s/\PROJECTNAME/${PROJECT_NAME}/" ${PROJECT_PATH}/gulp/config2.js > ${PROJECT_PATH}/gulp/config.js rm ${PROJECT_PATH}/gulp/config2.js +sed -e "s/\PROJECTNAME/${PROJECT_NAME}/" ${PROJECT_PATH}/devpackages/phpcs.xml > ${PROJECT_PATH}/phpcs.xml diff --git a/functions.php b/functions.php index 7695c6aa..1c9fd2d7 100644 --- a/functions.php +++ b/functions.php @@ -17,7 +17,7 @@ /** * The current version of the theme. */ -define( 'AIR_LIGHT_VERSION', '9.4.0' ); +define( 'AIR_LIGHT_VERSION', '9.4.1' ); // We need to have some defaults as comments or empties so let's allow this: // phpcs:disable Squiz.Commenting.InlineComment.SpacingBefore, WordPress.Arrays.ArrayDeclarationSpacing.SpaceInEmptyArray diff --git a/package-lock.json b/package-lock.json index a6b210a0..da968676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "air-light", - "version": "9.4.0", + "version": "9.4.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 5750aa5e..7d793415 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "air-light", - "version": "9.4.0", + "version": "9.4.1", "description": "A minimalist WordPress starter theme.", "author": "Digitoimisto Dude Oy (moro@dude.fi)", "devDependencies": { diff --git a/readme.txt b/readme.txt index b61677ec..3ba2e13b 100644 --- a/readme.txt +++ b/readme.txt @@ -11,8 +11,8 @@ Contributors: Digitoimisto Dude Oy Tags: one-column, accessibility-ready, translation-ready Requires at least: 5.0 -Tested up to: 6.4.3 -Stable tag: 9.3.5 +Tested up to: 6.5.2 +Stable tag: 9.4.1 License: MIT License License URI: https://opensource.org/licenses/MIT diff --git a/style.css b/style.css index 164f4060..dd0f256b 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air-light Author: Digitoimisto Dude Oy Author URI: https://www.dude.fi Description: Hi. I'm a starter theme called Air-light, or air, if you like. I'm a theme based on Automattic's underscores and I'm meant for hacking so don't use me as a Parent Theme as-is. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for. -Version: 9.4.0 +Version: 9.4.1 ------8<---------- Please do this before your actual theme is ready to go live: @@ -20,11 +20,11 @@ If you see this, contact the site admin. /*--------------------------------------------------------------- >>> Air-light theme version information, only for AIR developers ----------------------------------------------------------------- -@version 2024-02-26 +@version 2024-04-18 @since 2016-01-28 -Tested up to: 6.4.3 -Requires PHP: 7.4 +Tested up to: 6.5.2 +Requires PHP: 8.3 License: MIT License License URI: LICENSE Text Domain: air-light From ca035febececab303b5cda0fe0b506fbeec9fe21 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:42:37 +0300 Subject: [PATCH 09/62] Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67266b2f..70bbe315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ### 9.4.1: 2024-04-18 * Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) -* Release version 1.1.4 of the `newthem` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) +* Release version 1.1.4 of the `newtheme` starting script: Use phpcs.xml from devpackages 2.5.6 (2024-04-18) * Bump tested WordPress version to 6.5.2 ### 9.4.0: 2024-02-26 From 7564dce79cd15d43ed0aecc2c59994339d380324 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 16:45:58 +0300 Subject: [PATCH 10/62] Fix js unit tests --- .github/workflows/js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 364d57d0..bd3015b7 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -41,4 +41,4 @@ jobs: run: | npm ci npm link eslint --ignore-scripts - npx eslint . + npx eslint -c .eslintrc.js js/src/ From 0a05ca579ad4504b035e612b7fdc3e6e70176790 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:23:39 +0300 Subject: [PATCH 11/62] Add correct version for eslint unit tests --- .github/workflows/js.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index bd3015b7..dfa555e5 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -39,6 +39,5 @@ jobs: - name: Run eslint run: | - npm ci - npm link eslint --ignore-scripts - npx eslint -c .eslintrc.js js/src/ + npm i eslint@8.18.0 --save-dev + eslint -c .eslintrc.js js/src/ From 08083fff6ef9cfe72a2e3acde32359fd070d9321 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:30:59 +0300 Subject: [PATCH 12/62] Fix workflow for JS --- .github/workflows/js.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index dfa555e5..8e2af864 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -24,20 +24,14 @@ jobs: with: node-version: '${{ steps.nvm.outputs.NVMRC }}' - - name: Install packages + - name: Install packages and test JS run: | rm package.json wget https://raw.githubusercontent.com/digitoimistodude/devpackages/master/package.json sed -i 's/PROJECTNAME/air-light/g' package.json - npm i - - - name: Install air-light related packages - run: | npm i airbnb-browser-shims@^3.3.0 --save npm i moveto@^1.8.2 --save npm i reframe.js@^4.0.0 --save - - - name: Run eslint - run: | + npm i npm i eslint@8.18.0 --save-dev eslint -c .eslintrc.js js/src/ From feccef15ad325abd6f547e8575ce69a57dda31ea Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 18 Apr 2024 18:36:18 +0300 Subject: [PATCH 13/62] Fix eslint command for GitHub Actions --- .github/workflows/js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 8e2af864..48d6f021 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -34,4 +34,4 @@ jobs: npm i reframe.js@^4.0.0 --save npm i npm i eslint@8.18.0 --save-dev - eslint -c .eslintrc.js js/src/ + npx eslint -c .eslintrc.js js/src/ From c4bd95f3e4400a8702331ec1866fe7d6a9a105d0 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Wed, 5 Jun 2024 15:28:06 +0300 Subject: [PATCH 14/62] Fix typos #216 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70bbe315..4c2907b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 9.4.2rc: 2024-06-05 + +* Fix typos #216 (thanks @szepeviktor!) + ### 9.4.1: 2024-04-18 * Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) From 032388f13219cd8304f649eaef57963a1f3b0731 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 13 Jun 2024 12:23:21 +0300 Subject: [PATCH 15/62] Add is-external-link helper class to external links --- CHANGELOG.md | 3 ++- js/dev/front-end.js | 6 +++--- js/prod/front-end.js | 2 +- js/src/modules/external-link.js | 1 + package.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c2907b6..7cde5a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -### 9.4.2rc: 2024-06-05 +### 9.4.2: 2024-06-13 * Fix typos #216 (thanks @szepeviktor!) +* Add is-external-link helper class to external links ### 9.4.1: 2024-04-18 diff --git a/js/dev/front-end.js b/js/dev/front-end.js index 1798d7d4..dbcd7399 100644 --- a/js/dev/front-end.js +++ b/js/dev/front-end.js @@ -56,7 +56,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getChildAltText: () => (/* binding */ getChildAltText),\n/* harmony export */ initExternalLinkLabels: () => (/* binding */ initExternalLinkLabels),\n/* harmony export */ styleExternalLinks: () => (/* binding */ styleExternalLinks)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localization */ \"./js/src/modules/localization.js\");\n\n/* eslint-disable no-param-reassign */\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2021-09-01 11:55:37\n * @Last Modified by: Elias Kautto\n * @Last Modified time: 2023-09-07 12:13:08\n */\n/**\n * Style external links\n */\n\n\nfunction isLinkExternal(link, localDomains) {\n // Empty links are not external\n if (!link.length) {\n return false;\n }\n var exceptions = ['#', 'tel:', 'mailto:', '/'];\n\n // Check if the url starts with some of the exceptions\n var isException = exceptions.some(function (exception) {\n var compare = new RegExp(\"^\".concat(exception), 'g');\n return compare.test(link);\n });\n if (isException) {\n return false;\n }\n var linkUrl;\n try {\n linkUrl = new URL(link);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(\"Invalid URL: \".concat(link));\n return false;\n }\n // Check if host is one of the local domains\n return !localDomains.some(function (domain) {\n return linkUrl.host === domain;\n });\n}\n\n/**\n * Try to get image alt texts from inside a link\n * to use in aria-label, when only elements inside\n * of link are images\n * @param {*} link DOM link element\n * @returns string\n */\nfunction getChildAltText(link) {\n var children = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(link.children);\n if (children.length === 0) {\n return '';\n }\n var childImgs = children.filter(function (child) {\n return child.tagName.toLowerCase() === 'img';\n });\n\n // If there are other elements than img elements, no need to add aria-label\n if (children.length !== childImgs.length) {\n return '';\n }\n\n // Find alt texts and add to array\n var altTexts = childImgs.filter(function (child) {\n return child.alt && child.alt !== '';\n }).map(function (child) {\n return child.alt;\n });\n\n // If there is no alt texts,\n if (!altTexts.length) {\n return '';\n }\n return altTexts.join(', ');\n}\nfunction styleExternalLinks() {\n var localDomains = [window.location.host];\n if (typeof window.air_light_externalLinkDomains !== 'undefined') {\n localDomains = localDomains.concat(window.air_light_externalLinkDomains);\n }\n var links = document.querySelectorAll('a');\n var externalLinks = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(links).filter(function (link) {\n return isLinkExternal(link.href, localDomains);\n });\n\n // eslint-disable-next-line consistent-return\n externalLinks.forEach(function (externalLink) {\n // Abort mission if there is only img element inside of link\n if (externalLink.childElementCount === 1 && externalLink.children[0].tagName.toLowerCase() === 'img') {\n return false;\n }\n if (!externalLink.classList.contains('no-external-link-label')) {\n var textContent = externalLink.textContent.trim().length ? externalLink.textContent.trim() : getChildAltText(externalLink);\n if (textContent && !externalLink.getAttribute('aria-label')) {\n var ariaLabel = externalLink.target === '_blank' ? \"\".concat(textContent, \": \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('external_link'), \", \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('target_blank')) : \"\".concat(textContent, \": \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('external_link'));\n externalLink.setAttribute('aria-label', ariaLabel);\n }\n }\n\n // Arrow icon won't be added if one of these classes is defined for the link\n var classExceptions = ['no-external-link-indicator', 'global-link', 'button'];\n if (!classExceptions.some(function (className) {\n return externalLink.classList.contains(className);\n })) {\n // Add SVG arrow icon\n externalLink.insertAdjacentHTML('beforeend', '');\n }\n });\n}\nfunction initExternalLinkLabels() {\n // Add aria-labels to links without text or aria-labels and contain image with alt text\n var links = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(document.querySelectorAll('a'));\n // eslint-disable-next-line no-unused-vars\n var linksWithImgChildren = links.forEach(function (link) {\n // If link already has text content or an aria label no need to add aria-label\n if (link.textContent.trim() !== '' || link.ariaLabel) {\n return;\n }\n var ariaLabel = getChildAltText(link);\n if (ariaLabel !== '') {\n link.ariaLabel = ariaLabel;\n }\n });\n}\n\n//# sourceURL=webpack://air-light/./js/src/modules/external-link.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getChildAltText: () => (/* binding */ getChildAltText),\n/* harmony export */ initExternalLinkLabels: () => (/* binding */ initExternalLinkLabels),\n/* harmony export */ styleExternalLinks: () => (/* binding */ styleExternalLinks)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localization */ \"./js/src/modules/localization.js\");\n\n/* eslint-disable no-param-reassign */\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2021-09-01 11:55:37\n * @Last Modified by: Elias Kautto\n * @Last Modified time: 2023-09-07 12:13:08\n */\n/**\n * Style external links\n */\n\n\nfunction isLinkExternal(link, localDomains) {\n // Empty links are not external\n if (!link.length) {\n return false;\n }\n var exceptions = ['#', 'tel:', 'mailto:', '/'];\n\n // Check if the url starts with some of the exceptions\n var isException = exceptions.some(function (exception) {\n var compare = new RegExp(\"^\".concat(exception), 'g');\n return compare.test(link);\n });\n if (isException) {\n return false;\n }\n var linkUrl;\n try {\n linkUrl = new URL(link);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(\"Invalid URL: \".concat(link));\n return false;\n }\n // Check if host is one of the local domains\n return !localDomains.some(function (domain) {\n return linkUrl.host === domain;\n });\n}\n\n/**\n * Try to get image alt texts from inside a link\n * to use in aria-label, when only elements inside\n * of link are images\n * @param {*} link DOM link element\n * @returns string\n */\nfunction getChildAltText(link) {\n var children = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(link.children);\n if (children.length === 0) {\n return '';\n }\n var childImgs = children.filter(function (child) {\n return child.tagName.toLowerCase() === 'img';\n });\n\n // If there are other elements than img elements, no need to add aria-label\n if (children.length !== childImgs.length) {\n return '';\n }\n\n // Find alt texts and add to array\n var altTexts = childImgs.filter(function (child) {\n return child.alt && child.alt !== '';\n }).map(function (child) {\n return child.alt;\n });\n\n // If there is no alt texts,\n if (!altTexts.length) {\n return '';\n }\n return altTexts.join(', ');\n}\nfunction styleExternalLinks() {\n var localDomains = [window.location.host];\n if (typeof window.air_light_externalLinkDomains !== 'undefined') {\n localDomains = localDomains.concat(window.air_light_externalLinkDomains);\n }\n var links = document.querySelectorAll('a');\n var externalLinks = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(links).filter(function (link) {\n return isLinkExternal(link.href, localDomains);\n });\n\n // eslint-disable-next-line consistent-return\n externalLinks.forEach(function (externalLink) {\n // Abort mission if there is only img element inside of link\n if (externalLink.childElementCount === 1 && externalLink.children[0].tagName.toLowerCase() === 'img') {\n return false;\n }\n if (!externalLink.classList.contains('no-external-link-label')) {\n var textContent = externalLink.textContent.trim().length ? externalLink.textContent.trim() : getChildAltText(externalLink);\n if (textContent && !externalLink.getAttribute('aria-label')) {\n var ariaLabel = externalLink.target === '_blank' ? \"\".concat(textContent, \": \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('external_link'), \", \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('target_blank')) : \"\".concat(textContent, \": \").concat((0,_localization__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('external_link'));\n externalLink.setAttribute('aria-label', ariaLabel);\n }\n }\n\n // Arrow icon won't be added if one of these classes is defined for the link\n var classExceptions = ['no-external-link-indicator', 'global-link', 'button'];\n if (!classExceptions.some(function (className) {\n return externalLink.classList.contains(className);\n })) {\n // Add SVG arrow icon\n externalLink.insertAdjacentHTML('beforeend', '');\n externalLink.classList.add('is-external-link');\n }\n });\n}\nfunction initExternalLinkLabels() {\n // Add aria-labels to links without text or aria-labels and contain image with alt text\n var links = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(document.querySelectorAll('a'));\n // eslint-disable-next-line no-unused-vars\n var linksWithImgChildren = links.forEach(function (link) {\n // If link already has text content or an aria label no need to add aria-label\n if (link.textContent.trim() !== '' || link.ariaLabel) {\n return;\n }\n var ariaLabel = getChildAltText(link);\n if (ariaLabel !== '') {\n link.ariaLabel = ariaLabel;\n }\n });\n}\n\n//# sourceURL=webpack://air-light/./js/src/modules/external-link.js?"); /***/ }), @@ -146,7 +146,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2022-12-31 00:21:23\n * @Last Modified by: Michael Bourne\n * @Last Modified time: 2023-03-09 12:19:32\n */\n// Calculate burger menu position\nfunction calculateBurgerMenuPosition() {\n // If nav-toggle, site-header or main-menu not found, bail\n if (!document.getElementById('nav-toggle') || !document.querySelector('.site-header') || !document.getElementById('menu-items-wrapper')) {\n // eslint-disable-next-line no-console\n console.log('Warning: No nav-toggle or site-header found.');\n return;\n }\n\n // Set viewport\n var viewportWidth = document.documentElement.clientWidth || document.body.clientWidth;\n\n // Get --width-max-mobile from CSS\n var widthMaxMobile = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--width-max-mobile'), 10);\n\n // Get the height of .site-header and #nav-toggle\n // Calculate the top position of the toggle to be exactly in the center vertically\n var siteHeaderHeight = document.querySelector('.site-header').offsetHeight;\n\n // Set navigation position from top if on mobile\n if (viewportWidth <= widthMaxMobile) {\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight, \"px\");\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight, \"px)\");\n\n // If there is air-notification element(s), calculate top and height of menu-items-wrapper\n if (document.querySelector('.air-notification')) {\n // Get air-notification element(s)\n var airNotifications = document.querySelectorAll('.air-notification');\n\n // Get the height of air-notification(s)\n var airNotificationsHeight = 0;\n airNotifications.forEach(function (airNotification) {\n airNotificationsHeight = airNotification.offsetHeight + airNotificationsHeight;\n });\n\n // Set the height and top of menu-items-wrapper\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight + airNotificationsHeight, \"px)\");\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight + airNotificationsHeight, \"px\");\n\n // When air-notification is closed, recalculate the height of menu-items-wrapper\n airNotifications.forEach(function (airNotification) {\n var button = airNotification.querySelector('button');\n var currenNotificationHeight = airNotification.offsetHeight;\n if (button) {\n button.addEventListener('click', function () {\n airNotificationsHeight -= currenNotificationHeight;\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight + airNotificationsHeight, \"px)\");\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight + airNotificationsHeight, \"px\");\n });\n }\n });\n }\n } else {\n document.getElementById('menu-items-wrapper').style.top = '0';\n document.getElementById('menu-items-wrapper').style.height = 'auto';\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculateBurgerMenuPosition);\n\n//# sourceURL=webpack://air-light/./js/src/modules/navigation/calculate-burger-menu-position.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2022-12-31 00:21:23\n * @Last Modified by: Michael Bourne\n * @Last Modified time: 2023-03-09 12:19:32\n */\n// Calculate burger menu position\nfunction calculateBurgerMenuPosition() {\n // If nav-toggle, site-header or main-menu not found, bail\n if (!document.getElementById('nav-toggle') || !document.querySelector('.site-header') || !document.getElementById('menu-items-wrapper')) {\n // eslint-disable-next-line no-console\n console.log('Warning: No nav-toggle or site-header found.');\n return;\n }\n\n // Set viewport\n var viewportWidth = document.documentElement.clientWidth || document.body.clientWidth;\n\n // Get --width-max-mobile from CSS\n var widthMaxMobile = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--width-max-mobile'), 10);\n\n // Get the height of .site-header and #nav-toggle\n // Calculate the top position of the toggle to be exactly in the center vertically\n var siteHeaderHeight = document.querySelector('.site-header').offsetHeight;\n\n // Set navigation position from top if on mobile\n if (viewportWidth <= widthMaxMobile) {\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight, \"px\");\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight, \"px)\");\n\n // If there is air-notification element(s), calculate top and height of menu-items-wrapper\n if (document.querySelector('.air-notification')) {\n // Get air-notification element(s)\n var airNotifications = document.querySelectorAll('.air-notification');\n\n // Get the height of air-notification(s)\n var airNotificationsHeight = 0;\n airNotifications.forEach(function (airNotification) {\n airNotificationsHeight = airNotification.offsetHeight + airNotificationsHeight;\n });\n\n // Set the height and top of menu-items-wrapper\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight + airNotificationsHeight, \"px)\");\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight + airNotificationsHeight, \"px\");\n\n // When air-notification is closed, recalculate the height of menu-items-wrapper\n airNotifications.forEach(function (airNotification) {\n var button = airNotification.querySelector('button');\n var currentNotificationHeight = airNotification.offsetHeight;\n if (button) {\n button.addEventListener('click', function () {\n airNotificationsHeight -= currentNotificationHeight;\n document.getElementById('menu-items-wrapper').style.height = \"calc(100vh - \".concat(siteHeaderHeight + airNotificationsHeight, \"px)\");\n document.getElementById('menu-items-wrapper').style.top = \"\".concat(siteHeaderHeight + airNotificationsHeight, \"px\");\n });\n }\n });\n }\n } else {\n document.getElementById('menu-items-wrapper').style.top = '0';\n document.getElementById('menu-items-wrapper').style.height = 'auto';\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculateBurgerMenuPosition);\n\n//# sourceURL=webpack://air-light/./js/src/modules/navigation/calculate-burger-menu-position.js?"); /***/ }), @@ -226,7 +226,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var moveto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moveto */ \"./node_modules/moveto/dist/moveTo.js\");\n/* harmony import */ var moveto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moveto__WEBPACK_IMPORTED_MODULE_0__);\n/* eslint-disable max-len */\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2022-05-07 12:20:13\n * @Last Modified by: Roni Äikäs\n * @Last Modified time: 2023-08-16 17:05:43\n */\n\nvar backToTop = function backToTop() {\n // Back to top button\n var moveToTop = new (moveto__WEBPACK_IMPORTED_MODULE_0___default())({\n duration: 300,\n easing: 'easeOutQuart'\n });\n var topButton = document.getElementById('top');\n var focusableElements = document.querySelectorAll('button, a, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])');\n function trackScroll() {\n var scrolled = window.pageYOffset;\n var scrollAmount = document.documentElement.clientHeight;\n if (scrolled > scrollAmount) {\n topButton.classList.add('is-visible');\n }\n if (scrolled < scrollAmount) {\n topButton.classList.remove('is-visible');\n }\n }\n function scroll(focusVisible) {\n // Check if user prefers reduced motion, if so, just scroll to top\n var prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n if (prefersReducedMotion) {\n focusableElements[0].focus({\n focusVisible: focusVisible\n });\n return;\n }\n\n // Move smoothly to the first focusable element on the page\n moveToTop.move(focusableElements[0]);\n\n // Focus too, if on keyboard\n focusableElements[0].focus({\n preventScroll: true,\n focusVisible: focusVisible\n });\n }\n if (topButton) {\n topButton.addEventListener('click', function (event) {\n // Don't add hash in the end of the url\n event.preventDefault();\n\n // Focus without visiblity (as user is not using keyboard)\n scroll(false);\n });\n topButton.addEventListener('keydown', function (event) {\n // Don't propagate keydown event to click event\n event.preventDefault();\n\n // Scroll with focus visible\n scroll(true);\n });\n }\n window.addEventListener('scroll', trackScroll);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (backToTop);\n\n//# sourceURL=webpack://air-light/./js/src/modules/top.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var moveto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moveto */ \"./node_modules/moveto/dist/moveTo.js\");\n/* harmony import */ var moveto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moveto__WEBPACK_IMPORTED_MODULE_0__);\n/* eslint-disable max-len */\n/**\n * @Author: Roni Laukkarinen\n * @Date: 2022-05-07 12:20:13\n * @Last Modified by: Roni Äikäs\n * @Last Modified time: 2023-08-16 17:05:43\n */\n\nvar backToTop = function backToTop() {\n // Back to top button\n var moveToTop = new (moveto__WEBPACK_IMPORTED_MODULE_0___default())({\n duration: 300,\n easing: 'easeOutQuart'\n });\n var topButton = document.getElementById('top');\n var focusableElements = document.querySelectorAll('button, a, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])');\n function trackScroll() {\n var scrolled = window.pageYOffset;\n var scrollAmount = document.documentElement.clientHeight;\n if (scrolled > scrollAmount) {\n topButton.classList.add('is-visible');\n }\n if (scrolled < scrollAmount) {\n topButton.classList.remove('is-visible');\n }\n }\n function scroll(focusVisible) {\n // Check if user prefers reduced motion, if so, just scroll to top\n var prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n if (prefersReducedMotion) {\n focusableElements[0].focus({\n focusVisible: focusVisible\n });\n return;\n }\n\n // Move smoothly to the first focusable element on the page\n moveToTop.move(focusableElements[0]);\n\n // Focus too, if on keyboard\n focusableElements[0].focus({\n preventScroll: true,\n focusVisible: focusVisible\n });\n }\n if (topButton) {\n topButton.addEventListener('click', function (event) {\n // Don't add hash in the end of the url\n event.preventDefault();\n\n // Focus without visibility (as user is not using keyboard)\n scroll(false);\n });\n topButton.addEventListener('keydown', function (event) {\n // Don't propagate keydown event to click event\n event.preventDefault();\n\n // Scroll with focus visible\n scroll(true);\n });\n }\n window.addEventListener('scroll', trackScroll);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (backToTop);\n\n//# sourceURL=webpack://air-light/./js/src/modules/top.js?"); /***/ }), diff --git a/js/prod/front-end.js b/js/prod/front-end.js index c2db5c3a..74e29575 100644 --- a/js/prod/front-end.js +++ b/js/prod/front-end.js @@ -1 +1 @@ -(()=>{"use strict";var e={4251:e=>{var t=function(){var e={tolerance:0,duration:800,easing:"easeOutQuart",container:window,callback:function(){}};function t(e,t,n,o){return e/=o,-n*(--e*e*e*e-1)+t}function n(e,t){var n={};return Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function o(e){return e instanceof HTMLElement?e.scrollTop:e.pageYOffset}function r(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options=n(e,o),this.easeFunctions=n({easeOutQuart:t},r)}return r.prototype.registerTrigger=function(e,t){var o=this;if(e){var r=e.getAttribute("href")||e.getAttribute("data-target"),i=r&&"#"!==r?document.getElementById(r.substring(1)):document.body,a=n(this.options,function(e,t){var n={};return Object.keys(t).forEach((function(t){var o=e.getAttribute("data-mt-".concat(t.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))));o&&(n[t]=isNaN(o)?o:parseInt(o,10))})),n}(e,this.options));"function"==typeof t&&(a.callback=t);var c=function(e){e.preventDefault(),o.move(i,a)};return e.addEventListener("click",c,!1),function(){return e.removeEventListener("click",c,!1)}}},r.prototype.move=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0===e||e){r=n(this.options,r);var i,a="number"==typeof e?e:e.getBoundingClientRect().top,c=o(r.container),s=null;a-=r.tolerance;window.requestAnimationFrame((function n(l){var d=o(t.options.container);s||(s=l-1);var u=l-s;if(i&&(a>0&&i>d||a<0&&i{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n