TVTropes 1.3 - Add "Troper Page" Link

Adds links to a user's troper page, both in the user menu and their profile page

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        TVTropes 1.3 - Add "Troper Page" Link
// @namespace   TVTropes 1.3 Plus
// @description Adds links to a user's troper page, both in the user menu and their profile page
// @include     http://tvtropes.org/*
// @include     https://tvtropes.org/*
// @version     1
// @grant       none
// ==/UserScript==

logoutLink = $('#header-new .dropdown-menu.pull-right li').last();
troperName = logoutLink.children().first().attr('href').split('=')[1];
logoutLink.before('<li><a href="http://tvtropes.org/pmwiki/pmwiki.php/Tropers/' + troperName + '">Troper Page</a></li>');

if (document.location.href == 'http://tvtropes.org/pmwiki/profile.php' || document.location.href == 'https://tvtropes.org/pmwiki/profile.php') {
   $('.mobile-dropDown-list .close-btn').before('<li style="display:inline-block;"><a href="http://tvtropes.org/pmwiki/pmwiki.php/Tropers/' + troperName + '"><i class="io icon-file-empty"></i> Troper Page</a></li>');
}