Module:Guidance: Difference between revisions
Jump to navigation
Jump to search
no edit summary
imported>Pingu No edit summary |
imported>Pingu No edit summary |
||
| Line 3: | Line 3: | ||
r = { --keyword, short name, formatted name, severity | r = { --keyword, short name, formatted name, severity | ||
{ "flashing", | { "flashing", | ||
" | "Flashing images", | ||
"[[:wikipedia:photosensitive epilepsy| | "[[:wikipedia:photosensitive epilepsy|Flashing images]]", | ||
1, | 1, | ||
}, | }, | ||
{ "graphic", | { "graphic", | ||
" | "Graphic violence", | ||
" | "Graphic violence or gore", | ||
2, | 2, | ||
}, | }, | ||
{ "jumpscare", | { "jumpscare", | ||
" | "Jump scares", | ||
"[[:wikipedia:jump scare| | "[[:wikipedia:jump scare|Jump scares]]", | ||
1, | 1, | ||
}, | }, | ||
{ " | { "sex", | ||
" | "Sex", | ||
" | "Sex", | ||
2, | 2, | ||
} | } | ||
} | } | ||
ri = 4 | |||
function p.reasons(frame) | function p.reasons(frame) | ||
for i = | for i = ri,1,-1 | ||
do | do | ||
if string.find(frame.args[1],r[i][1]) then | if string.find(frame.args[1],r[i][1]) then | ||
| Line 46: | Line 42: | ||
function p.warn_1(frame) | function p.warn_1(frame) | ||
for i = | for i = ri,1,-1 | ||
do | do | ||
if string.find(frame.args[1],r[i][1]) and (r[i][4] == 1) then | if string.find(frame.args[1],r[i][1]) and (r[i][4] == 1) then | ||
| Line 62: | Line 58: | ||
function p.warn_2(frame) | function p.warn_2(frame) | ||
for i = | for i = ri,1,-1 | ||
do | do | ||
if string.find(frame.args[1],r[i][1]) and (r[i][4] == 2) then | if string.find(frame.args[1],r[i][1]) and (r[i][4] == 2) then | ||
| Line 85: | Line 81: | ||
function p.category(frame) | function p.category(frame) | ||
for i = 1,ri,1 | |||
do | |||
if string.find(frame.args[1],r[i][1]) then | |||
if rc == nil then | |||
rc = "[[Category:Logos with content warnings for "..r[i][2].."]]" | |||
else | |||
rc = rc.."[[Category:Logos with content warnings for "..r[i][2].."]]" | |||
end | |||
end | |||
end | |||
return rc | |||
end | end | ||
return p | return p | ||