Module:EditAtWikidata/sandbox: Difference between revisions

Content deleted Content added
tweaks to clean code while retaining Snævar's performance fix; will restore Nardog's noprint when exact html is decided on talk
fix omitted word
 
(2 intermediate revisions by the same user not shown)
Line 1:
-- Module to display an icon with a tooltip such as "Edit this at Wikidata".
-- Icon will beis linked to the Wikidata entry for the article where this is placed.
-- 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.
Line 32:
local anchor = trimToNil(args.pid)
-- Parameter nbsp replaces the leading space with  
local space = trimToNil(args.nbsp) and " " or " "
if trimToNil(args.nbsp) then
space = " "
else
space = " "
end
return
space ..
"[[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=" ..
"|alt=" .. i18n.message ..
" |link=https://www.wikidata.org/wiki/" .. qid ..
qid ..
(anchor and ("#" .. anchor) or "") ..
"|class=noprint" ..
"|" .. i18n.message ..
"]]"
end