MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
No edit summary
imported>Hendrik Brummermann
No edit summary
Line 3: Line 3:
// set up the words in your language
// set up the words in your language
var ExpandableBarHide = 'Einklappen';
var ExpandableBarHide = 'Hide';
var ExpandableBarShow = 'Ausklappen';
var ExpandableBarShow = 'Show';
// set up max count of Expandable Bars on page,
// if there are more, all will be hidden
// ExpandableBarShowDefault = 0; // all bars will be hidden
// ExpandableBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
// adds show/hide-button to Expandable bars
// adds show/hide-button to Expandable bars
jQuery( document ).ready(function() {
jQuery( document ).ready(function() {
if(!mw.user.options.exists( 'ExpandableBarShowDefault' )){
if (typeof ExpandableBarShowDefault != 'undefined' ) {
mw.user.options.set( 'ExpandableBarShowDefault',ExpandableBarShowDefault)
}
}
// shows and hides content and picture (if available) of Expandable bars
// shows and hides content and picture (if available) of Expandable bars
Line 76: Line 67:
// if more Expandable Bars found and not template namespace than Default: hide all
// if more Expandable Bars found and not template namespace than Default: hide all
var initiallyToggle = true;
var initiallyToggle = mw.user.options.get( 'ExpandableBarShowDefault',1 ) < ExpandableFrames.length && mw.config.get( 'wgNamespaceNumber' ) != 10;
for (var i=0; i<ExpandableFrames.length; i++) {
for (var i=0; i<ExpandableFrames.length; i++) {
var ExpandableFrame = ExpandableFrames[i];
var ExpandableFrame = ExpandableFrames[i];