forked from e621ng/e621ng
[ESLint] Fix core complaints
This commit is contained in:
parent
697efbc376
commit
82891b91d1
@ -9,10 +9,10 @@ Artist.update = function (id, params) {
|
||||
type: "PUT",
|
||||
url: "/artists/" + id + ".json",
|
||||
data: params,
|
||||
success: function(data) {
|
||||
success: function() {
|
||||
Utility.notice("Artist updated.");
|
||||
},
|
||||
error: function(data) {
|
||||
error: function() {
|
||||
Utility.error(`There was an error updating <a href="/artists/${id}">artist #${id}</a>`);
|
||||
}
|
||||
});
|
||||
|
@ -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];
|
||||
};
|
||||
@ -326,7 +326,7 @@ Blacklist.initialize_blacklist_editor = function () {
|
||||
}
|
||||
}).done(function () {
|
||||
Utility.notice("Blacklist updated");
|
||||
}).fail(function (data, status, xhr) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to update blacklist");
|
||||
});
|
||||
}
|
||||
|
@ -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.");
|
||||
});
|
||||
};
|
||||
@ -65,10 +65,10 @@ Comment.hide = function (e) {
|
||||
url: `/comments/${cid}/hide.json`,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).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) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to hide comment.");
|
||||
});
|
||||
};
|
||||
@ -83,11 +83,11 @@ Comment.unhide = function (e) {
|
||||
url: `/comments/${cid}/unhide.json`,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).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) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to unhide comment.");
|
||||
});
|
||||
};
|
||||
@ -102,9 +102,9 @@ Comment.delete = function (e) {
|
||||
url: `/comments/${cid}.json`,
|
||||
type: 'DELETE',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).done(function () {
|
||||
parent.remove();
|
||||
}).fail(function (data) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to delete comment.");
|
||||
});
|
||||
};
|
||||
|
@ -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);
|
||||
@ -60,9 +60,9 @@ $(function() {
|
||||
method: "PUT",
|
||||
url: path,
|
||||
dataType: 'json'
|
||||
}).done(data => {
|
||||
}).done(() => {
|
||||
location.reload();
|
||||
}).fail(data => {
|
||||
}).fail(() => {
|
||||
Utility.error("Failed to revert to specified version.");
|
||||
})
|
||||
});
|
||||
|
@ -42,7 +42,7 @@ Favorite.create = function (post_id) {
|
||||
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);
|
||||
});
|
||||
});
|
||||
@ -60,7 +60,7 @@ Favorite.destroy = function (post_id) {
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
@ -84,11 +84,11 @@ 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.");
|
||||
})
|
||||
}
|
||||
@ -136,10 +136,10 @@ ForumPost.hide = function (e) {
|
||||
url: `/forum_posts/${fpid}/hide.json`,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).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) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to hide post.");
|
||||
});
|
||||
};
|
||||
@ -154,11 +154,11 @@ ForumPost.unhide = function (e) {
|
||||
url: `/forum_posts/${fpid}/unhide.json`,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).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) {
|
||||
}).fail(function () {
|
||||
Utility.error("Failed to unhide post.");
|
||||
});
|
||||
};
|
||||
|
@ -13,6 +13,7 @@ let LS = {
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ let Note = {
|
||||
$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);
|
||||
}
|
||||
});
|
||||
@ -406,11 +406,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
|
||||
|
@ -54,7 +54,7 @@ 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();
|
||||
});
|
||||
@ -103,7 +103,7 @@ PostModeMenu.close_edit_form = function() {
|
||||
}
|
||||
|
||||
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");
|
||||
|
@ -34,7 +34,7 @@ PostReplacement.approve = function (id, penalize_current_uploader) {
|
||||
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");
|
||||
});
|
||||
@ -51,7 +51,7 @@ PostReplacement.reject = function (id) {
|
||||
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");
|
||||
});
|
||||
@ -69,7 +69,7 @@ PostReplacement.promote = function (id) {
|
||||
}).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");
|
||||
});
|
||||
@ -83,10 +83,10 @@ PostReplacement.toggle_penalize = function ($target) {
|
||||
type: "PUT",
|
||||
url: `/post_replacements/${id}/toggle_penalize.json`,
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).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);
|
||||
});
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ 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('; ');
|
||||
var message = $.map(data.responseJSON.errors, function(msg) { return msg; }).join('; ');
|
||||
Post.notice_update("dec");
|
||||
$(window).trigger('danbooru:error', "Error: " + message);
|
||||
}).done(function () {
|
||||
@ -32,7 +32,7 @@ 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, function(msg) { return msg; }).join('; ');
|
||||
Post.notice_update("dec");
|
||||
$(window).trigger('danbooru:error', "Error: " + message);
|
||||
}).done(function () {
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ Post.open_edit_dialog = function() {
|
||||
at: "right-20",
|
||||
of: window
|
||||
},
|
||||
drag: function(e, ui) {
|
||||
drag: function() {
|
||||
if (Utility.meta("enable-auto-complete") === "true") {
|
||||
$tag_string.data("uiAutocomplete").close();
|
||||
}
|
||||
@ -118,7 +118,7 @@ Post.open_edit_dialog = function() {
|
||||
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) {
|
||||
pin_button.on("click.danbooru", function() {
|
||||
var dialog_widget = $('.ui-dialog:has(#edit-dialog)');
|
||||
var pos = dialog_widget.offset();
|
||||
|
||||
@ -139,9 +139,9 @@ 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"});
|
||||
});
|
||||
|
||||
@ -149,7 +149,7 @@ Post.open_edit_dialog = function() {
|
||||
$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");
|
||||
@ -225,7 +225,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;
|
||||
@ -387,7 +387,7 @@ Post.initialize_links = function() {
|
||||
data: {
|
||||
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) {
|
||||
@ -481,9 +481,8 @@ Post.resize_video = function (post, target_size) {
|
||||
|
||||
function original_sources() {
|
||||
target_sources.push({type: 'video/webm', url: post?.file?.url});
|
||||
if (typeof post?.sample?.alternates?.original !== 'unknown') {
|
||||
if (typeof post?.sample?.alternates?.original !== "undefined")
|
||||
target_sources.push({type: 'video/mp4', url: post?.sample?.alternates?.original?.urls[1]});
|
||||
}
|
||||
}
|
||||
|
||||
switch (target_size) {
|
||||
@ -498,7 +497,7 @@ Post.resize_video = function (post, target_size) {
|
||||
original_sources();
|
||||
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]});
|
||||
@ -506,6 +505,7 @@ Post.resize_video = function (post, target_size) {
|
||||
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.
|
||||
@ -644,7 +644,7 @@ Post.initialize_resize = function () {
|
||||
Post.resize_notes();
|
||||
}
|
||||
|
||||
$image.on('load', function (e) {
|
||||
$image.on('load', function () {
|
||||
Post.resize_notes();
|
||||
$("#image-container").removeClass("image-loading");
|
||||
});
|
||||
@ -749,7 +749,7 @@ 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>');
|
||||
}
|
||||
@ -765,9 +765,9 @@ Post.delete_with_reason = function(post_id, reason, reload_after_delete) {
|
||||
url: `/moderator/post/posts/${post_id}/delete.json`,
|
||||
data: {commit: "Delete", reason: reason, move_favorites: true}
|
||||
}).fail(function(data) {
|
||||
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
|
||||
var message = $.map(data.responseJSON.errors, function(msg) { return msg; }).join('; ');
|
||||
$(window).trigger('danbooru:error', "Error: " + message);
|
||||
}).done(function(data) {
|
||||
}).done(function() {
|
||||
$(window).trigger("danbooru:notice", "Deleted post.");
|
||||
if(reload_after_delete) {
|
||||
location.reload();
|
||||
@ -790,7 +790,7 @@ Post.undelete = function(post_id, callback) {
|
||||
// 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) {
|
||||
}).done(function() {
|
||||
$(window).trigger("danbooru:notice", "Undeleted post.");
|
||||
$(`article#post_${post_id}`).attr('data-flags', 'active');
|
||||
if(callback) callback();
|
||||
@ -811,7 +811,7 @@ Post.unflag = function(post_id, approval, reload = true) {
|
||||
}).fail(function(data) {
|
||||
const message = data.responseJSON.message;
|
||||
$(window).trigger('danbooru:error', "Error: " + message);
|
||||
}).done(function(data) {
|
||||
}).done(function() {
|
||||
$(window).trigger("danbooru:notice", "Unflagged post");
|
||||
if (reload) {
|
||||
location.reload();
|
||||
@ -830,9 +830,9 @@ Post.unapprove = function(post_id) {
|
||||
url: "/moderator/post/approval.json",
|
||||
data: {post_id: post_id}
|
||||
}).fail(function(data) {
|
||||
var message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join('; ');
|
||||
var message = $.map(data.responseJSON.errors, function(msg) { return msg; }).join('; ');
|
||||
$(window).trigger('danbooru:error', "Error: " + message);
|
||||
}).done(function(data) {
|
||||
}).done(function() {
|
||||
$(window).trigger("danbooru:notice", "Unapproved post.");
|
||||
location.reload();
|
||||
}).always(function() {
|
||||
@ -844,9 +844,9 @@ Post.unapprove = function(post_id) {
|
||||
Post.destroy = function(post_id, 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, function(msg) { return msg; }).join("; ");
|
||||
$(window).trigger("danbooru:error", "Error: " + message);
|
||||
}).done(data => {
|
||||
}).done(() => {
|
||||
location.href = `/admin/destroyed_posts/${post_id}`;
|
||||
});
|
||||
};
|
||||
@ -855,7 +855,7 @@ Post.regenerate_image_samples = function(post_id) {
|
||||
$.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.");
|
||||
});
|
||||
};
|
||||
@ -864,7 +864,7 @@ Post.regenerate_video_samples = function(post_id) {
|
||||
$.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.");
|
||||
});
|
||||
};
|
||||
@ -876,9 +876,9 @@ Post.approve = function(post_id, callback) {
|
||||
"/moderator/post/approval.json",
|
||||
{ "post_id": post_id }
|
||||
).fail(function(data) {
|
||||
const message = $.map(data.responseJSON.errors, function(msg, attr) { return msg; }).join("; ");
|
||||
const message = $.map(data.responseJSON.errors, function(msg) { return 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/, ""));
|
||||
@ -901,9 +901,9 @@ Post.disapprove = function(post_id, reason, message) {
|
||||
"/moderator/post/disapprovals.json",
|
||||
{"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, function(msg) { return msg; }).join("; ");
|
||||
$(window).trigger("danbooru:error", "Error: " + message);
|
||||
}).done(function(data) {
|
||||
}).done(function() {
|
||||
if ($("#c-posts #a-show").length) {
|
||||
location.reload();
|
||||
}
|
||||
@ -916,7 +916,7 @@ 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))];
|
||||
@ -994,7 +994,7 @@ Post.set_as_avatar = function(id) {
|
||||
headers: {
|
||||
accept: '*/*;q=0.5,text/javascript'
|
||||
}
|
||||
}).done(function(data) {
|
||||
}).done(function() {
|
||||
$(window).trigger("danbooru:notice", "Post set as avatar");
|
||||
});
|
||||
});
|
||||
|
@ -17,10 +17,10 @@ class TagRelationships {
|
||||
url: `/${route}/${id}/approve.json`,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).done(function () {
|
||||
Utility.notice(`Accepted ${human}.`);
|
||||
parent.slideUp('fast');
|
||||
}).fail(function (data) {
|
||||
}).fail(function () {
|
||||
Utility.error(`Failed to accept ${human}.`);
|
||||
});
|
||||
}
|
||||
@ -41,10 +41,10 @@ class TagRelationships {
|
||||
url: `/${route}/${id}.json`,
|
||||
type: 'DELETE',
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
}).done(function () {
|
||||
Utility.notice(`Rejected ${human}.`);
|
||||
parent.slideUp('fast');
|
||||
}).fail(function (data) {
|
||||
}).fail(function () {
|
||||
Utility.error(`Failed to reject ${human}.`);
|
||||
});
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ Takedown.destroy = function (id) {
|
||||
data: {
|
||||
"id": id
|
||||
}
|
||||
}).done(function (data) {
|
||||
}).done(function () {
|
||||
Utility.notice("Takedown deleted");
|
||||
$("#takedown-" + id).fadeOut("fast");
|
||||
}).fail(function (data) {
|
||||
@ -128,7 +128,7 @@ Takedown.remove_post = function (id, post_id) {
|
||||
id: id,
|
||||
post_ids: post_id
|
||||
}
|
||||
}).done(function (data) {
|
||||
}).done(function () {
|
||||
Utility.notice("Post #" + post_id + " removed from takedown")
|
||||
$("#takedown-post-" + post_id).remove();
|
||||
}).fail(function (data) {
|
||||
|
@ -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.");
|
||||
});
|
||||
});
|
||||
|
@ -18,7 +18,7 @@ export default [
|
||||
"@stylistic/js": stylistic,
|
||||
},
|
||||
rules: {
|
||||
"no-unused-vars": "off",
|
||||
"no-unused-vars": "warn",
|
||||
|
||||
// https://eslint.style/packages/js
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user