User:Ricewind/common.js: Difference between revisions

From Melvor Idle
(Created page with "$(document).ready(function() { // Create subpage link functionality function createSubpage() { var subpageTitle = prompt('Enter subpage title:'); if (!subpageTitle) return; var encodedTitle = encodeURIComponent(subpageTitle.trim()); var link = mw.config.get('wgScriptPath') + '/index.php?title=' + mw.config.get('wgPageName') + '/' + encodedTitle + '&action=edit&preload=Template:MoneyMakingGuide'; window.location.href = link;...")
 
(Blanked the page)
Tags: Blanking Manual revert
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
$(document).ready(function() {
    // Create subpage link functionality
    function createSubpage() {
        var subpageTitle = prompt('Enter subpage title:');
        if (!subpageTitle) return;
        var encodedTitle = encodeURIComponent(subpageTitle.trim());
        var link = mw.config.get('wgScriptPath') + '/index.php?title=' + mw.config.get('wgPageName') + '/' + encodedTitle + '&action=edit&preload=Template:MoneyMakingGuide';
        window.location.href = link;
    }


    // Add a button to create a subpage dynamically
    var createSubpageButton = '<input type="button" value="Create Subpage" onclick="createSubpage()">';
    $('#p-cactions').append(createSubpageButton);
});

Latest revision as of 13:24, 19 July 2024