Predložak:Kronologija iPod modela: razlika između inačica

Izvor: Hrvatska internetska enciklopedija
Prijeđi na navigaciju Prijeđi na pretraživanje
Nema sažetka uređivanja
Oznaka: uklonjeno uređivanje
ažurirano prema hr.wikipediji
Oznaka: uklanjanje ručnim načinom
 
Redak 1: Redak 1:
local p = {}
{{{headerextension|}}}{{{header|==Kronologija iPod modela==}}}{{{headerextension|}}}  


local function esc(s)
<div style="width: 90%; height:335px; overflow: auto; padding: 3px;text-align: left; border: 1px solid silver">
    if not s then return "" end
{{#tag:timeline|
    return s:gsub("&","&amp;"):gsub("<","&lt;"):gsub(">","&gt;")
DateFormat = dd/mm/yyyy
end
Define $now = {{CURRENTDAY2}}/{{CURRENTMONTH}}/{{CURRENTYEAR}}


local function yearToX(year, minYear, scale, startX)
Define $later = {{#time:d/m/Y|+13 months}}
    return startX + (year - minYear) * scale
Period = from:15/10/2001 till:$later
end
Define $skip = at:end # Force a blank line
Define $dayunknown = 15 # what day to use if it's actually not known
ImageSize= width:900 height:auto barincrement:20
TimeAxis = orientation:horizontal
PlotArea = right:1 left:1 bottom:130 top:1
Legend = orientation:vertical position:bottom columns:4


local function yearToY(year, minYear, scale, startY)
Colors =
     return startY + (year - minYear) * scale
id:bg          value:white
end
    id:lightline  value:rgb(0.9,0.9,0.9)
    id:lighttext  value:rgb(0.5,0.5,0.5)
    id:server      value:rgb(0.8,0.8,0.9)
    id:gen1        value:rgb(0.95,0.95,1)
    id:gen2        value:rgb(0.9,0.9,1)
    id:gen3        value:rgb(0.85,0.85,1)
    id:gen4        value:rgb(0.8,0.8,1)
    id:photo      value:rgb(0.75,0.75,1)
    id:color      value:rgb(0.7,0.7,1)
    id:gen5        value:rgb(0.65,0.65,1)
    id:classic     value:rgb(0.6,0.6,1)
    id:gen7        value:rgb(0.55,0.55,1) Legend:iPod_Classic
    id:mini        value:rgb(0.9,1,0.8)
    id:mini2      value:rgb(0.8,1,0.8) Legend:iPod_Mini
    id:nano        value:rgb(0.7,0.9,0.8)
    id:nano2      value:rgb(0.6,0.9,0.8)
    id:nano3      value:rgb(0.5,0.9,0.8)
    id:nano4      value:rgb(0.4,0.9,0.8)
    id:nano5      value:rgb(0.3,0.9,0.8)
    id:nano6      value:rgb(0.2,0.9,0.8)
    id:nano7      value:rgb(0.1,0.9,0.8) Legend:iPod_Nano
    id:shuffle    value:rgb(1,0.9,0.4)
    id:shuffle2    value:rgb(1,0.8,0.4)
    id:shuffle3    value:rgb(1,0.7,0.4)
    id:shuffle4    value:rgb(1,0.6,0.4)
    id:shuffle5    value:rgb(1,0.5,0.4) Legend:iPod_Shuffle
    id:touch1      value:rgb(0.9,0.9,0.9)
    id:touch2      value:rgb(0.9,0.9,0.8)
    id:touch3      value:rgb(0.9,0.9,0.7) 
    id:touch4      value:rgb(0.9,0.9,0.6)
    id:touch5      value:rgb(0.9,0.9,0.5)
    id:touch6      value:rgb(0.9,0.9,0.4) Legend:iPod_Touch
    id:current    value:rgb(0.9,0.9,0.9) Legend:U_proizvodnji


function p.render(frame)
BackgroundColors = canvas:bg
    local args = frame:getParent().args
ScaleMajor = gridcolor:lighttext unit:year increment:1 start:01/01/2002
ScaleMinor = gridcolor:lightline unit:month increment:1 start:01/11/2001


    -- osnovne postavke
BarData =
    local minYear = tonumber(args.minYear) or 2000
  barset:shuffle
    local maxYear = tonumber(args.maxYear) or 2030
  barset:minano
    local scale   = tonumber(args.scale)   or 60
  barset:classic
    local orientation = (args.orientation or "horizontal"):lower()
  barset:touch
  barset:phone
   barset:pad
   barset:padmini
  barset:tv


    local startMain = 60
PlotData=
    local padding   = 80
   width:15 textcolor:black shift:(5,-5) anchor:from fontsize:s


     local svg = {}
  barset:shuffle
     color:shuffle  from:11/01/2005 till:12/09/2006 text:"[[iPod Shuffle#Prva generacija|Shuffle 1G]]"
  barset:break
    color:shuffle2 from:12/09/2006 till:09/09/2009 text:"[[iPod Shuffle#Druga generacija|Shuffle 2G]]"
    color:shuffle3 from:11/03/2009 till:09/09/2010 text:"[[iPod Shuffle#Treća generacija|Shuffle 3G]]"
  barset:break
    color:shuffle4 from:09/09/2010 till:$now      text:"[[iPod Shuffle#Četvrta generacija|Shuffle 4G]]"
  barset:break
    color:current  from:$now till:end


     ---------------------------------------------------------
  barset:minano
     -- VERTIKALNI TIMELINE
    color:mini    from:06/01/2004 till:23/02/2005 text:"[[iPod Mini|Mini 1G]]"
     ---------------------------------------------------------
  barset:break
     if orientation == "vertical" then
    color:mini2    from:23/02/2005 till:07/09/2005 text:"[[iPod Mini|2G]]"
        local height = startMain + (maxYear - minYear) * scale + padding
  barset:break
        if height < 300 then height = 300 end
    color:nano    from:07/09/2005 till:12/09/2006 text:"[[iPod Nano#Prva generacija|Nano 1G]]"
  barset:break
    color:nano2    from:12/09/2006 till:05/09/2007 text:"[[iPod Nano#Druga generacija|Nano 2G]]"
  barset:break
     color:nano3    from:05/09/2007 till:09/09/2008 text:"[[iPod Nano#Treća generacija|Nano 3G]]"
  barset:break
     color:nano4    from:09/09/2008 till:09/09/2009 text:"[[iPod Nano#Četvrta generacija|Nano 4G]]"
  barset:break
     color:nano5    from:09/09/2009 till:01/09/2010 text:"[[iPod Nano#Peta generacija|Nano 5G]]"
  barset:break
     color:nano6    from:01/09/2010 till:12/10/2012 text:"[[iPod Nano#Šesta generacija|Nano 6G]]"
  barset:break
    color:nano7    from:12/10/2012 till:$now      text:"[[iPod Nano#Sedma generacija|Nano 7G]]"
  barset:break
    color:current  from:$now                      till:end


        table.insert(svg, string.format(
  barset:classic
            '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 %d">',
    color:gen1    from:23/10/2001 till:28/04/2003 text:"[[iPod Classic#Prva generacija|Classic 1G]]"
            height
    color:gen2    from:17/07/2002 till:28/04/2003 text:"[[iPod Classic#Druga generacija|Classic 2G]]"
        ))
  barset:break
        table.insert(svg, '<rect x="0" y="0" width="100%" height="100%" fill="white" />')
    color:gen3    from:28/04/2003 till:19/07/2004 text:"[[iPod Classic#Treća generacija|Classic 3G]]"
    $skip
  barset:break
    color:gen4    from:19/07/2004 till:28/06/2005 text:"[[iPod Classic#Četvrta generacija|Classic 4G]]"
    color:photo    from:26/10/2004 till:28/06/2005 text:"[[iPod Photo|Photo]]"
  barset:break
    $skip
    color:color    from:28/06/2005 till:12/10/2005 text:"[[iPod Classic#Color|Color]]"
  barset:break
    color:gen5    from:12/10/2005 till:05/09/2007 text:"[[iPod Classic#Peta generacija|Classic 5G]]"
    $skip
  barset:break
    color:classic  from:05/09/2007 till:08/09/2014      text:"[[iPod Classic#Šesta generacija|Classic 6G]]"
    $skip
  barset:break


        -- vremenska os
        table.insert(svg, '<g font-family="sans-serif" font-size="10" fill="#555">')
        local yEnd = yearToY(maxYear, minYear, scale, startMain)
        table.insert(svg, string.format(
            '<line x1="80" y1="%d" x2="80" y2="%d" stroke="#aaa" />',
            startMain, yEnd
        ))


        for y = minYear, maxYear do
  barset:touch
            local yy = yearToY(y, minYear, scale, startMain)
    color:touch1  from:14/09/2007 till:09/09/2008 text:"[[iPod Touch#Prva generacija|Touch 1G]]"
            table.insert(svg, string.format('<text x="50" y="%d">%d</text>', yy + 4, y))
   barset:break
        end
    color:touch2   from:09/09/2008 till:09/09/2010 text:"[[iPod Touch#Druga generacija|Touch 2G]]"
        table.insert(svg, '</g>')
    color:touch3  from:09/09/2009 till:09/09/2010 text:"[[iPod Touch#Treća generacija|Touch 3G]]"
 
  barset:break
        -- redovi
     color:touch4  from:09/09/2010 till:30/05/2013 text:"[[iPod Touch#Četvrta generacija|Touch 4G]]"
        local rowIndex = 1
  barset:break
        while args["row" .. rowIndex .. "_label"] do
     $skip
            local label = args["row" .. rowIndex .. "_label"]
     color:touch5  from:12/10/2012 till:$now      text:"[[iPod Touch (peta generacija)|Touch 5G]]"
            local x    = tonumber(args["row" .. rowIndex .. "_x"]) or (120 + (rowIndex - 1) * 120)
  barset:break
 
    $skip
            table.insert(svg, string.format(
    color:touch6  from:15/07/2015 till:$now text:"[[iPod Touch (šesta generacija)|Touch 6G]]"
                '<text x="%d" y="40" font-family="sans-serif" font-size="11" fill="#333">%s</text>',
   barset:break
                x, esc(label)
    $skip
            ))
    color:current from:$now      till:end
 
}}</div>
            local blockIndex = 1
<noinclude>
            while args[string.format("row%d_block%d_start", rowIndex, blockIndex)] do
[[Kategorija:Računalni predlošci]]
                local start = tonumber(args[string.format("row%d_block%d_start", rowIndex, blockIndex)])
</noinclude>
                local stop  = tonumber(args[string.format("row%d_block%d_end",  rowIndex, blockIndex)]) or maxYear
                local text  = args[string.format("row%d_block%d_label", rowIndex, blockIndex)] or ""
                local tip   = args[string.format("row%d_block%d_tip",  rowIndex, blockIndex)]
                local icon  = args[string.format("row%d_block%d_icon",  rowIndex, blockIndex)] or ""
                local col   = args[string.format("row%d_block%d_color", rowIndex, blockIndex)] or "#cccccc"
 
                if not tip or tip == "" then
                    tip = string.format("%s (%s–%s)", text, tostring(start), tostring(stop))
                end
 
                local y1 = yearToY(start, minYear, scale, startMain)
                local y2 = yearToY(stop,  minYear, scale, startMain)
                local h  = y2 - y1
                if h < 6 then h = 6 end
 
                table.insert(svg, '<g font-family="sans-serif" font-size="9" fill="#000">')
                table.insert(svg, string.format(
                    '<rect x="%d" y="%d" width="90" height="%d" fill="%s"><title>%s</title></rect>',
                    x - 10, y1, h, esc(col), esc(tip)
                ))
 
                local labelText = icon ~= "" and (icon .. " " .. esc(text)) or esc(text)
 
                table.insert(svg, string.format(
                    '<text x="%d" y="%d" transform="rotate(90 %d %d)">%s</text>',
                    x + 5, y1 + h/2, x + 5, y1 + h/2, labelText
                ))
                table.insert(svg, '</g>')
 
                blockIndex = blockIndex + 1
            end
 
            rowIndex = rowIndex + 1
        end
 
        table.insert(svg, '</svg>')
        return table.concat(svg, "\n")
    end
 
     ---------------------------------------------------------
    -- HORIZONTALNI TIMELINE
    ---------------------------------------------------------
    local width = startMain + (maxYear - minYear) * scale + padding
    if width < 400 then width = 400 end
 
    table.insert(svg, string.format(
        '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 %d 300">',
        width
     ))
     table.insert(svg, '<rect x="0" y="0" width="100%" height="100%" fill="white" />')
 
    -- vremenska os
    table.insert(svg, '<g font-family="sans-serif" font-size="10" fill="#555">')
    local xEnd = yearToX(maxYear, minYear, scale, startMain)
    table.insert(svg, string.format(
        '<line x1="%d" y1="30" x2="%d" y2="30" stroke="#aaa" />',
        startMain, xEnd
    ))
 
    for y = minYear, maxYear do
        local xx = yearToX(y, minYear, scale, startMain)
        table.insert(svg, string.format('<text x="%d" y="25">%d</text>', xx, y))
    end
    table.insert(svg, '</g>')
 
    -- redovi
    local rowIndex = 1
    while args["row" .. rowIndex .. "_label"] do
        local label = args["row" .. rowIndex .. "_label"]
        local y    = tonumber(args["row" .. rowIndex .. "_y"]) or (50 + rowIndex * 40)
 
        table.insert(svg, string.format(
            '<text x="10" y="%d" font-family="sans-serif" font-size="11" fill="#333">%s</text>',
            y, esc(label)
        ))
 
        local blockIndex = 1
        while args[string.format("row%d_block%d_start", rowIndex, blockIndex)] do
            local start = tonumber(args[string.format("row%d_block%d_start", rowIndex, blockIndex)])
            local stop  = tonumber(args[string.format("row%d_block%d_end",  rowIndex, blockIndex)]) or maxYear
            local text  = args[string.format("row%d_block%d_label", rowIndex, blockIndex)] or ""
            local tip   = args[string.format("row%d_block%d_tip",  rowIndex, blockIndex)]
            local icon  = args[string.format("row%d_block%d_icon",  rowIndex, blockIndex)] or ""
            local col  = args[string.format("row%d_block%d_color", rowIndex, blockIndex)] or "#cccccc"
 
            if not tip or tip == "" then
                tip = string.format("%s (%s–%s)", text, tostring(start), tostring(stop))
            end
 
            local x1 = yearToX(start, minYear, scale, startMain)
            local x2 = yearToX(stop, minYear, scale, startMain)
            local w  = x2 - x1
            if w < 6 then w = 6 end
 
            table.insert(svg, '<g font-family="sans-serif" font-size="9" fill="#000">')
            table.insert(svg, string.format(
                '<rect x="%d" y="%d" width="%d" height="14" fill="%s"><title>%s</title></rect>',
                x1, y - 10, w, esc(col), esc(tip)
            ))
 
            local labelText = icon ~= "" and (icon .. " " .. esc(text)) or esc(text)
 
            table.insert(svg, string.format(
                '<text x="%d" y="%d">%s</text>',
                x1 + 3, y, labelText
            ))
            table.insert(svg, '</g>')
 
            blockIndex = blockIndex + 1
        end
 
        rowIndex = rowIndex + 1
    end
 
    table.insert(svg, '</svg>')
    return table.concat(svg, "\n")
end
 
return p

Posljednja izmjena od 27. veljača 2026. u 23:41

Kronologija iPod modela

<timeline> DateFormat = dd/mm/yyyy Define $now = 03/09/2026

Define $later = 03/10/2027 Period = from:15/10/2001 till:$later Define $skip = at:end # Force a blank line Define $dayunknown = 15 # what day to use if it's actually not known ImageSize= width:900 height:auto barincrement:20 TimeAxis = orientation:horizontal PlotArea = right:1 left:1 bottom:130 top:1 Legend = orientation:vertical position:bottom columns:4

Colors =

id:bg          value:white
    id:lightline   value:rgb(0.9,0.9,0.9)
    id:lighttext   value:rgb(0.5,0.5,0.5)
    id:server      value:rgb(0.8,0.8,0.9)
    id:gen1        value:rgb(0.95,0.95,1)
    id:gen2        value:rgb(0.9,0.9,1)
    id:gen3        value:rgb(0.85,0.85,1)
    id:gen4        value:rgb(0.8,0.8,1)
    id:photo       value:rgb(0.75,0.75,1)
    id:color       value:rgb(0.7,0.7,1)
    id:gen5        value:rgb(0.65,0.65,1)
    id:classic     value:rgb(0.6,0.6,1)
    id:gen7        value:rgb(0.55,0.55,1) Legend:iPod_Classic
    id:mini        value:rgb(0.9,1,0.8)
    id:mini2       value:rgb(0.8,1,0.8) Legend:iPod_Mini
    id:nano        value:rgb(0.7,0.9,0.8)
    id:nano2       value:rgb(0.6,0.9,0.8)
    id:nano3       value:rgb(0.5,0.9,0.8)
    id:nano4       value:rgb(0.4,0.9,0.8)
    id:nano5       value:rgb(0.3,0.9,0.8)
    id:nano6       value:rgb(0.2,0.9,0.8)
    id:nano7       value:rgb(0.1,0.9,0.8) Legend:iPod_Nano
    id:shuffle     value:rgb(1,0.9,0.4)
    id:shuffle2    value:rgb(1,0.8,0.4)
    id:shuffle3    value:rgb(1,0.7,0.4)
    id:shuffle4    value:rgb(1,0.6,0.4)
    id:shuffle5    value:rgb(1,0.5,0.4) Legend:iPod_Shuffle
    id:touch1      value:rgb(0.9,0.9,0.9)
    id:touch2      value:rgb(0.9,0.9,0.8)
    id:touch3      value:rgb(0.9,0.9,0.7)  
    id:touch4      value:rgb(0.9,0.9,0.6)
    id:touch5      value:rgb(0.9,0.9,0.5)
    id:touch6      value:rgb(0.9,0.9,0.4) Legend:iPod_Touch
    id:current     value:rgb(0.9,0.9,0.9) Legend:U_proizvodnji

BackgroundColors = canvas:bg ScaleMajor = gridcolor:lighttext unit:year increment:1 start:01/01/2002 ScaleMinor = gridcolor:lightline unit:month increment:1 start:01/11/2001

BarData =

 barset:shuffle
 barset:minano
 barset:classic
 barset:touch
 barset:phone
 barset:pad
 barset:padmini
 barset:tv

PlotData=

 width:15 textcolor:black shift:(5,-5) anchor:from fontsize:s
 barset:shuffle
   color:shuffle  from:11/01/2005 till:12/09/2006 text:"Shuffle 1G"
 barset:break
   color:shuffle2 from:12/09/2006 till:09/09/2009 text:"Shuffle 2G"
   color:shuffle3 from:11/03/2009 till:09/09/2010 text:"Shuffle 3G"
 barset:break
   color:shuffle4 from:09/09/2010 till:$now       text:"Shuffle 4G"
 barset:break
   color:current  from:$now till:end
 barset:minano
   color:mini     from:06/01/2004 till:23/02/2005 text:"Mini 1G"
 barset:break
   color:mini2    from:23/02/2005 till:07/09/2005 text:"2G"
 barset:break
   color:nano     from:07/09/2005 till:12/09/2006 text:"Nano 1G"
 barset:break
   color:nano2    from:12/09/2006 till:05/09/2007 text:"Nano 2G"
 barset:break
   color:nano3    from:05/09/2007 till:09/09/2008 text:"Nano 3G"
 barset:break
   color:nano4    from:09/09/2008 till:09/09/2009 text:"Nano 4G"
 barset:break
   color:nano5    from:09/09/2009 till:01/09/2010 text:"Nano 5G"
 barset:break
   color:nano6    from:01/09/2010 till:12/10/2012 text:"Nano 6G"
 barset:break
   color:nano7    from:12/10/2012 till:$now       text:"Nano 7G"
 barset:break
   color:current  from:$now                       till:end
 barset:classic
   color:gen1     from:23/10/2001 till:28/04/2003 text:"Classic 1G"
   color:gen2     from:17/07/2002 till:28/04/2003 text:"Classic 2G"
 barset:break
   color:gen3     from:28/04/2003 till:19/07/2004 text:"Classic 3G"
   $skip
 barset:break
   color:gen4     from:19/07/2004 till:28/06/2005 text:"Classic 4G"
   color:photo    from:26/10/2004 till:28/06/2005 text:"Photo"
 barset:break
   $skip
   color:color    from:28/06/2005 till:12/10/2005 text:"Color"
 barset:break
   color:gen5     from:12/10/2005 till:05/09/2007 text:"Classic 5G"
   $skip
 barset:break
   color:classic  from:05/09/2007 till:08/09/2014       text:"Classic 6G"
   $skip
 barset:break


 barset:touch
   color:touch1   from:14/09/2007 till:09/09/2008 text:"Touch 1G"
 barset:break
   color:touch2   from:09/09/2008 till:09/09/2010 text:"Touch 2G"
   color:touch3   from:09/09/2009 till:09/09/2010 text:"Touch 3G"
 barset:break
   color:touch4   from:09/09/2010 till:30/05/2013 text:"Touch 4G"
 barset:break
   $skip
   color:touch5   from:12/10/2012 till:$now       text:"Touch 5G"
 barset:break
   $skip
   color:touch6   from:15/07/2015 till:$now text:"Touch 6G"
 barset:break
   $skip
   color:current  from:$now       till:end
</timeline>