en:Module:Location map 22:04, 2 July 2015(UTC)より
template>K-iczn (en:Module:Location map 20:16, 27 April 2015(UTC)より) |
template>K-iczn (en:Module:Location map 22:04, 2 July 2015(UTC)より) |
||
158行目: | 158行目: | ||
end | end | ||
local retval = args.float == 'center' and '<div class="center">' or '' | local retval = args.float == 'center' and '<div class="center">' or '' | ||
if args.caption and args.caption ~= '' then | if args.caption and args.caption ~= '' and args.border ~= 'infobox' then | ||
retval = retval .. '<div class="noviewer thumb ' | retval = retval .. '<div class="noviewer thumb ' | ||
if args.float == '"left"' or args.float == 'left' then | if args.float == '"left"' or args.float == 'left' then | ||
212行目: | 212行目: | ||
local retval = '</div>' | local retval = '</div>' | ||
if not args.caption then | if not args.caption or args.border == 'infobox' then | ||
retval = retval .. '<div style="font-size:90%;padding-top:3px">' | if args.border then | ||
.. ((args.label or mw.title.getCurrentTitle().text) .. ' (' .. map('name') .. ')') | retval = retval .. '<div>' | ||
else | |||
retval = retval .. '<div style="font-size:90%;padding-top:3px">' | |||
end | |||
retval = retval | |||
.. (args.caption or (args.label or mw.title.getCurrentTitle().text) .. ' (' .. map('name') .. ')') | |||
.. '</div>' | .. '</div>' | ||
elseif args.caption ~= '' then | elseif args.caption ~= '' then | ||
224行目: | 229行目: | ||
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>' | retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>' | ||
elseif args.autoSwitcherLabel then | elseif args.autoSwitcherLabel then | ||
retval = retval .. '<span class="switcher-label" style="display:none"> | retval = retval .. '<span class="switcher-label" style="display:none">' .. map('name') .. 'の地図を表示</span>' | ||
end | end | ||
235行目: | 240行目: | ||
end | end | ||
mw.logObject(args, 'args') | mw.logObject(args, 'args') | ||
retval = retval .. '' | |||
end | |||
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then | |||
mw.log('Removed parameter used in map definition ' .. map()) | |||
retval = retval .. '' | |||
end | |||
if string.find(map('name'), '|', 1, true) then | |||
mw.log('Pipe used in name of map definition ' .. map()) | |||
retval = retval .. '' | retval = retval .. '' | ||
end | end | ||
245行目: | 258行目: | ||
local function markOuterDiv(x, y, imageDiv, labelDiv) | local function markOuterDiv(x, y, imageDiv, labelDiv) | ||
return mw.html.create('div') | return mw.html.create('div') | ||
:cssText('position:absolute;z-index:1;top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '% | :cssText('position:absolute;z-index:1;top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%') | ||
:node(imageDiv) | :node(imageDiv) | ||
:node(labelDiv) | :node(labelDiv) | ||
252行目: | 265行目: | ||
local function markImageDiv(mark, marksize, label, link, alt, title) | local function markImageDiv(mark, marksize, label, link, alt, title) | ||
local builder = mw.html.create('div') | local builder = mw.html.create('div') | ||
:cssText('position:absolute | :cssText('position:absolute;left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px;line-height:0') | ||
:attr('title', title) | :attr('title', title) | ||
if marksize ~= 0 then | if marksize ~= 0 then | ||
357行目: | 370行目: | ||
end | end | ||
mw.logObject(args, 'args') | mw.logObject(args, 'args') | ||
builder:wikitext('') | builder:wikitext('') | ||
end | end |