Difference between revisions of "MediaWiki:Common.js"

From ICANNWiki
Jump to navigation Jump to search
(wikiEditor initialization removed)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
(function() {
+
// Ensure everything loads properly
    // Check if jQuery is loaded
+
mw.loader.using(['jquery.ui'], function() {
    if (typeof jQuery == 'undefined') {
+
  $.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js', function() {
        // If not, dynamically load jQuery
+
    console.log("Osano script loaded.");
        var script = document.createElement('script');
+
  });
        script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js';
+
});
        script.type = 'text/javascript';
 
        document.getElementsByTagName('head')[0].appendChild(script);
 
 
 
        // Wait for jQuery to load before executing the rest of the code
 
        script.onload = function() {
 
            runCustomScript();
 
        };
 
    } else {
 
        // jQuery is already loaded, run the custom script immediately
 
        runCustomScript();
 
    }
 
 
 
    function runCustomScript() {
 
        $(document).ready(function() {
 
            $('body').append(`
 
                <div class="flowing-numbers">
 
                    <span>001101010</span>
 
                    <span>110100110</span>
 
                    <span>011010101</span>
 
                    <span>101001101</span>
 
                    <span>010110110</span>
 
                </div>
 
            `);
 
        });
 
    }
 
})();
 
 
 
jQuery.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js');
 
('#free_text').wikiEditor;
 

Latest revision as of 01:24, 30 August 2024

// Ensure everything loads properly
mw.loader.using(['jquery.ui'], function() {
  $.getScript('//cmp.osano.com/Azyw1RRk4ZCOx2wli/04c9aa84-7b4a-45a8-bb7e-3b3767dd3378/osano.js', function() {
    console.log("Osano script loaded.");
  });
});