Jump to content

MediaWiki:Common.js: Difference between revisions

From ICANNWiki
Dustin Loup (talk | contribs)
No edit summary
No edit summary
Line 1: Line 1:
jQuery.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js');
jQuery.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js');
('#free_text').wikiEditor;
('#free_text').wikiEditor;
document.addEventListener('DOMContentLoaded', function() {
    var links = document.querySelectorAll('a[href*="https://ntldstats.com/tld/"]');
    links.forEach(function(link) {
        var url = new URL(link.href);
        var paths = url.pathname.split('/');
        var lastSegment = paths[paths.length - 1];
        if (lastSegment.startsWith('.')) {
            lastSegment = lastSegment.substring(1); // Remove the leading dot
            paths[paths.length - 1] = lastSegment;
            url.pathname = paths.join('/');
            link.href = url.toString();
        }
    });
});

Revision as of 23:47, 22 April 2024

jQuery.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js');
('#free_text').wikiEditor;

document.addEventListener('DOMContentLoaded', function() {
    var links = document.querySelectorAll('a[href*="https://ntldstats.com/tld/"]');
    links.forEach(function(link) {
        var url = new URL(link.href);
        var paths = url.pathname.split('/');
        var lastSegment = paths[paths.length - 1];
        if (lastSegment.startsWith('.')) {
            lastSegment = lastSegment.substring(1); // Remove the leading dot
            paths[paths.length - 1] = lastSegment;
            url.pathname = paths.join('/');
            link.href = url.toString();
        }
    });
});