v1.6.4/version bump
- hide/show button - popup redesign - start of tutorial
This commit is contained in:
+37
-4
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user