Difference between revisions of "MediaWiki:Monobook.js"

Jump to navigation Jump to search
8 bytes removed ,  19:25, 27 December 2013
m
change whitespace?
(try making sidebar menus collapsible)
 
m (change whitespace?)
Line 7: Line 7:
// Use this code ONLY for the Monobook skin.          //
// Use this code ONLY for the Monobook skin.          //
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
 
$( document ).ready( function() {
$( document ).ready( function() {
// Set the default expanded items by their headline
// Set the default expanded items by their headline
Line 13: Line 13:
// Set the basic-name for the cookies, which save the current state of expanding
// Set the basic-name for the cookies, which save the current state of expanding
var expandCookieName = 'disdance_project_wiki_nav_expanded_';
var expandCookieName = 'disdance_project_wiki_nav_expanded_';
 
var maxHeights = [];
var maxHeights = [];
var expandeds = [];
var expandeds = [];
Line 19: Line 19:
initNav();
initNav();
});
});
 
function initNav() {
function initNav() {
$( '#p-logo' ).css({'position': 'relative', 'display': 'block'});
$( '#p-logo' ).css({'position': 'relative', 'display': 'block'});
Line 27: Line 27:
var str = $( this ).html();
var str = $( this ).html();
labels[id] = str;
labels[id] = str;
 
if ( $.cookie( expandCookieName + id ) == 'false' ) {
if ( $.cookie( expandCookieName + id ) == 'false' ) {
expandeds[id] = false;
expandeds[id] = false;
Line 45: Line 45:
} );
} );
}
}
 
function minimize( target ) {
function minimize( target ) {
var id = $( target ).parent().attr( 'id' );
var id = $( target ).parent().attr( 'id' );
Line 54: Line 54:
$( target ).html( str );
$( target ).html( str );
}
}
 
function maximize( target ) {
function maximize( target ) {
var id = $( target ).parent().attr( 'id' );
var id = $( target ).parent().attr( 'id' );
Line 64: Line 64:
$( target ).html( str );
$( target ).html( str );
}
}
 
function toggleNav( e ) {
function toggleNav( e ) {
var id = $(e.target ).parent().attr( 'id' );
var id = $(e.target ).parent().attr( 'id' );
Line 74: Line 74:
}
}
}
}
 
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////

Navigation menu