Content deleted Content added
update to File:OOjs UI icon edit-ltr-progressive.svg - see talk |
update from Module:EditAtWikidata/sandbox per talk: tweaks + greatly reduce memory usage + class=noprint |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1:
-- Module to display an icon with a tooltip such as "Edit this at Wikidata".
-- Icon
-- This message is only displayed if a local_parameter is not supplied
-- i.e. when called from a template, it can be coded not to display the message.
-- The qid of a Wikidata entry can optionally be supplied for testing outside the article.
-- Usage:
Line 16 ⟶ 15:
}
-- Return trimmed non-empty text, or nil.
if type(text) == 'string' then
return text:match('(%S.-)%s*$')
end
end
function p._showMessage(args)
if local_parm then return "" end
--
-- This
local qid =
if qid and mw.wikibase.entityExists(qid
-- Parameter pid=x uses x as an anchor in the link to the Wikidata entry.
local anchor = trimToNil(args.pid)
-- Parameter nbsp replaces the leading space with
return
"
i18n.message ..▼
"
"|link=https://www.wikidata.org/wiki/" .. qid ..
▲ thisQid ..
(
"|class=noprint" ..
▲ "|" .. i18n.message ..
"]]"
end
return ""
end
function p.showMessage(frame)
return p._showMessage(frame.args)
end
|