Migrate assets to use Webpacker

This commit is contained in:
Albert Yi
2018-07-06 16:41:08 -07:00
parent 95b72f5f5c
commit 6fa0ae2cf1
175 changed files with 11518 additions and 3726 deletions

View File

@@ -0,0 +1,67 @@
let ModQueue = {};
ModQueue.processed = 0;
ModQueue.increment_processed = function() {
if (Utility.meta("random-mode") === "1") {
ModQueue.processed += 1;
if (ModQueue.processed === 12) {
window.location = Utility.meta("return-to");
}
}
}
ModQueue.initialize_hilights = function() {
$.each($("div.post"), function(i, v) {
var $post = $(v);
var score = parseInt($post.data("score"));
if (score >= 3) {
$post.addClass("post-pos-score");
}
if (score <= -3) {
$post.addClass("post-neg-score");
}
if ($post.data("has-children")) {
$post.addClass("post-has-children");
}
});
}
ModQueue.initialize_detailed_rejection_links = function() {
$(".detailed-rejection-link").click(ModQueue.detailed_rejection_dialog)
}
ModQueue.detailed_rejection_dialog = function() {
$("#post_disapproval_post_id").val($(this).data("post-id"));
$("#detailed-rejection-dialog").dialog({
width: 500,
buttons: {
"Submit": function() {
$(this).find("form").submit();
$(this).dialog("close");
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
return false;
}
$(function() {
$(window).on("danbooru:modqueue_increment_processed", ModQueue.increment_processed);
if ($("#c-moderator-post-queues").length) {
ModQueue.initialize_hilights();
ModQueue.initialize_detailed_rejection_links();
}
if ($("#c-posts #a-show").length) {
ModQueue.initialize_detailed_rejection_links();
}
});
export default ModQueue