Merge branch 'linter'

This commit is contained in:
Sindrake 2024-07-17 15:45:24 -07:00
commit 60351ed8e4
42 changed files with 1676 additions and 1242 deletions

View File

@ -21,7 +21,8 @@
"vscode": {
"extensions": [
"Shopify.ruby-lsp",
"Vue.volar"
"Vue.volar",
"dbaeumer.vscode-eslint"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"

View File

@ -1,88 +0,0 @@
env:
browser: true
es6: true
extends: 'eslint:recommended'
parserOptions:
sourceType: module
globals:
$: false
require: false
rules:
# https://eslint.org/docs/rules/
array-callback-return: error
block-scoped-var: error
consistent-return: error
default-case: error
dot-notation: error
eqeqeq: error
init-declarations: error
no-caller: error
no-empty-function: error
no-eval: error
no-extend-native: error
no-implicit-coercion: error
no-lone-blocks: error
no-lonely-if: error
no-mixed-operators: error
no-new: error
no-new-wrappers: error
no-return-assign: error
no-self-compare: error
no-sequences: error
no-shadow: error
no-shadow-restricted-names: error
no-unused-expressions: error
no-unused-vars:
- error
- argsIgnorePattern: "^_"
args: none
no-use-before-define: error
no-useless-call: error
no-useless-concat: error
no-useless-return: error
# formatting issues
array-bracket-spacing: warn
brace-style: [warn, 1tbs, allowSingleLine: true]
comma-spacing: warn
curly: warn
dot-location: [warn, property]
eol-last: warn
func-call-spacing: warn
indent: [warn, 2]
linebreak-style: [warn, unix]
key-spacing: warn
keyword-spacing: warn
no-multiple-empty-lines: warn
no-tabs: warn
no-trailing-spaces: warn
no-whitespace-before-property: warn
space-before-blocks: warn
space-in-parens: warn
space-infix-ops: warn
space-unary-ops: warn
spaced-comment: warn
# These rules are potentially useful, but are currently too noisy to enable.
# block-spacing: warn
# no-alert: warn
# no-extra-parens: warn
# no-magic-numbers:
# - warn
# - ignore: [-1, 0, 1]
# ignoreArrayIndexes: true
# enforceConst: true
# no-multi-spaces: warn
# no-negated-condition: warn
# no-param-reassign: warn
# no-var: warn
# object-curly-spacing: warn
# prefer-arrow-callback: warn
# prefer-const: warn
# prefer-template: warn
# quote-props: [warn, consistent-as-needed]
# radix: warn
# semi: warn
# space-before-function-paren: warn
# vars-on-top: warn

16
.vscode/settings.json vendored
View File

@ -2,6 +2,22 @@
"[ruby]": {
"editor.formatOnSave": false
},
"files.associations": {
"*.erb": "Ruby ERB"
},
// Trick ruby-lsp into not doing any updates
"rubyLsp.bundleGemfile": "Gemfile",
"npm.packageManager": "yarn",
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.rulers": [100],
"editor.formatOnSave": false,
// Eslint shenanigans
"eslint.useFlatConfig": true,
"eslint.validate": [
"javascript"
],
}

View File

@ -1,28 +1,26 @@
import Utility from './utility';
import { SendQueue } from './send_queue';
import Utility from "./utility";
import { SendQueue } from "./send_queue";
const Artist = {};
Artist.update = function (id, params) {
SendQueue.add(function() {
SendQueue.add(() => {
$.ajax({
type: "PUT",
url: "/artists/" + id + ".json",
data: params,
success: function(data) {
Utility.notice("Artist updated.");
},
error: function(data) {
success: () => { Utility.notice("Artist updated."); },
error: () => {
Utility.error(`There was an error updating <a href="/artists/${id}">artist #${id}</a>`);
}
},
});
});
};
function init () {
$("#undelete-artist-link").on('click', e => {
$("#undelete-artist-link").on("click", e => {
if (confirm("Are you sure you want to undelete this artist?"))
Artist.update($(e.target).data('aid'), {"artist[is_active]": true});
Artist.update($(e.target).data("aid"), {"artist[is_active]": true});
e.preventDefault();
});
}

View File

@ -1,6 +1,6 @@
import Utility from './utility'
import LS from './local_storage'
import Post from './posts';
import Utility from "./utility";
import LS from "./local_storage";
import Post from "./posts";
let Blacklist = {};
@ -9,7 +9,7 @@ Blacklist.post_count = 0;
Blacklist.entries = [];
Blacklist.entryGet = function (line) {
return $.grep(Blacklist.entries, function (e, i) {
return $.grep(Blacklist.entries, function (e) {
return e.tags === line;
})[0];
};
@ -38,14 +38,14 @@ Blacklist.lineSet = function (line, enabled) {
Blacklist.entryParse = function (string) {
const fixInsanity = function (input) {
switch (input) {
case '=>':
return '>=';
case '=<':
return '<=';
case '=':
return '==';
case '':
return '==';
case "=>":
return ">=";
case "=<":
return "<=";
case "=":
return "==";
case "":
return "==";
default:
return input;
}
@ -59,13 +59,13 @@ Blacklist.entryParse = function (string) {
"hits": 0,
"score_comparison": null,
"username": false,
"user_id": 0
"user_id": 0,
};
const matches = string.match(/\S+/g) || [];
for (const tag of matches) {
if (tag.charAt(0) === '-') {
if (tag.charAt(0) === "-") {
entry.exclude.push(tag.slice(1));
} else if (tag.charAt(0) === '~') {
} else if (tag.charAt(0) === "~") {
entry.optional.push(tag.slice(1));
} else if (tag.match(/^score:[<=>]{0,2}-?\d+/)) {
const score = tag.match(/^score:([<=>]{0,2})(-?\d+)/);
@ -166,7 +166,7 @@ Blacklist.sidebarUpdate = function () {
$("#blacklist-box").show();
}
};
Blacklist.initialize_disable_all_blacklists = function () {
if (LS.get("dab") === "1") {
@ -184,7 +184,7 @@ Blacklist.initialize_disable_all_blacklists = function () {
Blacklist.entriesAllSet(true);
Blacklist.apply();
});
}
};
Blacklist.apply = function () {
Blacklist.post_count = 0;
@ -220,25 +220,25 @@ Blacklist.apply = function () {
}
Blacklist.sidebarUpdate();
}
};
Blacklist.posts = function () {
return $(".post-preview, #image-container, #c-comments .post, .post-thumbnail");
}
};
Blacklist.postMatch = function (post, entry) {
const $post = $(post);
if ($post.hasClass('post-no-blacklist'))
if ($post.hasClass("post-no-blacklist"))
return false;
let post_data = {
id: $post.data('id'),
score: parseInt($post.data('score'), 10),
tags: $post.data('tags').toString(),
rating: $post.data('rating'),
uploader_id: $post.data('uploader-id'),
user: $post.data('uploader').toString().toLowerCase(),
flags: $post.data('flags'),
is_fav: $post.data('is-favorited')
id: $post.data("id"),
score: parseInt($post.data("score"), 10),
tags: $post.data("tags").toString(),
rating: $post.data("rating"),
uploader_id: $post.data("uploader-id"),
user: $post.data("uploader").toString().toLowerCase(),
flags: $post.data("flags"),
is_fav: $post.data("is-favorited"),
};
return Blacklist.postMatchObject(post_data, entry);
};
@ -246,18 +246,18 @@ Blacklist.postMatch = function (post, entry) {
Blacklist.postMatchObject = function (post, entry) {
const rangeComparator = function (comparison, target) {
// Bad comparison, post matches score.
if (!Array.isArray(comparison) || typeof target === 'undefined' || comparison.length !== 2)
if (!Array.isArray(comparison) || typeof target === "undefined" || comparison.length !== 2)
return true;
switch (comparison[0]) {
case '<':
case "<":
return target < comparison[1];
case '<=':
case "<=":
return target <= comparison[1];
case '==':
case "==":
return target == comparison[1];
case '>=':
case ">=":
return target >= comparison[1];
case '>':
case ">":
return target > comparison[1];
default:
return true;
@ -273,7 +273,7 @@ Blacklist.postMatchObject = function (post, entry) {
tags.push(`height:${post.height}`);
tags.push(`width:${post.width}`);
if (post.is_fav)
tags.push('fav:me');
tags.push("fav:me");
$.each(post.flags.match(/\S+/g) || [], function (i, v) {
tags.push(`status:${v}`);
});
@ -281,7 +281,7 @@ Blacklist.postMatchObject = function (post, entry) {
return (Utility.is_subset(tags, entry.require) && score_test)
&& (!entry.optional.length || Utility.intersect(tags, entry.optional).length)
&& !Utility.intersect(tags, entry.exclude).length;
}
};
Blacklist.initialize_all = function () {
Blacklist.entriesParse();
@ -289,18 +289,18 @@ Blacklist.initialize_all = function () {
Blacklist.initialize_disable_all_blacklists();
Blacklist.apply();
$("#blacklisted-hider").remove();
}
};
Blacklist.initialize_anonymous_blacklist = function () {
if ($(document.body).data('user-is-anonymous') !== true) {
if ($(document.body).data("user-is-anonymous") !== true) {
return;
}
const anonBlacklist = LS.get('anonymous-blacklist');
const anonBlacklist = LS.get("anonymous-blacklist");
if (anonBlacklist) {
$("meta[name=blacklisted-tags]").attr("content", anonBlacklist);
}
}
};
Blacklist.initialize_blacklist_editor = function () {
$("#blacklist-edit-dialog").dialog({
@ -309,64 +309,64 @@ Blacklist.initialize_blacklist_editor = function () {
height: 400,
});
$("#blacklist-cancel").on('click', function () {
$("#blacklist-edit-dialog").dialog('close');
$("#blacklist-cancel").on("click", function () {
$("#blacklist-edit-dialog").dialog("close");
});
$("#blacklist-save").on('click', function () {
$("#blacklist-save").on("click", function () {
const blacklist_content = $("#blacklist-edit").val();
const blacklist_json = JSON.stringify(blacklist_content.split(/\n\r?/));
if($(document.body).data('user-is-anonymous') === true) {
LS.put('anonymous-blacklist', blacklist_json);
if ($(document.body).data("user-is-anonymous") === true) {
LS.put("anonymous-blacklist", blacklist_json);
} else {
$.ajax("/users/" + Utility.meta("current-user-id") + ".json", {
method: "PUT",
data: {
"user[blacklisted_tags]": blacklist_content
}
"user[blacklisted_tags]": blacklist_content,
},
}).done(function () {
Utility.notice("Blacklist updated");
}).fail(function (data, status, xhr) {
}).fail(function () {
Utility.error("Failed to update blacklist");
});
}
$("#blacklist-edit-dialog").dialog('close');
$("#blacklist-edit-dialog").dialog("close");
$("meta[name=blacklisted-tags]").attr("content", blacklist_json);
Blacklist.initialize_all();
});
$("#blacklist-edit-link").on('click', function (event) {
$("#blacklist-edit-link").on("click", function (event) {
event.preventDefault();
let entries = JSON.parse(Utility.meta("blacklisted-tags") || "[]");
entries = entries.map(e => e.replace(/(rating:[qes])\w+/ig, "$1").toLowerCase());
entries = entries.filter(e => e.trim() !== "");
$("#blacklist-edit").val(entries.join('\n'));
$("#blacklist-edit-dialog").dialog('open');
$("#blacklist-edit").val(entries.join("\n"));
$("#blacklist-edit-dialog").dialog("open");
});
};
Blacklist.collapseGet = function () {
const lsValue = LS.get('bc') || '1';
return lsValue === '1';
const lsValue = LS.get("bc") || "1";
return lsValue === "1";
};
Blacklist.collapseSet = function (collapsed) {
LS.put('bc', collapsed ? "1" : "0");
LS.put("bc", collapsed ? "1" : "0");
};
Blacklist.collapseUpdate = function () {
if (Blacklist.collapseGet()) {
$('#blacklist-list').hide();
$('#blacklist-collapse').addClass('hidden');
$("#blacklist-list").hide();
$("#blacklist-collapse").addClass("hidden");
} else {
$('#blacklist-list').show();
$('#blacklist-collapse').removeClass('hidden');
$("#blacklist-list").show();
$("#blacklist-collapse").removeClass("hidden");
}
};
Blacklist.initialize_collapse = function () {
$("#blacklist-collapse").on('click', function (e) {
$("#blacklist-collapse").on("click", function (e) {
e.preventDefault();
const current = Blacklist.collapseGet();
Blacklist.collapseSet(!current);
@ -382,4 +382,4 @@ $(document).ready(function () {
Blacklist.initialize_all();
});
export default Blacklist
export default Blacklist;

View File

@ -1,3 +1,4 @@
/* eslint-disable quotes */
import Utility from './utility.js';
let Blip = {};
@ -9,8 +10,8 @@ Blip.atme = function (id) {
dataType: 'json',
accept: 'text/javascript',
data: {
id: id
}
id: id,
},
}).done(function (data) {
$('#blip_body_for_')[0].value += '@' + data.creator_name.replace(/ /g, "_") + ': ';
$("#blip_body_for_")[0].focus();
@ -27,8 +28,8 @@ Blip.quote = function (id) {
dataType: 'json',
accept: 'text/javascript',
data: {
id: id
}
id: id,
},
}).done(function (data) {
const stripped_body = data.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm, "");
$('#blip_body_for_')[0].value += `[quote]"${data.creator_name}":/users/${data.creator_id} said:
@ -54,7 +55,7 @@ Blip.initialize_all = function() {
e.preventDefault();
});
}
}
};
Blip.reinitialize_all = function () {
if ($("#c-blips").length) {
@ -62,7 +63,7 @@ Blip.reinitialize_all = function() {
$(".blip-reply-link").off('click');
Blip.initialize_all();
}
}
};
$(function () {
Blip.initialize_all();

View File

@ -7,42 +7,42 @@ Comment.initialize_all = function () {
if ($("#c-posts").length || $("#c-comments").length) {
$(".edit_comment_link").on("click", Comment.show_edit_form);
$(".expand-comment-response").on("click", Comment.show_new_comment_form);
$('.comment-vote-up-link').on("click", Comment.vote_up);
$(".comment-vote-up-link").on("click", Comment.vote_up);
$(".comment-vote-down-link").on("click", Comment.vote_down);
$(".comment-reply-link").on('click', Comment.quote);
$(".comment-hide-link").on('click', Comment.hide);
$(".comment-unhide-link").on('click', Comment.unhide);
$(".comment-delete-link").on('click', Comment.delete);
$(".show-all-comments-for-post-link").on('click', Comment.show_all);
$(".comment-reply-link").on("click", Comment.quote);
$(".comment-hide-link").on("click", Comment.hide);
$(".comment-unhide-link").on("click", Comment.unhide);
$(".comment-delete-link").on("click", Comment.delete);
$(".show-all-comments-for-post-link").on("click", Comment.show_all);
$(".comment-tag-hide-link").on("click", Comment.toggle_post_tags);
}
}
};
Comment.reinitialize_all = function () {
if ($("#c-posts").length || $("#c-comments").length) {
$(".comment-reply-link").off('click');
$(".comment-hide-link").off('click');
$(".comment-unhide-link").off('click');
$(".comment-delete-link").off('click');
$(".show-all-comments-for-post-link").off('click');
$(".comment-reply-link").off("click");
$(".comment-hide-link").off("click");
$(".comment-unhide-link").off("click");
$(".comment-delete-link").off("click");
$(".show-all-comments-for-post-link").off("click");
$(".comment-tag-hide-link").off("click");
$(".edit_comment_link").off('click');
$(".expand-comment-response").off('click');
$('.comment-vote-up-link').off('click');
$(".comment-vote-down-link").off('click');
$(".edit_comment_link").off("click");
$(".expand-comment-response").off("click");
$(".comment-vote-up-link").off("click");
$(".comment-vote-down-link").off("click");
Comment.initialize_all();
DText.initialize_all_inputs();
}
}
};
Comment.show_all = function (e) {
e.preventDefault();
const target = $(e.target);
const post_id = target.data('pid');
const post_id = target.data("pid");
$.ajax({
url: `/posts/${post_id}/comments.json`,
type: 'GET',
dataType: 'json'
type: "GET",
dataType: "json",
}).done(function (data) {
$(`#threshold-comments-notice-for-${post_id}`).hide();
@ -50,7 +50,7 @@ Comment.show_all = function(e) {
current_comment_section.html(data.html);
Comment.reinitialize_all();
$(window).trigger("e621:add_deferred_posts", data.posts);
}).fail(function(data) {
}).fail(function () {
Utility.error("Failed to fetch all comments for this post.");
});
};
@ -59,16 +59,16 @@ Comment.hide = function (e) {
e.preventDefault();
if (!confirm("Are you sure you want to hide this comment?"))
return;
const parent = $(e.target).parents('article.comment');
const cid = parent.data('comment-id');
const parent = $(e.target).parents("article.comment");
const cid = parent.data("comment-id");
$.ajax({
url: `/comments/${cid}/hide.json`,
type: 'POST',
dataType: 'json'
}).done(function (data) {
type: "POST",
dataType: "json",
}).done(function () {
$(`.comment[data-comment-id="${cid}"] div.author h1`).append(" (hidden)");
$(`.comment[data-comment-id="${cid}"]`).attr('data-is-deleted', 'true');
}).fail(function (data) {
$(`.comment[data-comment-id="${cid}"]`).attr("data-is-deleted", "true");
}).fail(function () {
Utility.error("Failed to hide comment.");
});
};
@ -77,17 +77,17 @@ Comment.unhide = function (e) {
e.preventDefault();
if (!confirm("Are you sure you want to unhide this comment?"))
return;
const parent = $(e.target).parents('article.comment');
const cid = parent.data('comment-id');
const parent = $(e.target).parents("article.comment");
const cid = parent.data("comment-id");
$.ajax({
url: `/comments/${cid}/unhide.json`,
type: 'POST',
dataType: 'json'
}).done(function (data) {
type: "POST",
dataType: "json",
}).done(function () {
const $author = $(`.comment[data-comment-id="${cid}"] div.author h1`);
$author.text($author.text().replace(" (hidden)", ""));
$(`.comment[data-comment-id="${cid}"]`).attr('data-is-deleted', 'false');
}).fail(function (data) {
$(`.comment[data-comment-id="${cid}"]`).attr("data-is-deleted", "false");
}).fail(function () {
Utility.error("Failed to unhide comment.");
});
};
@ -96,32 +96,32 @@ Comment.delete = function (e) {
e.preventDefault();
if (!confirm("Are you sure you want to permanently delete this comment?"))
return;
const parent = $(e.target).parents('article.comment');
const cid = parent.data('comment-id');
const parent = $(e.target).parents("article.comment");
const cid = parent.data("comment-id");
$.ajax({
url: `/comments/${cid}.json`,
type: 'DELETE',
dataType: 'json'
}).done(function (data) {
type: "DELETE",
dataType: "json",
}).done(function () {
parent.remove();
}).fail(function (data) {
}).fail(function () {
Utility.error("Failed to delete comment.");
});
};
Comment.quote = function (e) {
e.preventDefault();
const parent = $(e.target).parents('article.comment');
const pid = parent.data('post-id');
const cid = parent.data('comment-id');
const parent = $(e.target).parents("article.comment");
const pid = parent.data("post-id");
const cid = parent.data("comment-id");
$.ajax({
url: `/comments/${cid}.json`,
type: 'GET',
dataType: 'json',
accept: 'text/javascript'
type: "GET",
dataType: "json",
accept: "text/javascript",
}).done(function (data) {
let stripped_body = data.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm, "");
stripped_body = `[quote]"${parent.data('creator')}":/users/${parent.data('creator-id')} said:
stripped_body = `[quote]"${parent.data("creator")}":/users/${parent.data("creator-id")} said:
${stripped_body}
[/quote]
@ -145,8 +145,8 @@ ${stripped_body}
Comment.toggle_post_tags = function (e) {
e.preventDefault();
const link = $(e.target);
$(`#post-tags-${link.data('post-id')}`).toggleClass("hidden");
}
$(`#post-tags-${link.data("post-id")}`).toggleClass("hidden");
};
Comment.show_new_comment_form = function (e) {
e.preventDefault();
@ -154,55 +154,55 @@ Comment.show_new_comment_form = function (e) {
var $form = $(e.target).closest("div.new-comment").find("form");
$form.show();
$form[0].scrollIntoView(false);
}
};
Comment.show_edit_form = function (e) {
e.preventDefault();
$(this).closest(".comment").find(".edit_comment").show();
}
};
Comment.vote_up = function (e) {
var id = $(e.target).attr('data-id');
var id = $(e.target).attr("data-id");
Comment.vote(id, 1);
}
};
Comment.vote_down = function (e) {
var id = $(e.target).attr('data-id');
var id = $(e.target).attr("data-id");
Comment.vote(id, -1);
}
};
Comment.vote = function (id, score) {
$.ajax({
method: 'POST',
method: "POST",
url: `/comments/${id}/votes.json`,
data: {
score: score
score: score,
},
dataType: 'json'
dataType: "json",
}).done(function (data) {
const scoreClasses = 'score-neutral score-positive score-negative';
const scoreClasses = "score-neutral score-positive score-negative";
const commentID = id;
const commentScore = data.score;
const ourScore = data.our_score;
function scoreToClass (inScore) {
if (inScore === 0) return 'score-neutral';
return inScore > 0 ? 'score-positive' : 'score-negative';
if (inScore === 0) return "score-neutral";
return inScore > 0 ? "score-positive" : "score-negative";
}
$("#comment-score-" + commentID).removeClass(scoreClasses);
$("#comment-vote-up-" + commentID).removeClass(scoreClasses);
$("#comment-vote-down-" + commentID).removeClass(scoreClasses);
$('#comment-score-'+commentID).text(commentScore);
$("#comment-score-" + commentID).text(commentScore);
$("#comment-score-" + commentID).addClass(scoreToClass(commentScore));
$('#comment-vote-up-'+commentID).addClass(ourScore > 0 ? 'score-positive' : 'score-neutral');
$('#comment-vote-down-'+commentID).addClass(ourScore < 0 ? 'score-negative' : 'score-neutral');
Utility.notice('Vote saved');
$("#comment-vote-up-" + commentID).addClass(ourScore > 0 ? "score-positive" : "score-neutral");
$("#comment-vote-down-" + commentID).addClass(ourScore < 0 ? "score-negative" : "score-neutral");
Utility.notice("Vote saved");
}).fail(function (data) {
Utility.error(data.responseJSON.message);
});
}
};
$(document).ready(function () {
Comment.initialize_all();
});
export default Comment
export default Comment;

View File

@ -1,21 +1,21 @@
import Cookie from './cookie'
import LS from './local_storage'
import Utility from './utility'
import Cookie from "./cookie";
import LS from "./local_storage";
import Utility from "./utility";
function initSearch () {
const $searchForm = $("#searchform");
const $searchShow = $("#search-form-show-link");
const $searchHide = $("#search-form-hide-link");
if ($searchForm.length) {
$searchShow.on('click', e => {
$searchShow.on("click", e => {
e.preventDefault();
$searchForm.fadeIn('fast');
$searchForm.fadeIn("fast");
$searchShow.hide();
$searchHide.show();
});
$searchHide.on('click', e => {
$searchHide.on("click", e => {
e.preventDefault();
$searchForm.fadeOut('fast');
$searchForm.fadeOut("fast");
$searchShow.show();
$searchHide.hide();
});
@ -23,7 +23,7 @@ function initSearch() {
}
$(function () {
$("#theme-switcher").change(function(e) {
$("#theme-switcher").change(function () {
let theme = $(this).val();
LS.put("theme", theme);
$("body").attr("data-th-main", theme);
@ -45,26 +45,26 @@ $(function() {
});
$("#close-notice-link").on("click.danbooru", function (e) {
$('#notice').fadeOut("fast");
$("#notice").fadeOut("fast");
e.preventDefault();
});
$(".revert-item-link").on('click', e => {
$(".revert-item-link").on("click", e => {
e.preventDefault();
const target = $(e.target);
const noun = target.data('noun');
const noun = target.data("noun");
if (!confirm(`Are you sure you want to revert ${noun} to this version?`))
return;
const path = target.attr('href');
const path = target.attr("href");
$.ajax({
method: "PUT",
url: path,
dataType: 'json'
}).done(data => {
dataType: "json",
}).done(() => {
location.reload();
}).fail(data => {
}).fail(() => {
Utility.error("Failed to revert to specified version.");
})
});
});
initSearch();
@ -72,4 +72,4 @@ $(function() {
window.submitInvisibleRecaptchaForm = function () {
document.getElementById("signup-form").submit();
}
};

View File

@ -19,10 +19,10 @@ Cookie.put = function(name, value, days) {
document.cookie = new_val;
return true;
} else {
Utility.error("You have too many cookies on this site. Consider deleting them all.")
Utility.error("You have too many cookies on this site. Consider deleting them all.");
return false;
}
}
};
Cookie.raw_get = function (name) {
var nameEq = name + "=";
@ -41,18 +41,18 @@ Cookie.raw_get = function(name) {
}
return "";
}
};
Cookie.get = function (name) {
return this.unescape(this.raw_get(name));
}
};
Cookie.remove = function (name) {
this.put(name, "", -1);
}
};
Cookie.unescape = function (val) {
return decodeURIComponent(val.replace(/\+/g, " "));
}
};
export default Cookie
export default Cookie;

View File

@ -1,4 +1,4 @@
import { SendQueue } from './send_queue';
import { SendQueue } from "./send_queue";
const DText = {};
@ -30,7 +30,7 @@ DText.initialze_input = function($element) {
DText.initialize_formatting_buttons($element);
$element.attr("data-initialized", "true");
}
};
DText.initialize_formatting_buttons = function (element) {
const $textarea = $(".dtext-formatter-input", element);
@ -44,7 +44,7 @@ DText.initialize_formatting_buttons = function(element) {
DText.process_formatting(content, $textarea);
});
}
}
};
/** Refreshes the preview field to match the provided input */
function update_preview (input, preview) {
@ -87,7 +87,7 @@ function update_preview(input, preview) {
.attr("loading", "false")
.text("Unable to fetch DText preview.");
input.removeData("cache");
}
},
});
});
}
@ -120,14 +120,14 @@ DText.process_formatting = function (content, input) {
input.prop("selectionStart", position.start + offset.start);
input.prop("selectionEnd", position.start + content.length - offset.end);
input.trigger("focus");
}
};
/** Add formatters to all appropriate inputs */
DText.initialize_all_inputs = function () {
$(".dtext-formatter[data-initialized='false']").each((index, element) => {
DText.initialze_input($(element));
});
}
};
$(function () {
DText.initialize_all_inputs();

View File

@ -1,6 +1,6 @@
import Post from './posts'
import Utility from './utility'
import {SendQueue} from './send_queue'
import Post from "./posts";
import Utility from "./utility";
import {SendQueue} from "./send_queue";
let Favorite = {};
@ -35,14 +35,14 @@ Favorite.create = function (post_id) {
type: "POST",
url: "/favorites.json",
data: {
post_id: post_id
post_id: post_id,
},
dataType: 'json'
dataType: "json",
}).done(function () {
Post.notice_update("dec");
Favorite.after_action(post_id, 1);
Utility.notice("Favorite added");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error("Error: " + data.responseJSON.message);
});
});
@ -55,12 +55,12 @@ Favorite.destroy = function (post_id) {
$.ajax({
type: "DELETE",
url: "/favorites/" + post_id + ".json",
dataType: 'json'
dataType: "json",
}).done(function () {
Post.notice_update("dec");
Favorite.after_action(post_id, -1);
Utility.notice("Favorite removed");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error("Error: " + data.responseJSON.message);
});
});
@ -68,4 +68,4 @@ Favorite.destroy = function (post_id) {
$(Favorite.initialize_actions);
export default Favorite
export default Favorite;

View File

@ -18,30 +18,30 @@ ForumPost.initialize_all = function() {
e.preventDefault();
});
$(".forum-post-reply-link").on('click', ForumPost.quote);
$(".forum-post-hide-link").on('click', ForumPost.hide);
$(".forum-post-unhide-link").on('click', ForumPost.unhide);
$(".forum-vote-up").on('click', evt => ForumPost.vote(evt, 1));
$(".forum-vote-meh").on('click', evt => ForumPost.vote(evt, 0));
$(".forum-vote-down").on('click', evt => ForumPost.vote(evt, -1));
$(document).on('click', ".forum-vote-remove", ForumPost.vote_remove);
}
$(".forum-post-reply-link").on("click", ForumPost.quote);
$(".forum-post-hide-link").on("click", ForumPost.hide);
$(".forum-post-unhide-link").on("click", ForumPost.unhide);
$(".forum-vote-up").on("click", evt => ForumPost.vote(evt, 1));
$(".forum-vote-meh").on("click", evt => ForumPost.vote(evt, 0));
$(".forum-vote-down").on("click", evt => ForumPost.vote(evt, -1));
$(document).on("click", ".forum-vote-remove", ForumPost.vote_remove);
}
};
ForumPost.reinitialize_all = function () {
if ($("#c-forum-topics #a-show,#c-forum-posts #a-show").length) {
$(".edit_forum_post_link").off("click.danbooru");
$(".edit_forum_topic_link").off("click.danbooru");
$(".forum-post-reply-link").off('click');
$(".forum-post-hide-link").off('click');
$(".forum-post-unhide-link").off('click');
$(".forum-vote-up").off('click');
$(".forum-vote-meh").off('click');
$(".forum-vote-down").off('click');
$(document).off('click', ".forum-vote-remove");
$(".forum-post-reply-link").off("click");
$(".forum-post-hide-link").off("click");
$(".forum-post-unhide-link").off("click");
$(".forum-vote-up").off("click");
$(".forum-vote-meh").off("click");
$(".forum-vote-down").off("click");
$(document).off("click", ".forum-vote-remove");
this.initialize_all();
}
}
};
ForumPost.vote = function (evt, score) {
evt.preventDefault();
@ -50,11 +50,11 @@ ForumPost.vote = function(evt, score) {
"1": { fa_class: "fa-thumbs-up", e6_class: "up" },
"0": { fa_class: "fa-face-meh", e6_class: "meh" },
"-1": { fa_class: "fa-thumbs-down", e6_class: "down" },
}
const icon = $('<a>').attr('href', '#').attr('data-forum-id', new_vote.forum_post_id).addClass('forum-vote-remove').append($('<i>').addClass('fa-regular').addClass(score_map[new_vote.score.toString()].fa_class));
const username = $('<a>').attr('href', `/users/${new_vote.creator_id}`).text(new_vote.creator_name);
const container = $('<li>').addClass(`vote-score-${score_map[new_vote.score].e6_class}`).addClass('own-forum-vote');
container.append(icon).append(' ').append(username);
};
const icon = $("<a>").attr("href", "#").attr("data-forum-id", new_vote.forum_post_id).addClass("forum-vote-remove").append($("<i>").addClass("fa-regular").addClass(score_map[new_vote.score.toString()].fa_class));
const username = $("<a>").attr("href", `/users/${new_vote.creator_id}`).text(new_vote.creator_name);
const container = $("<li>").addClass(`vote-score-${score_map[new_vote.score].e6_class}`).addClass("own-forum-vote");
container.append(icon).append(" ").append(username);
$(`#forum-post-votes-for-${new_vote.forum_post_id}`).prepend(container);
};
const id = $(evt.currentTarget).data("forum-id");
@ -63,7 +63,7 @@ ForumPost.vote = function(evt, score) {
type: "POST",
dataType: "json",
accept: "text/javascript",
data: { "forum_post_vote[score]": score }
data: { "forum_post_vote[score]": score },
}).done(function (data) {
create_post(data);
$(`#forum-post-votes-for-${id} .forum-post-vote-block`).hide();
@ -74,7 +74,7 @@ ForumPost.vote = function(evt, score) {
Utility.error("Failed to vote on forum post.");
}
});
}
};
ForumPost.vote_remove = function (evt) {
evt.preventDefault();
@ -84,32 +84,32 @@ ForumPost.vote_remove = function(evt) {
type: "DELETE",
dataType: "json",
accept: "text/javascript",
}).done(function(data) {
}).done(function () {
$(evt.target).parents(".own-forum-vote").remove();
$(`#forum-post-votes-for-${id} .forum-post-vote-block`).show();
Utility.notice("Vote removed.");
}).fail(function(data) {
}).fail(function () {
Utility.error("Failed to unvote on forum post.");
})
}
});
};
ForumPost.quote = function (e) {
e.preventDefault();
const parent = $(e.target).parents('article.forum-post');
const fpid = parent.data('forum-post-id');
const parent = $(e.target).parents("article.forum-post");
const fpid = parent.data("forum-post-id");
$.ajax({
url: `/forum_posts/${fpid}.json`,
type: 'GET',
dataType: 'json',
accept: 'text/javascript'
type: "GET",
dataType: "json",
accept: "text/javascript",
}).done(function (data) {
let stripped_body = data.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm, "");
stripped_body = `[quote]"${parent.data('creator')}":/users/${parent.data('creator-id')} said:
stripped_body = `[quote]"${parent.data("creator")}":/users/${parent.data("creator-id")} said:
${stripped_body}
[/quote]
`;
var $textarea = $('#forum_post_body_for_');
var $textarea = $("#forum_post_body_for_");
var msg = stripped_body;
if ($textarea.val().length > 0) {
msg = $textarea.val() + "\n\n" + msg;
@ -117,9 +117,9 @@ ${stripped_body}
$textarea.val(msg);
$textarea.selectEnd();
$('#topic-response').show();
$("#topic-response").show();
setTimeout(function () {
$('#topic-response')[0].scrollIntoView();
$("#topic-response")[0].scrollIntoView();
}, 15);
}).fail(function (data) {
Utility.error(data.responseText);
@ -130,16 +130,16 @@ ForumPost.hide = function (e) {
e.preventDefault();
if (!confirm("Are you sure you want to hide this post?"))
return;
const parent = $(e.target).parents('article.forum-post');
const fpid = parent.data('forum-post-id');
const parent = $(e.target).parents("article.forum-post");
const fpid = parent.data("forum-post-id");
$.ajax({
url: `/forum_posts/${fpid}/hide.json`,
type: 'POST',
dataType: 'json'
}).done(function (data) {
type: "POST",
dataType: "json",
}).done(function () {
$(`.forum-post[data-forum-post-id="${fpid}"] div.author h4`).append(" (hidden)");
$(`.forum-post[data-forum-post-id="${fpid}"]`).attr('data-is-hidden', 'true');
}).fail(function (data) {
$(`.forum-post[data-forum-post-id="${fpid}"]`).attr("data-is-hidden", "true");
}).fail(function () {
Utility.error("Failed to hide post.");
});
};
@ -148,17 +148,17 @@ ForumPost.unhide = function (e) {
e.preventDefault();
if (!confirm("Are you sure you want to unhide this post?"))
return;
const parent = $(e.target).parents('article.forum-post');
const fpid = parent.data('forum-post-id');
const parent = $(e.target).parents("article.forum-post");
const fpid = parent.data("forum-post-id");
$.ajax({
url: `/forum_posts/${fpid}/unhide.json`,
type: 'POST',
dataType: 'json'
}).done(function (data) {
type: "POST",
dataType: "json",
}).done(function () {
const $author = $(`.forum-post[data-forum-post-id="${fpid}"] div.author h4`);
$author.text($author.text().replace(" (hidden)", ""));
$(`.forum-post[data-forum-post-id="${fpid}"]`).attr('data-is-hidden', 'false');
}).fail(function (data) {
$(`.forum-post[data-forum-post-id="${fpid}"]`).attr("data-is-hidden", "false");
}).fail(function () {
Utility.error("Failed to unhide post.");
});
};
@ -167,4 +167,4 @@ $(document).ready(function() {
ForumPost.initialize_all();
});
export default ForumPost
export default ForumPost;

View File

@ -8,15 +8,15 @@ const GuestWarning = {
return;
}
hider.show();
$("#guest-warning-accept").on('click', function() {
$("#guest-warning-accept").on("click", function () {
Cookie.put("gw", "seen");
hider.hide();
});
$("#guest-warning-decline").on('click', function() {
$("#guest-warning-decline").on("click", function () {
Cookie.put("gw", "reject");
window.location.assign("https://www.google.com/");
});
}
},
};
$(document).ready(function () {

View File

@ -13,9 +13,10 @@ let LS = {
try {
return JSON.parse(value);
} catch (error) {
console.log(error);
return null;
}
}
},
};
export default LS;

View File

@ -1,14 +1,14 @@
import LS from './local_storage'
import LS from "./local_storage";
const Mascots = {
current: 0
current: 0,
};
function showMascot (mascot) {
$('body').css("background-image", "url(" + mascot.background_url + ")");
$('body').css("background-color", mascot.background_color);
$('.mascotbox').css("background-image", "url(" + mascot.background_url + ")");
$('.mascotbox').css("background-color", mascot.background_color);
$("body").css("background-image", "url(" + mascot.background_url + ")");
$("body").css("background-color", mascot.background_color);
$(".mascotbox").css("background-image", "url(" + mascot.background_url + ")");
$(".mascotbox").css("background-color", mascot.background_color);
const artistLink = $("<span>").text("Mascot by ").append($("<a>").text(mascot.artist_name).attr("href", mascot.artist_url));
$("#mascot_artist").empty().append(artistLink);
@ -23,11 +23,11 @@ function changeMascot() {
Mascots.current = availableMascotIds[(currentMascotIndex + 1) % availableMascotIds.length];
showMascot(mascots[Mascots.current]);
LS.put('mascot', Mascots.current);
LS.put("mascot", Mascots.current);
}
function initMascots () {
$('#change-mascot').on('click', changeMascot);
$("#change-mascot").on("click", changeMascot);
const mascots = window.mascots;
Mascots.current = LS.get("mascot");
if (!mascots[Mascots.current]) {
@ -39,6 +39,6 @@ function initMascots() {
}
$(function () {
if ($('#c-static > #a-home').length)
if ($("#c-static > #a-home").length)
initMascots();
});

View File

@ -1,6 +1,6 @@
import Utility from './utility'
import Post from './posts'
import LS from './local_storage';
import Utility from "./utility";
import Post from "./posts";
import LS from "./local_storage";
let ModQueue = {};
@ -12,13 +12,13 @@ ModQueue.detailed_rejection_dialog = function() {
$("#new_post_disapproval")
.off("submit.danbooru")
.on("submit.danbooru", () => {
Post.disapprove(postID, $("#post_disapproval_reason").val(), $("#post_disapproval_message").val())
Post.disapprove(postID, $("#post_disapproval_reason").val(), $("#post_disapproval_message").val());
return false;
});
Utility.dialog("Detailed Rejection", "#detailed-rejection-dialog");
return false;
}
};
$(function () {
// Toolbar visibility
@ -41,15 +41,15 @@ $(function() {
// Toolbar buttons
$(document).on("click.danbooru", ".quick-mod .detailed-rejection-link", ModQueue.detailed_rejection_dialog);
$(".delete-with-reason-link").on('click', function(e) {
$(".delete-with-reason-link").on("click", function (e) {
e.preventDefault();
const post_id = $(e.target).attr('data-post-id');
const prompt = $(e.target).data('prompt');
const reason = $(e.target).data('reason');
const post_id = $(e.target).attr("data-post-id");
const prompt = $(e.target).data("prompt");
const reason = $(e.target).data("reason");
if (confirm(`Delete post for ${prompt}?`))
Post.delete_with_reason(post_id, reason, true);
});
});
export default ModQueue
export default ModQueue;

View File

@ -1,4 +1,4 @@
import LS from './local_storage'
import LS from "./local_storage";
let NewsUpdate = {};
@ -8,12 +8,12 @@ NewsUpdate.initialize = function () {
}
const key = parseInt($("#news").data("id"), 10);
$('#news').on('click', function () {
$('#news').toggleClass('open');
$("#news").on("click", function () {
$("#news").toggleClass("open");
});
$('#news-closebutton').on('click', function () {
$('#news').hide();
LS.put('hide_news_notice', key.toString());
$("#news-closebutton").on("click", function () {
$("#news").hide();
LS.put("hide_news_notice", key.toString());
});
if (parseInt(LS.get("hide_news_notice") || 0, 10) < key) {
$("#news").show();
@ -24,4 +24,4 @@ $(function () {
NewsUpdate.initialize();
});
export default NewsUpdate
export default NewsUpdate;

View File

@ -1,31 +1,31 @@
import Utility from './utility'
import Utility from "./utility";
let Note = {
Box: {
create: function (id) {
var $inner_border = $('<div/>');
var $inner_border = $("<div/>");
$inner_border.addClass("note-box-inner-border");
$inner_border.css({
opacity: 0.5,
});
var $note_box = $('<div/>');
var $note_box = $("<div/>");
$note_box.addClass("note-box");
$note_box.data("id", String(id));
$note_box.attr("data-id", String(id));
$note_box.draggable({
containment: $("#image"),
stop: function(e, ui) {
stop: function () {
Note.Box.update_data_attributes($note_box);
}
},
});
$note_box.resizable({
containment: $("#image"),
handles: "se, nw",
stop: function(e, ui) {
stop: function () {
Note.Box.update_data_attributes($note_box);
}
},
});
$note_box.css({position: "absolute"});
$note_box.append($inner_border);
@ -36,7 +36,7 @@ let Note = {
update_data_attributes: function ($note_box) {
var $image = $("#image");
var $image_container = $("#image-container")
var $image_container = $("#image-container");
var ratio = $image.width() / parseFloat($image_container.data("width"));
var new_x = parseFloat($note_box.css("left"));
var new_y = parseFloat($note_box.css("top"));
@ -62,7 +62,7 @@ let Note = {
Note.clear_timeouts();
Note.Body.hide_all();
e.stopPropagation();
}
},
);
$note_box.on("resize.danbooru",
@ -70,7 +70,7 @@ let Note = {
var $note_box_inner = $(e.currentTarget);
Note.Box.resize_inner_border($note_box_inner);
e.stopPropagation();
}
},
);
$note_box.on(
@ -78,7 +78,7 @@ let Note = {
function (e) {
Note.dragging = false;
e.stopPropagation();
}
},
);
$note_box.on(
@ -106,7 +106,7 @@ let Note = {
}
e.stopPropagation();
}
},
);
},
@ -127,7 +127,7 @@ let Note = {
var $inner_border = $note_box.find("div.note-box-inner-border");
$inner_border.css({
height: $note_box.height() - 2,
width: $note_box.width() - 2
width: $note_box.width() - 2,
});
if ($inner_border.width() >= $note_box.width() - 2) {
@ -141,14 +141,14 @@ let Note = {
scale: function ($note_box) {
var $image = $("#image");
var $image_container = $("#image-container")
var $image_container = $("#image-container");
var ratio = $image.width() / parseFloat($image_container.data("width"));
var MIN_SIZE = 5;
$note_box.css({
top: Math.ceil(parseFloat($note_box.data("y")) * ratio),
left: Math.ceil(parseFloat($note_box.data("x")) * ratio),
width: Math.max(MIN_SIZE, Math.ceil(parseFloat($note_box.data("width")) * ratio)),
height: Math.max(MIN_SIZE, Math.ceil(parseFloat($note_box.data("height")) * ratio))
height: Math.max(MIN_SIZE, Math.ceil(parseFloat($note_box.data("height")) * ratio)),
});
Note.Box.resize_inner_border($note_box);
},
@ -168,19 +168,19 @@ let Note = {
toggle_all: function () {
var $note_container = $("#note-container");
var is_hidden = ($note_container.css('visibility') === 'hidden');
var is_hidden = ($note_container.css("visibility") === "hidden");
if (is_hidden) {
$note_container.css('visibility', 'visible');
$note_container.css("visibility", "visible");
} else {
$note_container.css('visibility', 'hidden');
}
$note_container.css("visibility", "hidden");
}
},
},
Body: {
create: function (id) {
var $note_body = $('<div></div>');
var $note_body = $("<div></div>");
$note_body.addClass("note-body");
$note_body.data("id", String(id));
$note_body.attr("data-id", String(id));
@ -193,7 +193,7 @@ let Note = {
var $note_box = Note.Box.find($note_body.data("id"));
$note_body.css({
top: $note_box.position().top + $note_box.height() + 5,
left: $note_box.position().left
left: $note_box.position().left,
});
Note.Body.bound_position($note_body);
},
@ -204,7 +204,7 @@ let Note = {
if ($note_body.offset().left + $note_body.width() > doc_width) {
$note_body.css({
left: $note_body.position().left - 10 - ($note_body.offset().left + $note_body.width() - doc_width)
left: $note_body.position().left - 10 - ($note_body.offset().left + $note_body.width() - doc_width),
});
}
},
@ -213,9 +213,9 @@ let Note = {
Note.Body.hide_all();
Note.clear_timeouts();
var $note_body = Note.Body.find(id);
if (!$note_body.data('resized')) {
if (!$note_body.data("resized")) {
Note.Body.resize($note_body);
$note_body.data('resized', 'true');
$note_body.data("resized", "true");
}
$note_body.show();
Note.Body.initialize($note_body);
@ -227,7 +227,9 @@ let Note = {
hide: function (id) {
var $note_body = Note.Body.find(id);
Note.timeouts.push(setTimeout(function() {$note_body.hide();}, 350));
Note.timeouts.push(
setTimeout(() => { $note_body.hide(); }, 350),
);
},
hide_all: function () {
@ -269,7 +271,7 @@ let Note = {
x = (lo + hi) / 2;
$note_body.css("min-width", x);
if ($note_body.height() > h) {
lo = x
lo = x;
} else {
hi = x;
}
@ -319,7 +321,7 @@ let Note = {
e.stopPropagation();
});
}
}
},
},
Edit: {
@ -333,7 +335,7 @@ let Note = {
$(".note-box").resizable("disable");
$(".note-box").draggable("disable");
let $textarea = $('<textarea></textarea>');
let $textarea = $("<textarea></textarea>");
$textarea.css({
width: "97%",
height: "92%",
@ -344,7 +346,7 @@ let Note = {
$textarea.val($note_body.data("original-body"));
}
let $dialog = $('<div></div>');
let $dialog = $("<div></div>");
$dialog.append($textarea);
$dialog.data("id", id);
$dialog.dialog({
@ -353,7 +355,7 @@ let Note = {
position: {
my: "right",
at: "right-20",
of: window
of: window,
},
classes: {
"ui-dialog": "note-edit-dialog",
@ -364,13 +366,13 @@ let Note = {
"Preview": Note.Edit.preview,
"Cancel": Note.Edit.cancel,
"Delete": Note.Edit.destroy,
"History": Note.Edit.history
}
"History": Note.Edit.history,
},
});
$dialog.data("uiDialog")._title = function (title) {
title.html(this.options.title); // Allow unescaped html in dialog title
}
$dialog.dialog("option", "title", 'Edit note #' + id + ' (<a href="/wiki_pages/e621:notes">view help</a>)');
};
$dialog.dialog("option", "title", "Edit note #" + id + " (<a href=\"/wiki_pages/e621:notes\">view help</a>)");
$dialog.on("dialogclose.danbooru", function () {
Note.editing = false;
@ -395,8 +397,8 @@ let Note = {
width: $note_box.width() / ratio,
height: $note_box.height() / ratio,
body: $note_body.data("original-body"),
}
}
},
};
if ($note_box.data("id").match(/x/)) {
hash.note.html_id = $note_box.data("id");
@ -406,11 +408,11 @@ let Note = {
return hash;
},
error_handler: function(xhr, status, exception) {
error_handler: function (xhr) {
Utility.error("Error: " + (xhr.responseJSON.reason || xhr.responseJSON.reasons.join("; ")));
},
success_handler: function(data, status, xhr) {
success_handler: function (data) {
var $note_box = null;
if (data.html_id) { // new note
@ -447,14 +449,14 @@ let Note = {
type: "PUT",
data: Note.Edit.parameterize_note($note_box, $note_body),
error: Note.Edit.error_handler,
success: Note.Edit.success_handler
success: Note.Edit.success_handler,
});
} else {
$.ajax("/notes.json", {
type: "POST",
data: Note.Edit.parameterize_note($note_box, $note_body),
error: Note.Edit.error_handler,
success: Note.Edit.success_handler
success: Note.Edit.success_handler,
});
}
},
@ -481,7 +483,7 @@ let Note = {
destroy: function () {
if (!confirm("Do you really want to delete this note?")) {
return
return;
}
var $this = $(this);
@ -494,7 +496,7 @@ let Note = {
Note.Box.find(id).remove();
Note.Body.find(id).remove();
$this.dialog("close");
}
},
});
}
},
@ -506,7 +508,7 @@ let Note = {
window.location.href = "/note_versions?search[note_id]=" + id;
}
$(this).dialog("close");
}
},
},
TranslationMode: {
@ -541,7 +543,7 @@ let Note = {
$(document).on("mouseup.danbooru.note", Note.TranslationMode.Drag.stop);
$("#mark-as-translated-section").show();
Utility.notice('Translation mode is on. Drag on the image to create notes. <a href="#">Turn translation mode off</a> (shortcut is <span class="key">n</span>).');
Utility.notice("Translation mode is on. Drag on the image to create notes. <a href=\"#\">Turn translation mode off</a> (shortcut is <span class=\"key\">n</span>).");
$("#notice a:contains(Turn translation mode off)").on("click.danbooru", Note.TranslationMode.stop);
},
@ -570,7 +572,7 @@ let Note = {
Note.create(x - offset.left, y - offset.top, w, h);
}
$("#note-container").css('visibility', 'visible');
$("#note-container").css("visibility", "visible");
e.stopPropagation();
e.preventDefault();
},
@ -638,12 +640,12 @@ let Note = {
Note.TranslationMode.Drag.h = -Note.TranslationMode.Drag.dragDistanceY;
}
$('#note-preview').css({
display: 'block',
$("#note-preview").css({
display: "block",
left: (Note.TranslationMode.Drag.x + 1),
top: (Note.TranslationMode.Drag.y + 1),
width: (Note.TranslationMode.Drag.w - 3),
height: (Note.TranslationMode.Drag.h - 3)
height: (Note.TranslationMode.Drag.h - 3),
});
}
},
@ -658,7 +660,7 @@ let Note = {
$(document).off("mousemove", Note.TranslationMode.Drag.drag);
if (Note.TranslationMode.Drag.dragging) {
$('#note-preview').css({ display: 'none' });
$("#note-preview").css({ display: "none" });
Note.TranslationMode.create_note(e, Note.TranslationMode.Drag.x, Note.TranslationMode.Drag.y, Note.TranslationMode.Drag.w - 1, Note.TranslationMode.Drag.h - 1);
Note.TranslationMode.Drag.dragging = false; /* border of the note is pixel-perfect on the preview border */
} else { /* no dragging -> toggle display of notes */
@ -667,8 +669,8 @@ let Note = {
Note.TranslationMode.Drag.dragStartX = 0;
Note.TranslationMode.Drag.dragStartY = 0;
}
}
},
},
},
id: "x",
@ -681,10 +683,10 @@ let Note = {
var $note_box = Note.Box.create(id);
var $note_body = Note.Body.create(id);
$note_box.data('x', x);
$note_box.data('y', y);
$note_box.data('width', w);
$note_box.data('height', h);
$note_box.data("x", x);
$note_box.data("y", y);
$note_box.data("width", w);
$note_box.data("height", h);
container.appendChild($note_box[0]);
container.appendChild($note_body[0]);
$note_body.data("original-body", original_body);
@ -699,7 +701,7 @@ let Note = {
top: y,
left: x,
width: w,
height: h
height: h,
});
Note.Box.update_data_attributes($note_box);
$note_box.find(".note-box-inner-border").addClass("unsaved");
@ -730,7 +732,7 @@ let Note = {
$article.data("width"),
$article.data("height"),
$article.data("body"),
$article.html()
$article.html(),
);
});
$("#note-container").append(fragment);
@ -761,10 +763,10 @@ let Note = {
Note.Box.show_highlighted($note_box);
}
},
}
};
$(function () {
Note.initialize_all();
});
export default Note
export default Note;

View File

@ -28,11 +28,11 @@ Pool.initialize_add_to_pool_link = function() {
e.preventDefault();
$("#pool_name").val($(this).attr("data-value"));
});
}
};
Pool.initialize_simple_edit = function () {
$("#sortable").sortable({
placeholder: "ui-state-placeholder"
placeholder: "ui-state-placeholder",
});
$("#sortable").disableSelection();
@ -41,17 +41,17 @@ Pool.initialize_simple_edit = function() {
$.ajax({
type: "post",
url: e.target.action,
data: $("#sortable").sortable("serialize") + "&" + $(e.target).serialize() + "&format=json"
data: $("#sortable").sortable("serialize") + "&" + $(e.target).serialize() + "&format=json",
}).done(() => {
window.location.href = e.target.action;
}).fail((data) => {
Utility.error(`Error: ${data.responseText}`);
});
});
}
};
$(document).ready(function () {
Pool.initialize_all();
});
export default Pool
export default Pool;

View File

@ -37,7 +37,7 @@ PostDeletion.init = function() {
const $button = $(element);
$button.find("input[type=text]").on("input", () => {
$button.trigger("e621:refresh");
})
});
});
buttons.trigger("e621:refresh");
@ -49,11 +49,11 @@ PostDeletion.init = function() {
$("#delreason-clear").on("click", () => {
input.val("").trigger("input");
});
}
};
$(function () {
if ($("div#c-confirm-delete").length)
Danbooru.PostDeletion.init();
});
export default PostDeletion
export default PostDeletion;

View File

@ -1,12 +1,12 @@
import Utility from './utility'
import LS from './local_storage'
import Post from './posts'
import Favorite from './favorites'
import PostSet from './post_sets'
import TagScript from './tag_script'
import { SendQueue } from './send_queue'
import Rails from '@rails/ujs'
import Shortcuts from './shortcuts'
import Utility from "./utility";
import LS from "./local_storage";
import Post from "./posts";
import Favorite from "./favorites";
import PostSet from "./post_sets";
import TagScript from "./tag_script";
import { SendQueue } from "./send_queue";
import Rails from "@rails/ujs";
import Shortcuts from "./shortcuts";
let PostModeMenu = {};
@ -19,15 +19,15 @@ PostModeMenu.initialize = function() {
this.initialize_shortcuts();
PostModeMenu.change();
}
}
};
PostModeMenu.initialize_shortcuts = function () {
Shortcuts.keydown("1 2 3 4 5 6 7 8 9 0", "change_tag_script", PostModeMenu.change_tag_script);
}
};
PostModeMenu.show_notice = function (i) {
Utility.notice("Switched to tag script #" + i + ". To switch tag scripts, use the number keys.");
}
};
PostModeMenu.change_tag_script = function (e) {
if ($("#mode-box-mode").val() === "tag-script") {
@ -44,7 +44,7 @@ PostModeMenu.change_tag_script = function(e) {
e.preventDefault();
}
}
};
PostModeMenu.initialize_selector = function () {
if (!LS.get("mode")) {
@ -54,15 +54,15 @@ PostModeMenu.initialize_selector = function() {
$("#mode-box-mode").val(LS.get("mode"));
}
$("#mode-box-mode").on("change.danbooru", function(e) {
$("#mode-box-mode").on("change.danbooru", function () {
PostModeMenu.change();
$("#tag-script-field:visible").focus().select();
});
}
};
PostModeMenu.initialize_preview_link = function () {
$(".post-preview a").on("click.danbooru", PostModeMenu.click);
}
};
PostModeMenu.initialize_edit_form = function () {
$("#quick-edit-div").hide();
@ -77,8 +77,8 @@ PostModeMenu.initialize_edit_form = function() {
url: $("#quick-edit-form").attr("action"),
data: {
post: {
tag_string: $("#post_tag_string").val()
}
tag_string: $("#post_tag_string").val(),
},
},
complete: function () {
Rails.enableElement(document.getElementById("quick-edit-form"));
@ -87,12 +87,12 @@ PostModeMenu.initialize_edit_form = function() {
Post.update_data(data);
Utility.notice("Post #" + data.post.id + " updated");
PostModeMenu.close_edit_form();
}
},
});
e.preventDefault();
});
}
};
PostModeMenu.close_edit_form = function () {
Shortcuts.disabled = false;
@ -100,36 +100,36 @@ PostModeMenu.close_edit_form = function() {
if (Utility.meta("enable-auto-complete") === "true") {
$("#post_tag_string").data("uiAutocomplete").close();
}
}
};
PostModeMenu.initialize_tag_script_field = function () {
$("#tag-script-field").blur(function(e) {
$("#tag-script-field").blur(function () {
const script = $(this).val();
const current_script_id = LS.get("current_tag_script_id");
LS.put("tag-script-" + current_script_id, script);
});
}
};
PostModeMenu.update_sets_menu = function () {
let target = $('#set-id');
target.off('change');
let target = $("#set-id");
target.off("change");
SendQueue.add(function () {
$.ajax({
type: "GET",
url: "/post_sets/for_select.json",
}).fail(function (data) {
$(window).trigger('danbooru:error', "Error getting sets list: " + data.message);
$(window).trigger("danbooru:error", "Error getting sets list: " + data.message);
}).done(function (data) {
target.on('change', function(e) {
LS.put('set', e.target.value);
target.on("change", function (e) {
LS.put("set", e.target.value);
});
target.empty();
const target_set = LS.get('set') || 0;
['Owned', "Maintained"].forEach(function(v) {
let group = $('<optgroup>', {label: v});
const target_set = LS.get("set") || 0;
["Owned", "Maintained"].forEach(function (v) {
let group = $("<optgroup>", {label: v});
data[v].forEach(function (gi) {
group.append($('<option>', {value: gi[1], selected: (gi[1] == target_set)}).text(gi[0]));
group.append($("<option>", {value: gi[1], selected: (gi[1] == target_set)}).text(gi[0]));
});
target.append(group);
});
@ -159,13 +159,13 @@ PostModeMenu.change = function() {
$("#tag-script-field").val(script).show();
PostModeMenu.show_notice(current_script_id);
} else if (s === 'add-to-set' || s === 'remove-from-set') {
} else if (s === "add-to-set" || s === "remove-from-set") {
PostModeMenu.update_sets_menu();
$("#set-id").show();
} else if (s === 'delete') {
} else if (s === "delete") {
$("#quick-mode-reason").show();
}
}
};
PostModeMenu.open_edit = function (post_id) {
Shortcuts.disabled = true;
@ -179,7 +179,7 @@ PostModeMenu.open_edit = function(post_id) {
var padding = $("#post_tag_string").innerHeight() - $("#post_tag_string").height();
var height = $("#post_tag_string").prop("scrollHeight") - padding;
$("#post_tag_string").height(height);
}
};
PostModeMenu.click = function (e) {
var s = $("#mode-box-mode").val();
@ -191,33 +191,33 @@ PostModeMenu.click = function(e) {
Favorite.destroy(post_id);
} else if (s === "edit") {
PostModeMenu.open_edit(post_id);
} else if (s === 'vote-down') {
} else if (s === "vote-down") {
Post.vote(post_id, -1, true);
} else if (s === 'vote-up') {
} else if (s === "vote-up") {
Post.vote(post_id, 1, true);
} else if (s === 'add-to-set') {
} else if (s === "add-to-set") {
PostSet.add_post($("#set-id").val(), post_id);
} else if (s === 'remove-from-set') {
} else if (s === "remove-from-set") {
PostSet.remove_post($("#set-id").val(), post_id);
} else if (s === 'rating-q') {
Post.update(post_id, {"post[rating]": "q"})
} else if (s === 'rating-s') {
Post.update(post_id, {"post[rating]": "s"})
} else if (s === 'rating-e') {
Post.update(post_id, {"post[rating]": "e"})
} else if (s === 'lock-rating') {
} else if (s === "rating-q") {
Post.update(post_id, {"post[rating]": "q"});
} else if (s === "rating-s") {
Post.update(post_id, {"post[rating]": "s"});
} else if (s === "rating-e") {
Post.update(post_id, {"post[rating]": "e"});
} else if (s === "lock-rating") {
Post.update(post_id, {"post[is_rating_locked]": "1"});
} else if (s === 'lock-note') {
} else if (s === "lock-note") {
Post.update(post_id, {"post[is_note_locked]": "1"});
} else if (s === 'delete') {
} else if (s === "delete") {
Post.delete_with_reason(post_id, $("#quick-mode-reason").val(), false);
} else if (s === 'undelete') {
} else if (s === "undelete") {
Post.undelete(post_id);
} else if (s === 'unflag') {
} else if (s === "unflag") {
Post.unflag(post_id, "none", false);
} else if (s === 'approve') {
} else if (s === "approve") {
Post.approve(post_id);
} else if (s === 'remove-parent') {
} else if (s === "remove-parent") {
Post.update(post_id, {"post[parent_id]": ""});
} else if (s === "tag-script") {
const current_script_id = LS.get("current_tag_script_id");
@ -226,7 +226,7 @@ PostModeMenu.click = function(e) {
e.preventDefault();
return;
}
const postTags = $("#post_" + post_id).data('tags').split(' ');
const postTags = $("#post_" + post_id).data("tags").split(" ");
const tags = new Set(postTags);
const changes = TagScript.run(tags, tag_script);
Post.tagScript(post_id, changes);
@ -235,10 +235,10 @@ PostModeMenu.click = function(e) {
}
e.preventDefault();
}
};
$(function () {
PostModeMenu.initialize();
});
export default PostModeMenu
export default PostModeMenu;

View File

@ -1,4 +1,4 @@
import Utility from './utility'
import Utility from "./utility";
let PostReplacement = {};
@ -29,12 +29,12 @@ PostReplacement.approve = function (id, penalize_current_uploader) {
type: "PUT",
url: `/post_replacements/${id}/approve.json`,
data: {
penalize_current_uploader: penalize_current_uploader
penalize_current_uploader: penalize_current_uploader,
},
dataType: 'json'
dataType: "json",
}).done(function () {
set_status($row, "approved");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error(data.responseText);
set_status($row, "replacement failed");
});
@ -48,14 +48,14 @@ PostReplacement.reject = function (id) {
$.ajax({
type: "PUT",
url: `/post_replacements/${id}/reject.json`,
dataType: 'json'
dataType: "json",
}).done(function () {
set_status($row, "rejected");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error(data.responseText);
set_status($row, "rejecting failed");
});
}
};
PostReplacement.promote = function (id) {
if (!confirm("Are you sure you want to promote this replacement?"))
@ -65,15 +65,15 @@ PostReplacement.promote = function (id) {
$.ajax({
type: "POST",
url: `/post_replacements/${id}/promote.json`,
dataType: 'json'
dataType: "json",
}).done(function (data) {
Utility.notice(`Replacement promoted to post #${data.post.id}`);
set_status($row, "promoted");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error(data.responseText);
set_status($row, "promoting failed");
});
}
};
PostReplacement.toggle_penalize = function ($target) {
const id = $target.data("replacement-id");
@ -82,14 +82,14 @@ PostReplacement.toggle_penalize = function ($target) {
$.ajax({
type: "PUT",
url: `/post_replacements/${id}/toggle_penalize.json`,
dataType: 'json'
}).done(function (data) {
dataType: "json",
}).done(function () {
$target.removeClass("disabled-link");
$currentStatus.text($currentStatus.text() == "yes" ? "no" : "yes");
}).fail(function (data, status, xhr) {
}).fail(function (data) {
Utility.error(data.responseText);
});
}
};
function make_processing ($row) {
$row.removeClass("replacement-pending-row").addClass("replacement-processing-row");
@ -108,4 +108,4 @@ $(function () {
});
export default PostReplacement
export default PostReplacement;

View File

@ -1,6 +1,6 @@
import {SendQueue} from './send_queue'
import Post from './posts'
import LS from './local_storage'
import {SendQueue} from "./send_queue";
import Post from "./posts";
import LS from "./local_storage";
let PostSet = {};
@ -14,9 +14,10 @@ PostSet.add_post = function (set_id, post_id) {
url: "/post_sets/" + set_id + "/add_posts.json",
data: {post_ids: [post_id]},
}).fail(function (data) {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
console.log(data, data.responseJSON, data.responseJSON.error);
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
Post.notice_update("dec");
$(window).trigger('danbooru:error', "Error: " + message);
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
Post.notice_update("dec");
$(window).trigger("danbooru:notice", "Added post to set");
@ -32,9 +33,9 @@ PostSet.remove_post = function (set_id, post_id) {
url: "/post_sets/" + set_id + "/remove_posts.json",
data: {post_ids: [post_id]},
}).fail(function (data) {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
Post.notice_update("dec");
$(window).trigger('danbooru:error', "Error: " + message);
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
Post.notice_update("dec");
$(window).trigger("danbooru:notice", "Removed post from set");
@ -55,33 +56,33 @@ PostSet.initialize_add_to_set_link = function() {
$("#add-to-set-submit").on("click", function (e) {
e.preventDefault();
const post_id = $('#image-container').data('id');
const post_id = $("#image-container").data("id");
PostSet.add_post($("#add-to-set-id").val(), post_id);
$('#add-to-set-dialog').dialog('close');
$("#add-to-set-dialog").dialog("close");
});
};
PostSet.update_sets_menu = function () {
const target = $('#add-to-set-id');
const target = $("#add-to-set-id");
target.empty();
target.append($('<option>').text('Loading...'));
target.off('change');
target.append($("<option>").text("Loading..."));
target.off("change");
SendQueue.add(function () {
$.ajax({
type: "GET",
url: "/post_sets/for_select.json",
}).fail(function (data) {
$(window).trigger('danbooru:error', "Error getting sets list: " + data.message);
$(window).trigger("danbooru:error", "Error getting sets list: " + data.message);
}).done(function (data) {
target.on('change', function(e) {
LS.put('set', e.target.value);
})
const target_set = LS.get('set') || 0;
target.on("change", function (e) {
LS.put("set", e.target.value);
});
const target_set = LS.get("set") || 0;
target.empty();
['Owned', "Maintained"].forEach(function(v) {
let group = $('<optgroup>', {label: v});
["Owned", "Maintained"].forEach(function (v) {
let group = $("<optgroup>", {label: v});
data[v].forEach(function (gi) {
group.append($('<option>', {value: gi[1], selected: (gi[1] == target_set)}).text(gi[0]));
group.append($("<option>", {value: gi[1], selected: (gi[1] == target_set)}).text(gi[0]));
});
target.append(group);
});
@ -90,7 +91,7 @@ PostSet.update_sets_menu = function() {
};
$(function () {
if ($("#c-posts").length && $('#a-show').length) {
if ($("#c-posts").length && $("#a-show").length) {
PostSet.initialize_add_to_set_link();
}
});

View File

@ -1,6 +1,6 @@
import Utility from './utility';
import Utility from "./utility";
import {SendQueue} from "./send_queue";
import Post from './posts';
import Post from "./posts";
let PostVersion = {};
@ -8,11 +8,11 @@ PostVersion.updated = 0;
PostVersion.initialize_all = function () {
if ($("#c-post-versions #a-index").length) {
PostVersion.initialize_undo();
$('#subnav-select-all-link').on('click', function(event) {
$("#subnav-select-all-link").on("click", function (event) {
event.preventDefault();
$(".post-version-select:not(:disabled)").prop("checked", true).change();
});
$("#subnav-apply-tag-script-to-selected-link").on('click', PostVersion.tag_script_selected);
$("#subnav-apply-tag-script-to-selected-link").on("click", PostVersion.tag_script_selected);
}
};
@ -22,11 +22,11 @@ PostVersion.initialize_undo = function () {
$(event.target).find(".post-version-select:not(:disabled)").prop("checked", (_, checked) => !checked).change();
});
$("#post-version-select-all").on("change.danbooru", function (event) {
$("#post-version-select-all").on("change.danbooru", function () {
$(".post-version-select:not(:disabled)").prop("checked", $("#post-version-select-all").prop("checked")).change();
});
$(".post-version-select").on("change.danbooru", function (event) {
$(".post-version-select").on("change.danbooru", function () {
let checked = $(".post-version-select:checked");
$("#subnav-undo-selected-link").text(`Undo selected (${checked.length})`).toggle(checked.length > 0);
});
@ -69,7 +69,7 @@ PostVersion.tag_script_selected = function() {
Utility.notice(`${++PostVersion.updated}/${selected_rows.length} changes applied.`);
});
}
}
};
$(document).ready(PostVersion.initialize_all);
export default PostVersion;

View File

@ -1,9 +1,9 @@
import Utility from './utility'
import ZingTouch from 'zingtouch'
import LS from './local_storage'
import Note from './notes'
import { SendQueue } from './send_queue'
import Shortcuts from './shortcuts'
import Utility from "./utility";
import ZingTouch from "zingtouch";
import LS from "./local_storage";
import Note from "./notes";
import { SendQueue } from "./send_queue";
import Shortcuts from "./shortcuts";
let Post = {};
@ -39,46 +39,46 @@ Post.initialize_all = function() {
}
$(document).on("danbooru:open-post-edit-tab", () => Shortcuts.disabled = true);
$(document).on("danbooru:open-post-edit-tab", () => $('#post_tag_string').focus());
$(document).on("danbooru:open-post-edit-tab", () => $("#post_tag_string").focus());
$(document).on("danbooru:close-post-edit-tab", () => Shortcuts.disabled = false);
var $fields_multiple = $('[data-autocomplete="tag-edit"]');
var $fields_multiple = $("[data-autocomplete=\"tag-edit\"]");
$fields_multiple.on("keypress.danbooru", Post.update_tag_count);
$fields_multiple.on("click", Post.update_tag_count);
}
};
Post.initialize_moderation = function () {
$("#unapprove-post-link").on('click', e => {
Post.unapprove($(e.target).data('pid'));
$("#unapprove-post-link").on("click", e => {
Post.unapprove($(e.target).data("pid"));
e.preventDefault();
});
$(".unflag-post-link").on('click', e => {
$(".unflag-post-link").on("click", e => {
const $e = $(e.target);
Post.unflag($e.data('pid'), $e.data('type'));
Post.unflag($e.data("pid"), $e.data("type"));
e.preventDefault();
});
};
Post.initialize_collapse = function () {
$('.tag-list-header').on('click', function(e) {
const category = $(e.target).data('category');
$(".tag-list-header").on("click", function (e) {
const category = $(e.target).data("category");
$(`.${category}-tag-list`).toggle();
$(e.target).toggleClass("hidden-category");
e.preventDefault();
});
}
};
Post.initialize_voting = function () {
$(document).on("click.danbooru.post", '.post-vote-up-link', Post.vote_up);
$(document).on("click.danbooru.post", ".post-vote-up-link", Post.vote_up);
$(document).on("click.danbooru.post", ".post-vote-down-link", Post.vote_down);
}
};
Post.initialize_edit_dialog = function () {
$("#open-edit-dialog").show().on("click.danbooru", function (e) {
Post.open_edit_dialog();
e.preventDefault();
});
}
};
Post.open_edit_dialog = function () {
if ($("#edit-dialog").length === 1) {
@ -104,29 +104,31 @@ Post.open_edit_dialog = function() {
position: {
my: "right",
at: "right-20",
of: window
of: window,
},
drag: function(e, ui) {
drag: function () {
if (Utility.meta("enable-auto-complete") === "true") {
$tag_string.data("uiAutocomplete").close();
}
},
close: Post.close_edit_dialog
close: Post.close_edit_dialog,
});
dialog.dialog("widget").draggable("option", "containment", "none");
var pin_button = $("<button/>").button({icons: {primary: "ui-icon-pin-w"}, label: "pin", text: false});
pin_button.css({width: "20px", height: "20px", position: "absolute", right: "28.4px"});
dialog.parent().children(".ui-dialog-titlebar").append(pin_button);
pin_button.on("click.danbooru", function(e) {
var dialog_widget = $('.ui-dialog:has(#edit-dialog)');
pin_button.on("click.danbooru", function () {
var dialog_widget = $(".ui-dialog:has(#edit-dialog)");
var pos = dialog_widget.offset();
if (dialog_widget.css("position") === "absolute") {
pos.left -= $(window).scrollLeft();
pos.top -= $(window).scrollTop();
dialog_widget.offset(pos).css({ position: "fixed" });
dialog.dialog("option", "resize", function() { dialog_widget.css({ position: "fixed" }); });
dialog.dialog("option", "resize", function () {
dialog_widget.css({ position: "fixed" });
});
pin_button.button("option", "icons", {primary: "ui-icon-pin-s"});
} else {
@ -139,17 +141,17 @@ Post.open_edit_dialog = function() {
}
});
dialog.parent().mouseout(function(e) {
dialog.parent().mouseout(function () {
dialog.parent().css({"opacity": 0.6, "transition": "opacity .4s ease"});
}).mouseover(function(e) {
}).mouseover(function () {
dialog.parent().css({"opacity": 1, "transition": "opacity .2s ease"});
});
$tag_string.css({"resize": "none", "width": "100%"});
$tag_string.focus().selectEnd().height($tag_string[0].scrollHeight);
}
};
Post.close_edit_dialog = function(e, ui) {
Post.close_edit_dialog = function () {
$("#form").appendTo($("#c-posts #edit,#c-uploads #a-new"));
$("#edit-dialog").remove();
var $tag_string = $("#post_tag_string");
@ -157,15 +159,15 @@ Post.close_edit_dialog = function(e, ui) {
$("#open-edit-dialog").show();
$tag_string.css({"resize": "", "width": ""});
$(document).trigger("danbooru:close-post-edit-dialog");
}
};
Post.has_next_target = function () {
return $(".paginator a[rel~=next]").length || $(".search-seq-nav a[rel~=next]").length || $(".pool-nav li.pool-selected-true a[rel~=next], .set-nav a.active[rel~=next]").length;
}
};
Post.has_prev_target = function () {
return $(".paginator a[rel~=prev]").length || $(".search-seq-nav a[rel~=prev]").length || $(".pool-nav li.pool-selected-true a[rel~=prev], .set-nav a.active[rel~=prev]").length
}
return $(".paginator a[rel~=prev]").length || $(".search-seq-nav a[rel~=prev]").length || $(".pool-nav li.pool-selected-true a[rel~=prev], .set-nav a.active[rel~=prev]").length;
};
/**
* Swipe gesture recognizer that works by averaging the angle/distance/velocity of a gesture path and returning the result.
@ -175,7 +177,7 @@ Post.has_prev_target = function() {
class E6Swipe extends ZingTouch.Swipe {
constructor (options) {
super(options);
this.type = 'e6swipe';
this.type = "e6swipe";
this.minDistance = 150;
}
@ -198,7 +200,7 @@ class E6Swipe extends ZingTouch.Swipe {
// Prevent gestures from triggering while inputs are active.
const activeElement = document.activeElement;
if(activeElement && ['INPUT', 'TEXTAREA', 'SELECT'].indexOf(activeElement.tagName) !== -1)
if (activeElement && ["INPUT", "TEXTAREA", "SELECT"].indexOf(activeElement.tagName) !== -1)
return null;
let output = {
@ -206,7 +208,7 @@ class E6Swipe extends ZingTouch.Swipe {
};
const input = inputs[0];
if(input.current.type !== 'end')
if (input.current.type !== "end")
return null;
const progress = input.getGestureProgress(this.getId());
// Ensure sufficient move data to compute inputs.
@ -225,7 +227,7 @@ class E6Swipe extends ZingTouch.Swipe {
const dist = distanceBetweenTwoPoints([acc.last.x, acc.last.y], [move.x, move.y]);
return {vel: acc.vel + vel, angle: [acc.angle[0] + Math.cos(angle), acc.angle[1] + Math.sin(angle)], dist: acc.dist + dist, last: move};
}, {vel: 0, angle: 0, dist: 0, last: null});
const initial = input.initial;
// const initial = input.initial;
// Add total gesture motion as a bias.
// totals.vel += getVelocity([initial.x, initial.y, initial.time], [input.current.x, input.current.y, input.current.time]);
// totals.angle += getAngle([initial.x, initial.y], [input.current.x, input.current.y]) + Math.PI;
@ -257,14 +259,14 @@ Post.initialize_gestures = function() {
if (LS.get("emg") !== "true") {
return;
}
if (!(('ontouchstart' in window) || (navigator.maxTouchPoints > 0)))
if (!(("ontouchstart" in window) || (navigator.maxTouchPoints > 0)))
return;
// Need activeElement to make sure that this doesn't go off during input.
if(!('activeElement' in document))
if (!("activeElement" in document))
return;
const $body = $("body");
if($body.data('zing'))
if ($body.data("zing"))
return;
const zing = new ZingTouch.Region(document.body, false, false);
@ -275,17 +277,17 @@ Post.initialize_gestures = function() {
const hasNext = Post.has_next_target();
if (hasPrev && (angle > 90 - 25 && angle < 90 + 25)) { // right swipe
$("body").css({"transition-timing-function": "ease", "transition-duration": "0.2s", "opacity": "0", "transform": "translateX(150%)"});
Utility.delay(200).then(function() { Post.nav_prev(e); });
Utility.delay(200).then(() => Post.nav_prev(e));
}
if (hasNext && (angle > -90 - 25 && angle < -90 + 25)) { // Left swipe
$("body").css({"transition-timing-function": "ease", "transition-duration": "0.2s", "opacity": "0", "transform": "translateX(-150%)"});
Utility.delay(200).then(function() { Post.nav_next(e); });
Utility.delay(200).then(() => Post.nav_next(e));
}
});
$body.data("zing", zing);
$("#image-container").css({overflow: "visible"});
}
};
Post.nav_prev = function (e) {
var href = "";
@ -305,7 +307,7 @@ Post.nav_prev = function(e) {
}
e.preventDefault();
}
};
Post.nav_next = function (e) {
var href = "";
@ -323,7 +325,7 @@ Post.nav_next = function(e) {
}
e.preventDefault();
}
};
Post.initialize_shortcuts = function () {
if ($("#a-show").length) {
@ -334,48 +336,54 @@ Post.initialize_shortcuts = function() {
Shortcuts.keydown("a", "prev_page", Post.nav_prev);
Shortcuts.keydown("d", "next_page", Post.nav_next);
}
}
};
Post.initialize_links = function () {
$(".undelete-post-link").on('click', e => {
$(".undelete-post-link").on("click", e => {
e.preventDefault();
if (!confirm("Are you sure you want to undelete this post?"))
return;
Post.undelete($(e.target).data('pid'), () => { location.reload(); });
Post.undelete($(e.target).data("pid"), () => {
location.reload();
});
$(".approve-post-link").on('click', e => {
});
$(".approve-post-link").on("click", e => {
e.preventDefault();
Post.approve($(e.target).data('pid'), () => { location.reload(); });
Post.approve($(e.target).data("pid"), () => {
location.reload();
});
$(".approve-post-and-navigate-link").on('click', e => {
});
$(".approve-post-and-navigate-link").on("click", e => {
e.preventDefault();
const $target = $(e.target);
Post.approve($target.data('pid'), () => { location.href = $target.data('location') });
Post.approve($target.data("pid"), () => {
location.href = $target.data("location");
});
$("#destroy-post-link").on('click', e => {
});
$("#destroy-post-link").on("click", e => {
e.preventDefault();
const reason = prompt("This will permanently delete this post (meaning the file will be deleted). What is the reason for destroying the post?")
const reason = prompt("This will permanently delete this post (meaning the file will be deleted). What is the reason for destroying the post?");
if (reason === null) return;
Post.destroy($(e.target).data('pid'), reason);
Post.destroy($(e.target).data("pid"), reason);
});
$("#regenerate-image-samples-link").on('click', e => {
$("#regenerate-image-samples-link").on("click", e => {
e.preventDefault();
Post.regenerate_image_samples($(e.target).data('pid'));
Post.regenerate_image_samples($(e.target).data("pid"));
});
$("#regenerate-video-samples-link").on('click', e => {
$("#regenerate-video-samples-link").on("click", e => {
e.preventDefault();
Post.regenerate_video_samples($(e.target).data('pid'));
Post.regenerate_video_samples($(e.target).data("pid"));
});
$(".disapprove-post-link").on('click', e => {
$(".disapprove-post-link").on("click", e => {
e.preventDefault();
const target = $(e.target);
Post.disapprove(target.data('pid'), target.data('reason'));
Post.disapprove(target.data("pid"), target.data("reason"));
});
$("#set-as-avatar-link").on('click.danbooru', function(e) {
$("#set-as-avatar-link").on("click.danbooru", function (e) {
e.preventDefault();
if (!confirm("Set post as avatar?"))
return;
Post.set_as_avatar($(e.target).data('post-id'));
Post.set_as_avatar($(e.target).data("post-id"));
});
$("#copy-notes").on("click.danbooru", function (e) {
var current_post_id = $("meta[name=post-id]").attr("content");
@ -385,9 +393,9 @@ Post.initialize_links = function() {
$.ajax("/posts/" + current_post_id + "/copy_notes", {
type: "PUT",
data: {
other_post_id: other_post_id
other_post_id: other_post_id,
},
success: function(data) {
success: function () {
$(window).trigger("danbooru:notice", "Successfully copied notes to <a href='" + other_post_id + "'>post #" + other_post_id + "</a>");
},
error: function (data) {
@ -398,13 +406,13 @@ Post.initialize_links = function() {
} else {
$(window).trigger("danbooru:error", "There was an error copying notes to <a href='" + other_post_id + "'>post #" + other_post_id + "</a>");
}
}
},
});
}
e.preventDefault();
});
}
};
Post.initialize_post_relationship_previews = function () {
var current_post_id = $("meta[name=post-id]").attr("content");
@ -413,14 +421,14 @@ Post.initialize_post_relationship_previews = function() {
const toggle = function () {
Post.toggle_relationship_preview($("#has-children-relationship-preview"), $("#has-children-relationship-preview-link"));
Post.toggle_relationship_preview($("#has-parent-relationship-preview"), $("#has-parent-relationship-preview-link"));
}
};
const flip_saved = function () {
if (LS.get("show-relationship-previews") === "1")
LS.put("show-relationship-previews", "0");
else
LS.put("show-relationship-previews", "1");
}
};
if (LS.get("show-relationship-previews") === "1") {
toggle();
@ -435,8 +443,8 @@ Post.initialize_post_relationship_previews = function() {
toggle();
flip_saved();
e.preventDefault();
})
}
});
};
Post.toggle_relationship_preview = function (preview, preview_link) {
preview.toggle();
@ -445,25 +453,25 @@ Post.toggle_relationship_preview = function(preview, preview_link) {
} else {
preview_link.text("show »");
}
}
};
Post.currentPost = function () {
if (!this._currentPost)
this._currentPost = this.fromDOM($("#image-container"));
return this._currentPost;
}
};
Post.fromDOM = function (element) {
if (!element)
return {};
const post = element.attr("data-post") || '{}';
const post = element.attr("data-post") || "{}";
return JSON.parse(post);
}
};
Post.resize_notes = function () {
Note.Box.scale_all();
}
};
Post.resize_video = function (post, target_size) {
const $video = $("video#image");
@ -475,38 +483,38 @@ Post.resize_video = function (post, target_size) {
const scaled_percentage = Math.floor(100 * width / orig_width);
$percentage.text(`${scaled_percentage}%`);
};
$notice.hide()
$notice.hide();
let target_sources = [];
let desired_classes = [];
function original_sources () {
target_sources.push({type: 'video/webm', url: post?.file?.url});
if (typeof post?.sample?.alternates?.original !== 'unknown') {
target_sources.push({type: 'video/mp4', url: post?.sample?.alternates?.original?.urls[1]});
}
target_sources.push({type: "video/webm", url: post?.file?.url});
if (typeof post?.sample?.alternates?.original !== "undefined")
target_sources.push({type: "video/mp4", url: post?.sample?.alternates?.original?.urls[1]});
}
switch (target_size) {
case 'original':
case "original":
original_sources();
break;
case 'fit':
case "fit":
original_sources();
desired_classes.push('fit-window');
desired_classes.push("fit-window");
break;
case 'fitv':
case "fitv":
original_sources();
desired_classes.push('fit-window-vertical');
desired_classes.push("fit-window-vertical");
break;
default:
default: {
$notice.show();
const alternate = post?.sample?.alternates[target_size];
target_sources.push({type: 'video/webm; codecs="vp9"', url: alternate.urls[0]});
target_sources.push({type: 'video/mp4', url: alternate.urls[1]});
desired_classes.push('fit-window');
target_sources.push({type: "video/webm; codecs=\"vp9\"", url: alternate.urls[0]});
target_sources.push({type: "video/mp4", url: alternate.urls[1]});
desired_classes.push("fit-window");
update_resize_percentage(post?.sample?.alternates[target_size]?.width, post?.file?.width);
break;
}
}
$video.removeClass();
$video.empty(); // Yank any sources out of the list to prevent browsers from being pants on head.
for (const source of target_sources) {
@ -517,8 +525,8 @@ Post.resize_video = function (post, target_size) {
const canPlay = videoTag.canPlayType(source.type);
if (canPlay === "probably" || canPlay === "maybe") {
// This comparison fixes reloading the media on changing between fit modes.
if(source.url !== $video.attr('src')) {
$video.attr('src', source.url);
if (source.url !== $video.attr("src")) {
$video.attr("src", source.url);
videoTag.load(); // Forces changed source to take effect. *SOME* browsers ignore changes otherwise.
}
break;
@ -527,7 +535,7 @@ Post.resize_video = function (post, target_size) {
for (const class_name of desired_classes) {
$video.addClass(class_name);
}
}
};
Post.resize_image = function (post, target_size) {
const $image = $("img#image");
@ -538,43 +546,43 @@ Post.resize_image = function (post, target_size) {
$percentage.text(`${scaled_percentage}%`);
};
$notice.hide();
let desired_url = '';
let desired_url = "";
let desired_classes = [];
switch (target_size) {
case 'original':
case "original":
desired_url = post?.file?.url;
break;
case 'fit':
desired_classes.push('fit-window');
case "fit":
desired_classes.push("fit-window");
desired_url = post?.file?.url;
break;
case 'fitv':
desired_classes.push('fit-window-vertical');
case "fitv":
desired_classes.push("fit-window-vertical");
desired_url = post?.file?.url;
break;
case 'large':
case "large":
$notice.show();
desired_classes.push('fit-window');
desired_classes.push("fit-window");
desired_url = post?.sample?.url;
update_resize_percentage(post?.sample?.width, post?.file?.width);
break;
default:
$notice.show();
desired_classes.push('fit-window');
desired_classes.push("fit-window");
desired_url = post?.sample?.alternates[target_size]?.url;
update_resize_percentage(post?.sample?.alternates[target_size]?.width, post?.file?.width);
break;
}
$image.removeClass();
if ($image.attr('src') !== desired_url) {
$("#image-container").addClass('image-loading');
$image.attr('src', desired_url);
if ($image.attr("src") !== desired_url) {
$("#image-container").addClass("image-loading");
$image.attr("src", desired_url);
}
for (const class_name of desired_classes) {
$image.addClass(class_name);
}
Post.resize_notes();
}
};
Post.resize_to = function (target_size) {
target_size = update_size_selector(target_size);
@ -585,13 +593,13 @@ Post.resize_to = function(target_size) {
} else {
Post.resize_image(post, target_size);
}
}
};
function is_video (post) {
switch (post.file.ext) {
case 'webm':
case 'mp4':
case "webm":
case "mp4":
return true;
default:
return false;
@ -619,60 +627,60 @@ function update_size_selector(choice) {
function most_relevant_sample_size (post) {
let samples = Object.entries(Post.currentPost().sample.alternates);
samples = samples.filter((x) => x[0] !== 'original');
samples = samples.filter((x) => x[0] !== "original");
if (samples.length === 0) {
return 'fit';
return "fit";
}
if (post?.file?.width <= 1280 && post?.file?.height <= 720) {
return 'fit'; // Don't force people onto 480p samples for <720 videos.
return "fit"; // Don't force people onto 480p samples for <720 videos.
}
const differences = samples.map((x) => [x[0], Math.abs(window.outerHeight - x[1].height) * Math.abs(window.outerWidth - x[1].width)]).sort((a,b) => a[1] < b[1] ? -1 : 1);
const differences = samples.map((x) => [x[0], Math.abs(window.outerHeight - x[1].height) * Math.abs(window.outerWidth - x[1].width)]).sort((a, b) => (a[1] < b[1] ? -1 : 1));
return differences[0][0];
}
Post.initialize_resize = function () {
Post.initialize_change_resize_mode_link();
const post = Post.currentPost();
if (post?.file?.ext === 'swf')
if (post?.file?.ext === "swf")
return;
const is_post_video = is_video(post);
if (!is_post_video) {
const $image = $('img#image');
const $image = $("img#image");
if ($image.length > 0 && $image[0]) {
if ($image[0].complete)
Post.resize_notes();
}
$image.on('load', function (e) {
$image.on("load", function () {
Post.resize_notes();
$("#image-container").removeClass("image-loading");
});
$(window).on('resize', Post.resize_notes);
$(window).on("resize", Post.resize_notes);
}
let image_size = Utility.meta('image-override-size') || Utility.meta("default-image-size");
if(is_post_video && image_size === 'large') {
let image_size = Utility.meta("image-override-size") || Utility.meta("default-image-size");
if (is_post_video && image_size === "large") {
image_size = most_relevant_sample_size(post);
}
Post.resize_to(image_size);
const $selector = $("#image-resize-selector");
$selector.on('change', () => Post.resize_to($selector.val()));
}
$selector.on("change", () => Post.resize_to($selector.val()));
};
Post.resize_cycle_mode = function (e) {
if (e && e.target)
e.preventDefault();
Post.resize_to("next");
}
};
Post.initialize_change_resize_mode_link = function () {
$("#image-resize-link").on("click", (e) => {
e.preventDefault();
Post.resize_to('fit');
Post.resize_to("fit");
}); // For top panel
Shortcuts.keydown('v', 'resize', Post.resize_cycle_mode);
}
Shortcuts.keydown("v", "resize", Post.resize_cycle_mode);
};
Post.initialize_post_sections = function () {
$("#post-sections li a,#side-edit-link").on("click.danbooru", function (e) {
@ -697,7 +705,7 @@ Post.initialize_post_sections = function() {
$(e.target).parent("li").addClass("active");
e.preventDefault();
});
}
};
Post.notice_update = function (x) {
if (x === "inc") {
@ -712,7 +720,7 @@ Post.notice_update = function(x) {
$(window).trigger("danbooru:notice", "Updating posts (" + Post.pending_update_count + " pending)...", true);
}
}
}
};
Post.update_data = function (data) {
var $post = $("#post_" + data.id);
@ -725,17 +733,17 @@ Post.update_data = function(data) {
if (data.has_visible_children) {
$post.addClass("post-status-has-children");
}
}
};
Post.tag = function (post_id, tags) {
const tag_string = (Array.isArray(tags) ? tags.join(" ") : String(tags));
Post.update(post_id, { "post[old_tag_string]": "", "post[tag_string]": tag_string });
}
};
Post.tagScript = function (post_id, tags) {
const tag_string = (Array.isArray(tags) ? tags.join(" ") : String(tags));
Post.update(post_id, { "post[tag_string_diff]": tag_string });
}
};
Post.update = function (post_id, params) {
Post.notice_update("inc");
@ -749,13 +757,13 @@ Post.update = function(post_id, params) {
Post.notice_update("dec");
Post.update_data(data);
},
error: function(data) {
error: function () {
Post.notice_update("dec");
$(window).trigger("danbooru:error", 'There was an error updating <a href="/posts/' + post_id + '">post #' + post_id + '</a>');
}
$(window).trigger("danbooru:error", "There was an error updating <a href=\"/posts/" + post_id + "\">post #" + post_id + "</a>");
},
});
});
}
};
Post.delete_with_reason = function (post_id, reason, reload_after_delete) {
Post.notice_update("inc");
@ -763,55 +771,55 @@ Post.delete_with_reason = function(post_id, reason, reload_after_delete) {
$.ajax({
type: "POST",
url: `/moderator/post/posts/${post_id}/delete.json`,
data: {commit: "Delete", reason: reason, move_favorites: true}
data: {commit: "Delete", reason: reason, move_favorites: true},
}).fail(function (data) {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
$(window).trigger('danbooru:error', "Error: " + message);
}).done(function(data) {
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
$(window).trigger("danbooru:notice", "Deleted post.");
if (reload_after_delete) {
location.reload();
} else {
$(`article#post_${post_id}`).attr('data-flags', 'deleted');
$(`article#post_${post_id}`).attr("data-flags", "deleted");
}
}).always(function () {
Post.notice_update("dec");
});
});
}
};
Post.undelete = function (post_id, callback) {
Post.notice_update("inc");
SendQueue.add(function () {
$.ajax({
type: "POST",
url: `/moderator/post/posts/${post_id}/undelete.json`
url: `/moderator/post/posts/${post_id}/undelete.json`,
}).fail(function (data) {
// var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
const message = data.responseJSON.message;
$(window).trigger('danbooru:error', "Error: " + message);
}).done(function(data) {
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
$(window).trigger("danbooru:notice", "Undeleted post.");
$(`article#post_${post_id}`).attr('data-flags', 'active');
$(`article#post_${post_id}`).attr("data-flags", "active");
if (callback) callback();
}).always(function () {
Post.notice_update("dec");
});
});
}
};
Post.unflag = function (post_id, approval, reload = true) {
Post.notice_update("inc");
let modApproval = approval || 'none';
let modApproval = approval || "none";
SendQueue.add(function () {
$.ajax({
type: "DELETE",
url: `/posts/${post_id}/flag.json`,
data: {approval: modApproval}
data: {approval: modApproval},
}).fail(function (data) {
const message = data.responseJSON.message;
$(window).trigger('danbooru:error', "Error: " + message);
}).done(function(data) {
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
$(window).trigger("danbooru:notice", "Unflagged post");
if (reload) {
location.reload();
@ -820,7 +828,7 @@ Post.unflag = function(post_id, approval, reload = true) {
Post.notice_update("dec");
});
});
}
};
Post.unapprove = function (post_id) {
Post.notice_update("inc");
@ -828,43 +836,43 @@ Post.unapprove = function(post_id) {
$.ajax({
type: "DELETE",
url: "/moderator/post/approval.json",
data: {post_id: post_id}
data: {post_id: post_id},
}).fail(function (data) {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
$(window).trigger('danbooru:error', "Error: " + message);
}).done(function(data) {
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function () {
$(window).trigger("danbooru:notice", "Unapproved post.");
location.reload();
}).always(function () {
Post.notice_update("dec");
});
});
}
};
Post.destroy = function (post_id, reason) {
$.post(`/moderator/post/posts/${post_id}/expunge.json`, { reason }
$.post(`/moderator/post/posts/${post_id}/expunge.json`, { reason },
).fail(data => {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join("; ");
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
$(window).trigger("danbooru:error", "Error: " + message);
}).done(data => {
}).done(() => {
location.href = `/admin/destroyed_posts/${post_id}`;
});
};
Post.regenerate_image_samples = function (post_id) {
$.post(`/moderator/post/posts/${post_id}/regenerate_thumbnails.json`, {}
$.post(`/moderator/post/posts/${post_id}/regenerate_thumbnails.json`, {},
).fail(data => {
Utility.error("Error: " + data.responseJSON.reason);
}).done(data => {
}).done(() => {
Utility.notice("Image samples regenerated.");
});
};
Post.regenerate_video_samples = function (post_id) {
$.post(`/moderator/post/posts/${post_id}/regenerate_videos.json`, {}
$.post(`/moderator/post/posts/${post_id}/regenerate_videos.json`, {},
).fail(data => {
Utility.error("Error: " + data.responseJSON.reason);
}).done(data => {
}).done(() => {
Utility.notice("Video samples will be regenerated in a few minutes.");
});
};
@ -874,11 +882,11 @@ Post.approve = function(post_id, callback) {
SendQueue.add(function () {
$.post(
"/moderator/post/approval.json",
{ "post_id": post_id }
{ "post_id": post_id },
).fail(function (data) {
const message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join("; ");
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
Danbooru.error("Error: " + message);
}).done(function(data) {
}).done(function () {
var $post = $("#post_" + post_id);
if ($post.length) {
$post.data("flags", $post.data("flags").replace(/pending/, ""));
@ -892,18 +900,18 @@ Post.approve = function(post_id, callback) {
Post.notice_update("dec");
});
});
}
};
Post.disapprove = function (post_id, reason, message) {
Post.notice_update("inc");
SendQueue.add(function () {
$.post(
"/moderator/post/disapprovals.json",
{"post_disapproval[post_id]": post_id, "post_disapproval[reason]": reason, "post_disapproval[message]": message}
{"post_disapproval[post_id]": post_id, "post_disapproval[reason]": reason, "post_disapproval[message]": message},
).fail(function (data) {
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join("; ");
var message = $.map(data.responseJSON.errors, (msg) => msg).join("; ");
$(window).trigger("danbooru:error", "Error: " + message);
}).done(function(data) {
}).done(function () {
if ($("#c-posts #a-show").length) {
location.reload();
}
@ -916,13 +924,13 @@ Post.disapprove = function(post_id, reason, message) {
Post.update_tag_count = function (event) {
let string = "0 tags";
let count = 0;
let count2 = 1;
// let count2 = 1;
if (event) {
let tags = [...new Set($(event.target).val().match(/\S+/g))];
if (tags) {
count = tags.length;
string = (count == 1) ? (count + " tag") : (count + " tags")
string = (count == 1) ? (count + " tag") : (count + " tags");
}
}
$("#tags-container .count").html(string);
@ -933,75 +941,75 @@ Post.update_tag_count = function(event) {
klass = "meh";
}
$("#tags-container .options #face").removeClass().addClass(`fa-regular fa-face-${klass}`);
}
};
Post.vote_up = function (e) {
var id = $(e.target).parent().attr('data-id');
var id = $(e.target).parent().attr("data-id");
Post.vote(id, 1);
}
};
Post.vote_down = function (e) {
var id = $(e.target).parent().attr('data-id');
var id = $(e.target).parent().attr("data-id");
Post.vote(id, -1);
}
};
Post.vote = function (id, score, prevent_unvote) {
Post.notice_update("inc");
SendQueue.add(function () {
$.ajax({
method: 'POST',
method: "POST",
url: `/posts/${id}/votes.json`,
data: {
score: score,
no_unvote: prevent_unvote === true
no_unvote: prevent_unvote === true,
},
dataType: 'json',
dataType: "json",
headers: {
accept: '*/*;q=0.5,text/javascript'
}
accept: "*/*;q=0.5,text/javascript",
},
}).done(function (data) {
const scoreClasses = 'score-neutral score-positive score-negative';
const scoreClasses = "score-neutral score-positive score-negative";
const postID = id;
const postScore = data.score;
const ourScore = data.our_score;
function scoreToClass (inScore) {
if(inScore == 0) return 'score-neutral';
return inScore > 0 ? 'score-positive' : 'score-negative';
if (inScore == 0) return "score-neutral";
return inScore > 0 ? "score-positive" : "score-negative";
}
$(".post-score-" + postID).removeClass(scoreClasses);
$(".post-vote-up-" + postID).removeClass(scoreClasses);
$(".post-vote-down-" + postID).removeClass(scoreClasses);
$('.post-score-'+postID).text(postScore);
$('.post-score-'+postID).attr('title', `${data.up} up/${data.down} down`);
$(".post-score-" + postID).text(postScore);
$(".post-score-" + postID).attr("title", `${data.up} up/${data.down} down`);
$(".post-score-" + postID).addClass(scoreToClass(postScore));
$('.post-vote-up-'+postID).addClass(ourScore > 0 ? 'score-positive' : 'score-neutral');
$('.post-vote-down-'+postID).addClass(ourScore < 0 ? 'score-negative' : 'score-neutral');
$(window).trigger('danbooru:notice', 'Vote saved');
$(".post-vote-up-" + postID).addClass(ourScore > 0 ? "score-positive" : "score-neutral");
$(".post-vote-down-" + postID).addClass(ourScore < 0 ? "score-negative" : "score-neutral");
$(window).trigger("danbooru:notice", "Vote saved");
}).always(function () {
Post.notice_update("dec");
});
});
}
};
Post.set_as_avatar = function (id) {
SendQueue.add(function () {
$.ajax({
method: 'PATCH',
method: "PATCH",
url: `/users/${Utility.meta("current-user-id")}.json`,
data: {
'user[avatar_id]': id
"user[avatar_id]": id,
},
headers: {
accept: '*/*;q=0.5,text/javascript'
}
}).done(function(data) {
accept: "*/*;q=0.5,text/javascript",
},
}).done(function () {
$(window).trigger("danbooru:notice", "Post set as avatar");
});
});
}
};
$(document).ready(function () {
Post.initialize_all();
});
export default Post
export default Post;

View File

@ -11,7 +11,7 @@ RelatedTag.init_post_show_editor = function() {
const app = createApp(TagEditor);
app.mount("#tag-string-editor");
}
};
$(function () {
$(document).on("danbooru:open-post-edit-tab", RelatedTag.init_post_show_editor);

View File

@ -5,5 +5,5 @@ export default {
init () {
const app = createApp(Replacer);
app.mount("#replacement-uploader");
}
}
},
};

View File

@ -1,8 +1,8 @@
$(function () {
$("#maintoggle").on("click.danbooru", function (e) {
e.preventDefault();
$('#nav').toggle();
$('#maintoggle-on').toggle();
$('#maintoggle-off').toggle();
$("#nav").toggle();
$("#maintoggle-on").toggle();
$("#maintoggle-off").toggle();
});
});

View File

@ -1,4 +1,4 @@
import Utility from './utility'
import Utility from "./utility";
let Shortcuts = {};
Shortcuts.disabled = false;
@ -7,7 +7,7 @@ Shortcuts.initialize = function() {
Shortcuts.keydown("s", "scroll_down", Shortcuts.nav_scroll_down);
Shortcuts.keydown("w", "scroll_up", Shortcuts.nav_scroll_up);
Shortcuts.initialize_data_shortcuts();
}
};
// Bind keyboard shortcuts to links that have a `data-shortcut="..."` attribute. If multiple links have the
// same shortcut, then only the first link will be triggered by the shortcut.
@ -15,7 +15,7 @@ Shortcuts.initialize_data_shortcuts = function() {
$(document).off("keydown.danbooru.shortcut");
$("[data-shortcut]").each((_i, element) => {
const $e = $(element)
const $e = $(element);
const id = $e.attr("id");
const keys = $e.attr("data-shortcut");
const namespace = `shortcut.${id}`;
@ -53,14 +53,14 @@ Shortcuts.keydown = function(keys, namespace, handler) {
Shortcuts.nav_scroll_down = function () {
window.scrollBy(0, $(window).height() * 0.15);
}
};
Shortcuts.nav_scroll_up = function () {
window.scrollBy(0, $(window).height() * -0.15);
}
};
$(document).ready(function () {
Shortcuts.initialize();
});
export default Shortcuts
export default Shortcuts;

View File

@ -1,4 +1,4 @@
import Utility from './utility.js';
import Utility from "./utility.js";
class TagRelationships {
static approve (e) {
@ -15,12 +15,12 @@ class TagRelationships {
$.ajax({
url: `/${route}/${id}/approve.json`,
type: 'POST',
dataType: 'json'
}).done(function (data) {
type: "POST",
dataType: "json",
}).done(function () {
Utility.notice(`Accepted ${human}.`);
parent.slideUp('fast');
}).fail(function (data) {
parent.slideUp("fast");
}).fail(function () {
Utility.error(`Failed to accept ${human}.`);
});
}
@ -39,24 +39,24 @@ class TagRelationships {
$.ajax({
url: `/${route}/${id}.json`,
type: 'DELETE',
dataType: 'json'
}).done(function (data) {
type: "DELETE",
dataType: "json",
}).done(function () {
Utility.notice(`Rejected ${human}.`);
parent.slideUp('fast');
}).fail(function (data) {
parent.slideUp("fast");
}).fail(function () {
Utility.error(`Failed to reject ${human}.`);
});
}
}
$(document).ready(function () {
$(".tag-relationship-accept").on('click', e => {
$(".tag-relationship-accept").on("click", e => {
TagRelationships.approve(e);
});
$(".tag-relationship-reject").on('click', e => {
$(".tag-relationship-reject").on("click", e => {
TagRelationships.reject(e);
});
});
export default TagRelationships
export default TagRelationships;

View File

@ -1,12 +1,13 @@
/* eslint-disable comma-dangle */
const TagScript = {
parse (script) {
return script.match(/\[.+?\]|\S+/g)
return script.match(/\[.+?\]|\S+/g);
},
test (tags, predicate) {
const split_pred = predicate.match(/\S+/g);
for (const x of split_pred) {
if (x[0] === '-') {
if (x[0] === "-") {
if (tags.has(x.substr(1))) {
return false;
}
@ -21,7 +22,7 @@ const TagScript = {
if (command.match(/^\[if/)) {
const match = command.match(/\[if\s+(.+?)\s*,\s*(.+?)\]/);
if (TagScript.test(tags, match[1])) {
return TagScript.process(tags, match[2])
return TagScript.process(tags, match[2]);
} else {
return null;
}
@ -41,7 +42,7 @@ const TagScript = {
changes.push(result);
}
}
return changes.join(' ');
return changes.join(" ");
}
};

View File

@ -1,9 +1,9 @@
import Utility from './utility.js';
import Utility from "./utility.js";
let Takedown = {};
Takedown.destroy = function (id) {
Utility.notice('Deleting takedown #' + id + "...");
Utility.notice("Deleting takedown #" + id + "...");
$.ajax({
url: "/takedown/destroy.json",
@ -11,9 +11,9 @@ Takedown.destroy = function (id) {
dataType: "json",
headers: {accept: "text/javascript"},
data: {
"id": id
}
}).done(function (data) {
"id": id,
},
}).done(function () {
Utility.notice("Takedown deleted");
$("#takedown-" + id).fadeOut("fast");
}).fail(function (data) {
@ -30,8 +30,8 @@ Takedown.add_posts_by_tags_preview = function (id) {
headers: {accept: "text/javascript"},
data: {
id: id,
post_tags: tags
}
post_tags: tags,
},
}).done(function (data) {
var count = data.matched_post_count;
var preview_text = "<a href='/post/index?tags=" + tags.replace(" ", "+") + "+status:any'>" + count + " " + (count == 1 ? "post" : "posts") + "</a> " + (count == 1 ? "matches" : "match") + " the search '<a href='/post/index?tags=" + tags.replace(" ", "+") + "+status:any'>" + tags + "</a>'. Click Confirm to add " + (count == 1 ? "it" : "them") + " to the takedown.";
@ -48,7 +48,7 @@ Takedown.add_posts_by_tags_preview = function (id) {
Takedown.add_posts_by_tags_cancel = function () {
$("#takedown-add-posts-tags-warning").hide();
$("#takedown-add-posts-tags").val('').prop("disabled", false);
$("#takedown-add-posts-tags").val("").prop("disabled", false);
$("#takedown-add-posts-tags-preview").show().prop("disabled", true);
$("#takedown-add-posts-tags-confirm").hide();
$("#takedown-add-posts-tags-cancel").hide();
@ -66,8 +66,8 @@ Takedown.add_posts_by_tags = function (id) {
headers: {accept: "text/javascript"},
data: {
id: id,
post_tags: tags
}
post_tags: tags,
},
}).done(function (data) {
const added_post_ids = data.added_post_ids;
const count = added_post_ids.length;
@ -98,8 +98,8 @@ Takedown.add_posts_by_ids = function (id) {
headers: {accept: "text/javascript"},
data: {
id: id,
post_ids: post_ids
}
post_ids: post_ids,
},
}).done(function (data) {
Utility.notice(data.added_count + " post" + (data.added_count == 1 ? "" : "s") + " added to takedown");
@ -109,7 +109,7 @@ Takedown.add_posts_by_ids = function (id) {
$(html).appendTo($("#takedown-post-buttons"));
}
$("#takedown-add-posts-ids").val('');
$("#takedown-add-posts-ids").val("");
$("#takedown-add-posts-ids-submit").prop("disabled", true);
}).fail(function (data) {
Utility.error(data.responseText);
@ -126,10 +126,10 @@ Takedown.remove_post = function (id, post_id) {
headers: {accept: "text/javascript"},
data: {
id: id,
post_ids: post_id
}
}).done(function (data) {
Utility.notice("Post #" + post_id + " removed from takedown")
post_ids: post_id,
},
}).done(function () {
Utility.notice("Post #" + post_id + " removed from takedown");
$("#takedown-post-" + post_id).remove();
}).fail(function (data) {
Utility.error(data.responseText);
@ -141,21 +141,21 @@ Takedown.post_button_html = function (post_id) {
};
$(document).ready(function () {
$("#takedown-add-posts-ids-submit").on('click', e => {
$("#takedown-add-posts-ids-submit").on("click", e => {
const $e = $(e.target);
Takedown.add_posts_by_ids($e.data('tid'));
Takedown.add_posts_by_ids($e.data("tid"));
});
$("#takedown-add-posts-tags-cancel").on('click', () => {
$("#takedown-add-posts-tags-cancel").on("click", () => {
Takedown.add_posts_by_tags_cancel();
});
$("#takedown-add-posts-tags-confirm").on('click', e => {
$("#takedown-add-posts-tags-confirm").on("click", e => {
const $e = $(e.target);
Takedown.add_posts_by_tags($e.data('tid'));
Takedown.add_posts_by_tags($e.data("tid"));
});
$("#takedown-add-posts-tags-preview").on('click', e => {
$("#takedown-add-posts-tags-preview").on("click", e => {
const $e = $(e.target);
Takedown.add_posts_by_tags_preview($e.data('tid'));
})
Takedown.add_posts_by_tags_preview($e.data("tid"));
});
});
export default Takedown
export default Takedown;

View File

@ -1,22 +1,22 @@
import Blacklist from './blacklists';
import LS from './local_storage';
import Blacklist from "./blacklists";
import LS from "./local_storage";
const Thumbnails = {};
Thumbnails.initialize = function () {
const clearPlaceholder = function (post) {
if (post.hasClass('thumb-placeholder-link')) {
post.removeClass('thumb-placeholder-link');
if (post.hasClass("thumb-placeholder-link")) {
post.removeClass("thumb-placeholder-link");
} else {
post.empty();
}
};
const postsData = window.___deferred_posts || {};
const posts = $('.post-thumb.placeholder, .thumb-placeholder-link');
const posts = $(".post-thumb.placeholder, .thumb-placeholder-link");
const DAB = LS.get("dab") === "1";
$.each(posts, function (i, post) {
const p = $(post);
const postID = p.data('id');
const postID = p.data("id");
if (!postID) {
clearPlaceholder(p);
return;
@ -33,25 +33,25 @@ Thumbnails.initialize = function () {
blacklist_hit_count += 1;
}
});
const newTag = $('<div>');
const newTag = $("<div>");
const blacklisted = DAB ? false : blacklist_hit_count > 0;
for (const key in postData) {
newTag.attr("data-" + key.replace(/_/g, '-'), postData[key]);
newTag.attr("data-" + key.replace(/_/g, "-"), postData[key]);
}
newTag.attr('class', blacklisted ? "post-thumbnail blacklisted" : "post-thumbnail");
if (p.hasClass('thumb-placeholder-link'))
newTag.addClass('dtext');
const img = $('<img>');
img.attr('src', postData.preview_url || '/images/deleted-preview.png');
newTag.attr("class", blacklisted ? "post-thumbnail blacklisted" : "post-thumbnail");
if (p.hasClass("thumb-placeholder-link"))
newTag.addClass("dtext");
const img = $("<img>");
img.attr("src", postData.preview_url || "/images/deleted-preview.png");
img.attr({
height: postData.preview_url ? postData.preview_height : 150,
width: postData.preview_url ? postData.preview_width : 150,
title: `Rating: ${postData.rating}\r\nID: ${postData.id}\r\nStatus: ${postData.status}\r\nDate: ${postData.created_at}\r\n\r\n${postData.tags}`,
alt: postData.tags,
class: 'post-thumbnail-img'
class: "post-thumbnail-img",
});
const link = $('<a>');
link.attr('href', `/posts/${postData.id}`);
const link = $("<a>");
link.attr("href", `/posts/${postData.id}`);
link.append(img);
newTag.append(link);
p.replaceWith(newTag);
@ -60,12 +60,12 @@ Thumbnails.initialize = function () {
$(document).ready(function () {
Thumbnails.initialize();
$(window).on('e621:add_deferred_posts', (_, posts) => {
window.___deferred_posts = window.___deferred_posts || {}
$(window).on("e621:add_deferred_posts", (_, posts) => {
window.___deferred_posts = window.___deferred_posts || {};
window.___deferred_posts = $.extend(window.___deferred_posts, posts);
Thumbnails.initialize();
});
$(document).on('thumbnails:apply', Thumbnails.initialize);
$(document).on("thumbnails:apply", Thumbnails.initialize);
});
export default Thumbnails;

View File

@ -1,9 +1,9 @@
import Uploader from './uploader/uploader.vue.erb';
import { createApp } from 'vue';
import Uploader from "./uploader/uploader.vue.erb";
import { createApp } from "vue";
export default {
init () {
const app = createApp(Uploader);
app.mount('#uploader');
}
}
app.mount("#uploader");
},
};

View File

@ -1,22 +1,22 @@
import Blip from './blips.js';
import Comment from './comments.js';
import DText from './dtext.js';
import ForumPost from './forum_posts.js';
import Utility from './utility.js';
import Blip from "./blips.js";
import Comment from "./comments.js";
import DText from "./dtext.js";
import ForumPost from "./forum_posts.js";
import Utility from "./utility.js";
class UserWarnable {
static initialize_click_handlers () {
$('.item-mark-user-warned').on('click', evt => {
$(".item-mark-user-warned").on("click", evt => {
evt.preventDefault();
const target = $(evt.target);
const type = target.data('item-route');
const id = target.data('item-id');
const item_type = target.data('item-type');
const record_type = target.data('record-type');
const type = target.data("item-route");
const id = target.data("item-id");
const item_type = target.data("item-type");
const record_type = target.data("record-type");
const message = record_type === "unmark"
? `Are you sure you want to unmark this ${item_type}?`
: `Are you sure you want to mark this ${item_type} for having received ${record_type}?`
: `Are you sure you want to mark this ${item_type} for having received ${record_type}?`;
if (!confirm(message)) {
return;
}
@ -25,7 +25,7 @@ class UserWarnable {
type: "POST",
url: `/${type}/${id}/warning.json`,
data: {
'record_type': record_type
"record_type": record_type,
},
}).done(data => {
target.closest("article.blip, article.comment, article.forum-post").replaceWith(data.html);
@ -36,7 +36,7 @@ class UserWarnable {
Comment.reinitialize_all();
ForumPost.reinitialize_all();
DText.initialize_all_inputs();
}).fail(data => {
}).fail(() => {
Utility.error("Failed to mark as warned.");
});
});

View File

@ -4,27 +4,27 @@ let Utility = {};
Utility.delay = function (milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}
};
Utility.meta = function (key) {
return $("meta[name=" + key + "]").attr("content");
}
};
Utility.test_max_width = function (width) {
if (!window.matchMedia) {
return false;
}
var mq = window.matchMedia('(max-width: ' + width + 'px)');
var mq = window.matchMedia("(max-width: " + width + "px)");
return mq.matches;
}
};
Utility.notice_timeout_id = undefined;
Utility.notice = function (msg, permanent) {
$('#notice').addClass("ui-state-highlight").removeClass("ui-state-error").fadeIn("fast").children("span").html(msg);
$("#notice").addClass("ui-state-highlight").removeClass("ui-state-error").fadeIn("fast").children("span").html(msg);
if (Utility.notice_timeout_id !== undefined) {
clearTimeout(Utility.notice_timeout_id)
clearTimeout(Utility.notice_timeout_id);
}
if (!permanent) {
Utility.notice_timeout_id = setTimeout(function () {
@ -32,15 +32,15 @@ Utility.notice = function(msg, permanent) {
Utility.notice_timeout_id = undefined;
}, 6000);
}
}
};
Utility.error = function (msg) {
$('#notice').removeClass("ui-state-highlight").addClass("ui-state-error").fadeIn("fast").children("span").html(msg);
$("#notice").removeClass("ui-state-highlight").addClass("ui-state-error").fadeIn("fast").children("span").html(msg);
if (Utility.notice_timeout_id !== undefined) {
clearTimeout(Utility.notice_timeout_id)
}
clearTimeout(Utility.notice_timeout_id);
}
};
Utility.dialog = function (title, html) {
const $dialog = $(html).dialog({
@ -58,14 +58,14 @@ Utility.dialog = function(title, html) {
},
"Cancel": function () {
$dialog.dialog("close");
}
}
},
},
});
$dialog.find("form").on("submit.danbooru", function () {
$dialog.dialog("close");
});
}
};
// TODO: Remove 2024-05-15
Object.defineProperty(Utility, "disableShortcuts", {
@ -75,13 +75,13 @@ Object.defineProperty(Utility, "disableShortcuts", {
},
set (value) {
console.log("Utility.disableShortcuts is deprecated and will be removed at a later date, use Shortcuts.disabled instead");
Shortcuts.disabled = value
}
})
Shortcuts.disabled = value;
},
});
Utility.keydown = function (keys, namespace, handler) {
console.log("Utility.keydown is deprecated and will be removed at a later date, use Shortcuts.keydown instead");
Shortcuts.keydown(keys, namespace, handler)
Shortcuts.keydown(keys, namespace, handler);
};
Utility.is_subset = function (array, subarray) {
@ -94,7 +94,7 @@ Utility.is_subset = function(array, subarray) {
});
return all;
}
};
Utility.intersect = function (a, b) {
a = a.slice(0).sort();
@ -111,27 +111,27 @@ Utility.intersect = function(a, b) {
}
}
return result;
}
};
Utility.regexp_escape = function (string) {
return string.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
}
};
$.fn.selectEnd = function () {
return this.each(function () {
this.focus();
this.setSelectionRange(this.value.length, this.value.length);
})
}
});
};
$(function () {
$(window).on("danbooru:notice", function (event, msg) {
Utility.notice(msg);
})
});
$(window).on("danbooru:error", function (event, msg) {
Utility.error(msg);
})
});
});
export default Utility
export default Utility;

View File

@ -1,4 +1,4 @@
import Utility from './utility';
import Utility from "./utility";
class VoteManager {
constructor (itemType) {
@ -10,39 +10,39 @@ class VoteManager {
init () {
const self = this;
self.lastSelected = 0;
$("#votes").on('click', 'tbody tr', function (evt) {
$("#votes").on("click", "tbody tr", function (evt) {
if ($(evt.target).is("a")) return;
evt.preventDefault();
if (evt.shiftKey) {
self.toggleRowsBetween([self.lastSelected, this.rowIndex]);
}
$(this).toggleClass('selected');
$(this).toggleClass("selected");
self.lastSelected = this.rowIndex;
});
$("#select-all-votes").on('click', () => self.selectAll());
$("#lock-votes").on('click', () => self.lockVotes());
$("#delete-votes").on('click', () => self.deleteVotes());
$("#select-all-votes").on("click", () => self.selectAll());
$("#lock-votes").on("click", () => self.lockVotes());
$("#delete-votes").on("click", () => self.deleteVotes());
}
selectAll () {
this.allSelected = !this.allSelected;
if (this.allSelected)
$('#votes').find('tr').addClass('selected');
$("#votes").find("tr").addClass("selected");
else
$('#votes').find('tr').removeClass('selected');
$("#votes").find("tr").removeClass("selected");
}
toggleRowsBetween (indices) {
this.lastSelected = indices[1];
let rows = $('#votes').find('tr');
let rows = $("#votes").find("tr");
indices = indices.sort();
rows = rows.slice(indices[0], indices[1]);
rows.toggleClass('selected');
rows.toggleClass("selected");
}
selectedVotes () {
return $("#votes>tbody>tr.selected").map(function () {
return $(this).attr('id').substr(1);
return $(this).attr("id").substr(1);
}).get();
}
@ -53,8 +53,8 @@ class VoteManager {
url: `/${this._type}_votes/lock.json`,
method: "post",
data: {
ids: votes.join(',')
}
ids: votes.join(","),
},
}).done(() => {
Utility.notice(`${this._type} votes locked.`);
});
@ -67,10 +67,10 @@ class VoteManager {
url: `/${this._type}_votes/delete.json`,
method: "post",
data: {
ids: votes.join(',')
}
ids: votes.join(","),
},
}).done(() => {
Utility.notice(`${this._type} votes deleted.`)
Utility.notice(`${this._type} votes deleted.`);
});
}
}

View File

@ -180,6 +180,15 @@ services:
profiles:
- rubocop
linter:
image: e621
volumes:
- .:/app
- node_modules:/app/node_modules
entrypoint: yarn run lint
profiles:
- linter
volumes:
post_data:
iqdb_data:

87
eslint.config.mjs Normal file
View File

@ -0,0 +1,87 @@
import globals from "globals";
import eslint from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin-js";
export default [
eslint.configs.recommended,
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
$: false,
Danbooru: false,
},
},
plugins: {
"@stylistic/js": stylistic,
},
rules: {
"no-unused-vars": "warn",
// https://eslint.style/packages/js
"array-bracket-newline": "warn",
"array-bracket-spacing": "off",
"array-element-newline": ["warn", "consistent"],
"arrow-parens": "off",
"arrow-spacing": "warn",
"block-spacing": "warn",
"brace-style": ["warn", "1tbs", { allowSingleLine: true }],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": "warn",
"comma-style": "warn",
"computed-property-spacing": "warn",
"dot-location": ["warn", "property"],
"eol-last": "warn",
"function-call-argument-newline": ["warn", "consistent"],
"func-call-spacing": "warn", // function-call-spacing does not work ???
"implicit-arrow-linebreak": "warn",
"indent": ["warn", 2, { SwitchCase: 1, }],
"key-spacing": ["warn", { mode: "minimum" }],
"keyword-spacing": "warn",
"line-comment-position": "off",
"linebreak-style": "error",
"lines-around-comment": "off",
"lines-between-class-members": "warn",
// "max-len": ["warn", { code: 100, tabWidth: 2, ignoreComments: true }], // Might get annoying, see https://eslint.style/rules/js/max-len
"max-statements-per-line": "warn",
"multiline-comment-style": "off",
"multiline-ternary": ["warn", "always-multiline"],
"new-parens": "warn",
"newline-per-chained-call": "off",
"no-confusing-arrow": "warn",
"no-extra-parens": "off",
"no-extra-semi": "warn",
"no-floating-decimal": "warn",
"no-mixed-operators": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": ["warn", { ignoreEOLComments: false }],
"no-multiple-empty-lines": "warn",
"no-tabs": "warn",
"no-trailing-spaces": "warn",
"no-whitespace-before-property": "warn",
"nonblock-statement-body-position": "off",
"object-curly-newline": ["warn", { consistent: true }],
"one-var-declaration-per-line": "off",
"operator-linebreak": ["warn", "before"],
"padded-blocks": "off",
"padding-line-between-statements": "off",
"quote-props": ["warn", "consistent"],
"quotes": "warn",
"rest-spread-spacing": "warn",
"semi": "warn",
"semi-spacing": "warn",
"semi-style": "warn",
"space-before-blocks": "warn",
"space-before-function-paren": "warn", // good idea?
"space-in-parens": "warn",
"space-infix-ops": "warn",
"space-unary-ops": "warn",
"spaced-comment": "warn",
"switch-colon-spacing": "warn",
"template-curly-spacing": "warn",
"template-tag-spacing": "warn",
},
},
]

View File

@ -24,5 +24,13 @@
"zingtouch": "^1.0.6"
},
"version": "0.1.0",
"devDependencies": {}
"devDependencies": {
"@eslint/js": "^9.7.0",
"@stylistic/eslint-plugin-js": "^2.3.0",
"eslint": "9.x",
"globals": "^15.8.0"
},
"scripts": {
"lint": "yarn run eslint ./app/javascript/src/**/*.js"
}
}

399
yarn.lock
View File

@ -976,11 +976,67 @@
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
"@eslint-community/eslint-utils@^4.2.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==
dependencies:
eslint-visitor-keys "^3.3.0"
"@eslint-community/regexpp@^4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==
"@eslint/config-array@^0.17.0":
version "0.17.0"
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.17.0.tgz#ff305e1ee618a00e6e5d0485454c8d92d94a860d"
integrity sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==
dependencies:
"@eslint/object-schema" "^2.1.4"
debug "^4.3.1"
minimatch "^3.1.2"
"@eslint/eslintrc@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6"
integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==
dependencies:
ajv "^6.12.4"
debug "^4.3.2"
espree "^10.0.1"
globals "^14.0.0"
ignore "^5.2.0"
import-fresh "^3.2.1"
js-yaml "^4.1.0"
minimatch "^3.1.2"
strip-json-comments "^3.1.1"
"@eslint/js@9.7.0", "@eslint/js@^9.7.0":
version "9.7.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.7.0.tgz#b712d802582f02b11cfdf83a85040a296afec3f0"
integrity sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng==
"@eslint/object-schema@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843"
integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==
"@fortawesome/fontawesome-free@^6.2.1":
version "6.5.2"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.2.tgz#310fe90cb5a8dee9698833171b98e7835404293d"
integrity sha512-hRILoInAx8GNT5IMkrtIt9blOdrqHOnPBH+k70aWUAqPZPgopb9G5EQJFpaBx/S8zp2fC+mPW349Bziuk1o28Q==
"@humanwhocodes/module-importer@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c"
integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==
"@humanwhocodes/retry@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570"
integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==
"@jest/schemas@^29.6.3":
version "29.6.3"
resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03"
@ -1040,6 +1096,27 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==
dependencies:
"@nodelib/fs.stat" "2.0.5"
run-parallel "^1.1.9"
"@nodelib/fs.stat@2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
"@nodelib/fs.walk@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==
dependencies:
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@rails/ujs@^7.0.4":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.1.3.tgz#6d94a68b7da5046147d31716e0c187a4ead4fb93"
@ -1073,6 +1150,16 @@
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==
"@stylistic/eslint-plugin-js@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.3.0.tgz#a3faee05863c50c0bb6f879db72b7ee895bfa74e"
integrity sha512-lQwoiYb0Fs6Yc5QS3uT8+T9CPKK2Eoxc3H8EnYJgM26v/DgtW+1lvy2WNgyBflU+ThShZaHm3a6CdD9QeKx23w==
dependencies:
"@types/eslint" "^8.56.10"
acorn "^8.11.3"
eslint-visitor-keys "^4.0.0"
espree "^10.0.1"
"@trysound/sax@0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
@ -1086,7 +1173,7 @@
"@types/eslint" "*"
"@types/estree" "*"
"@types/eslint@*":
"@types/eslint@*", "@types/eslint@^8.56.10":
version "8.56.10"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d"
integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==
@ -1379,6 +1466,16 @@ acorn-import-assertions@^1.9.0:
resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac"
integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==
acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
acorn@^8.11.3, acorn@^8.12.0:
version "8.12.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248"
integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==
acorn@^8.7.1, acorn@^8.8.2:
version "8.11.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
@ -1423,6 +1520,11 @@ ajv@^8.0.0, ajv@^8.9.0:
require-from-string "^2.0.2"
uri-js "^4.2.2"
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
@ -1699,7 +1801,7 @@ cosmiconfig@^7.0.0:
path-type "^4.0.0"
yaml "^1.10.0"
cross-spawn@^7.0.3:
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
@ -1844,6 +1946,18 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.1:
dependencies:
ms "2.1.2"
debug@^4.3.2:
version "4.3.5"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e"
integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==
dependencies:
ms "2.1.2"
deep-is@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
deepmerge@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a"
@ -1929,6 +2043,11 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
escape-string-regexp@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
eslint-scope@5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@ -1937,6 +2056,80 @@ eslint-scope@5.1.1:
esrecurse "^4.3.0"
estraverse "^4.1.1"
eslint-scope@^8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94"
integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==
dependencies:
esrecurse "^4.3.0"
estraverse "^5.2.0"
eslint-visitor-keys@^3.3.0:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
eslint-visitor-keys@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb"
integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==
eslint@9.x:
version "9.7.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.7.0.tgz#bedb48e1cdc2362a0caaa106a4c6ed943e8b09e4"
integrity sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@eslint-community/regexpp" "^4.11.0"
"@eslint/config-array" "^0.17.0"
"@eslint/eslintrc" "^3.1.0"
"@eslint/js" "9.7.0"
"@humanwhocodes/module-importer" "^1.0.1"
"@humanwhocodes/retry" "^0.3.0"
"@nodelib/fs.walk" "^1.2.8"
ajv "^6.12.4"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.3.2"
escape-string-regexp "^4.0.0"
eslint-scope "^8.0.2"
eslint-visitor-keys "^4.0.0"
espree "^10.1.0"
esquery "^1.5.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
file-entry-cache "^8.0.0"
find-up "^5.0.0"
glob-parent "^6.0.2"
ignore "^5.2.0"
imurmurhash "^0.1.4"
is-glob "^4.0.0"
is-path-inside "^3.0.3"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash.merge "^4.6.2"
minimatch "^3.1.2"
natural-compare "^1.4.0"
optionator "^0.9.3"
strip-ansi "^6.0.1"
text-table "^0.2.0"
espree@^10.0.1, espree@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56"
integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==
dependencies:
acorn "^8.12.0"
acorn-jsx "^5.3.2"
eslint-visitor-keys "^4.0.0"
esquery@^1.5.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7"
integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==
dependencies:
estraverse "^5.1.0"
esrecurse@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
@ -1949,7 +2142,7 @@ estraverse@^4.1.1:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
estraverse@^5.2.0:
estraverse@^5.1.0, estraverse@^5.2.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
@ -1979,11 +2172,30 @@ fast-json-stable-stringify@^2.0.0:
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
fast-levenshtein@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
fastest-levenshtein@^1.0.12:
version "1.0.16"
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5"
integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==
fastq@^1.6.0:
version "1.17.1"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47"
integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==
dependencies:
reusify "^1.0.4"
file-entry-cache@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f"
integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==
dependencies:
flat-cache "^4.0.0"
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
@ -2008,11 +2220,32 @@ find-up@^4.0.0:
locate-path "^5.0.0"
path-exists "^4.0.0"
find-up@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
dependencies:
locate-path "^6.0.0"
path-exists "^4.0.0"
flat-cache@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c"
integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==
dependencies:
flatted "^3.2.9"
keyv "^4.5.4"
flat@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==
flatted@^3.2.9:
version "3.3.1"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@ -2033,6 +2266,13 @@ gensync@^1.0.0-beta.2:
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
glob-parent@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
dependencies:
is-glob "^4.0.3"
glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@ -2062,6 +2302,16 @@ globals@^11.1.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
globals@^14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==
globals@^15.8.0:
version "15.8.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.8.0.tgz#e64bb47b619dd8cbf32b3c1a0a61714e33cbbb41"
integrity sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==
graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
@ -2094,6 +2344,11 @@ icss-utils@^5.0.0, icss-utils@^5.1.0:
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==
ignore@^5.2.0:
version "5.3.1"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
immutable@^4.0.0:
version "4.3.5"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.5.tgz#f8b436e66d59f99760dc577f5c99a4fd2a5cc5a0"
@ -2115,6 +2370,11 @@ import-local@^3.0.2:
pkg-dir "^4.2.0"
resolve-cwd "^3.0.0"
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@ -2157,7 +2417,7 @@ is-extglob@^2.1.1:
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
is-glob@^4.0.1, is-glob@~4.0.1:
is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
@ -2169,6 +2429,11 @@ is-number@^7.0.0:
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
is-path-inside@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
@ -2256,6 +2521,11 @@ jsesc@~0.5.0:
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==
json-buffer@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
@ -2271,6 +2541,11 @@ json-schema-traverse@^1.0.0:
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
json5@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
@ -2283,11 +2558,26 @@ json5@^2.1.2, json5@^2.2.3:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
keyv@^4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==
dependencies:
json-buffer "3.0.1"
kind-of@^6.0.2:
version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
levn@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
dependencies:
prelude-ls "^1.2.1"
type-check "~0.4.0"
lilconfig@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.1.tgz#9d8a246fa753106cfc205fd2d77042faca56e5e3"
@ -2328,6 +2618,13 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
locate-path@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
dependencies:
p-locate "^5.0.0"
lockfile@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609"
@ -2360,6 +2657,11 @@ lodash.memoize@^4.1.2:
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==
lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@ -2428,7 +2730,7 @@ mini-css-extract-plugin@^2.3.0:
schema-utils "^4.0.0"
tapable "^2.2.1"
minimatch@^3.1.1:
minimatch@^3.1.1, minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
@ -2450,6 +2752,11 @@ nanoid@^3.3.7:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
neo-async@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
@ -2479,6 +2786,18 @@ once@^1.3.0:
dependencies:
wrappy "1"
optionator@^0.9.3:
version "0.9.4"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734"
integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==
dependencies:
deep-is "^0.1.3"
fast-levenshtein "^2.0.6"
levn "^0.4.1"
prelude-ls "^1.2.1"
type-check "^0.4.0"
word-wrap "^1.2.5"
p-limit@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
@ -2486,6 +2805,13 @@ p-limit@^2.2.0:
dependencies:
p-try "^2.0.0"
p-limit@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
dependencies:
yocto-queue "^0.1.0"
p-locate@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
@ -2493,6 +2819,13 @@ p-locate@^4.1.0:
dependencies:
p-limit "^2.2.0"
p-locate@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
dependencies:
p-limit "^3.0.2"
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
@ -2815,11 +3148,21 @@ postcss@^8.4.33, postcss@^8.4.38:
picocolors "^1.0.0"
source-map-js "^1.2.0"
prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
punycode@^2.1.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
rails-erb-loader@^5.5.2:
version "5.5.2"
resolved "https://registry.yarnpkg.com/rails-erb-loader/-/rails-erb-loader-5.5.2.tgz#db3fa8ac89600f09d179a1a70a2ca18c592576ea"
@ -2928,6 +3271,18 @@ resolve@^1.14.2, resolve@^1.19.0, resolve@^1.9.0:
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"
reusify@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
run-parallel@^1.1.9:
version "1.2.0"
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
dependencies:
queue-microtask "^1.2.2"
safe-buffer@^5.1.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
@ -3045,6 +3400,18 @@ source-map@^0.6.0:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-json-comments@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
style-loader@^3.3.0:
version "3.3.4"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.4.tgz#f30f786c36db03a45cbd55b6a70d930c479090e7"
@ -3123,6 +3490,11 @@ terser@^5.26.0:
commander "^2.20.0"
source-map-support "~0.5.20"
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
@ -3140,6 +3512,13 @@ ts-pnp@^1.1.6:
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
dependencies:
prelude-ls "^1.2.1"
undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
@ -3303,6 +3682,11 @@ wildcard@^2.0.0:
resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67"
integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==
word-wrap@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@ -3323,6 +3707,11 @@ yaml@^1.10.0:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
zingtouch@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/zingtouch/-/zingtouch-1.0.6.tgz#456cf2b0a69f91a5ffbd8a83b18033c671f1096d"