chore: apply prettier on all files (#8)

* chore: apply prettier on all files

* chore: add prettier npm script

* Update .prettierrc

Co-authored-by: Axel Cocat <ax.cocat@gmail.com>

* Update .prettierignore

Co-authored-by: Axel Cocat <ax.cocat@gmail.com>

* Update .prettierignore

Co-authored-by: Axel Cocat <ax.cocat@gmail.com>

* Update .prettierignore

Co-authored-by: Axel Cocat <ax.cocat@gmail.com>

* chore: apply prettier with new conf

* Revert "chore: apply prettier with new conf"

This reverts commit db2a04c03f.

* chore: apply prettier correctly

* chore: update .prettierignore

* chore: restore viewer.min.js minification

* chore: apply again prettier

Co-authored-by: Stefano Borzi <stefano.borzi@fedex.com>
Co-authored-by: Axel Cocat <ax.cocat@gmail.com>
This commit is contained in:
Stefano Borzì 2022-05-06 19:35:26 +02:00 committed by GitHub
parent fe21209817
commit 8331e4dd73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 504 additions and 228 deletions

View file

@ -1,14 +1,16 @@
function waitForEmblemImages($emblem) {
return Promise.all($emblem.find(".images img").map((idx, img) => {
return new Promise((res, rej) => {
if (img.complete) {
res();
} else {
img.addEventListener("load", res);
img.addEventListener("error", rej);
}
});
}));
return Promise.all(
$emblem.find(".images img").map((idx, img) => {
return new Promise((res, rej) => {
if (img.complete) {
res();
} else {
img.addEventListener("load", res);
img.addEventListener("error", rej);
}
});
}),
);
}
function createGuildEmblem(emblem, el) {
@ -16,7 +18,8 @@ function createGuildEmblem(emblem, el) {
const canvas = $emblem.find("canvas")[0];
const ctx = canvas.getContext("2d");
const imgUrl = (type, section, value, value2) => `${handlebarsData.websiteRoot}/img/guild-emblems/${type}_${value}${value2 ? ("_" + value2) : ""}_T${section}_U.PNG`;
const imgUrl = (type, section, value, value2) =>
`${handlebarsData.websiteRoot}/img/guild-emblems/${type}_${value}${value2 ? "_" + value2 : ""}_T${section}_U.PNG`;
const $images = $("<div>").addClass("images").appendTo($emblem);
const bgUpper = $("<img>").attr("src", imgUrl("Background", "U", emblem.background)).appendTo($images)[0];
@ -64,7 +67,10 @@ function createArenaEmblem(teamSize, emblem, el) {
const canvas = $emblem.find("canvas")[0];
const ctx = canvas.getContext("2d");
const imgUrl = (teamSize, type, value) => `${handlebarsData.websiteRoot}/img/arena-banners/PVP-Banner${teamSize ? ("-" + teamSize) : ""}${type ? ("-" + type) : ""}${value ? ("-" + value) : ""}.PNG`;
const imgUrl = (teamSize, type, value) =>
`${handlebarsData.websiteRoot}/img/arena-banners/PVP-Banner${teamSize ? "-" + teamSize : ""}${type ? "-" + type : ""}${
value ? "-" + value : ""
}.PNG`;
const $images = $("<div>").addClass("images").appendTo($emblem);
const banner = $("<img>").attr("src", imgUrl(teamSize)).appendTo($images)[0];