v1.6.4/version bump

- hide/show button
- popup redesign
- start of tutorial
This commit is contained in:
2020-08-26 18:19:01 -04:00
parent 51f191b794
commit 60758dc35a
13 changed files with 269 additions and 68 deletions
+37 -4
View File
@@ -9,10 +9,43 @@ ALL CONTENT ON WATCH PARTY'S WEBSITE OR IN WATCH PARTY'S CHROME EXTENSION APP, U
CITED ARE THE SOLE INTELECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
************************************************************************/
function clearLocal() {
window.localStorage.removeItem('parties');
return 0;
}
window.onload = function () {
const MDCSwitch = mdc.switchControl.MDCSwitch;
const switchControl = new MDCSwitch(document.querySelector('.mdc-switch'));
function clearLocal() {
window.localStorage.removeItem('parties');
return 0;
}
function setShowWPButton(v) {
window.localStorage.setItem('showWPButton', v);
}
function getShowWPButton() {
return window.localStorage.getItem('showWPButton')
? JSON.parse(window.localStorage.getItem('showWPButton'))
: true;
}
function toggleShowWPButton() {
const currentStatus = getShowWPButton();
setShowWPButton(!currentStatus);
switchControl.checked = !currentStatus;
changeShowWPButtonDescription();
}
function changeShowWPButtonDescription() {
const currentStatus = getShowWPButton();
if (currentStatus === true) {
document.querySelector('.switch-wrapper span').innerText =
'Currently showing Watch Party button';
} else {
document.querySelector('.switch-wrapper span').innerText =
'Watch Party button is currently hidden';
}
}
switchControl.checked = getShowWPButton();
changeShowWPButtonDescription();
document.querySelector('.mdc-switch').onchange = toggleShowWPButton;
mdc.ripple.MDCRipple.attachTo(document.getElementById('clear-button'));
document.getElementById('clear-button').onclick = clearLocal;
};