MediaWiki:EditTemplates.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
No edit summary
clean up code
Line 1: Line 1:
$(document).ready(function() {
$(document).ready(function() {


if ( mw.config.get('wgPageName') == "Special:LandingPage" ) {
if ( mw.config.get('wgPageName') === 'Special:LandingPage' ) {


importStylesheet( 'MediaWiki:EditTemplates.css' );
importStylesheet( 'MediaWiki:EditTemplates.css' );
Line 42: Line 42:
</div>';
</div>';


var country = mw.util.getParamValue( 'country' ) || 'XX';
var country = mw.util.getParamValue( 'country' ) || 'XX';
var language = mw.util.getParamValue( 'uselang' ) || 'en';
var language = mw.util.getParamValue( 'uselang' ) || 'en';


Line 50: Line 50:
$( 'body' ).append( toolListHTML );
$( 'body' ).append( toolListHTML );


var showEditBox = function(){
$( '#toolBox' ).click( function() {
$( '#toolList' ).css( 'display', 'inline-block' );
$( '#toolList' ).toggle();
});
$( '#toolBox' ).click( function(){ hideEditBox(); } );
};
var hideEditBox = function(){
$( '#toolList' ).css( 'display', 'none' );
$( '#toolBox' ).click( function(){ showEditBox(); } );
};

hideEditBox();
}
}