Modulo:Bozza: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
+ |
aggiorno |
||
Riga 2:
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function
local i, j = str:find(pattern, 1, true)
str = str:sub(0, i - 1) .. replace .. str:sub(j + 1)
return str
:gsub('<!%-%-.-%-%->', '')▼
:gsub('<nowiki>.-</nowiki>', '')▼
:gsub('%{%{ *[Cc]ategorie *bozza *%|.-%}%}', '')▼
end
local function
local text = mw.title.getCurrentTitle():getContent() or ''▼
local old_tmp = tmp
end▼
stored_submissions, tmp = getSubmissions(stored_submissions, tmp)
new_text = replace(new_text, old_tmp, tmp)
new_text = replace(new_text, request, '')
local pattern = "%[%[ *([Cc][Aa][Tt][Ee][Gg][Oo][Rr][YyIi][Aa]?) *: *[^%s][^\n]-%]%]"▼
tmp = tmp:gsub('%{%b{}%}', '{{')
▲ for colonprefix in text:gmatch(pattern) do
table.insert(stored_submissions.old, request)
local ns = mw.site.namespaces[colonprefix]▼
else▼
table.insert(stored_submissions.current, request)
if ns and ns.canonicalName == 'Category' then▼
end▼
return '[[Categoria:Bozze con categorie da disabilitare]]'▼
end
end
return stored_submissions, new_text
end
function p.
if current_title.namespace == 0 then
return '[[Categoria:Rimuovere template Bozza]]'
▲ local declined = false
▲ end
local lang = mw.language.getContentLanguage()▼
local text = current_title:getContent()
▲ for str in text:gmatch('%{%{ *[Rr]ichiesta *revisione *bozza *(%|.-%})%}') do
▲ if str:find('%| *1? *=? *respinta *[%|%}]') then
▲ else
if not text then return end
return 'R'▼
text
▲ end
▲ :gsub('<!%-%-.-%-%->', '')
▲ :gsub('<nowiki>.-</nowiki>', '')
:gsub('%f[%{]%{%f[^%{]', '\r')
▲ :gsub('%{%{ *[Cc]ategorie *bozza *%|.-%}%}', '')
local args = getArgs(frame, { parentOnly = true })
▲ local lang = mw.language.getContentLanguage()
local state = lang:ucfirst(args[1] or '')
local submissions = getSubmissions({ current = {}, old = {} }, text)
if #submissions.current > 0 then
elseif #submissions.old > 0 and state ~= 'A' then
state = 'N'
end
end
local ret = frame:expandTemplate{
▲ if declined then
title = 'Template:Bozza',
args = { state, ts = args.ts }
}
if current_title.namespace == 118 then
for colonprefix in text:gmatch('%[%[ *(' .. catpattern .. ') *: *[^%s][^\n]-%]%]') do
▲ local ns = mw.site.namespaces[colonprefix]
▲ if ns and ns.canonicalName == 'Category' then
break
end
end
end
return
end
|