MediaWiki:Common.js: Difference between revisions

no edit summary
m (Removed "Dynamic Navigation Bars" section)
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 11: Line 11:
  * dependency hasn't arrived yet it'll make sure those are loaded before this.
  * dependency hasn't arrived yet it'll make sure those are loaded before this.
  */
  */
$( document ).ready( function() {
        var $collapseglobal = $('#collapse-global');
        if ( $collapseglobal.length > 0 ) {
                $collapseglobal.html('');
                $('<a class="mediawiki-button">Expand/Collapse All</a>').on('click', function() {
                        $('.mw-collapsible-toggle a').trigger('click.mw-collapsible');
                }).appendTo($collapseglobal);
        }
});


/* global mw, $, importStylesheet, importScript */
/* global mw, $, importStylesheet, importScript */
Line 230: Line 242:
   
   
//$(function() {
//$(function() {
//    $('#collapse-global').html('<a class="mediawiki-button" onclick="for (var i=0; i<50; i++) { "wikitable sortable collapsible collapsed"([i]); }">Show/Hide //All</a>');
//    $('#collapse-global').html('<a class="mediawiki-button" onclick="for (var i=0; i<50; i++) { "mw-collapsible mw-collapsed sortable wikitable"([i]); }">Expand/Collapse All</a>');
//});
 
 
//$(function() {
//        var $collapseglobal = $('#collapse-global');
//        if ( $collapseglobal.length > 0 ) {
//                $collapseglobal.html('');
//                $('<a class="mediawiki-button">Expand/Collapse All</a>').on('click', function() {
//                        $('a.collapsible-text').trigger('click.collapsible');
//                }).appendTo($collapseglobal);
//        }
//});
//});


$(function() {
        var $collapseglobal = $('#collapse-global');
        if ( $collapseglobal.length > 0 ) {
                $collapseglobal.html('');
                $('<a class="mediawiki-button">Show/Hide All</a>').on('click', function() {
                        $('a.collapsible-text').trigger('click.collapsible');
                }).appendTo($collapseglobal);
        }
});


// Complete as of 171104
// Complete as of 171104
/* End of mw.loader.using callback */
/* End of mw.loader.using callback */
} );
} );
$.when(
    mw.loader.getScript( 'https://sarkarverse.org/index.php?title=MediaWiki:MP3Player.js&action=raw&ctype=text/javascript' )
)
.then(
    function () {
    $( ".sarkarverse-mp3-player" ).each(function() {
  new GreenAudioPlayer( this );
});
    },
    function ( e ) {
        mw.log.error( e.message ); // => "Failed to load script"
    }
);
/* DO NOT ADD CODE BELOW THIS LINE */
/* DO NOT ADD CODE BELOW THIS LINE */