יחידה:גרפים: הבדלים בין גרסאות בדף

עדכון לפונקציה createGroupList בלבד
ביטול גרסה 20908448 של Sokuya (שיחה)
שורה 65: שורה 65:


local function createGroupList( tab, legends, cols )
local function createGroupList( tab, legends, cols )
     if #legends > 1 and not hideGroupLegends then
     if #legends > 1 then
         table.insert( tab, mw.text.tag( 'div' ) )
         table.insert( tab, mw.text.tag( 'div' ) )
         local list = {}
         local list = {}
         local spanStyle = "padding:0 1em;background-color:%s;border:1px solid %s;margin-right:1em;-webkit-print-color-adjust:exact;"
         local spanStyle = "padding:0 1em;background-color:%s;box-shadow:2px -1px 4px 0 silver;margin-right:1em;"
         for gi = 1, #legends do
         for gi = 1, #legends do
             local span = mw.text.tag( 'span', { style = string.format( spanStyle, cols[gi], cols[gi] ) }, ' ' ) .. ' '..  legends[gi]
             local span = mw.text.tag( 'span', { style = string.format( spanStyle, cols[gi] ) }, ' ' ) .. ' '..  legends[gi]
             table.insert( list, mw.text.tag( 'li', {}, span ) )
             table.insert( list, mw.text.tag( 'li', {}, span ) )
         end
         end
         table.insert( tab,
         table.insert( tab,
             mw.text.tag( 'ul',
             mw.text.tag( 'ul',
            -- chrome bug with column display with rtl. {style="text-align:right;width:100%;list-style:none;-webkit-column-width:12em;-moz-column-width:12em;column-width:12em"},
-- chrome bug with column display with rtl.                 {style="text-align:right;width:100%;list-style:none;-webkit-column-width:12em;-moz-column-width:12em;column-width:12em"},
                 {style="width:100%;list-style:none;-webkit-column-width:12em;-moz-column-width:12em;column-width:12em;"},
                 {style="text-align:right;width:100%;list-style:none;-moz-column-width:12em;column-width:12em"},
                 table.concat( list, '\n' )
                 table.concat( list, '\n' )
             )
             )