Skip to content

Commit

Permalink
prettier usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Apr 9, 2024
1 parent 751a558 commit 2092bb4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 39 deletions.
9 changes: 6 additions & 3 deletions assets/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
@font-face {
font-family: font-opensans;
font-display: swap;
src: url("/font/opensans_variable.woff2") format("woff2"),
src:
url("/font/opensans_variable.woff2") format("woff2"),
url("/font/opensans_variable.woff") format("woff"),
url("/font/opensans_variable.ttf") format("truetype");
}
Expand All @@ -41,7 +42,8 @@
@font-face {
font-family: font-vga-eight;
font-display: swap;
src: url("/font/pxplus_ibm_vga8.woff2") format("woff2"),
src:
url("/font/pxplus_ibm_vga8.woff2") format("woff2"),
url("/font/pxplus_ibm_vga8.woff") format("woff"),
url("/font/pxplus_ibm_vga8.ttf") format("truetype");
}
Expand All @@ -56,7 +58,8 @@
@font-face {
font-family: font-topaz-two;
font-display: swap;
src: url("/font/topazplus_a1200.woff2") format("woff2"),
src:
url("/font/topazplus_a1200.woff2") format("woff2"),
url("/font/topazplus_a1200.woff") format("woff"),
url("/font/topazplus_a1200.ttf") format("truetype");
}
Expand Down
5 changes: 2 additions & 3 deletions assets/js/editor-archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@
);
if (!exists) {
previewValue.classList.add(err);
document.getElementById(
`edCopyPreviewErr`
).textContent = `unknown filename`;
document.getElementById(`edCopyPreviewErr`).textContent =
`unknown filename`;
previewList.classList.remove(err);
return;
}
Expand Down
61 changes: 30 additions & 31 deletions assets/js/editor-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,41 @@
// It is also used to confirm the existence of the editor modal
const id = document.getElementById(`recordID`);
if (id == null) {
console.info(`the editor modal is not open so editor assets script is not needed`);
console.info(
`the editor modal is not open so editor assets script is not needed`
);
return;
}

// Modify the metadata, delete images asset
document
.getElementById(`edBtnImgs`)
.addEventListener(`click`, function () {
if (!window.confirm("Delete the previews and thumbnail?")) {
return;
}
const info = document.getElementById(`edBtnsHide`);
const feed = document.getElementById(`edBtnsFeedback`);
fetch("/editor/images/delete", {
method: "POST",
body: JSON.stringify({
id: parseInt(id.value),
}),
headers: header,
document.getElementById(`edBtnImgs`).addEventListener(`click`, function () {
if (!window.confirm("Delete the previews and thumbnail?")) {
return;
}
const info = document.getElementById(`edBtnsHide`);
const feed = document.getElementById(`edBtnsFeedback`);
fetch("/editor/images/delete", {
method: "POST",
body: JSON.stringify({
id: parseInt(id.value),
}),
headers: header,
})
.then((response) => {
if (!response.ok) {
throw new Error(saveErr);
}
info.classList.add(ok);
feed.classList.add(fok);
feed.textContent = `images deleted, refresh the page to see the change`;
return response.json();
})
.then((response) => {
if (!response.ok) {
throw new Error(saveErr);
}
info.classList.add(ok);
feed.classList.add(fok);
feed.textContent = `images deleted, refresh the page to see the change`;
return response.json();
})
.catch((error) => {
info.classList.add(err);
feed.classList.add(ferr);
feed.textContent = error.message;
});
});
.catch((error) => {
info.classList.add(err);
feed.classList.add(ferr);
feed.textContent = error.message;
});
});

/// ==============
/// TODO: below
Expand Down Expand Up @@ -114,5 +114,4 @@
artifact.classList.remove(err);
artifact.classList.remove(ok);
});

})();
2 changes: 1 addition & 1 deletion assets/js/votes-pouet.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if (prodElm === null || row === null || stars === null || votes === null)
return;

const prodID = prodElm.innerHTML.trim();
const prodID = prodElm.innerHTML.trim();
console.info(`Requesting the Pouët API for production #${prodID}`);
fetch(url(prodID), {
method: `GET`,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@eslint/js": "^9.0.0",
"eslint": "^9.0.0",
"globals": "^15.0.0",
"prettier": "^3.2.5",
"stylelint": "^16.3.1",
"stylelint-config-standard": "^36.0.0"
}
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/layout.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2092bb4

Please sign in to comment.