|
|
| (6 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| /**
| | $(document).ready(function() { |
| * Winds of Valen Wiki - Common JS
| | $('#ca-nstab-main a').text('Article'); |
| * 1. Force the main nav sidebar to appear pinned (like OSRS wiki)
| | $('#ca-history a').text('History'); |
| * 2. Prevent dark mode extensions from inverting the color scheme
| | $('#ca-view a').text('Read'); |
| */
| |
| | |
| // --- Force light color scheme ---
| |
| (function () { | |
| var m = document.createElement('meta');
| |
| m.name = 'color-scheme';
| |
| m.content = 'light only';
| |
| document.head.insertBefore(m, document.head.firstChild);
| |
| document.documentElement.style.colorScheme = 'light';
| |
| }());
| |
| | |
| // --- Fix the html class: switch pinned-disabled to pinned-enabled ---
| |
| (function () { | |
| var html = document.documentElement; | |
| html.className = html.className
| |
| .replace('vector-feature-main-menu-pinned-disabled', 'vector-feature-main-menu-pinned-enabled');
| |
| }());
| |
| | |
| // --- Move the main menu DOM from the dropdown into the pinned sidebar slot ---
| |
| document.addEventListener('DOMContentLoaded', function () {
| |
| var pinned = document.getElementById('vector-main-menu-pinned-container'); | |
| var unpinned = document.getElementById('vector-main-menu-unpinned-container');
| |
| | |
| if (pinned && unpinned && unpinned.children.length > 0 && pinned.children.length === 0) { | |
| while (unpinned.firstChild) {
| |
| pinned.appendChild(unpinned.firstChild);
| |
| }
| |
| }
| |
| | |
| // Also hide the hamburger dropdown button since sidebar is now visible
| |
| var hamburger = document.getElementById('vector-main-menu-dropdown');
| |
| if (hamburger) hamburger.style.display = 'none';
| |
| }); | | }); |