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-04 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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.2
// @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();
  }
})();