User talk:Schniggendiller/global.js

From Meta, a Wikimedia project coordination wiki

spamblacklist log[edit]

At Special:Log/<username>, you won't see all logs. Some of them have to be chosen manually in the drop-down list, for example the spamblacklist log. This javascript snippet adds a new link "Spam" to every page, visible in the navigation box (that's the box that contains the link to a project's main page). If you're on a user's page/contribs page/log page or even a subpage of them and click the link, you will be forwarded to this user's spamblacklist log. You can add this snippet to your common.js or global.js.

/* modify the navigation box: new link "Spam" */
jQuery(document).ready(function() {
   mw.loader.using("mediawiki.util",
                   function() {
      mw.util.addPortletLink("p-navigation",
                             "/w/index.php?title=Special:Log/spamblacklist/"
                             + mw.util.wikiUrlencode(mw.config.get("wgRelevantUserName")),
                             "Spam",
                             "n-spam",
                             "show the spamblacklist log of this user",
                             "8",
                             "#n-mainpage-description",
                             null);
   });
});

line 8: The displayed name of this link

line 9: define a selector name for the link; needed to display the link in another (background) color etc.

line 10: tooltip of the link

line 11: access key (delete this line if you don't want one)

line 12: define the position where the link is displayed (in this case, the link is not exactly shown at the expected place)


It is possible to modify the appearance of the link by adding something like this to your common.css or global.css:

/* modify the "spam" link */
#n-spam { background-color: #FF0000; }

The link will then be displayed as Spam. An extensive list of color codes can be found at de:Hilfe:Farbtabelle.

CentralAuth[edit]

This javascript snippet adds a new link "CentralAuth" to every page, visible in the navigation box (that's the box that contains the link to a project's main page). If you're on a user's page/contribs page/log page or even a subpage of them and click the link, you will be forwarded to this user's CentralAuth page at Meta. You can add this snippet to your common.js or global.js.

/* modify the navigation box: new link "CentralAuth" */
jQuery(document).ready(function() {
   mw.loader.using("mediawiki.util",
                   function() {
      mw.util.addPortletLink("p-navigation",
                             "/w/index.php?title=m:Special:CentralAuth/"
                             + mw.util.wikiUrlencode(mw.config.get("wgRelevantUserName")),
                             "CentralAuth",
                             "n-ca",
                             "go to meta:Special:CentralAuth of this user",
                             "#n-spam",
                             null);
   });
});

line 8: The displayed name of this link

line 9: define a selector name for the link; needed to display the link in another (background) color etc.

line 10: tooltip of the link

line 11: define the position where the link is displayed (in this case, the link is not exactly shown at the expected place)


It is possible to modify the appearance of the link by adding something like this to your common.css or global.css:

/* modify the "CentralAuth" link */
#n-ca { background-color: #EEFF22; }

The link will then be displayed as CentralAuth. An extensive list of color codes can be found at de:Hilfe:Farbtabelle.

Global Block[edit]

This javascript snippet adds a new link "Global Block" to every page, visible in the navigation box (that's the box that contains the link to a project's main page). If you're on an IP’s user page/talk page/contribs page/log page and click the link, you will be forwarded to this user's GlobalBlock page at Meta. You can add this snippet to your common.js or global.js.

/* modifying the navigation box: new link "GlobalBlock" */
jQuery(document).ready(function() {
   mw.loader.using("mediawiki.util",
                   function() {
      mw.util.addPortletLink("p-navigation",
                             "/w/index.php?title=m:Special:GlobalBlock/"
                             + mw.util.wikiUrlencode(mw.config.get("wgRelevantUserName")),
                             "Global Block",
                             "n-gb",
                             "block this IP globally",
                             "#n-ca",
                             null);
   });
});

line 8: The displayed name of this link

line 9: define a selector name for the link; needed to display the link in another (background) color etc.

line 10: tooltip of the link

line 11: define the position where the link is displayed (in this case, the link is not exactly shown at the expected place)


It is possible to modify the appearance of the link by adding something like this to your common.css or global.css:

/* modify the "Global Block" link */
#n-ca { background-color: #00FF00; }

The link will then be displayed as Global Block. An extensive list of color codes can be found at de:Hilfe:Farbtabelle.