Add End And Start Dates For Any Anime/Manga In 1 Click + Buttons To Reset Dates/Reset Everything

This script adds 6 buttons on any Anime/Manga edit page. You will be able to Add End And Start Dates For Any Anime/Manga In 1 Click, Or Easily Reset Their Dates If You Added The Wrong Dates Or If You Want To Change The Dates Quickly.There's Also A Button That Allows You To Reset All Added Info, This Button Can Reset Almost Anything, Like Episodes Watched, All Dates, Tags, ReWatched/ReRead Values etc.

目前为 2020-08-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         Add End And Start Dates For Any Anime/Manga In 1 Click + Buttons To Reset Dates/Reset Everything
// @namespace    Add End And Start Dates In 1 Click + Reset Dates/All Buttons,
// @version      1.3
// @description  This script adds 6 buttons on any Anime/Manga edit page. You will be able to Add End And Start Dates For Any Anime/Manga In 1 Click, Or Easily Reset Their Dates If You Added The Wrong Dates Or If You Want To Change The Dates Quickly.There's Also A Button That Allows You To Reset All Added Info, This Button Can Reset Almost Anything, Like Episodes Watched, All Dates, Tags, ReWatched/ReRead Values etc.
// @author       hacker09
// @match        https://myanimelist.net/ownlist/*
// @require      http://code.jquery.com/jquery-3.3.1.min.js
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  var $ = window.jQuery;
  //**********************************************************************************************************************************************************************
  var ResetBTNStart = document.createElement("a");
  ResetBTNStart.innerHTML = "Reset";
  document.getElementById("start_date_insert_today").parentElement.appendChild(ResetBTNStart);
  ResetBTNStart.setAttribute("id", "resetstart");
  ResetBTNStart.setAttribute("style", "margin-left: 5px;height: 10px;width: 10px;top: 10px;");
  document.getElementById('resetstart').onclick = function (){document.getElementById("add_anime_start_date_year").selectedIndex = -1;
   document.getElementById("add_anime_start_date_day").selectedIndex = -1;
   document.getElementById("add_anime_start_date_month").selectedIndex = -1;
  }
  //**********************************************************************************************************************************************************************
  var ResetBTNEnd = document.createElement("a");
  ResetBTNEnd.innerHTML = "Reset";
  document.getElementById("end_date_insert_today").parentElement.appendChild(ResetBTNEnd);
  ResetBTNEnd.setAttribute("id", "resetend");
  ResetBTNEnd.setAttribute("style", "margin-left: 5px;height: 10px;width: 10px;top: 10px;");
  document.getElementById('resetend').onclick = function (){document.getElementById("add_anime_finish_date_year").selectedIndex = -1;
   document.getElementById("add_anime_finish_date_day").selectedIndex = -1;
   document.getElementById("add_anime_finish_date_month").selectedIndex = -1;
  }
  //**********************************************************************************************************************************************************************
  var AddDates = document.createElement("a");
  AddDates.innerHTML = "Add End And Start Dates + Submit";
  document.querySelector('.notice_open_public').appendChild(AddDates);
  AddDates.setAttribute("id", "addalldates");
  AddDates.setAttribute("style", "margin-left: 5px;height: 10px;width: 10px;top: 10px;");
  document.getElementById('addalldates').onclick = function (){document.getElementById("start_date_insert_today").click();
   document.getElementById("end_date_insert_today").click();
   document.getElementsByClassName("inputButton main_submit")[0].click();
  }
  //**********************************************************************************************************************************************************************
  document.querySelector("#main-form > table:nth-child(1) > tbody > tr:nth-child(5) > td:nth-child(2)").setAttribute("style", "padding: 10px;");
  var InsertStart = document.createElement("a");
  InsertStart.innerHTML = "Insert + Submit";
  document.querySelector("#main-form > table:nth-child(1) > tbody > tr:nth-child(5) > td:nth-child(1)").parentElement.appendChild(InsertStart);
  InsertStart.setAttribute("id", "InsertStart");
  InsertStart.setAttribute("style", "margin-left: -205px;");
  document.getElementById('InsertStart').onclick = function (){document.getElementById("start_date_insert_today").click();
   document.getElementsByClassName("inputButton main_submit")[0].click();
  }
  //**********************************************************************************************************************************************************************
  document.querySelector("#main-form > table:nth-child(1) > tbody > tr:nth-child(6) > td:nth-child(2)").setAttribute("style", "padding: 10px;");
  var InsertEnd = document.createElement("a");
  InsertEnd.innerHTML = "Insert + Submit";
  document.querySelector("#main-form > table:nth-child(1) > tbody > tr:nth-child(6) > td:nth-child(1)").parentElement.appendChild(InsertEnd);
  InsertEnd.setAttribute("id", "InsertEnd");
  InsertEnd.setAttribute("style", "margin-left: -205px;");
  document.getElementById('InsertEnd').onclick = function (){document.getElementById("end_date_insert_today").click();
   document.getElementsByClassName("inputButton main_submit")[0].click();
  }
  //**********************************************************************************************************************************************************************
  var ResetAlmostAll = document.createElement("a");
  ResetAlmostAll.innerHTML = "Reset Almost Everything";
  document.querySelector("#advanced-button").parentElement.appendChild(ResetAlmostAll);
  ResetAlmostAll.setAttribute("id", "resetalmostall");
  ResetAlmostAll.setAttribute("style", "margin-left: 240px;");
  document.getElementById('resetalmostall').onclick = function resetSelectElement(selectElement) {$('select').prop('selectedIndex', 0);
   document.getElementById("unknown_end").click();
  }
  //**********************************************************************************************************************************************************************
  if ($("#hide-advanced-button")[0].outerText !== "Hide Advanced ") //Detect if the Show Advanced button is already opened or not,if not then...
  {
   document.querySelector("#hide-advanced-button").click(); //Click on the Show Advanced button
  }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址