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

  1. // ==UserScript==
  2. // @name Better Buttons to Change The Status Of Animes/Mangas And To Add Scores
  3. // @namespace betterbuttonstomal2
  4. // @version 0.3
  5. // @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.
  6. // @author hacker09
  7. // @match https://myanimelist.net/anime/*
  8. // @match https://myanimelist.net/anime.php?id=*
  9. // @match https://myanimelist.net/manga/*
  10. // @match https://myanimelist.net/manga.php?id=*
  11. // @grant none
  12. // @run-at document-end
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. var $ = window.jQuery; //Defines That The Symbol $ Is A jQuery
  18. var animeid = location.pathname.match(/\d+/)[0];
  19. document.querySelectorAll("#myinfo_status")[1].size = "5"; //Set the size for the Status button
  20. document.querySelectorAll("#myinfo_status")[1].setAttribute("style", "font-size: 13.2px; background-image: none; overflow: hidden;"); //Set the css for the status button
  21. document.querySelectorAll("#myinfo_score")[1].size = "11"; //Set the size for the Score button
  22. document.querySelectorAll("#myinfo_score > option:nth-child(1)")[1].innerText = 'Reset Score'; //Change the text "selection" to Reset Score
  23. document.querySelectorAll("#myinfo_score")[1].setAttribute("style", "background-image: none; overflow: hidden; padding : 5px; width: 100px;"); //Set the css for the score button
  24. //*****************************************************************************************************************************************************
  25. var DeleteBTN = document.createElement("input");
  26. document.querySelectorAll("#myinfo_status")[1].parentElement.appendChild(DeleteBTN);
  27. $(DeleteBTN).attr({value: "Delete",id: "DeleteBTN",class: "inputButton ml8 delete_submit",type: "button"});
  28. if (window.location.pathname.split('/')[1] === 'anime') {var entrytype = 'anime'} else {var entrytype = 'manga'}
  29. // 1Function that will run after the mouse click was detected
  30. function clickonanimedeletebtn () {
  31. document.body.innerHTML += '<form id="delete-form" method="POST" action="/ownlist/'+entrytype+'/'+animeid+'/delete"></form>';
  32. document.querySelector("#delete-form").submit();
  33. }
  34. // 1Function that detects the mouse click on the Delete Button, and will run the function above
  35. document.querySelector("#DeleteBTN").addEventListener ("click", clickonanimedeletebtn , false);
  36. })();