Module:DependencyList: Difference between revisionsGive feedback
osrsw>Shoyrukon m Protected "Module:DependencyList" ([Edit=Only allow autoconfirmed users] (indefinite) [Move=Only allow autoconfirmed users] (indefinite)) |
osrsw>CephHunter Sync with rs3 |
||
| Line 76: | Line 76: | ||
namespace = 'Module', | namespace = 'Module', | ||
titlematch = query, | titlematch = query, | ||
nottitlematch = '%/doc | nottitlematch = '%/doc|'..query..'/%', | ||
distinct = 'strict', | distinct = 'strict', | ||
ignorecase = true, | ignorecase = true, | ||
| Line 524: | Line 524: | ||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
-- Leave early if not in module, template or calculator namespace or if module is part of exchange | -- Leave early if not in module, template or calculator namespace or if module is part of exchange groups | ||
if param.is_empty( currentPageName ) and ( | if param.is_empty( currentPageName ) and ( | ||
( not enum.contains( {'Module', 'Template', 'Calculator'}, title.nsText ) ) or | ( not enum.contains( {'Module', 'Template', 'Calculator'}, title.nsText ) ) or | ||
( title.nsText == 'Module' and ( enum.contains( {'Exchange', 'Exchange historical | ( title.nsText == 'Module' and ( enum.contains( {'Exchange', 'Exchange historical'}, title.text:match( '^(.-)/' ) ) ) ) | ||
) then | ) then | ||
return '' | return '' | ||
| Line 537: | Line 537: | ||
addCategories = yn( param.default_to( addCategories, title.subpageText~='doc' ) ) | addCategories = yn( param.default_to( addCategories, title.subpageText~='doc' ) ) | ||
moduleIsUsed = yn( param.default_to( isUsed, false ) ) | moduleIsUsed = yn( param.default_to( isUsed, false ) ) | ||
if title.text:match( '^(.-)/' ) == 'Sandbox' then | |||
moduleIsUsed = true -- Don't show sandbox modules as unused | |||
end | |||
if currentPageName:find( '^Template:' ) or currentPageName:find( '^Calculator:' ) then | if currentPageName:find( '^Template:' ) or currentPageName:find( '^Calculator:' ) then | ||
| Line 554: | Line 558: | ||
namespace = 'Module', | namespace = 'Module', | ||
linksto = currentPageName, | linksto = currentPageName, | ||
nottitlematch = '%/doc | nottitlematch = '%/doc|Exchange/%|Exchange historical/%|' .. currentPageName:gsub( 'Module:', '' ), | ||
distinct = 'strict', | distinct = 'strict', | ||
ignorecase = true, | ignorecase = true, | ||
| Line 581: | Line 585: | ||
usedTemplateList = enum.map( usedTemplateList, function( templateName ) | usedTemplateList = enum.map( usedTemplateList, function( templateName ) | ||
if | if string.find( templateName, ':' ) then -- Real templates are prefixed by a namespace, magic words are not | ||
return '[['..templateName..']]' | return '[['..templateName..']]' | ||
else | else | ||