Lakeus.js: Difference between revisions
From Illustrations in German Translations of Mark Twain's Works
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Lakeus skin */ | /* All JavaScript here will be loaded for users of the Lakeus skin */ | ||
$(function() { | mw.loader.using('jquery', function() { | ||
$(document).ready(function() { | |||
if (mw.config.get('wgUserName')) { // Nur für eingeloggte Nutzer | if (mw.config.get('wgUserName')) { // Nur für eingeloggte Nutzer | ||
var pageName = mw.config.get('wgPageName'); | var pageName = mw.config.get('wgPageName'); | ||
| Line 80: | Line 52: | ||
$('body').append(editButton, veEditButton); | $('body').append(editButton, veEditButton); | ||
} | } | ||
}); | |||
}); | }); | ||
Revision as of 13:02, 15 July 2025
/* All JavaScript here will be loaded for users of the Lakeus skin */
mw.loader.using('jquery', function() {
$(document).ready(function() {
if (mw.config.get('wgUserName')) { // Nur für eingeloggte Nutzer
var pageName = mw.config.get('wgPageName');
// Klassischer Editor-Button
var editButton = $('<a>', {
href: mw.util.getUrl(pageName, { action: 'edit' }),
text: 'Edit (Classic)',
id: 'custom-edit-button-classic',
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)',
display: 'block',
marginBottom: '5px',
}
});
// Visual Editor-Button
var veEditButton = $('<a>', {
href: mw.util.getUrl(pageName, { veaction: 'edit' }),
text: 'Edit (Visual Editor)',
id: 'custom-edit-button-ve',
css: {
position: 'fixed',
top: '50px',
right: '10px',
padding: '8px 12px',
backgroundColor: '#2a7f62',
color: '#fff',
borderRadius: '4px',
textDecoration: 'none',
zIndex: 9999,
fontWeight: 'bold',
boxShadow: '0 2px 4px rgba(0,0,0,0.3)',
display: 'block',
}
});
// Buttons zum Body hinzufügen
$('body').append(editButton, veEditButton);
}
});
});