Greasy Fork

MAM User Menu

Custom menu with links for MAM

目前为 2023-03-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         MAM User Menu
// @namespace    https://greasyfork.org/en/users/705546-yyyzzz999
// @version      0.3
// @description  Custom menu with links for MAM
// @author       Spawvn & yyyzzz999
// @match        https://www.myanonamouse.net/*
// @exclude      https://*.myanonamouse.net/pic/*
// @exclude      https://cdn.myanonamouse.net/imagebucket/*
// @exclude      https://cdn.myanonamouse.net/*
// @icon         https://cdn.myanonamouse.net/imagebucket/164109/um64.png
// @license      MIT
// @grant        none
// ==/UserScript==

// Screenshot: https://cdn.myanonamouse.net/imagebucket/164109/mem.jpg
(function() {
    var menu = document.querySelector('#menu')
    var newMenu = document.createElement('li')
    newMenu.setAttribute('role', 'presentation')
    newMenu.style.order = '7'

    var newLink = document.createElement('a')
    newLink.setAttribute('id', 'userMenu')
    newLink.setAttribute('tabindex', '0')
    newLink.setAttribute('aria-haspopup', 'true')
    newLink.innerHTML = 'More ↓'; // Keep this short, but call it Extras, MyMenu or whatever you like

    var newList = document.createElement('ul')
    newList.setAttribute('class', 'hidden')
    newList.setAttribute('role', 'menu')
    newList.setAttribute('aria-labelledby', 'userMenu')

    function addItemToMenu(item, menu) {
        var newItem = document.createElement('li')
        newItem.setAttribute('role', 'presentation')
        var newItemLink = document.createElement('a')
        newItemLink.setAttribute('role', 'menuitem')
        newItemLink.setAttribute('tabindex', '0')
        newItemLink.setAttribute('href', item.link)
        newItemLink.innerHTML = item.name
        newItem.appendChild(newItemLink)
        menu.appendChild(newItem)
    }

//Add your custom links below copying the format of the templates here:
    var menuData = [
        {
            link: '/tor/browse.php?&tor[srchIn][narrator]=true&tor[cat][]=39&tor[cat][]=49&tor[cat][]=50&tor[cat][]=83&tor[cat][]=51&tor[cat][]=97' +
            '&tor[cat][]=40&tor[cat][]=41&tor[cat][]=106&tor[cat][]=42&tor[cat][]=52&tor[cat][]=98&tor[cat][]=54&tor[cat][]=55&tor[cat][]=43&tor[cat][]=99' +
            '&tor[cat][]=84&tor[cat][]=44&tor[cat][]=56&tor[cat][]=45&tor[cat][]=57&tor[cat][]=85&tor[cat][]=87&tor[cat][]=119&tor[cat][]=88&tor[cat][]=58' +
            '&tor[cat][]=59&tor[cat][]=46&tor[cat][]=47&tor[cat][]=53&tor[cat][]=89&tor[cat][]=100&tor[cat][]=108&tor[cat][]=48&tor[cat][]=111&tor[cat][]=0' +
            '&tor[browseFlagsHideVsShow]=1&&&tor[unit]=1',
            name: 'Audio Book Search'
        },
        {
            link: '/bitbucket-upload.php',
            name: 'Bit-bucket Images'
        },
        {
            link: '/tor/bookclubs.php', // Duplicate of Fun & Games menu, but this title may clarify Monthly FL list is here too
            name: 'Book Club FL List'
        },
        {
            link: '/f/t/66317/p/1',
            name: 'CSS How To...'
        },
        {
            link: '/f/t/41863/p/1',
            name: 'MAM+'
        },
        {
            link: '/f/t/60213/p/1',
            name: 'MAM Ratio Protect'
        },
        {
            link: '/newUsers.php',
            name: 'New Users List'
        },
        {
            link: '/f/t/49354/p/1',
            name: 'qBittorrent 4 Guide'
        },
/*         {
            link: '/json/userBonusHistory.php?type[]=wedgePF',
            name: 'Recent FL History'
        },
        {
            link: '/json/userBonusHistory.php?type[]=millionaires',
            name: "Recent Millionaire's History"
        },
        {
            link: '/json/userBonusHistory.php?type[]=giftPoints',
            name: 'Recent Gift History'
        }, */
        {
            link: '/tor/browse.php?tor[minSeeders]=1&tor[maxSeeders]=1',
            name: 'Search Poorly Seeded Torrents'
        },

        {
            link: '/messages.php?action=viewmailbox&box=-1',
            name: 'Sent Messages'
        },
        {
            link: '/f/t/55465',
            name: 'Shoutbox BBCode Guide'
        },
 //       https://t.myanonamouse.net/json/jsonIp.php
        {
            link: '/json/jsonIp.php',
            name: 'Show My IP address'
        },
        {
            link: '/smilies.php',
            name: 'Smilies Text Key'
        },
        {
            link: '/funsmilies.php',
            name: 'Smilies, Fun Key'
        },
        {
            link: '/preferences/index.php?view=style',
            name: 'Style Preferences'
        },
        {
            link: '/f/t/58463/p/1',
            name: 'User-made Resources'
        },
        {
            link: '/f/t/53364/p/1',
            name: 'Whale Guide'
        },
    ]

    for(var i=0; i<menuData.length; i++) {
        addItemToMenu(menuData[i], newList)
    }

    newMenu.appendChild(newLink)
    newMenu.appendChild(newList)
    menu.appendChild(newMenu)
})();