Module:Infobox MOS: Difference between revisions

Inthar (talk | contribs)
No edit summary
Inthar (talk | contribs)
No edit summary
Line 102: Line 102:
local has_prev_y = (nL > 1)
local has_prev_y = (nL > 1)
local has_prev_x = (ns > 1)
local has_prev_x = (ns > 1)
local prev_L, next_L, prev_s,next_s, prev_L_prev_s, prev_L_next_s, next_L_prev_s, next_L_next_s = nil
local prev_L, next_L, prev_s,next_s, prev_L_prev_s, prev_L_next_s, next_L_prev_s, next_L_next_s = ''
next_s = '[[' .. mos.nL .. 'L ' .. (mos.ns + 1) .. 's' .. equave_link .. '|↓' .. mos.nL .. 'L ' .. (mos.ns + 1) .. 's' .. equave_disp .. '\n]]'
next_s = '[[' .. mos.nL .. 'L ' .. (mos.ns + 1) .. 's' .. equave_link .. '|↓' .. mos.nL .. 'L ' .. (mos.ns + 1) .. 's' .. equave_disp .. '\n]]'
next_L = '[[' .. (mos.nL + 1) .. 'L ' .. mos.ns .. 's' .. equave_link .. '|' .. (mos.nL + 1) .. 'L ' .. mos.ns .. 's' .. equave_disp .. '→]]'
next_L = '[[' .. (mos.nL + 1) .. 'L ' .. mos.ns .. 's' .. equave_link .. '|' .. (mos.nL + 1) .. 'L ' .. mos.ns .. 's' .. equave_disp .. '→]]'
Line 116: Line 116:
prev_L_next_s = '[[' .. (mos.nL - 1) .. 'L ' .. (mos.ns + 1) .. 's' .. equave_link .. '|← ' .. (mos.nL - 1) .. 'L ' .. (mos.ns + 1) .. 's' .. equave_disp .. ']]'
prev_L_next_s = '[[' .. (mos.nL - 1) .. 'L ' .. (mos.ns + 1) .. 's' .. equave_link .. '|← ' .. (mos.nL - 1) .. 'L ' .. (mos.ns + 1) .. 's' .. equave_disp .. ']]'
end
end
local adjacent_links = {prev_L_prev_s, prev_s, next_L_prev_s, prev_L, next_L, prev_L_next_s, next_s, next_L_next_s}
local adjacent_links = {prev_L_prev_s, prev_s, next_L_prev_s, prev_L, next_L, prev_L_next_s, next_s, next_L_next_s}
Line 283: Line 284:
'{| width="100%" style="border-collapse: collapse;"\n' ..
'{| width="100%" style="border-collapse: collapse;"\n' ..
'|+ style="font-weight: bold; text-align: center;" | '
'|+ style="font-weight: bold; text-align: center;" | '
if adjacent_links then
s = s .. '<table style="width: 100%; margin: 0"><tr><td>'
s = s .. '<table style="width: 100%; margin: 0"><tr><td>'
.. '</td>'
.. '</td>'
.. adjacent_links[1]
.. adjacent_links[1]
.. '<td style="\n'  
.. '<td style="\n'  
.. 'width: 50%; padding-left: 1em; padding-right: 1em; text-align: center; font-size: smaller">'
.. 'width: 50%; padding-left: 1em; padding-right: 1em; text-align: center; font-size: smaller">'
.. adjacent_links[2]
.. adjacent_links[2]
.. '\n</td><td>'
.. '\n</td><td>'
.. adjacent_links[3]
.. adjacent_links[3]
.. '</td>'  
.. '</td>'  
.. '\n<tr>'
.. '\n<tr>'
.. '<td style="width: 15%; text-align: left; white-space: nowrap; font-size: smaller">'
.. '<td style="width: 15%; text-align: left; white-space: nowrap; font-size: smaller">'
.. adjacent_links[4]
.. adjacent_links[4]
.. '</td>'
.. '</td>'
.. '<td style="width: 70%; padding-left: 1em; padding-right: 1em; text-align: center">'
.. '<td style="width: 70%; padding-left: 1em; padding-right: 1em; text-align: center">'
.. title
.. title
.. '</td>'
.. '</td>'
.. '<td style="width: 15%; text-align: right; white-space: nowrap; font-size: smaller">'
.. '<td style="width: 15%; text-align: right; white-space: nowrap; font-size: smaller">'
.. adjacent_links[5]
.. adjacent_links[5]
.. '</td>'
.. '</td>'
.. '</tr>'
.. '</tr>'
.. '<tr>'
.. '<tr>'
.. '<td>'
.. '<td>'
.. adjacent_links[6]
.. adjacent_links[6]
.. '</td><td style="\n'  
.. '</td><td style="\n'  
.. 'width: 50%; padding-left: 1em; padding-right: 1em; text-align: center; font-size: smaller">'
.. 'width: 50%; padding-left: 1em; padding-right: 1em; text-align: center; font-size: smaller">'
.. adjacent_links[7]
.. adjacent_links[7]
.. '\n</td><td>'
.. '\n</td><td>'
.. adjacent_links[8]
.. adjacent_links[8]
.. '</td>'
.. '</td>'
.. '</tr>'
.. '</tr>'
..  '</table>'
..  '</table>'
else
s = s .. title
end
s = s .. '\n'
s = s .. '\n'
for i, entry in ipairs(structure_entries) do
for i, entry in ipairs(structure_entries) do