Modulo:Fumetto e animazione/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
+ |
m Bot: rimuovo no globals obsoleto |
||
(18 versioni intermedie di un altro utente non mostrate) | |||
Riga 4:
]]
require('
local cfg = mw.loadData("Modulo:Fumetto e animazione/Configurazione/sandbox")
Riga 60:
genre = mw.text.trim(genre:lower())
end
return
end
end
Riga 66:
-- Parsifica i parametri rimuovendo le stringhe vuote
local function parse_args(args)
local ret = {}
for key, value in pairs(args) do
if end
end
return
end
Riga 129 ⟶ 131:
-- Cerca il nome o l'alias del medium nella configurazione
function Media:_getValue(
return cfg[
cfg[
cfg[
end
Riga 148 ⟶ 150:
self.args = args
self.media = Media:new(args)
self.error_category = false▼
self.year = self:_getYear()
self.genre_table_name = self:_getGenreTableName()
▲ self.error_category = false
self.categories = {}
self.tables_matched = {}
Riga 214 ⟶ 216:
self:_addCategoriesBy('studio')
local broadcaster
if self.media:inArray('film TV', 'serie TV') then
▲ local network = self.args['rete 1'] or self.args.rete
broadcaster = self:_getCategory(network, 'rete')
elseif network and self.media:inArray('ONA', 'webserie') then
self.error_category = true
end
if not
local platform = self.args['streaming 1'] or self.args.streaming
broadcaster = self:_getCategory(platform, 'streaming')
Riga 266 ⟶ 270:
-- Formatta e aggiunge una categoria
function CategoryManager:_addCategory(category)
if self.args.
table.insert(self.categories, string.format('[[Categoria:%s]]', category))
end
Riga 289 ⟶ 293:
-- Aggiunge una o più categorie per genere dell'opera
function CategoryManager:_addCategoryByGenre(value)
for genre
▲ local categories = cfg[self.genre_table_name][alias] or
if categories then
for _, category in ipairs(categories) do
Riga 365 ⟶ 367:
local start_date = self.args['data inizio'] or ''
local end_date = self.args['data fine'] or ''
local year = (start_date .. ' ' .. end_date):match('%f[%w]%d%d%d%d%f[%W]')
if year then
return year
else
self.
end
end
Riga 406 ⟶ 408:
function p.generi(frame)
local ret = {}
local args =
for genre
local wikilink =
table.insert(ret, wikilink and (wikilink .. tail) or default)
end
Riga 417 ⟶ 419:
-- una data tabella nella configurazione
function p.tabella_configurazione(frame)
local table_name =
if not cfg[table_name] then return end
local root = mw.html.create('table')
|