Module:DependencyList: Difference between revisions

mNo edit summary
No edit summary
Line 39: Line 39:
     query = table.concat( query )
     query = table.concat( query )
     query = query:gsub( '^[Mm]odule:', '' )
     query = query:gsub( '^[Mm]odule:', '' )
    if query:lower():find( '^exchange/' ) then
        return { 'Module:' .. query }  -- This format will later be used by formatDynamicQueryLink()
    end


     if dynamicRequireListQueryCache[ query ] then
     if dynamicRequireListQueryCache[ query ] then
Line 166: Line 162:
                     if name:find( ':' ) then
                     if name:find( ':' ) then
                         local ns = name:match( '^(.-):' )
                         local ns = name:match( '^(.-):' )
                         if enum.contains( {'', 'template', 'calculator', 'user'}, ns:lower() ) then
                         if enum.contains( {'', 'template', 'user'}, ns:lower() ) then
                             table.insert( usedTemplateList, name )
                             table.insert( usedTemplateList, name )
                         elseif ns == ns:upper() then
                         elseif ns == ns:upper() then
Line 503: Line 499:


     if param.is_empty( currentPageName ) and (
     if param.is_empty( currentPageName ) and (
     ( title.nsText ~= 'Module'  and title.nsText ~= 'Template' and title.nsText ~= 'Calculator') or
     ( title.nsText ~= 'Module'  and title.nsText ~= 'Template') or
     ( title.nsText == 'Module' and ( title.text:find( '^Exchange/' ) or title.text:find( '^Exchange historical/' ) or title.text:find( '^Sandbox/' ) ) ) ) then
     ( title.text:find( '^Sandbox/' ) ) ) then
         return ''
         return ''
     end
     end
Line 515: Line 511:
     moduleIsUsed = yn( param.default_to( isUsed, false ) )
     moduleIsUsed = yn( param.default_to( isUsed, false ) )


     if currentPageName:find( '^Template:' ) or currentPageName:find( '^Calculator:' ) then
     if currentPageName:find( '^Template:' ) then
         local invokeList = getInvokeCallList( currentPageName )
         local invokeList = getInvokeCallList( currentPageName )
         return formatInvokeCallList( currentPageName, addCategories, invokeList )
         return formatInvokeCallList( currentPageName, addCategories, invokeList )
Line 521: Line 517:


     local whatTemplatesLinkHere, whatModulesLinkHere = dpl.ask( {
     local whatTemplatesLinkHere, whatModulesLinkHere = dpl.ask( {
         namespace = 'Template|Calculator',
         namespace = 'Template',
         linksto = currentPageName,
         linksto = currentPageName,
         distinct = 'strict',
         distinct = 'strict',
Line 531: Line 527:
         namespace = 'Module',
         namespace = 'Module',
         linksto = currentPageName,
         linksto = currentPageName,
         nottitlematch = '%/doc|%sandbox%|Exchange/%|Exchange historical/%|' .. currentPageName:gsub( 'Module:', '' ),
         nottitlematch = '%/doc|%sandbox%|' .. currentPageName:gsub( 'Module:', '' ),
         distinct = 'strict',
         distinct = 'strict',
         ignorecase = true,
         ignorecase = true,