User:Euphoria/common.js: Difference between revisions

Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
/**
* 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() {
$(document).ready(function() {
     // Only execute in view mode
     // Only execute in view mode
     if (mw.config.get('wgAction') === "view") {
     if (mw.config.get('wgAction') === "view") {
         var apiURL = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php';
         var apiURL = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php';
         var wikiURL = mw.config.get('wgServer') + mw.config.get('wgScriptPath');
         var wikiURL = mw.util.getUrl('');


         // Fetches the creator of the current page
         // Fetches the creator of the current page
Line 48: Line 57:
             var creatorInfo = $('<div>')
             var creatorInfo = $('<div>')
                 .append('Page created by: ')
                 .append('Page created by: ')
                 .append($('<a>').attr('href', wikiURL + '/wiki/User:' + encodeURIComponent(creator)).text(creator).css({'color': '#0645ad'}))
                 .append($('<a>').attr('href', wikiURL + 'User:' + encodeURIComponent(creator)).text(creator).css({'color': '#0645ad'}))
                 .append(' (')
                 .append(' (')
                 .append($('<a>').attr('href', wikiURL + '/wiki/Special:Contributions/' + encodeURIComponent(creator)).text(editCount + ' edits').css({'color': '#0645ad'}))
                 .append($('<a>').attr('href', wikiURL + 'Special:Contributions/' + encodeURIComponent(creator)).text(editCount + ' edits').css({'color': '#0645ad'}))
                 .append(')')
                 .append(')')
                 .css({'font-size': '11px', 'color': '#666', 'margin-top': '5px'}); // Custom font size set to 11px
                 .css({'font-size': '84%', 'color': '#666', 'margin-top': '5px'});


             $('#bodyContent').prepend(creatorInfo);
             $('#bodyContent').prepend(creatorInfo);
Line 60: Line 69:
     }
     }
});
});
importScript('User:Euphoria/नेपालीकरण.js'); // Backlink: [[User:Euphoria/नेपालीकरण.js]]
importScript('User:Euphoria/massBlock.js'); // Backlink: [[User:Euphoria/massBlock.js]]
152

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu