Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Better MAL Favs
- // @namespace https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
- // @version 10
- // @description Choose how you want profile favorites to look like.
- // @author hacker09 & Shishio-kun
- // @include /https:\/\/myanimelist\.net\/profile\/[^\/]+(\/)?$/
- // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://myanimelist.net&size=64
- // @grant GM_registerMenuCommand
- // @run-at document-end
- // @grant GM_getValue
- // @grant GM_setValue
- // ==/UserScript==
- (function() {
- 'use strict';
- var hide = '1'; //Define the fav info as visible
- var CompaniesPosition = 'relative !important'; //Define the companies column position to show below all other tables
- GM_registerMenuCommand("Choose MAL Favs Styles", function() { //Creates a new function
- var UserInput = prompt('1 Actual style showing all favs titles and names\n\n2 Vertical style\n\n3 Vertical style with big images\n\n4 Vertical style without franchise name/year\n\n5 Vertical style with big images and without franchise name/year\n*Write only your choice number and click OK'); //Gets the user input
- GM_setValue("Choice", UserInput); //Defines the variable as the UserInput
- var UserInput2 = prompt('1 Allways move the companies table to the right.\n\n2 Show the companies table below all other tables\n*Write only your choice number and click OK'); //Gets the user input
- GM_setValue("CompaniesTablePosition", UserInput2); //Defines the variable as the UserInput
- location.reload(); //Reloads the page
- }); //Adds an option to the menu and finishes the function
- if (GM_getValue("Choice") === undefined) { //If the variable doesn't exist yet
- alert('Click on the TamperMonkey extension icon, and click on the button "Choose MAL Favs Styles", to chose how you want the MAL favs to look like by default.'); //Shows how to config the script
- } //Finishes the if condition
- if (GM_getValue("Choice") === '1') { //If the user chose option 1
- document.head.insertAdjacentHTML('beforeend', '<style>.fav-slide-block .fav-slide .btn-fav .link .title, .fav-slide-block .fav-slide .btn-fav .link .users {opacity: unset;}</style>'); //Show the titles by default
- } //Finishes the if condition
- if (GM_getValue("Choice").match(/4|5/) !== null) { //If the user chose option 4 or 5
- hide = '0'; //Hide the fav info
- } //Finishes the if condition
- if (GM_getValue("CompaniesTablePosition") === '1' && document.querySelector("div.favmore").innerText.match('People ') !== null && GM_getValue("Choice") !== '1') { //If the user chose option 1 and the companies column is below all other columns, and if the user didn't choose option 1
- CompaniesPosition = 'absolute !important'; //Define the companies column position to show below all other tables
- document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/238158.css"/>`); //Make the companies column show on the right side By Shishio-kun style 238158
- } //Finishes the if condition
- if (GM_getValue("Choice").match(/2|4/) !== null) { //If the user chose option 2 or 4
- document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" https://userstyles.org/styles/221397.css"/>`); //Original Favorites Styles By Shishio-kun (style 221397)
- document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" https://userstyles.org/styles/221276.css"/>`); //Original Favorites Styles By Shishio-kun (style 221276)
- } //Finishes the if condition
- if (GM_getValue("Choice").match(/3|5/) !== null) { //If the user chose option 3 or 5
- document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221398.css"/>`); //Original Favorites Styles with bigger pics By Shishio-kun (style 221398)
- document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221277.css"/>`); //Original Favorites Styles with bigger pics By Shishio-kun (style 221277)
- } //Finishes the if condition
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement