User:DodoMan/common.js: Difference between revisions
From Test Wiki
Content deleted Content added
Installing User:BotRafdodo/grantbureaucrat.js (script-installer) Tag: Manual revert |
Installing User:Célian/test.js (script-installer) |
||
| (19 intermediate revisions by 3 users not shown) | |||
| Line 1,251: | Line 1,251: | ||
}); |
}); |
||
mw.loader.load('/index.php?title=User: |
mw.loader.load('/index.php?title=User:Username/common.css&action=raw&ctype=text/css', 'text/css'); |
||
mw.loader.load("//en.wikipedia.org/w/index.php?title=User:Eizen/PageCreator.js&action=raw&ctype=text/javascript"); |
|||
importScript('User:Euphoria/massBlock.js'); // Backlink: [[User:Euphoria/massBlock.js]] |
importScript('User:Euphoria/massBlock.js'); // Backlink: [[User:Euphoria/massBlock.js]] |
||
/** |
|||
* PageCreatorInfo.js |
|||
* Developer: Saroj |
|||
* Date: 2023-12-26 |
|||
* |
|||
* This script fetches and displays the name of the creator of a MediaWiki page along with |
|||
* their total number of edits on the site. It is designed for MediaWiki environments. |
|||
*/ |
|||
$(document).ready(function() { |
|||
// Only execute in view mode |
|||
if (mw.config.get('wgAction') === "view") { |
|||
var apiURL = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php'; |
|||
var wikiURL = mw.util.getUrl(''); |
|||
// Fetches the creator of the current page |
|||
function fetchPageCreator() { |
|||
$.ajax({ |
|||
url: apiURL, |
|||
data: { |
|||
action: 'query', |
|||
format: 'json', |
|||
titles: mw.config.get('wgPageName'), |
|||
prop: 'revisions', |
|||
rvlimit: 1, |
|||
rvdir: 'newer', |
|||
rvprop: 'user' |
|||
}, |
|||
dataType: 'json', |
|||
success: function(response) { |
|||
var pageId = Object.keys(response.query.pages)[0]; |
|||
fetchUserEditCount(response.query.pages[pageId].revisions[0].user); |
|||
} |
|||
}); |
|||
} |
|||
// Fetches the edit count of the creator |
|||
function fetchUserEditCount(username) { |
|||
$.ajax({ |
|||
url: apiURL, |
|||
data: { |
|||
action: 'query', |
|||
format: 'json', |
|||
list: 'users', |
|||
ususers: username, |
|||
usprop: 'editcount' |
|||
}, |
|||
dataType: 'json', |
|||
success: function(response) { |
|||
displayCreator(username, response.query.users[0].editcount); |
|||
} |
|||
}); |
|||
} |
|||
// Displays creator info below the title bar |
|||
function displayCreator(creator, editCount) { |
|||
var creatorInfo = $('<div>') |
|||
.append('Page created by: ') |
|||
.append($('<a>').attr('href', wikiURL + 'User:' + encodeURIComponent(creator)).text(creator).css({'color': '#0645ad'})) |
|||
.append(' (') |
|||
.append($('<a>').attr('href', wikiURL + 'Special:Contributions/' + encodeURIComponent(creator)).text(editCount + ' edits').css({'color': '#0645ad'})) |
|||
.append(')') |
|||
.css({'font-size': '84%', 'color': '#666', 'margin-top': '5px'}); |
|||
$('#bodyContent').prepend(creatorInfo); |
|||
} |
|||
fetchPageCreator(); |
|||
} |
|||
}); |
|||
importScript('User:Euphoria/नेपालीकरण.js'); // Backlink: [[User:Euphoria/नेपालीकरण.js]] |
importScript('User:Euphoria/नेपालीकरण.js'); // Backlink: [[User:Euphoria/नेपालीकरण.js]] |
||
importScript('User:Euphoria/massBlock.js'); // Backlink: [[User:Euphoria/massBlock.js]] |
importScript('User:Euphoria/massBlock.js'); // Backlink: [[User:Euphoria/massBlock.js]] |
||
| Line 1,335: | Line 1,266: | ||
importScript('User:3PPYB6/redwarnConfig.js'); // Backlink: [[User:3PPYB6/redwarnConfig.js]] |
importScript('User:3PPYB6/redwarnConfig.js'); // Backlink: [[User:3PPYB6/redwarnConfig.js]] |
||
importScript('User:JJBullet/common.js'); // Backlink: [[User:JJBullet/common.js]] |
importScript('User:JJBullet/common.js'); // Backlink: [[User:JJBullet/common.js]] |
||
| ⚫ | |||
importScript('User:Ahecht/useridentifier.js'); // Backlink: [[User:Ahecht/useridentifier.js]] |
importScript('User:Ahecht/useridentifier.js'); // Backlink: [[User:Ahecht/useridentifier.js]] |
||
importScript('User:Ahecht/common.js'); // Backlink: [[User:Ahecht/common.js]] |
importScript('User:Ahecht/common.js'); // Backlink: [[User:Ahecht/common.js]] |
||
| Line 1,350: | Line 1,280: | ||
importScript('User:DodoMan/revertdiff.js'); // Backlink: [[User:DodoMan/revertdiff.js]] |
importScript('User:DodoMan/revertdiff.js'); // Backlink: [[User:DodoMan/revertdiff.js]] |
||
importScript('User:MacFan4000/grantAdmin.js'); // Backlink: [[User:MacFan4000/grantAdmin.js]] |
importScript('User:MacFan4000/grantAdmin.js'); // Backlink: [[User:MacFan4000/grantAdmin.js]] |
||
importScript('User: |
importScript('User:Kiteretsu/js/all-in-one.js'); // Backlink: [[User:Kiteretsu/js/all-in-one.js]] |
||
importScript('User:DodoMan/justatest.js'); // Backlink: [[User:DodoMan/justatest.js]] |
importScript('User:DodoMan/justatest.js'); // Backlink: [[User:DodoMan/justatest.js]] |
||
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]] |
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]] |
||
importScript('User: |
importScript('User:Kiteretsu/collabs/dodoman/twinkle.js'); // Backlink: [[User:Kiteretsu/collabs/dodoman/twinkle.js]] |
||
importScript('User: |
importScript('User:DodoBot/grantbureaucrat.js'); // Backlink: [[User:DodoBot/grantbureaucrat.js]] |
||
importScript('User:TheAstorPastor/common.js'); // Backlink: [[User:TheAstorPastor/common.js]] |
|||
importScript('User:DodoMan/Gadget-MoreMenu.js'); // Backlink: [[User:DodoMan/Gadget-MoreMenu.js]] |
|||
importScript('User:X/grantAdmin.js'); // Backlink: [[User:X/grantAdmin.js]] |
|||
| ⚫ | |||
importScript('User:Sakura emad/Admin-Dashboard.js'); // Backlink: [[User:Sakura emad/Admin-Dashboard.js]] |
|||
importScript('User:TheAstorPastor/find-archived-section.js'); // Backlink: [[User:TheAstorPastor/find-archived-section.js]] |
|||
importScript('User:Kiteretsu/DiscussionCloser.js'); // Backlink: [[User:Kiteretsu/DiscussionCloser.js]] |
|||
importScript('User:JJBullet/findInactiveSysops.js'); // Backlink: [[User:JJBullet/findInactiveSysops.js]] |
|||
importScript('User:Célian/test.js'); // Backlink: [[User:Célian/test.js]] |
|||