View text source at Wikipedia
Pages transcluding templates called with duplicate arguments are listed in Category:Pages using duplicate arguments in template calls. Examples of duplicate arguments are {{Foo|name=Bob|birth_date=Today|name=Jack}}
or {{Foo|Bob|Today|1=Jack}}
This script assists editors with finding the duplicate arguments within a particular page.
importScript('User:Frietjes/findargdups.js'); // [[User:Frietjes/findargdups]]
ctrl+R
or the equivalent for your browser).To install on another Wikipedia, use
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Frietjes/findargdups.js&action=raw&ctype=text/javascript');
Find dups
link in the Tools
section on the left side of the page.If the warning message appears for the page you are currently editing, but the script fails to provide a popup, then you have encountered a case not considered by the script's author, or a bug, and you should report this on the talk page so it can be fixed (or a reason can be given for not fixing it).
For editors interested in better understanding how the script works, the following is a general overview of how it works. The script does the following:
mytxt
){{{foo|}}}
.mytxt
into an array of strings where the split points are any double braces.tlist
. This step is performed repeatedly (up to 10 times) to try to unnest all the templates on the page.tlist
)
tlist
.To change the default edit summary, define findargdupseditsummary
in your common.js script page before the script is imported. For example,
findargdupseditsummary = 'Remove from [[:Category:Pages using duplicate arguments in template calls]]';
importScript('User:Frietjes/findargdups.js'); // [[User:Frietjes/findargdups]]
To disable this feature, use an empty string (findargdupseditsummary = '';
).
On some browsers, like Google Chrome, the text in the alert box cannot be copied/selected for searching. To add an additional results box with selectable text, define findargdupsresultsbox
in your common.js script page before the script is imported. For example,
findargdupsresultsbox = 'yes';
importScript('User:Frietjes/findargdups.js'); // [[User:Frietjes/findargdups]]
By default, the script issues a bubble notification when no duplicates are found. If you would like to change this message, define findargdupsnonefound
in your common.js script page before the script is imported. For example,
findargdupsnonefound = 'No dupes!';
importScript('User:Frietjes/findargdups.js'); // [[User:Frietjes/findargdups]]
To disable this message, define findargdupsnonefound
to be an empty string (findargdupsnonefound = '';
)
To change the default messages and link text, define findargdupseditsummary
, findargdupslinktext
, findargdupsmorefound
, and findargdupsnonefound
in your common.js script page before the script is imported. For example, for French,
findargdupslinktext = 'Arguments dupliqués';
findargdupsmoretext = 'Il existe d\'autres arguments dupliqués, corrigez en quelques-uns et exécutez à nouveau !';
findargdupseditsummary = 'Nettoyage des [[:Catégorie:Page utilisant des arguments dupliqués dans les appels de modèle|arguments dupliqués dans les appels de modèle]] avec [[:en:User:Frietjes/findargdups|findargdups]]';
findargdupsnonefound = 'Aucun doublon n\'a été trouvé !';
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Frietjes/findargdups.js&action=raw&ctype=text/javascript');
or for Latvian
findargdupslinktext = 'Atrast dublikātus';
findargdupsmoretext = 'Atrasti vēl vairāki dublikāti, salabo dažus un palaid vēlreiz!';
findargdupseditsummary = 'Izlaboti [[:Kategorija:Lapas ar vairākiem viena argumenta izsaukumiem veidnēs|argumenti]], izmantojot [[:en:User:Frietjes/findargdups|findargdups]]';
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Frietjes/findargdups.js&action=raw&ctype=text/javascript');