User:Kuttappan Chettan/vector.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.
The accompanying .css page for this skin is at User:Kuttappan Chettan/vector.css. |
- Report page listing warnings and errors.
// Forcing the use of Globalization template.
if(document.getElementById("wpTextbox1") != null)
{
var wpTextBox1 = document.getElementById("wpTextbox1").value;
wpTextBox1 = wpTextBox1.replace(/==\s*Summary\s*==/g, '== {{int:filedesc}} ==');
wpTextBox1 = wpTextBox1.replace(/==\s*Licensing\s*==/g, '== {{int:license-header}} ==');
wpTextBox1 = wpTextBox1.replace(/==\s*{{int:license}}\s*==/g, '== {{int:license-header}} ==');
wpTextBox1 = wpTextBox1.replace('== {{int:license-header}} ==', '== {{int:license-header}} ==');
if(wpTextBox1.indexOf("== {{int:filedesc}} ==") < 0
&& wpTextBox1.indexOf("=={{int:filedesc}}==") < 0
&& wpTextBox1.indexOf("{Information") > 0)
wpTextBox1 = "== {{int:filedesc}} ==\n" + wpTextBox1;
if(document.getElementById("wpTextbox1").value != wpTextBox1)
document.getElementById("wpTextbox1").value = wpTextBox1;
}
///////////////// Get user details
$(document).ready(function () {
if(mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk")
GetUserDetails();
});
function GetUserDetails()
{
var query = {
action: 'query',
list: 'users',
ususers: mw.config.get("wgTitle"),
usprop: 'editcount|groups',
format: 'json'
};
$.ajax({
url: mw.util.wikiScript('api'),
cache: false,
dataType: 'json',
data: query,
type: 'GET',
success: function (result, status, x) {
if (!result) alert("Received empty API response:\n" + x.responseText);
if (result.error) alert("API request failed (" + result.error.code + "): " + result.error.info);
var groups = String(result.query.users[0].groups);
groups = groups.replace("*,","");
$('#firstHeading').append("<div class='catlinks'>" +
" (" + result.query.users[0].editcount + " edits. Rights: [" + groups + "])" +
"</div>");
},
error: function (x, status, error) {
alert("API request returned status " + x.status + " " + status + ". Error code is " + error);
}
});
}
///////////////// End of get user details