Difference between revisions 23981061 and 23981087 on svwikip = {} function p.diagram(frame) local pFrame = frame:getParent() local args = pFrame.args local text = '' local namn = args.namn or frame.args.namn local max = -math.huge local note = args['ref'] or '' local fotnot = args.fotnot or '' if namn == nil or namn == ''then return 'Inget namn är angivet' end local fran = tonumber(args.fran) or 1800 local fran2 = math.huge local till2 = -math.huge local till = tonumber(args.till) or tonumber(os.date("%Y")) local step = 1 local areakolumn = nil -- variabel för att avgöra om en kolumn för area behövs local fkr = nil -- variabel för att avgöra om "före Kristus" behöver markeras if args.fkr then fkr = 'fkr' end if till < fran then step = -1 end local reffarna = '' local notraknare = 1 for i = fran, till, step do local pu = 'inv' .. i if tonumber(args[pu]) then local pv = 'area' .. i if args[pv] then areakolumn = '' end if tonumber(args[pu]) > max then max = tonumber(args[pu]) end if i > till2 then till2 = i end if i < fran2 then fran2 = i end if i < 0 then fkr = 'fkr' end local pw = 'typ' .. i if args[pw] then reffarna = 'A'⏎ if args[pw] == 'småort' then if noter['som småort'] == nil then notraknare = notraknare + 1 noter['som småort'] = 'Not'.. tostring(notraknare) end elseif args[pw] == 'tätort' then if noter['som tätort'] == nil then notraknare = notraknare + 1 (contracted; show full) local h6 = args[h5] or '' h2 = h2 .. mw.text.tag('td', {style="min-width:3em;padding-left:0.4em", align="right"}, h6 .. lokalnot) end text = text .. mw.text.tag('tr', {}, h2) end end if reffarna ~= '' then reffarna =text = text + frame:extensionTag{ name = 'references', content = reffarna, args = { group = 'N' } } local fn = mw.text.tag('b', {}, 'Anm.:') .. reffarna .. mw.text.tag('br', {}) .. mw.text.tag('br', {}) fn = mw.text.tag('td', {colspan = "5", style="padding:4px"}, fn) fn = mw.text.tag('tr', {}, fn) text = text .. fn end text = mw.text.tag('table', {cellspacing="0", cellpadding="0", style="clear:none;float:none;border:silver solid 1px; font-size:90%; padding:0.4em;margin:0.4em;width:650px"}, text) return frame:extensionTag{name='references', content = frame:extensionTag{ name = 'ref', content = 'som småort', args = { name = 'smaort', group = 'N' }} .. frame:extensionTag{ name = 'ref', content = 'som tätort', args = { name = 'smaort', group = 'N' }}, args = {group="N"}}end text = mw.text.tag('table', {cellspacing="0", cellpadding="0", style="clear:none;float:none;border:silver solid 1px; font-size:90%; padding:0.4em;margin:0.4em;width:650px"}, text) return text end return p All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://sv.wikipedia.org/w/index.php?diff=prev&oldid=23981087.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|