Module:Favilink: Difference between revisions

448 bytes added ,  20:33, 7 January 2020
split main favilink to its own main function that cannot be individually called, added modulefavilink that allows direct calling that does not require frame usage
No edit summary
(split main favilink to its own main function that cannot be individually called, added modulefavilink that allows direct calling that does not require frame usage)
Line 4: Line 4:
local colorparse = require'Module:ColorParse'
local colorparse = require'Module:ColorParse'
local util = require'Module:Favilink Utility'
local util = require'Module:Favilink Utility'
local util_args = require('Module:Args Utility')


function p.favilink(frame, searchtype)
function p.favilink(frame, searchtype)
local displayname_tooltip_override = false


--[Getting query results...]
--[Getting query results...]
Line 26: Line 26:
end
end


local result = util.favilink(name, searchtype)
return main(name, searchtype, modifier)
 
end
 
function p.modulefavilink(name, searchtype, modifier)
  searchtype = searchtype or 'PlainName'
  modifier = modifier or ''
  if name ~= nil and name ~= '' then
    return main(name, searchtype, modifier)
  else 
    error "There is no argument specified! [[Category:pages with favilink errors]]"
  end
end
 
function main(name, searchtype, modifier)
local displayname_tooltip_override = false
  local result = util.favilink(name, searchtype)


if result ~= nil then
if result ~= nil then
Line 82: Line 98:


return tostring(qudimage)
return tostring(qudimage)
end
end