MediaWiki:Common.js: Difference between revisions

From GrinderScape Wiki
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
No edit summary
Line 8: Line 8:
         footerInfo.innerHTML = footerInfo.innerHTML.replace("GrinderScape Wiki user", "");
         footerInfo.innerHTML = footerInfo.innerHTML.replace("GrinderScape Wiki user", "");
     }
     }
});
$(document).ready(function() {
    // Target the row with ID 'wiki-manager'
    var wikiManagerRow = $('#wiki-manager');
   
    // Find the closest table and tbody
    var tableBody = wikiManagerRow.closest('table').find('tbody');
   
    // Check if the header is at the top
    var tableHeader = wikiManagerRow.closest('table').find('thead');
    // Ensure the header stays at the top
    if (tableHeader.length && tableHeader.offset().top !== 0) {
        tableHeader.prependTo(tableHeader.closest('table'));
    }
    // Move the 'wiki-manager' row to the top of the tbody
    wikiManagerRow.prependTo(tableBody);
});
});

Revision as of 00:03, 22 March 2025

/* Load dependencies */
// mw.loader.load('https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css', 'text/css');

/* Remove unessecary footer text */
$(document).ready(function() {
    var footerInfo = document.getElementById("footer-info-credits");
    if (footerInfo) {
        footerInfo.innerHTML = footerInfo.innerHTML.replace("GrinderScape Wiki user", "");
    }
});

$(document).ready(function() {
    // Target the row with ID 'wiki-manager'
    var wikiManagerRow = $('#wiki-manager');
    
    // Find the closest table and tbody
    var tableBody = wikiManagerRow.closest('table').find('tbody');
    
    // Check if the header is at the top
    var tableHeader = wikiManagerRow.closest('table').find('thead');

    // Ensure the header stays at the top
    if (tableHeader.length && tableHeader.offset().top !== 0) {
        tableHeader.prependTo(tableHeader.closest('table'));
    }

    // Move the 'wiki-manager' row to the top of the tbody
    wikiManagerRow.prependTo(tableBody);
});