Edit Page
A szerkesztés visszavonható. Ellenőrizd alább a változásokat, hogy valóban ezt szeretnéd-e tenni, majd tedd közzé a változtatásaidat a visszavonás véglegesítéséhez.
Aktuális változat | A te változatod | ||
37. sor: | 37. sor: | ||
-- for each divider found |
-- for each divider found |
||
for st,sp in function() return string.find(str,div,pos,true) end do |
for st,sp in function() return string.find(str,div,pos,true) end do |
||
− | arr |
+ | table.insert(arr,trim(string.sub(str,pos,st-1))) -- Attach chars left of current divider |
pos = sp + 1 -- Jump past current divider |
pos = sp + 1 -- Jump past current divider |
||
end |
end |
||
− | arr |
+ | table.insert(arr, trim(string.sub(str,pos))) -- Attach chars right of last divider |
return arr |
return arr |
||
end |
end |
||
222. sor: | 222. sor: | ||
local _arg1 = getArg(1) or '' |
local _arg1 = getArg(1) or '' |
||
local _nolink = getArg('nolink') |
local _nolink = getArg('nolink') |
||
⚫ | |||
+ | -- link target and eicons target |
||
− | local text = getArg(2) or '' |
||
+ | local _link, _eicons_link = getArg('link'), nil |
||
− | |||
+ | if _link then -- override _nolink = y |
||
− | local hovertext |
||
+ | _eicons_link = _link -- _eicontr does not affect _link |
||
− | if _arg1 ~= '' then |
||
⚫ | |||
− | elseif text ~= '' then |
||
− | hovertext = text |
||
else |
else |
||
+ | if _nolink then |
||
− | hovertext = _link |
||
+ | _link = '' |
||
+ | if getArg('eicontr') then |
||
⚫ | |||
⚫ | |||
+ | _eicons_link = _arg1 |
||
⚫ | |||
+ | else |
||
+ | -- no link=<link> input, use _arg1 with auto link translation. |
||
⚫ | |||
+ | if getArg('eicontr') then |
||
+ | _eicons_link = _link -- reuse |
||
+ | else |
||
+ | _eicons_link = _arg1 |
||
+ | end |
||
+ | end |
||
end |
end |
||
+ | -- now _link == '' means nolink. |
||
− | local |
+ | local text = getArg(2) or '' |
+ | |||
+ | local class = 'item-link' |
||
local output_image, output_text, output_table = true, true, false |
local output_image, output_text, output_table = true, true, false |
||
251. sor: | 265. sor: | ||
local image_output, text_output |
local image_output, text_output |
||
if output_image then |
if output_image then |
||
⚫ | |||
− | local image_arg = string.gsub(_arg1, ":%s*", " ") |
||
− | if _arg1 == '1/2 Second Timer' then |
||
− | image_arg = '1 2 Second Timer' |
||
− | elseif _arg1 == '1/4 Second Timer' then |
||
− | image_arg = '1 4 Second Timer' |
||
⚫ | |||
− | image_arg = getArg('image') or image_arg .. '.' .. (getArg('ext') or 'png') |
||
⚫ | |||
else |
else |
||
image_output = '' |
image_output = '' |
||
281. sor: | 288. sor: | ||
if _link ~= '' then |
if _link ~= '' then |
||
if text == _link then |
if text == _link then |
||
− | text = ' |
+ | text = '[['..text..']]' |
else |
else |
||
− | text = ' |
+ | text = '[['.._link..'|'..text..']]' |
end |
end |
||
⚫ | |||
− | text = '<span title="'..hovertext..'">'..text..'</span>' |
||
end |
end |
||
293. sor: | 298. sor: | ||
icon = '' |
icon = '' |
||
else |
else |
||
− | icon = eicons( |
+ | icon = eicons(_eicons_link, lang, (_showid or _note2 or _wrap or getArg('small')) and 'y') |
end |
end |
||
− | local content = text -- item name link text first. |
+ | local content = '<span>' .. text .. '</span>' -- item name link text first. |
-- '-w' class means 'wrapmode', optimized for multiple lines of text. But it should be disabled for single line text. |
-- '-w' class means 'wrapmode', optimized for multiple lines of text. But it should be disabled for single line text. |
||
if _wrap then |
if _wrap then |
||
349. sor: | 354. sor: | ||
end |
end |
||
if output_table then |
if output_table then |
||
− | attr.class = class |
+ | attr.class = class .. ' block aligncenter' |
− | local |
+ | local result = mw.text.tag('span', attr, image_output) .. '||' |
+ | attr.class = class .. ' block alignleft' |
||
− | return (rowspan and (' rowspan='..rowspan..' class="il1c" | ') or ' class="il1c" | ') .. mw.text.tag('span', attr, image_output) .. ' || class="il2c"'.. (rowspan and (' rowspan='..rowspan) or '')..' | ' .. mw.text.tag('span', attr, text_output) |
||
+ | return result .. mw.text.tag('span', attr, text_output) |
||
else |
else |
||
return mw.text.tag('span', attr, image_output .. text_output) |
return mw.text.tag('span', attr, image_output .. text_output) |