מדיה ויקי:סקריפטים/94.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
if ( mw.config.get( 'wgNamespaceNumber' ) == 14 )
mw.loader.using( 'mediawiki.util' ).done( function() {
var state = !! window.auto_hide_empty, // make it bool;
toggleEmpty = function() {
state = ! state;
menuItem.find('a').text( menuItemText[state] );
$( '.CategoryTreeEmptyBullet' )
.filter(function() { return $(this).siblings(':Contains("(ריקה)")').length;})
.closest( 'li' ).toggle( state ); // remove empty cats
if ( state )
$( '.mw-category-group' ).toggle( true );
else
$('.mw-category-group').each(function() {
if (! $(this).find('li:visible').length)
$(this).toggle(false);
}); // remove emptied sections
},
menuItemText = { false: 'הצג את כל הקטגוריות' , true: 'הסתר קטגוריות ריקות'},
menuItem = $( mw.util.addPortletLink( 'p-cactions', '#', '' ) )
.click( toggleEmpty );
$( toggleEmpty );
} ); // using