Modhul:Location map: Béda antara owahan

Konten dihapus Konten ditambahkan
Sunshroom17 (parembugan | pasumbang)
Tanpa ringkesan besutan
c Besutané Danangtrihartanto (rembugan) dipulihaké ing révisi pungkasan garapané Wirjadisastra
Tenger: Pambalèkan
 
Larik 28:
else
return mapData[name]
end
end
elseif mw.title.new('Template:Location map ' .. map).exists then
local cache = {}
if type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function' then
error('A frame must be provided when using a legacy location map')
end
return function(name, params)
if params then
return frame:expandTemplate{title = 'Location map ' .. map, args = { name, unpack(params) }}
else
if name == nil then
return 'Template:Location map ' .. map
elseif cache[name] == nil then
cache[name] = frame:expandTemplate{title = 'Location map ' .. map, args = { name }}
end
return cache[name]
end
end
else
error('Unable to find the specified location map definition:. Neither "Module:Location map/data/' .. map .. '" doesnor not"Template:Location map ' .. map .. '" existexists', 2)
end
end
Baris 193 ⟶ 210:
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s]]',
Baris 199 ⟶ 215:
image,
width,
args.alt or ((args.label or currentTitlemw.title.getCurrentTitle().text) .. ' is locatedkapernah ining ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
Baris 222 ⟶ 238:
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
Baris 230 ⟶ 246:
end
retval = retval
.. (args.caption or (args.label or currentTitlemw.title.getCurrentTitle().text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
Baris 240 ⟶ 256:
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">ShowTuduhaké map ofkar ' .. map('name') .. '</span>'
end
Baris 251 ⟶ 267:
end
mw.logObject(args, 'args')
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
local key = (map('skew') ~= '' and 'skew' or '') ..
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
Baris 321 ⟶ 331:
spanCss = 'float:left'
end
builder = builder:tag('divspan')
:css('display', 'inline')
:cssText('padding:1px')
:cssText(spanCss)
Baris 390 ⟶ 399:
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
Baris 406 ⟶ 413:
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
Baris 416 ⟶ 420:
error('No value was provided for latitude')
end
local builder = mw.html.create()
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if args.skew or args.lon_shift or args.markhigh then
Baris 436 ⟶ 439:
end
mw.logObject(args, 'args')
local key = (args.markhighskew and 'markhighskew' or '') ..
if currentTitle.namespace == 0 then
local key = (args.skewlon_shift and 'skewlon_shift' or '') ..
(args.lon_shiftmarkhigh and 'lon_shiftmarkhigh' or '') ..
builder:wikitext('[[Category:Location maps with linkedremoved markersparameters|' with.. coordinateskey from..' Wikidata]]')
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
Baris 460 ⟶ 461:
end
mw.logObject(args, 'args')
local key = frame:preprocess('{{FULLPAGENAME}}')
if currentTitle.namespace == 0 then
builder:wikitext('[[Category:Location maps with removedmarks parametersoutside map and outside parameter not set|' .. key .. ' ]]')
local key = frame:preprocess('{{FULLPAGENAME}}')
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')