Munzee Links

Show some more links in the main menu

当前为 2018-04-02 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Munzee Links
// @version      0.2
// @description  Show some more links in the main menu
// @author       rabe85
// @match        https://www.munzee.com/*
// @grant        none
// @namespace    https://greasyfork.org/users/156194
// ==/UserScript==

(function() {
    'use strict';

    function munzee_links() {

        // Bootstrap Script laden
        var bootstrap_script_start = document.createElement('script');
        var bootstrap_script_function = document.createTextNode('$(window).load(function(){ $(\'.tooltip-helper\').tooltip(); });');
        bootstrap_script_start.appendChild(bootstrap_script_function);
        document.head.appendChild(bootstrap_script_start);


        // User eingeloggt?
        var usermenu_logged_in = document.getElementsByClassName('user')[0];
        if(usermenu_logged_in) {

            // Navbar
            var navbar0 = document.getElementsByClassName('nav-short tooltip-helper');
            for(var nav = 0, navbar; !!(navbar=navbar0[nav]); nav++) {
                var navbar_original_title = navbar.getAttribute("data-original-title");

                // Special Munzees Map
                var map_specials = ' <li class="hidden-xs nav-short tooltip-helper" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="View Special Munzees Map"><a href="https://www.munzee.com/specials/"><i class="fa fa-globe"></i><img src="https://munzee.global.ssl.fastly.net/images/pins/svg/nomad.svg" alt="Special Map" style="width: 100%; max-width: 12px; height: auto;"><span class="visible-xs">Special Map</span></a></li>';
                // Munzee Gardens Map
                var map_gardens = '<li class="hidden-xs nav-short tooltip-helper" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="View Munzee Gardens Map"><a href="https://www.munzee.com/gardens/"><i class="fa fa-globe"></i><img src="https://munzee.global.ssl.fastly.net/images/pins/svg/virtualemerald.svg" alt="Gardens Map" style="width: 100%; max-width: 12px; height: auto;"><span class="visible-xs">Gardens Map</span></a></li>';

                // Premium Member: New Deploys In Your Area
                var premium_new_deploys = '<li class="hidden-xs nav-short tooltip-helper" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="New Deploys In Your Area"><a href="https://statzee.munzee.com/player/where/"><i class="fa fa-globe"></i><img src="https://munzee.global.ssl.fastly.net/images/pins/svg/premiumpersonal.svg" alt="New Deploys In Your Area" style="width: 100%; max-width: 12px; height: auto;"><span class="visible-xs">New Deploys In Your Area</span></a></li>';

                // Add all new icons after map icon
                if(navbar_original_title == "View Munzee Map") navbar.insertAdjacentHTML('afterend', map_specials + map_gardens + premium_new_deploys);
            }

        }

    }


    // DOM vollständig aufgebaut?
    if (/complete|interactive|loaded/.test(document.readyState)) {
        munzee_links();
    } else {
        document.addEventListener("DOMContentLoaded", munzee_links, false);
    }

})();