Content deleted Content added
added "text and pen" getUpdateLink style, single accessible link containing both text and decorative image for {{Video game reviews}} etc. |
Implementing MOS RFC. |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 45:
[184839] = 'N64',
[182172] = 'GC', -- Sometimes has been NGC
[19610114] = 'NS', -- Nintendo Switch
[98973368] = 'XSX/S', -- Xbox Series X and Series S (Output label differs from the input parameter, XSXS, per RFC)
[63184502] = 'PS5'
}
Line 77 ⟶ 79:
['GC'] = 182172,
['NGC'] = 182172,
['NS'] = 19610114,
['XSXS'] = 98973368, -- This is the template parameter, which cannot contain a / or | character.
['PS5'] = 63184502
}
Line 107 ⟶ 111:
local function sortByPlatform(a,b)
local platformA =
local platformB =
if(a['qualifiers']['P400'] ~= nil and
platformA = p.getSystemAlias(a['qualifiers']['P400'][1]['datavalue']['value']['numeric-id']);
if(platformA == nil) then
Line 265 ⟶ 269:
if(reviewscore['references'] ~= nil and reviewscore['references'][1] ~= nil and genRefs) then
local cite = buildCite(reviewscore['references'][1]
if(cite ~= nil) then
Line 352 ⟶ 356:
-- Check for a game parameter. If missing, default to current article.
if(iGame ~= nil and iGame ~= "") then
if(entities[iGame] == nil and mw.wikibase ~= nil) then
entities[iGame] = mw.wikibase.getEntity(iGame);
end;
Line 359 ⟶ 363:
else
-- Need to research if we can determine the entity's ID before retrieving it.
entities[entity['id']] = entity;
end;
end;
end;
Line 414 ⟶ 420:
return '[[d:'..entity['id']..'#P444|[±]]]';
elseif(updateLinkStyle == "text and pen") then
return '<span style="position: relative;"><span style="position: absolute; right: 0;">[[File:Blue pencil.svg|10px|baseline|link=|alt=]]</span>[[d:'..entity['id']..'#P444|<span style="position: relative; padding-right: 14px;">Edit on Wikidata</span>]]</span>'
end;
Line 448 ⟶ 454:
if(pubDates) then
for i,pubDate in pairs(pubDates) do
if(pubDate['mainsnak']['datavalue']) then
local timestamp = pubDate['mainsnak']['datavalue']['value']['time']; local accessdate = Date(timestamp);
table.insert(ret,accessdate);
end;
end;
end;
|