|
|
| Zeile 1: |
Zeile 1: |
| // | | /* Icon für Sidebar-Portlet "Werkzeuge" */ |
| // Sidebar‑Manipulation (Werkzeugkasten erweitern)
| | #p-Werkzeuge .vector-menu-heading::before { |
| //
| | content: ""; |
| function ModifySidebar(action, section, name, link) {
| | display: inline-block; |
| try {
| | width: 1.2em; |
| var target = 'p-' + section;
| | height: 1.2em; |
| if (section === 'languages') target = 'p-lang';
| | margin-right: 0.05em; |
| if (section === 'toolbox') target = 'p-tb';
| | background-image: url("/Wiki_BlueX/images/7/75/MediaWiki-extensions-icon.png"); |
| if (section === 'navigation') target = 'p-navigation';
| | background-size: contain; |
| | | background-repeat: no-repeat; |
| var list = document.getElementById(target)
| | vertical-align: -0.18em; |
| ?.getElementsByTagName('div')[0]
| |
| ?.getElementsByTagName('ul')[0];
| |
| | |
| if (!list) return;
| |
| | |
| if (action === 'add') {
| |
| var aNode = document.createElement('a');
| |
| var liNode = document.createElement('li');
| |
| | |
| aNode.appendChild(document.createTextNode(name));
| |
| aNode.setAttribute('href', link);
| |
| liNode.appendChild(aNode);
| |
| liNode.className = 'plainlinks';
| |
| list.appendChild(liNode);
| |
| }
| |
| | |
| if (action === 'remove') {
| |
| var items = list.getElementsByTagName('li');
| |
| for (var i = 0; i < items.length; i++) {
| |
| var a = items[i].getElementsByTagName('a')[0];
| |
| if (a && (a.innerHTML === name || a.href === link)) {
| |
| list.removeChild(items[i]);
| |
| }
| |
| }
| |
| }
| |
| } catch (e) {
| |
| return;
| |
| }
| |
| } | | } |
|
| |
| function CustomizeModificationsOfSidebar() {
| |
| // Toolbox‑Einträge für BlueX
| |
| ModifySidebar('add', 'toolbox', 'Textbausteine', '/Wiki_BlueX/index.php/Kategorie:Textbausteine');
| |
| ModifySidebar('add', 'toolbox', 'Letzte Änderungen', '/Wiki_BlueX/index.php/Spezial:Letzte_Änderungen');
| |
| ModifySidebar('add', 'toolbox', 'Alle Seiten', '/Wiki_BlueX/index.php/Spezial:Alle_Seiten');
| |
| ModifySidebar('add', 'toolbox', 'Zufällige Seite', '/Wiki_BlueX/index.php/Spezial:Zufällige_Seite');
| |
| }
| |
|
| |
| jQuery(CustomizeModificationsOfSidebar);
| |
/* Icon für Sidebar-Portlet "Werkzeuge" */
- p-Werkzeuge .vector-menu-heading::before {
content: "";
display: inline-block;
width: 1.2em;
height: 1.2em;
margin-right: 0.05em;
background-image: url("/Wiki_BlueX/images/7/75/MediaWiki-extensions-icon.png");
background-size: contain;
background-repeat: no-repeat;
vertical-align: -0.18em;
}