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: | ||
mw.loader.using('jquery', function() { | mw.loader.using('jquery', function() { | ||
$(document).ready(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'); | |||
// 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); | |||
} | } | ||
}); | }); | ||
}); | }); | ||
Latest revision as of 13:03, 15 July 2025
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);
}
});
});