Modifiche

MediaWiki:Common.js

168 byte rimossi, 12:03, 3 gen 2017
var page = window.pageName.replace(/\W/g, '_');
var nowShown;
if(document.getElementById('infoboxtoggle').innerHTML == '[Hide]') {
document.getElementById('infoboxinternal').style.display = 'none';
nowShown = true;
}
if(window.storagePresent) {
var storage = globalStorage[window.location.hostname]; storagelocalStorage.setItem('infoboxshow-' + page, nowShown);
}
}
function addHideButtons() {
var hidables = getElementsByClass('hidable');
for( var i = 0; i < hidables.length; i++ ) {
var box = hidables[i];
var button = getElementsByClass('hidable-button', box, 'span');
if( button != null && button.length > 0 ) {
button = button[0];
button.onclick = toggleHidable;
button.appendChild( document.createTextNode('[Hide]') );
if( new ClassTester('start-hidden').isMatch(box) )
button.onclick('bypass');
}
}
function toggleHidable(bypassStorage) {
var parent = getParentByClass('hidable', this);
var content = getElementsByClass('hidable-content', parent);
var nowShown;
if( content != null && content.length > 0 ) {
content = content[0];
if( content.style.display == 'none' ) {
content.style.display = content.oldDisplayStyle;
nowShown = false;
}
if( window.storagePresent && ( typeof( bypassStorage ) == 'undefined' || bypassStorage != 'bypass' ) ) {
var page = window.pageName.replace(/\W/g, '_');
var items = getElementsByClass('hidable');
var item = -1;
for( var i = 0; i < items.length; i++ ) {
if( items[i] == parent ) {
}
}
if( item == -1 ) {
return;
}
var storage = globalStorage[window.location.hostname]; storagelocalStorage.setItem('hidableshow-' + item + '_' + page, nowShown);
}
}
14 229
contributi