מייבאים כמותיים, בדוקי עריכות אוטומטית, ביוראקראטן, אינטערפעיס רעדאקטארן, emailconfirmed, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, סיסאפן, צוות טכני, מייבאים, מעדכנים, אספקלריה רעדאקטארן
102,362
רעדאגירונגען
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 33: | שורה 33: | ||
function displaytitle (s, notes) | function displaytitle (s, notes) | ||
local l = "[[געאגראפישע קאארדינאטן|קאארדינאטן]]: " .. s | local l = "[[געאגראפישע קאארדינאטן|קאארדינאטן]]: " .. s | ||
local co = '<span id="coordinates">' .. l .. notes .. '</span>'; | local co = '<span id="coordinates" style="font-size: small;">' .. l .. notes .. '</span>'; | ||
return ' | |||
return globalFrame:extensionTag{ | |||
name = 'indicator', | |||
content = co, | |||
args = { name = '0-coord' } | |||
}; | |||
end | end | ||
| שורה 601: | שורה 606: | ||
text = text .. displaytitle(contents, Notes) | text = text .. displaytitle(contents, Notes) | ||
-- Add a Wikidata category for mainspace pages. | -- Add a Wikidata category for mainspace pages. | ||
if mw.wikibase and current_page.namespace == 0 then | if mw.wikibase and current_page.namespace == 0 and mw.wikibase.getEntityIdForCurrentPage() then | ||
local wikidata_cat | local wikidata_cat | ||
local | local wd_coord = mw.wikibase.getBestStatements( mw.wikibase.getEntityIdForCurrentPage(), 'P625' ) | ||
if | local snaktype | ||
-- fallback to P159 | |||
if | if not (wd_coord and wd_coord[1]) then | ||
wd_coord = mw.wikibase.getBestStatements( mw.wikibase.getEntityIdForCurrentPage(), 'P159' ) | |||
if #wd_coord > 0 and wd_coord[1].qualifiers and wd_coord[1].qualifiers and wd_coord[1].qualifiers['P625'] then | |||
snaktype = wd_coord[1].qualifiers['P625'][1].snaktype | |||
end | end | ||
else | |||
snaktype= wd_coord[1].mainsnak.snaktype | |||
end | |||
if snaktype == 'value' then | |||
wikidata_cat = '[[קאטעגאריע:קאארדינאטן אויף וויקידאטא]]' -- coordinates exist both here and on Wikidata, and can be compared | |||
else | else | ||
wikidata_cat = '[[קאטעגאריע:קאארדינאטן נישט אויף וויקידאטא]]' -- we have to either import the coordinates to Wikidata or remove them here | wikidata_cat = '[[קאטעגאריע:קאארדינאטן נישט אויף וויקידאטא]]' -- we have to either import the coordinates to Wikidata or remove them here | ||
| שורה 635: | שורה 643: | ||
if frame.args[1] == "latitude" or frame.args[1] == "longitude" or frame.args[1] == "precision" or frame.args[1] == "dimension" or frame.args[1] == "globe" then | if frame.args[1] == "latitude" or frame.args[1] == "longitude" or frame.args[1] == "precision" or frame.args[1] == "dimension" or frame.args[1] == "globe" then | ||
local claimName = args['claim'] or 'P625' | local claimName = args['claim'] or 'P625' | ||
local entityId = mw.wikibase.getEntityIdForCurrentPage() | |||
if entityId == nil then return nil end | |||
local wd_coord = mw.wikibase.getBestStatements( entityId, claimName ) | |||
if wd_coord==nil or #wd_coord==0 then return nil end | |||
myValue = wd_coord[1] | |||
local qualifierId = args['qualifier'] | |||
if qualifierId then | |||
myValue = myValue.qualifiers[qualifierId][1].datavalue.value[frame.args[1]] | |||
else | |||
myValue = myValue.mainsnak.datavalue.value[frame.args[1]] | |||
end | |||
if frame.args[1] == "globe" then | |||
globeId = mw.ustring.match( myValue, "Q%d+" ) | |||
myValue = myGlobes[globeId] | |||
end | |||
return myValue | |||
else | else | ||
return nil | return nil | ||
רעדאגירונגען