User:Fuzheado/showmid.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:Fuzheado/showmid. |
if (mw.config.get('wgNamespaceNumber')==6) {
var articleId = mw.config.get( 'wgArticleId' );
if (articleId > "0") {
mid = "M" + articleId;
$('#firstHeading')
.append( $("<a />")
.text(mid)
.attr("href", "https://commons.wikimedia.org/entity/" + mid)
.css({
"margin-left": "1em",
"font-size": "60%"
})
);
$('#firstHeading')
.append( $("<a />")
.text("(ttl)")
.attr("href", "https://commons.wikimedia.org/entity/" + mid + ".ttl")
.css({
"margin-left": "0.5em",
"font-size": "60%"
})
);
$('#firstHeading')
.append( $("<a />")
.text("(json)")
.attr("href", "https://commons.wikimedia.org/entity/" + mid + ".json")
.css({
"margin-left": "0.5em",
"font-size": "60%"
})
);
}
}