Skip to content

Instantly share code, notes, and snippets.

@smasongarrison
Last active July 19, 2025 22:23
Show Gist options
  • Select an option

  • Save smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114 to your computer and use it in GitHub Desktop.

Select an option

Save smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114 to your computer and use it in GitHub Desktop.

Revisions

  1. smasongarrison revised this gist Jul 19, 2025. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,8 @@
    // @version 1.0
    // @description Auto-fills Cat-a-lot edit summary on category-related pages
    // @match https://en.wikipedia.org/wiki/Category:*
    // @include /^https:\/\/en\.wikipedia\.org\/w\/index\.php\?.*(title=Category:|search=Category:).*/
    // @match https://en.wikipedia.org/w/index.php?search=*
    // @match https://en.wikipedia.org/w/index.php?title=Category:
    // @downloadURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @updateURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @grant none
    @@ -21,5 +22,5 @@
    if (box && !box.value.trim()) {
    box.value = stringToInsert;
    }
    }, 500); // wait .5 seconds
    }, 1400); // wait 1.4 seconds
    })();
  2. smasongarrison revised this gist Jul 12, 2025. No changes.
  3. smasongarrison revised this gist Jul 12, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -21,5 +21,5 @@
    if (box && !box.value.trim()) {
    box.value = stringToInsert;
    }
    }, 2000); // wait 2 seconds
    }, 500); // wait .5 seconds
    })();
  4. smasongarrison revised this gist Jul 12, 2025. 1 changed file with 4 additions and 15 deletions.
    19 changes: 4 additions & 15 deletions Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    // @namespace user-custom
    // @version 1.0
    // @description Auto-fills Cat-a-lot edit summary on category-related pages
    // @include /^https:\/\/en\.wikipedia\.org\/wiki\/Category:.*/
    // @include /^https:\/\/en\.wikipedia\.org\/w\/index\.php\?.*(title=Category:|search=Category:).*/
    // @match https://en.wikipedia.org/wiki/Category:*
    // @include /^https:\/\/en\.wikipedia\.org\/w\/index\.php\?.*(title=Category:|search=Category:).*/
    // @downloadURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @updateURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @grant none
    @@ -16,21 +16,10 @@
    const selector = '#cat_a_lot_comment';
    const stringToInsert = 'Diffusing per [[WP:DIFFUSE]] and/or [[WP:ALLINCLUDED]]';

    const fillIfEmpty = () => {
    setTimeout(() => {
    const box = document.querySelector(selector);
    if (box && !box.value.trim()) {
    box.value = stringToInsert;
    }
    };

    const observer = new MutationObserver(() => {
    const box = document.querySelector(selector);
    if (box) {
    fillIfEmpty();
    observer.disconnect();
    }
    });

    observer.observe(document.body, { childList: true, subtree: true });
    window.addEventListener('load', fillIfEmpty);
    }, 2000); // wait 2 seconds
    })();
  5. smasongarrison revised this gist Jul 12, 2025. No changes.
  6. smasongarrison revised this gist Jul 12, 2025. 1 changed file with 11 additions and 9 deletions.
    20 changes: 11 additions & 9 deletions Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,9 @@
    // @name Wikipedia Classic Edit Summary Autofill
    // @namespace user-custom
    // @version 1.0
    // @description Appends default summary text to the classic Wikipedia edit summary box
    // @match https://*.wikipedia.org/w/index.php?title=*&action=edit
    // @description Auto-fills Cat-a-lot edit summary on category-related pages
    // @include /^https:\/\/en\.wikipedia\.org\/wiki\/Category:.*/
    // @include /^https:\/\/en\.wikipedia\.org\/w\/index\.php\?.*(title=Category:|search=Category:).*/
    // @downloadURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @updateURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @grant none
    @@ -12,23 +13,24 @@
    (function() {
    'use strict';

    const selector = '#wpSummary'; // The classic edit summary input field
    const stringToAppend = ' - minor copyedit for clarity'; // The string you want to add
    const selector = '#cat_a_lot_comment';
    const stringToInsert = 'Diffusing per [[WP:DIFFUSE]] and/or [[WP:ALLINCLUDED]]';

    const updateTextbox = () => {
    const fillIfEmpty = () => {
    const box = document.querySelector(selector);
    if (box && !box.value.includes(stringToAppend)) {
    box.value += stringToAppend;
    if (box && !box.value.trim()) {
    box.value = stringToInsert;
    }
    };

    const observer = new MutationObserver(() => {
    const box = document.querySelector(selector);
    if (box) {
    updateTextbox();
    observer.disconnect(); // Done
    fillIfEmpty();
    observer.disconnect();
    }
    });

    observer.observe(document.body, { childList: true, subtree: true });
    window.addEventListener('load', fillIfEmpty);
    })();
  7. smasongarrison revised this gist Jul 11, 2025. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@
    // @version 1.0
    // @description Appends default summary text to the classic Wikipedia edit summary box
    // @match https://*.wikipedia.org/w/index.php?title=*&action=edit
    // @downloadURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @updateURL https://gist.github.com/smasongarrison/cf44eb29a3c862ffccfbec1b97e9e114/raw/Classic_Edit_Summary_Autofill.js
    // @grant none
    // ==/UserScript==

  8. smasongarrison created this gist Jul 11, 2025.
    32 changes: 32 additions & 0 deletions Classic_Edit_Summary_Autofill.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    // ==UserScript==
    // @name Wikipedia Classic Edit Summary Autofill
    // @namespace user-custom
    // @version 1.0
    // @description Appends default summary text to the classic Wikipedia edit summary box
    // @match https://*.wikipedia.org/w/index.php?title=*&action=edit
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';

    const selector = '#wpSummary'; // The classic edit summary input field
    const stringToAppend = ' - minor copyedit for clarity'; // The string you want to add

    const updateTextbox = () => {
    const box = document.querySelector(selector);
    if (box && !box.value.includes(stringToAppend)) {
    box.value += stringToAppend;
    }
    };

    const observer = new MutationObserver(() => {
    const box = document.querySelector(selector);
    if (box) {
    updateTextbox();
    observer.disconnect(); // Done
    }
    });

    observer.observe(document.body, { childList: true, subtree: true });
    })();