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

View File

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

View File

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