-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1518 from nunocoracao/dev
🔖 v2.71.0
- Loading branch information
Showing
166 changed files
with
637 additions
and
403 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,59 @@ | ||
function _toogleZenMode(zendModeButton) { | ||
// Nodes selection | ||
const body = document.querySelector('body'); | ||
const tocRight = document.querySelector('.toc-right'); | ||
const tocInside = document.querySelector('.toc-inside'); | ||
const articleContent = document.querySelector('.article-content'); | ||
const header = document.querySelector('#single_header'); | ||
// Nodes selection | ||
const body = document.querySelector('body'); | ||
const tocRight = document.querySelector('.toc-right'); | ||
const tocInside = document.querySelector('.toc-inside'); | ||
const articleContent = document.querySelector('.article-content'); | ||
const header = document.querySelector('#single_header'); | ||
|
||
|
||
// Add semantic class into body tag | ||
body.classList.toggle('zen-mode-enable'); | ||
// Add semantic class into body tag | ||
body.classList.toggle('zen-mode-enable'); | ||
|
||
// Show/Hide 'toc right' and 'toc inside' | ||
// Show/Hide 'toc right' and 'toc inside' | ||
if (tocRight) | ||
tocRight.classList.toggle('lg:block'); | ||
if (tocInside) | ||
tocInside.classList.toggle('lg:hidden'); | ||
|
||
// Change width of article content | ||
articleContent.classList.toggle('max-w-fit'); | ||
articleContent.classList.toggle('max-w-prose'); | ||
|
||
// Read i18n title from data-attributes | ||
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable'); | ||
const titleI18nEnable = zendModeButton.getAttribute('data-title-i18n-enable'); | ||
|
||
if (body.classList.contains('zen-mode-enable')) { | ||
// Persist configuration | ||
//localStorage.setItem('blowfish-zen-mode-enabled', 'true'); | ||
// Change title to enable | ||
zendModeButton.setAttribute('title', titleI18nEnable) | ||
// Auto-scroll to title article | ||
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90); | ||
} else { | ||
//localStorage.setItem('blowfish-zen-mode-enabled', 'false'); | ||
zendModeButton.setAttribute('title', titleI18nDisable); | ||
document.querySelector('body').scrollIntoView(); | ||
} | ||
// Change width of article content | ||
articleContent.classList.toggle('max-w-fit'); | ||
articleContent.classList.toggle('max-w-prose'); | ||
|
||
// Read i18n title from data-attributes | ||
const titleI18nDisable = zendModeButton.getAttribute('data-title-i18n-disable'); | ||
const titleI18nEnable = zendModeButton.getAttribute('data-title-i18n-enable'); | ||
|
||
if (body.classList.contains('zen-mode-enable')) { | ||
// Persist configuration | ||
//localStorage.setItem('blowfish-zen-mode-enabled', 'true'); | ||
|
||
// Change title to enable | ||
zendModeButton.setAttribute('title', titleI18nEnable) | ||
// Auto-scroll to title article | ||
window.scrollTo(window.scrollX, header.getBoundingClientRect().top - 90); | ||
} else { | ||
//localStorage.setItem('blowfish-zen-mode-enabled', 'false'); | ||
zendModeButton.setAttribute('title', titleI18nDisable); | ||
document.querySelector('body').scrollIntoView(); | ||
} | ||
} | ||
|
||
function _registerZendModeButtonClick(zendModeButton) { | ||
zendModeButton.addEventListener('click', function (event) { | ||
event.preventDefault(); | ||
zendModeButton.addEventListener('click', function (event) { | ||
event.preventDefault(); | ||
|
||
// Toggle zen-mode | ||
_toogleZenMode(zendModeButton); | ||
}); | ||
// Toggle zen-mode | ||
_toogleZenMode(zendModeButton); | ||
}); | ||
} | ||
|
||
(function init() { | ||
window.addEventListener("DOMContentLoaded", (event) => { | ||
// Register click on 'zen-mode-button' node element | ||
const zendModeButton = document.getElementById('zen-mode-button'); | ||
if(zendModeButton !== null && zendModeButton !== undefined) { | ||
_registerZendModeButtonClick(zendModeButton); | ||
} | ||
}); | ||
window.addEventListener("DOMContentLoaded", (event) => { | ||
// Register click on 'zen-mode-button' node element | ||
const zendModeButton = document.getElementById('zen-mode-button'); | ||
if (zendModeButton !== null && zendModeButton !== undefined) { | ||
_registerZendModeButtonClick(zendModeButton); | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
[module.hugoVersion] | ||
extended = true | ||
min = "0.87.0" | ||
max = "0.126.3" | ||
max = "0.127.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.