MediaWiki:Timeless.js

From The Joe Frank Wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* All JavaScript here will be loaded for users of the Timeless skin */

$(document).ready(function() {
    // Fetch expanded template content using the MediaWiki API
    $.get(mw.util.wikiScript('api'), {
        action: 'parse',
        page: 'Template:DisplayBroadcasts',
        format: 'json'
    }).done(function(data) {
        if (data && data.parse && data.parse.text) {
            var templateContent = data.parse.text['*'];
            // Append the parsed template content to the page tools section
            $('#page-tools').prepend('<div class="custom-template">' + templateContent + '</div>');
        } else {
            console.error('Error: Template content could not be loaded.');
        }
    }).fail(function() {
        console.error('Error: API request failed.');
    });
});