Différences entre les versions de « MediaWiki:Common.js »
De Wikip
m (1 révision importée)  | 
				m (1 version importée)  | 
				||
| (5 versions intermédiaires par 2 utilisateurs non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */  | /* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */  | ||
window.wpDarkModeAutoToggle = true;  | |||
/  | /*  | ||
jQuery.noConflict();  | |||
jQuery(document).ready(function($){  | |||
    $('img').each(function(){   | |||
        $(this).removeAttr('width')  | |||
        $(this).removeAttr('height');  | |||
    });  | |||
});  | |||
*/  | |||
$(document).ready(function(){  | $(document).ready(function(){  | ||
     //console.log( "document loaded" );  |      //console.log( "document loaded" );  | ||
| Ligne 52 : | Ligne 51 : | ||
         // title attribute is used because mediawiki filter the other attributes  |          // title attribute is used because mediawiki filter the other attributes  | ||
        // console.log($(ev.target).text());  | |||
        // console.log($(ev.target).prop('title'));  | |||
        // $( ".allCollapseInfo" ).hide();  | |||
        // alert( "#info"+ codeTitle );   | |||
        var codeTitle = $( ev.target ).prop( 'title' ) ;  | |||
        //alert( "codeTitle: "+codeTitle );   | |||
         $( "#info" + codeTitle ).toggle();  | |||
        $( "#"+codeTitle ).toggle();  | |||
         $( "#btn"+codeTitle ).toggle();  | |||
     });  |      });  | ||
});  | });  | ||
Version actuelle datée du 23 décembre 2022 à 17:36
/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */
window.wpDarkModeAutoToggle = true;
/*
jQuery.noConflict();
jQuery(document).ready(function($){
    $('img').each(function(){ 
        $(this).removeAttr('width')
        $(this).removeAttr('height');
    });
});
*/
$(document).ready(function(){
    //console.log( "document loaded" );
    //
    $( ".allCollapseGlobalBtnHideBtn" ).click( function() {
        // hide all global btns
        $( ".allCollapseGlobalBtnHideBtn" ).hide();
        $( ".allCollapseShowBtn" ).hide();
        $( ".allCollapseHideBtn" ).hide();
        $( ".allCollapseBtnShowBtn" ).hide();
        $( ".allCollapseBtnHideBtn" ).hide();
    });
    //
    $( ".allCollapseShowBtn" ).click( function() {
        $( ".allCollapse" ).show();
        $( ".allCollapseInfo" ).hide();
    });
    $(".allCollapseHideBtn").click(function(){
        $(".allCollapse").hide();
        $( ".allCollapseInfo" ).show();
    });
    //
    $( ".allCollapseBtnShowBtn" ).click( function() {
        $( ".allCollapseBtn" ).show();
    });
    $( ".allCollapseBtnHideBtn" ).click( function() {
        $( ".allCollapseBtn" ).hide();
    });
    //
    $( ".collapseBtn" ).click( function( ev ) {
        // title attribute is used because mediawiki filter the other attributes
        // console.log($(ev.target).text());
        // console.log($(ev.target).prop('title'));
        // $( ".allCollapseInfo" ).hide();
        // alert( "#info"+ codeTitle ); 
        var codeTitle = $( ev.target ).prop( 'title' ) ;
        //alert( "codeTitle: "+codeTitle ); 
        $( "#info" + codeTitle ).toggle();
        $( "#"+codeTitle ).toggle();
        $( "#btn"+codeTitle ).toggle();
        
    });
});