Modul:Location map: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Hidayatsrf (bicara | kontrib) fix |
-require('Module:No globals') |
||
(4 revisi perantara oleh 2 pengguna tidak ditampilkan) | |||
Baris 1:
local p = {}
Baris 76 ⟶ 74:
if decimal then
if degrees then
error('
elseif minutes then
error('
elseif seconds then
error('
elseif hemisphere then
error('
end
local retval = tonumber(decimal)
Baris 90 ⟶ 88:
error('Nilai "' .. decimal .. '" yang disediakan untuk ' .. direction .. ' tidak sah', 2)
elseif seconds and not minutes then
error('
elseif not degrees then
if minutes then
error('
elseif hemisphere then
error('
end
return nil
Baris 111 ⟶ 109:
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('
end
decimal = decimal * multiplier
Baris 228 ⟶ 226:
image,
width,
args.alt or ((args.label or currentTitle.text) .. '
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 .. '[[
end
end
Baris 281 ⟶ 279:
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[
end
end
Baris 291 ⟶ 289:
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[
end
end
Baris 297 ⟶ 295:
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[
end
end
Baris 433 ⟶ 431:
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[
end
end
if not longitude then
error('
elseif not latitude then
error('
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[
end
if args.skew or args.lon_shift or args.markhigh then
Baris 477 ⟶ 475:
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[
end
end
Baris 499 ⟶ 497:
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[
end
end
Baris 558 ⟶ 556:
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images
end
if #caption_list > #map then
error(string.format('%d captions
end
local outputs = {}
|