Description | Autofills "Preview page with this template" with the most relevant /testcases page that exists |
---|---|
Updated | May 4, 2023 (12 months ago) |
Browser support | Chrome, Firefox, etc. |
Source | User:Nardog/AutoTestcases.js |
This script fills in the "Preview page with this template" field with the closest /testcases page that exists when editing a template or module.
For example, if you're editing "Template:Foo/bar/baz" or "Template:Foo/bar/baz/sandbox", it checks for
and if any of them exist, it fills in the field with whichever comes first.
If you're editing "Module:Foo/bar" or "Module:Foo/bar/sandbox", it checks for
and if any of them exist, it fills in the field with whichever comes first.
If you're editing "Module:Foo/testcases", it fills in the field with "Module talk:Foo/testcases" even if it doesn't exist.
If the field is not empty when the script is run, it doesn't do anything.
Add the following to your common.js or global.js:
mw.loader.load('//en.wikipedia.org/?title=User:Nardog/AutoTestcases.js&action=raw&ctype=text/javascript');
Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.
Description | Autofills "Preview page with this template" with the most relevant /testcases page that exists |
---|---|
Updated | May 4, 2023 (12 months ago) |
Browser support | Chrome, Firefox, etc. |
Source | User:Nardog/AutoTestcases.js |
This script fills in the "Preview page with this template" field with the closest /testcases page that exists when editing a template or module.
For example, if you're editing "Template:Foo/bar/baz" or "Template:Foo/bar/baz/sandbox", it checks for
and if any of them exist, it fills in the field with whichever comes first.
If you're editing "Module:Foo/bar" or "Module:Foo/bar/sandbox", it checks for
and if any of them exist, it fills in the field with whichever comes first.
If you're editing "Module:Foo/testcases", it fills in the field with "Module talk:Foo/testcases" even if it doesn't exist.
If the field is not empty when the script is run, it doesn't do anything.
Add the following to your common.js or global.js:
mw.loader.load('//en.wikipedia.org/?title=User:Nardog/AutoTestcases.js&action=raw&ctype=text/javascript');
Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.