client: linting

This commit is contained in:
Shyam Sunder 2021-11-29 18:44:20 -05:00
parent 9b3123a815
commit 9f95e9eb90
9 changed files with 20 additions and 32 deletions

View file

@ -31,9 +31,8 @@ class UserController {
userTokenPromise = UserToken.get(userName).then(
(userTokens) => {
return userTokens.map((token) => {
token.isCurrentAuthToken = api.isCurrentAuthToken(
token
);
token.isCurrentAuthToken =
api.isCurrentAuthToken(token);
return token;
});
},

View file

@ -45,9 +45,8 @@ class ExpanderControl {
// eslint-disable-next-line accessor-pairs
set title(newTitle) {
if (this._expanderNode) {
this._expanderNode.querySelector(
"header span"
).textContent = newTitle;
this._expanderNode.querySelector("header span").textContent =
newTitle;
}
}

View file

@ -203,9 +203,8 @@ class PostEditSidebarControl extends events.EventTarget {
);
if (this._formNode) {
const inputNodes = this._formNode.querySelectorAll(
"input, textarea"
);
const inputNodes =
this._formNode.querySelectorAll("input, textarea");
for (let node of inputNodes) {
node.addEventListener("change", (e) =>
this.dispatchEvent(new CustomEvent("change"))

View file

@ -727,9 +727,8 @@ class PostNotesOverlayControl extends events.EventTarget {
}
_showNoteText(note) {
this._textNode.querySelector(
".wrapper"
).innerHTML = misc.formatMarkdown(note.text);
this._textNode.querySelector(".wrapper").innerHTML =
misc.formatMarkdown(note.text);
this._textNode.style.display = "block";
const bodyRect = document.body.getBoundingClientRect();
const noteRect = this._textNode.getBoundingClientRect();

View file

@ -136,12 +136,8 @@ function createRenderer() {
const renderer = new marked.Renderer();
renderer.image = (href, title, alt) => {
let [
_,
url,
width,
height,
] = /^(.+?)(?:\s=\s*(\d*)\s*x\s*(\d*)\s*)?$/.exec(href);
let [_, url, width, height] =
/^(.+?)(?:\s=\s*(\d*)\s*x\s*(\d*)\s*)?$/.exec(href);
let res = '<img src="' + sanitize(url) + '" alt="' + sanitize(alt);
if (width) {
res += '" width="' + width;

View file

@ -25,9 +25,8 @@ class PostMainView {
views.replaceContent(this._hostNode, sourceNode);
views.syncScrollPosition();
const topNavigationNode = document.body.querySelector(
"#top-navigation"
);
const topNavigationNode =
document.body.querySelector("#top-navigation");
this._postContentControl = new PostContentControl(
postContainerNode,

View file

@ -360,8 +360,8 @@ class PostUploadView extends events.EventTarget {
detail: {
uploadables: this._uploadables,
skipDuplicates: this._skipDuplicatesCheckboxNode.checked,
alwaysUploadSimilar: this._alwaysUploadSimilarCheckboxNode
.checked,
alwaysUploadSimilar:
this._alwaysUploadSimilarCheckboxNode.checked,
},
})
);

View file

@ -253,9 +253,8 @@ class PostsHeaderView extends events.EventTarget {
e.target.classList.toggle("disabled");
const safety = e.target.getAttribute("data-safety");
let browsingSettings = settings.get();
browsingSettings.listPosts[safety] = !browsingSettings.listPosts[
safety
];
browsingSettings.listPosts[safety] =
!browsingSettings.listPosts[safety];
settings.save(browsingSettings, true);
this.dispatchEvent(
new CustomEvent("navigate", {

View file

@ -72,9 +72,8 @@ class UserTokenView extends events.EventTarget {
_evtDelete(e) {
e.preventDefault();
const userToken = this._tokens[
parseInt(e.target.getAttribute("data-token-id"))
];
const userToken =
this._tokens[parseInt(e.target.getAttribute("data-token-id"))];
this.dispatchEvent(
new CustomEvent("delete", {
detail: {
@ -110,9 +109,8 @@ class UserTokenView extends events.EventTarget {
_evtChangeNoteClick(e) {
e.preventDefault();
const userToken = this._tokens[
parseInt(e.target.getAttribute("data-token-id"))
];
const userToken =
this._tokens[parseInt(e.target.getAttribute("data-token-id"))];
const text = window.prompt(
"Please enter the new name:",
userToken.note !== null ? userToken.note : undefined