Expand username textbox when editing.

This commit is contained in:
Ajay Ramachandran 2020-12-13 23:52:38 -05:00
parent df84f328a7
commit 1afabb934f
3 changed files with 18 additions and 6 deletions

View file

@ -7,7 +7,7 @@
}
.hidden {
display: none;
display: none !important;
}
#sponsorblockPopup {
@ -329,6 +329,12 @@ label>p, #disableExtension>p, #usernameValue, #usernameElement > div > p,#sponso
border: white 1px solid;
color: var(--sb-main-fg-color);
width: calc(100% - 24px);
text-overflow: ellipsis;
}
#setUsername.SBExpanded {
width: 200%;
}
/* footer */

View file

@ -96,7 +96,7 @@
</div>
</div>
</div>
<div id="sponsorTimesContributionsContainer" style="display: none">
<div id="sponsorTimesContributionsContainer" class="hidden">
<div>
<p>__MSG_soFarUHSubmited__</p>
<span id="sponsorTimesContributionsDisplay">

View file

@ -188,8 +188,8 @@ async function runThePopup(messageListener?: MessageListener) {
} else {
PageElements.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Segment");
}*/
PageElements.sponsorTimesContributionsDisplay.innerText = Config.config.sponsorTimesContributed;
PageElements.sponsorTimesContributionsContainer.style.display = "flex";
PageElements.sponsorTimesContributionsDisplay.innerText = Config.config.sponsorTimesContributed.toLocaleString();
PageElements.sponsorTimesContributionsContainer.classList.remove("hidden");
//get the userID
let userID = Config.config.userID;
@ -206,7 +206,7 @@ async function runThePopup(messageListener?: MessageListener) {
PageElements.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segment");
}
PageElements.sponsorTimesViewsDisplay.innerText = viewCount;
PageElements.sponsorTimesViewsDisplay.innerText = viewCount.toLocaleString();
PageElements.sponsorTimesViewsContainer.style.display = "unset";
}
}
@ -239,7 +239,7 @@ async function runThePopup(messageListener?: MessageListener) {
PageElements.sponsorTimesSkipsDoneEndWord.innerText = chrome.i18n.getMessage("Segment");
}
PageElements.sponsorTimesSkipsDoneDisplay.innerText = Config.config.skipCount;
PageElements.sponsorTimesSkipsDoneDisplay.innerText = Config.config.skipCount.toLocaleString();
PageElements.sponsorTimesSkipsDoneContainer.style.display = "unset";
}
@ -856,8 +856,11 @@ async function runThePopup(messageListener?: MessageListener) {
PageElements.setUsernameContainer.style.display = "none";
PageElements.setUsername.style.display = "flex";
PageElements.setUsername.classList.add("SBExpanded");
PageElements.setUsernameStatusContainer.style.display = "none";
PageElements.sponsorTimesContributionsContainer.classList.add("hidden");
}
//submit the new username
@ -873,9 +876,12 @@ async function runThePopup(messageListener?: MessageListener) {
PageElements.usernameInput.style.display = "none";
PageElements.setUsernameContainer.style.removeProperty("display");
PageElements.setUsername.classList.remove("SBExpanded");
PageElements.usernameValue.innerText = PageElements.usernameInput.value;
PageElements.setUsernameStatusContainer.style.display = "none";
PageElements.sponsorTimesContributionsContainer.classList.remove("hidden");
} else {
PageElements.setUsernameStatus.innerText = utils.getErrorMessage(response.status);
}