Module:Official website: Difference between revisions

Content deleted Content added
remove mobile and flash options, 50 uses in 300k does not support the additional complexity
 
(3 intermediate revisions by 3 users not shown)
Line 45:
-- Get objects for all official sites on Wikidata.
local websites = quickPcall(function ()
return mw.wikibase.getEntityObjectgetAllStatements()mw.claimswikibase.getEntityIdForCurrentPage(), 'P856')
end)
 
Line 88:
local function renderUrl(options)
if not options.url and not options.wikidataurl then
local entityqid = mw.wikibase.getEntityObjectgetEntityIdForCurrentPage() or {}
local qid = entity.id
local result = '<strong class="error">' ..
'No URL found. Please specify a URL here or add one to Wikidata.' ..
Line 104 ⟶ 103:
)
if options.wikidataurl and not options.url then
local entityqid = mw.wikibase.getEntityObjectgetEntityIdForCurrentPage() or {}
local qid = entity.id
if qid then
ret[#ret + 1] = '[[File:BlueOOjs pencilUI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/' .. qid .. '#P856|Edit this at Wikidata]]'
end
end
if options.format == 'flash' then
ret[#ret + 1] = mw.getCurrentFrame():expandTemplate{
title = 'Link note',
args = {note = 'Requires [[Adobe Flash Player]]'}
}
end
if options.mobile then
ret[#ret + 1] = '(' .. makeUrl(options.mobile, 'Mobile') .. ')'
end
return table.concat(ret, ' ')
Line 148 ⟶ 137:
url = url,
wikidataurl = wikidataurl,
display = args[2] or args.name or 'Official website',
format = args.format,
mobile = args.mobile
}
return formattedUrl .. renderTrackingCategory(url, wikidataurl)