Module:Infobox interval: Difference between revisions
m 2px separator added between audio buttons |
m Timbre selectors test |
||
| Line 334: | Line 334: | ||
-- is it within hearing range? | -- is it within hearing range? | ||
if hz >= 20 and hz <= 20000 then | if hz >= 20 and hz <= 20000 then | ||
-- TODO: better ids | |||
local html_id = 'interval_' .. math.random(0, 100000) | |||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
'<div style="display: flex;">' | '<div style="display: flex;"><div style="width: 270px; text-align: center;">' | ||
.. | .. | ||
frame:expandTemplate{ | frame:expandTemplate{ | ||
title = 'User:Plumtree/Interval Sound', | title = 'User:Plumtree/Interval Sound', | ||
args = { Frequency=tostring(hz), | args = { Frequency=tostring(hz), Center='true', Label='Audio demonstration', Attributes='id="' .. html_id .. '"' } | ||
} | } | ||
.. | .. | ||
'<div | '<div class="sequence-audio-timbre-selector" data-target="' .. html_id .. '" data-key="interval-audio" data-default="semisine"></div>' | ||
.. | .. | ||
'</div></div>' | |||
}) | }) | ||
end | end | ||