(Nodig voor het legen van de cache) |
k (Fix leeg menu.) |
||
Regel 1: | Regel 1: | ||
+ | /* Add purge action */ |
||
if ( !$( '#ca-purge' ).length ) { |
if ( !$( '#ca-purge' ).length ) { |
||
$( '#p-cactions' ).find( 'ul' ).append( |
$( '#p-cactions' ).find( 'ul' ).append( |
||
Regel 5: | Regel 6: | ||
) |
) |
||
); |
); |
||
+ | } else if ( $( "#ca-purge a:contains('Purge')" ) ) { // Also replace "Purge" with "Cache legen" |
||
+ | $( '#ca-purge a' ).text( "Cache legen" ); |
||
+ | } |
||
+ | |||
+ | /* In certain circumstances, the menu "More" shows nothing. This is due to a |
||
+ | * hidden Cargo purge button. If the menu only contains this, then hide it. |
||
+ | */ |
||
+ | if ( $( '#p-cactions .menu ul #ca-cargo-purge' ) && $( '#p-cactions .menu ul' ).length == 1 ) { |
||
+ | $( '#p-cactions' ).css( 'display', 'none' ); |
||
} |
} |
Versie van 30 aug 2020 18:48
/* Add purge action */
if ( !$( '#ca-purge' ).length ) {
$( '#p-cactions' ).find( 'ul' ).append(
$( '<li>' ).attr( 'id', 'ca-purge' ).addClass( 'collapsible' ).append(
$( '<a>' ).attr( 'href', mw.util.getUrl( null, { action: 'purge' } ) ).text( 'Cache legen' )
)
);
} else if ( $( "#ca-purge a:contains('Purge')" ) ) { // Also replace "Purge" with "Cache legen"
$( '#ca-purge a' ).text( "Cache legen" );
}
/* In certain circumstances, the menu "More" shows nothing. This is due to a
* hidden Cargo purge button. If the menu only contains this, then hide it.
*/
if ( $( '#p-cactions .menu ul #ca-cargo-purge' ) && $( '#p-cactions .menu ul' ).length == 1 ) {
$( '#p-cactions' ).css( 'display', 'none' );
}