Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 0c73205

Browse files
Update docs
1 parent ebdd43a commit 0c73205

File tree

8 files changed

+35
-15
lines changed

8 files changed

+35
-15
lines changed

docs/@freetube/videojs-quality-selector/1.2.5/QualityOption.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/QualityOption.js.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/QualitySelector.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/QualitySelector.js.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/global.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/index.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/@freetube/videojs-quality-selector/1.2.5/scripts/core.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function getTheme() {
1616
return body.getAttribute('data-theme');
1717
}
1818

19-
function updateTheme(theme) {
19+
function localUpdateTheme(theme) {
2020
var body = document.body;
2121
var svgUse = document.querySelectorAll('.theme-svg-use');
2222
var iconID = theme === 'dark' ? '#light-theme-icon' : '#dark-theme-icon';
@@ -28,7 +28,10 @@ function updateTheme(theme) {
2828
svgUse.forEach(function (svg) {
2929
svg.setAttribute('xlink:href', iconID);
3030
});
31+
}
3132

33+
function updateTheme(theme) {
34+
localUpdateTheme(theme);
3235
localStorage.setItem(themeLocalStorageKey, theme);
3336
}
3437

@@ -145,7 +148,7 @@ function bringElementIntoView(element, updateHistory = true) {
145148
/**
146149
* tocbotInstance is defined in layout.tmpl
147150
* It is defined when we are initializing tocbot.
148-
*
151+
*
149152
*/
150153
// eslint-disable-next-line no-undef
151154
if (tocbotInstance) {
@@ -401,9 +404,9 @@ function getFontSize() {
401404
return currentFontSize;
402405
}
403406

404-
function updateFontSize(fontSize) {
407+
function localUpdateFontSize(fontSize) {
405408
html.style.fontSize = fontSize + 'px';
406-
localStorage.setItem(fontSizeLocalStorageKey, fontSize);
409+
407410
var fontSizeText = document.querySelector(
408411
'#b77a68a492f343baabea06fad81f651e'
409412
);
@@ -413,6 +416,11 @@ function updateFontSize(fontSize) {
413416
}
414417
}
415418

419+
function updateFontSize(fontSize) {
420+
localUpdateFontSize(fontSize);
421+
localStorage.setItem(fontSizeLocalStorageKey, fontSize);
422+
}
423+
416424
(function () {
417425
var fontSize = getFontSize();
418426
var fontSizeInLocalStorage = localStorage.getItem(fontSizeLocalStorageKey);
@@ -653,3 +661,15 @@ window.addEventListener('hashchange', (event) => {
653661
bringIdToViewOnMount(url.hash);
654662
}
655663
});
664+
665+
// eslint-disable-next-line no-undef
666+
window.addEventListener('storage', event => {
667+
if (event.newValue === 'undefined') return;
668+
669+
initTooltip();
670+
671+
if (event.key === themeLocalStorageKey)
672+
localUpdateTheme(event.newValue);
673+
if (event.key === fontSizeLocalStorageKey)
674+
localUpdateFontSize(event.newValue);
675+
});

docs/@freetube/videojs-quality-selector/1.2.5/scripts/core.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)