User:Crazq/minerva.js

From the CreationKit Wiki
< User:Crazq
Revision as of 07:38, 8 November 2024 by Crazq (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
mw.hook('wikipage.content').add(function() {
    const editButton = document.querySelector('a#ca-edit');

    if (editButton) {
        // Видаляємо параметр "&section=0" з посилання
        editButton.href = editButton.href.replace(/&section=\d+/, "");

        // Змінюємо текст кнопки на "Редагувати код"
        editButton.innerText = "Редагувати код";

        // Змінюємо атрибут title
        editButton.title = "Редагувати всю сторінку";
    }
});