Better Buttons to Change The Status Of Animes/Mangas And To Add Scores

This script will remove the dropdown selection of the options Watching,Completed,Plan To Watch and Dropped, and does the same for the Score button.This makes a bit easier and faster to select what you want.The script also adds a button to delete the anime/manga entry of your list.

当前为 2020-08-11 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Better Buttons to Change The Status Of Animes/Mangas And To Add Scores
// @namespace    betterbuttonstomal2
// @version      0.2
// @description  This script will remove the dropdown selection of the options Watching,Completed,Plan To Watch and Dropped, and does the same for the Score button.This makes a bit easier and faster to select what you want.The script also adds a button to delete the anime/manga entry of your list.
// @author       hacker09
// @match        https://myanimelist.net/anime/*
// @match        https://myanimelist.net/anime.php?id=*
// @match        https://myanimelist.net/manga/*
// @match        https://myanimelist.net/manga.php?id=*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
  var $ = window.jQuery; //Defines That The Symbol $ Is A jQuery
  var animeid = location.pathname.match(/\d+/)[0];
  document.querySelectorAll("#myinfo_status")[1].size = "5"; //Set the size for the Status button
  document.querySelectorAll("#myinfo_status")[1].setAttribute("style", "font-size: 13.2px; background-image: none; overflow: hidden;"); //Set the css for the status button
  document.querySelectorAll("#myinfo_score")[1].size = "11"; //Set the size for the Score button
  document.querySelectorAll("#myinfo_score > option:nth-child(1)")[1].innerText = 'Reset Score'; //Change the text "selection" to Reset Score
  document.querySelectorAll("#myinfo_score")[1].setAttribute("style", "background-image: none; overflow: hidden; padding : 5px; width: 100px;"); //Set the css for the score button
    //*****************************************************************************************************************************************************
  var DeleteBTN = document.createElement("input");
  document.querySelectorAll("#myinfo_status")[1].parentElement.appendChild(DeleteBTN);
  $(DeleteBTN).attr({value: "Delete",id: "DeleteBTN",class: "inputButton ml8 delete_submit",type: "button"});
  if (window.location.pathname.split('/')[1] === 'anime') {var entrytype = 'anime'} else {var entrytype = 'manga'}
  // 1Function that will run after the mouse click was detected
  function clickonanimedeletebtn () {
    document.body.innerHTML += '<form id="delete-form" method="POST" action="/ownlist/'+entrytype+'/'+animeid+'/delete"></form>';
    document.querySelector("#delete-form").submit();
}
   // 1Function that detects the mouse click on the Backup My AnimeList Button, and run the function above
   document.querySelector("#DeleteBTN").addEventListener ("click", clickonanimedeletebtn , false);
})();