MediaWiki

MediaWiki:Lakeus.js

From Illustrations in German Translations of Mark Twain's Works

Revision as of 13:41, 8 July 2025 by HMHTEST (talk | contribs) (Created page with "All JavaScript here will be loaded for users of the Lakeus skin: $(function() { if ( mw.config.get('wgUserName') ) { // nur eingeloggte Nutzer // Edit-URL der aktuellen Seite holen var editUrl = mw.util.getUrl(mw.config.get('wgPageName'), { action: 'edit' }); // Button erstellen var editButton = $('<a>', { href: editUrl, text: 'Edit', id: 'custom-edit-button', css: {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* All JavaScript here will be loaded for users of the Lakeus skin */
$(function() {
    if ( mw.config.get('wgUserName') ) { // nur eingeloggte Nutzer
        // Edit-URL der aktuellen Seite holen
        var editUrl = mw.util.getUrl(mw.config.get('wgPageName'), { action: 'edit' });
        
        // Button erstellen
        var editButton = $('<a>', {
            href: editUrl,
            text: 'Edit',
            id: 'custom-edit-button',
            css: {
                position: 'fixed',
                top: '10px',
                right: '10px',
                padding: '8px 12px',
                backgroundColor: '#005ea2',
                color: '#fff',
                borderRadius: '4px',
                textDecoration: 'none',
                zIndex: 9999,
                fontWeight: 'bold',
                boxShadow: '0 2px 4px rgba(0,0,0,0.3)'
            }
        });
        
        // Button ans body anhängen
        $('body').append(editButton);
    }
});