Jump to content

Module:Horizontal timeline and Module:Horizontal timeline/sandbox: Difference between pages

(Difference between pages)
Content deleted Content added
readd width 100; the float is probably what's messing with the width
 
m Primefac moved page Module:Simple horizontal timeline/sandbox to Module:Horizontal timeline/sandbox without leaving a redirect: per RM discussion
 
Line 52: Line 52:
end
end
if args.caption then
if args.caption then
cntnt:tag('div')
cntnt:tag('')
:cssText('clear:both; text-align:center')
:cssText('clear:both; text-align:center')
:wikitext(args.caption)
:wikitext(args.caption)
Line 102: Line 102:
args[style .. '-color'],
args[style .. '-color'],
'transparent')
'transparent')
local barborder = getNotNilValue (args['bar-border'], '1px solid #000')
if bordrTop ~= 'none' then
if bordrTop ~= 'none' then
bordrTop = 'border-top:' .. bordrTop .. ';'
bordrTop = 'border-top:' .. bordrTop .. ';'
Line 166: Line 165:
if bar_bordr == 'none' then
if bar_bordr == 'none' then
if firstNode then -- for first box both left and right border needed
if firstNode then -- for first box both left and right border needed
bar_bordr = barborder .. "; border-left:" .. barborder
bar_bordr = ; border-left:
firstNode = false
firstNode = false
else
else
bar_bordr = barborder
bar_bordr =
end
end
end
end
Line 176: Line 175:
:cssText("width:"..width .."%")
:cssText("width:"..width .."%")
:tag('div')
:tag('div')
:cssText("box-sizing: border-box;")
:cssText("box-sizing: border-box;")
:cssText("float:right; width: 100%; height:100%; border-right:"..bar_bordr)
:cssText("float:right; :100%; :100%; border-right:"..bar_bordr)
:tag('div')
:tag('div')
:cssText('position: relative; top:'..bar_txtTop .. '; font-size:'.. bar_fontsize)
:cssText('position: relative; top:'..bar_txtTop .. '; font-size:'.. bar_fontsize)
Line 208: Line 207:
end
end
for _, vals in ipairs(rowDat) do
for _, vals in ipairs(rowDat) do
local note_at =args['row' .. num .. '-'.. vals .. '-at'] --will never be nil as it is what is used to receive rowDat
local note_at =args['row' .. num .. '-'.. vals .. '-at'] --will never be nil as it is what is to rowDat
local note_text =getNotNilValue(args['row' .. num .. '-'.. vals .. '-text'], '' )
local note_text =getNotNilValue(args['row' .. num .. '-'.. vals .. '-text'], '' )
local note_shift=getNotNilValue(args['row' .. num .. '-'.. vals .. '-shift'], '0em' )
local note_shift=getNotNilValue(args['row' .. num .. '-'.. vals .. '-shift'], '0em' )
Line 225: Line 224:
:done()
:done()
:tag('span')
:tag('span')
:cssText("font-size:90% ;position:relative; line-height:3px; overflow:visible")
:cssText("font-size:;position:relative; line-height:3px; overflow:visible")
:cssText("left:"..note_shift.."; top:"..note_lift.."; z-index:".. (1000- tonumber(num)))
:cssText("left:"..note_shift.."; top:"..note_lift.."; z-index:".. (1000- tonumber(num)))
:wikitext(note_text)
:wikitext(note_text)
Line 240: Line 239:
local to = getNotNilValue(tonumber(args['to']))
local to = getNotNilValue(tonumber(args['to']))
local inc = getNotNilValue( tonumber(args['inc']), (math.floor( (from - to) / 5 ) * -1) )
local inc = getNotNilValue( tonumber(args['inc']), (math.floor( (from - to) / 5 ) * -1) )
local negativeFmt = getNotNilValue(args['axis-negativeFmt'], '%s')
local negativeFmt = getNotNilValue(args['axis-negativeFmt'], '%s')
local positiveFmt = getNotNilValue(args['axis-positiveFmt'], '%s')
local positiveFmt = getNotNilValue(args['axis-positiveFmt'], '%s')
local zeroFmt = getNotNilValue(args['axis-zeroFmt'], '%s')
local zeroFmt = getNotNilValue(args['axis-zeroFmt'], '%s')
Line 252: Line 251:
:tag('div')
:tag('div')
:attr('id', 'Scale')
:attr('id', 'Scale')
:cssText('clear:both;position:relative;top:-1.4em;left:-0.2em;width:100%;padding:0;height:2.5em')
:cssText('clear:both;position:relative;top:-1.4em;left:-0.2em;width:100%;padding:0;height:.5em')
for var=from, to, inc do
for var=from, to, inc do