Modul:Navbox dan Modul:Navbox/bak pasir: Perbedaan antara halaman
(Perbedaan antarhalaman)
Konten dihapus Konten ditambahkan
k Mengembalikan suntingan oleh Nyilvoskt (bicara) ke revisi terakhir oleh Hidayatsrf Tag: Pengembalian Suntingan perangkat seluler Suntingan peramban seluler Suntingan seluler lanjutan |
k back |
||
Baris 5: | Baris 5: | ||
local p = {} |
local p = {} |
||
local navbar = require(' |
local navbar = require('Modul:Navbar/bak pasir')._navbar |
||
local getArgs -- lazily initialized |
local getArgs -- lazily initialized |
||
local args |
local args |
||
local border |
local border |
||
local listnums |
local listnums = {} |
||
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127' |
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127' |
||
local RESTART_MARKER = '\127_ODDEVEN0_\127' |
local RESTART_MARKER = '\127_ODDEVEN0_\127' |
||
Baris 20: | Baris 20: | ||
-- by parent navboxes. The result is that the category shows all pages |
-- by parent navboxes. The result is that the category shows all pages |
||
-- where a child navbox is not contained in a parent navbox. |
-- where a child navbox is not contained in a parent navbox. |
||
local orphanCat = '[[Kategori: |
local orphanCat = '[[Kategori:Halaman yatim navbox]]' |
||
if border == 'subgroup' and args.orphan ~= 'yes' then |
if border == 'subgroup' and args.orphan ~= 'yes' then |
||
-- No change; striping occurs in outermost navbox. |
-- No change; striping occurs in outermost navbox. |
||
Baris 85: | Baris 85: | ||
args.name, |
args.name, |
||
mini = 1, |
mini = 1, |
||
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;box-shadow:none;padding:0;' |
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none; padding:0;' |
||
}) |
}) |
||
end |
end |
||
Baris 192: | Baris 192: | ||
row |
row |
||
:tag('td') |
:tag('td') |
||
:addClass('noviewer') |
|||
:addClass('navbox-image') |
:addClass('navbox-image') |
||
:addClass(args.imageclass) |
:addClass(args.imageclass) |
||
Baris 217: | Baris 216: | ||
:addClass(args.groupclass) |
:addClass(args.groupclass) |
||
:cssText(args.basestyle) |
:cssText(args.basestyle) |
||
:css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width |
|||
groupCell |
groupCell |
||
Baris 261: | Baris 260: | ||
:addClass('navbox-' .. oddEven) |
:addClass('navbox-' .. oddEven) |
||
:addClass(args.listclass) |
:addClass(args.listclass) |
||
:addClass(args['list' .. listnum .. 'class']) |
|||
:tag('div') |
:tag('div') |
||
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em') |
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em') |
||
Baris 269: | Baris 267: | ||
row |
row |
||
:tag('td') |
:tag('td') |
||
:addClass('noviewer') |
|||
:addClass('navbox-image') |
:addClass('navbox-image') |
||
:addClass(args.imageclass) |
:addClass(args.imageclass) |
||
Baris 315: | Baris 312: | ||
local function isIllegible() |
local function isIllegible() |
||
local styleratio = require(' |
local styleratio = require('Modul:Color contrast')._styleratio |
||
for key, style in pairs(args) do |
for key, style in pairs(args) do |
||
Baris 329: | Baris 326: | ||
local function getTrackingCategories() |
local function getTrackingCategories() |
||
local cats = {} |
local cats = {} |
||
if needsHorizontalLists() then table.insert(cats, ' |
if needsHorizontalLists() then table.insert(cats, 'Kotak navigasi tanpa daftar horizontal') end |
||
if hasBackgroundColors() then table.insert(cats, 'Navbox menggunakan warna latar belakang') end |
if hasBackgroundColors() then table.insert(cats, 'Navbox yang menggunakan warna latar belakang') end |
||
if isIllegible() then table.insert(cats, 'Navbox berpotensi tidak terbaca') end |
if isIllegible() then table.insert(cats, 'Navbox yang berpotensi tidak terbaca') end |
||
if hasBorders() then table.insert(cats, 'Navbox menggunakan |
if hasBorders() then table.insert(cats, 'Navbox yang menggunakan batas') end |
||
return cats |
return cats |
||
end |
end |
||
Baris 343: | Baris 340: | ||
for _, cat in ipairs(getTrackingCategories()) do |
for _, cat in ipairs(getTrackingCategories()) do |
||
builder:wikitext('[[ |
builder:wikitext('[[Kategori:' .. cat .. ']]') |
||
end |
end |
||
end |
end |
||
Baris 356: | Baris 353: | ||
if args.title and (args.state ~= 'plain' and args.state ~= 'off') then |
if args.title and (args.state ~= 'plain' and args.state ~= 'off') then |
||
if args.state == 'collapsed' then args.state = 'mw-collapsed' end |
|||
tbl |
tbl |
||
:addClass(' |
:addClass('collapsible') |
||
:addClass(args.state or 'autocollapse') |
:addClass(args.state or 'autocollapse') |
||
end |
end |
||
Baris 388: | Baris 384: | ||
function p._navbox(navboxArgs) |
function p._navbox(navboxArgs) |
||
args = navboxArgs |
args = navboxArgs |
||
listnums = {} |
|||
for k, _ in pairs(args) do |
for k, _ in pairs(args) do |
||
Baris 430: | Baris 425: | ||
:attr('role', 'navigation') |
:attr('role', 'navigation') |
||
:addClass('navbox') |
:addClass('navbox') |
||
:addClass(args.navboxclass) |
|||
:cssText(args.bodystyle) |
:cssText(args.bodystyle) |
||
:cssText(args.style) |
:cssText(args.style) |
||
Baris 443: | Baris 437: | ||
end |
end |
||
⚫ | |||
if (args.nocat or 'false'):lower() == 'false' then |
|||
⚫ | |||
⚫ | |||
return striped(tostring(res)) |
return striped(tostring(res)) |
||
end |
end |
||
Baris 451: | Baris 444: | ||
function p.navbox(frame) |
function p.navbox(frame) |
||
if not getArgs then |
if not getArgs then |
||
getArgs = require(' |
getArgs = require('Modul:Arguments').getArgs |
||
⚫ | |||
⚫ | |||
if frame.args.border then |
|||
-- This allows Template:Navbox_subgroup to use {{#invoke:Navbox|navbox|border=...}}. |
|||
args.border = frame.args.border |
|||
end |
end |
||
⚫ | |||
-- Read the arguments in the order they'll be output in, to make references number in the right order. |
-- Read the arguments in the order they'll be output in, to make references number in the right order. |