MediaWiki:Gadget-RailModule.js
Z Nonsensopedii, polskiej encyklopedii humoru
Wersja z dnia 12:27, 17 lut 2022 autorstwa Ostrzyciel (dyskusja • edycje)
Uwaga: aby zobaczyć zmiany po zapisaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.
- Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5 lub Ctrl+R (⌘-R na komputerze Mac)
- Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
- Internet Explorer: Przytrzymaj Ctrl jednocześnie klikając Odśwież lub naciśnij klawisze Ctrl+F5
- Konqueror: Kliknij polecenie Odśwież lub naciśnij klawisz F5
- Opera: Wyczyść pamięć podręczną w Narzędzia → Preferencje
/**
* Magia dodająca bajery do stopki w trybie mobilnym.
*
* Autorzy: [[User:Ostrzyciel]], [[User:Polskacafe]]
**/
jQuery( document ).ready( function () {
var afterContent = $( '#mw-data-after-content' );
var catlinks = $( '#catlinks' );
const railDiv = '<div class="post-content footer-railmodule-content" style="margin-top: 22px;"></div>';
// railmodule -- czywiesze i te sprawy
var ratingstars = $( '.footer-ratingstars' );
if ( !ratingstars.length ) {
afterContent.prepend( railDiv );
} else {
ratingstars.after( railDiv );
}
// przycisk edycji
if ( mw.config.get( 'wgAction' ) === 'view' &&
mw.config.get( 'wgIsProbablyEditable' )
) {
href = 'https://nonsa.pl/wiki/' + mw.Uri.encode( mw.config.get( 'wgPageName' ) ) + '?action=edit';
toInsert = '<a href="' + href + '" id="bottom-edit-button"> \
<div>Edytuj tę stronę</div> \
</a>';
if ( catlinks.length === 1 ) {
catlinks.after( toInsert );
} else {
afterContent.before( toInsert );
}
}
// wypełnij railmodule
$.ajax( {
url: 'https://nonsa.pl/wiki/MediaWiki:RailModule?action=render',
type: 'GET',
success: function ( data ) {
$( 'div.footer-railmodule-content' ).prepend( data );
}
} );
}() );