Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 92: | Zeile 92: | ||
}); | }); | ||
}); | }); | ||
(function(){ | // attachments immer in neuem Tab öffnen | ||
(function () { | |||
// Hilfs-Funktion, die alle neuen Attachment-Links anpasst | |||
function updateAttachmentLinks() { | |||
// Alle Download-Links in der Datei-Liste | |||
function | $('.attachments-filelist a.oojsplus-data-gridWidget-url-button') | ||
.attr('target','_blank') | |||
.attr('rel','noopener noreferrer'); | |||
} | |||
// beim Seiten-Load einmal ausführen | |||
$(updateAttachmentLinks); | |||
// und mit MutationObserver auf nachträglich geladene Links achten | |||
var container = document.querySelector('.attachments-filelist'); | |||
if (container) { | |||
new MutationObserver(function (mutations) { | |||
updateAttachmentLinks(); | |||
}).observe(container, { childList: true, subtree: true }); | |||
}) | |||
} | } | ||
})(); | })(); |
Aktuelle Version vom 18. Juni 2025, 20:25 Uhr
mw.loader.using(['jquery'], function () {
$(document).ready(function () {
$('.smw-column-header').each(function () {
// aktuellen HTML-Inhalt holen
var html = $(this).html();
// "Fortsetzung" entfernen, Leerzeichen ggf. bereinigen
var newHtml = html.replace(/Fortsetzung/g, '').trim();
// falls nach dem Entfernen gar kein Text übrig ist, komplette Header-Box ausblenden:
if (newHtml === '') {
$(this).hide();
} else {
// ansonsten nur den Text überschreiben, sodass z. B. "B Fortsetzung" → "B" wird
$(this).html(newHtml);
}
});
$(function () {
$('<style>')
.prop('type', 'text/css')
.html(
'.breadcrumb-item { font-size: 17px !important; }' +
'.breadcrumb-nav { border-bottom: 2px solid #85bc20!important; margin-bottom: 20px !important; }'
)
.appendTo('head');
});
});
});
$(function() {
// 1) Klick merken
$('body').on('click', 'a.mws-tree-item-label', function() {
try {
window.name = JSON.stringify({ lastNav: this.getAttribute('href') });
} catch (e) {}
});
// 2) Polling & Aufklappen + Inline‐Styling
var attempts = 0,
interval = setInterval(function() {
attempts++;
var data = {};
try {
data = JSON.parse(window.name || '{}');
} catch (e) {}
var last = data.lastNav;
if (!last || attempts > 10) {
clearInterval(interval);
return;
}
var $link = $('a.mws-tree-item-label[href="' + last + '"]');
if ($link.length) {
clearInterval(interval);
// Zweige aufklappen
$link.parents('li.mws-tree-item').each(function() {
var $exp = $(this).children('div').children('a.mws-tree-expander.collapsed');
if ($exp.length) {
$exp.trigger('click');
}
});
// Inline‐Styles setzen
$link.css({
'background-color': '#eef',
'font-weight': 'bold',
'color': '#000',
'border-left': '3px solid #98A7C4',
'padding-left': '0.5em'
});
// optional scrollen
$('html, body').scrollTop($link.offset().top - 80);
}
}, 300);
});
$(function(){
// In allen Category-Ausgaben: jede LI, die einen <a class="new"> enthält, entfernen
$('.smw-columnlist-container a.new').each(function(){
$(this).closest('li').remove();
});
});
$(function(){
// 1. Rote Links raus (wie gehabt)
$('.smw-columnlist-container a.new').each(function(){
$(this).closest('li').remove();
});
// 2. Jetzt jede Buchstaben-Überschrift entfernen, deren Liste leer ist
$('.smw-column-header').each(function(){
var $header = $(this),
$ul = $header.next('ul');
if ($ul.length && $ul.children('li').length === 0) {
$ul.remove();
$header.remove();
}
});
});
// attachments immer in neuem Tab öffnen
(function () {
// Hilfs-Funktion, die alle neuen Attachment-Links anpasst
function updateAttachmentLinks() {
// Alle Download-Links in der Datei-Liste
$('.attachments-filelist a.oojsplus-data-gridWidget-url-button')
.attr('target','_blank')
.attr('rel','noopener noreferrer');
}
// beim Seiten-Load einmal ausführen
$(updateAttachmentLinks);
// und mit MutationObserver auf nachträglich geladene Links achten
var container = document.querySelector('.attachments-filelist');
if (container) {
new MutationObserver(function (mutations) {
updateAttachmentLinks();
}).observe(container, { childList: true, subtree: true });
}
})();