Moduł:Dopracować: Różnice pomiędzy wersjami
Usunięta treść Dodana treść
Nie podano opisu zmian |
Nie podano opisu zmian |
||
Linia 63:
-- scan well known reasons with date
local object = pf:getArgument(k)
if object then
▲ for k, i in pairs(mapParamToReason) do
local
if
▲ elseif onlyReason ~= i then
▲ break
end▼
end
end
end
end
end▼
end
end
end
end
Linia 214 ⟶ 211:
end;
function Templates()
if((
sourceTemplates = (section) and resources.sectionTemplates or resources.otherTemplates
templates["{{unit type}}"]="Jednostki"
templates["{{comma}}"]="";
elseif(
sourceTemplates = (section) and resources.sectionTemplates or resources.userTemplates
templates["{{unit type}}"]="Jednostki użytkowników"
templates["{{comma}}"]=",";
elseif(
sourceTemplates = (section) and resources.sectionTemplates or resources.pomocTemplates
templates["{{unit type}}"]="Strony pomocy"
templates["{{comma}}"]=",";
elseif(
if(((
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdraftprojectTemplates;
else
sourceTemplates = (section) and resources.sectionTemplates or resources.projektTemplates;
end;
if(((
templates["{{unit type}}"]="Jednostki brudnopisu projektu"
else
Linia 238 ⟶ 235:
end;
templates["{{comma}}"]=",";
elseif(
if(((
or((not mw.ustring.match(
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdrafttemplateTemplates
templates["{{unit type}}"]="Strony brudnopisu opisu szablonów"
Linia 248 ⟶ 245:
end;
templates["{{comma}}"]=",";
elseif(
if(((
or((not mw.ustring.match(
sourceTemplates = (section) and resources.sectionTemplates or resources.documentationdraftmoduleTemplates;
templates["{{unit type}}"]="Strony brudnopisu opisu modułów"
Linia 258 ⟶ 255:
end;
templates["{{comma}}"]=",";
elseif(
sourceTemplates = (section) and resources.sectionTemplates or resources.categoryTemplates
templates["{{unit type}}"]="Strony kategorii"
templates["{{comma}}"]=",";
elseif(
if(
if(
sourceTemplates=(section) and resources.sectionTemplates or resources.articleTemplates;
templates["{{unit type}}"]="Artykuły"
Linia 274 ⟶ 271:
end;
else
local test2=string.match(
sourceTemplates=(section) and resources.sectionTemplates or ManualAndTemplates(test2);
if(test2)then
Linia 284 ⟶ 281:
end;
end;
elseif(
if(
if(
sourceTemplates=(section) and resources.sectionTemplates or resources.articleTemplates;
templates["{{unit type}}"]="Artykuły dla dzieci"
Linia 296 ⟶ 293:
end;
else
local test2=string.match(
sourceTemplates=(section) and resources.sectionTemplates or ManualAndTemplates(test2);
if(test2)then
Linia 317 ⟶ 314:
templates[k] = v
end
if(
templates["{{M}}"] = templates["{{M}}"].." dla dzieci"
templates["{{B}}"] = templates["{{B}}"].." dla dzieci"
Linia 330 ⟶ 327:
end;
templates[resources.data.dateTemplate] = date or ""
if
templates[resources.data.talkNameTemplate] =
end
templates["{{FULLPAGENAMEE}}"] = mw.uri.encode(
templates["{{PAGENAMEE}}"] = mw.uri.encode(
templates["{{BASEPAGENAMEE}}"] = mw.uri.encode(
templates["{{SUBPAGENAMEE}}"] = mw.uri.encode(
templates["{{FULLPAGENAME}}"] =
templates["{{PAGENAME}}"] =
templates["{{BASEPAGENAME}}"] =
templates["{{SUBPAGENAME}}"] =
templates[resources.data.pageUrlTemplate] =
templates["{{Cat}}"] = resources.data.defaultcategory
templates[resources.data.talkSectionTemplate] =
local defaultComment, _ = string.gsub(c.default or "", resources.data.templatePattern, templates)
templates[resources.data.infoTemplate] = ((comments)and(#comments > 0)) and ((c.prefix or "")..table.concat(comments, c.separator or ", ")..(c.suffix or "")) or defaultComment
Linia 349 ⟶ 346:
-- prepare "talk" hint
local talk = ""
if
talk, _ = string.gsub(reason.talk or "", resources.data.templatePattern, templates)
end
Linia 355 ⟶ 352:
return templates
end
local defaultDate = args.pf.args[resources.data.defaultDateIndex] or ""▼
title = mw.title.getCurrentTitle()
pf = frame:getParent()
nazwa_przestrzeni_nazw=pf.args["nazwa przestrzeni nazw"]
nazwij_jednostka=pf.args["nazwij jednostką"]
typ_jednostki=pf.args["typ jednostki"]
nazwa_jednostki=pf.args["nazwa jednostki"]
strona_glowna_projektu=pf.args["strona główna projektu"]
strona_glowna_projektu=(not strona_glowna_projektu) and "Wikibooks:Strona główna" or string.gsub(strona_glowna_projektu,"_"," ");
strona_glowna_wikijuniora=pf.args["strona główna dla dzieci"]
strona_glowna_wikijuniora=(not strona_glowna_wikijuniora)and "Wikijunior:Strona główna" or string.gsub(strona_glowna_wikijuniora,"_"," ");
nazwa_przestrzeni_nazw=(not nazwa_przestrzeni_nazw)and title.nsText or nazwa_przestrzeni_nazw;
nazwa_przestrzeni_nazw=require("Module:Nazwy").NpFun{nazwa=nazwa_przestrzeni_nazw};
nazwa_jednostki=(not nazwa_jednostki)and title.text or nazwa_jednostki
local uchwyt_nazwy_przestrzeni_nazw=mw.site.namespaces[nazwa_przestrzeni_nazw];
if(uchwyt_nazwy_przestrzeni_nazw)then
nazwa_przestrzeni_nazw2=mw.ustring.gsub(uchwyt_nazwy_przestrzeni_nazw.name,"_"," ");
nazwa_przestrzeni_nazw=nazwa_przestrzeni_nazw2;
else
nazwa_przestrzeni_nazw2="";
if(nazwa_jednostki~="")then
prawidlowa_nazwa_jednostki=mw.title.makeTitle('',nazwa_jednostki);
if(prawidlowa_nazwa_jednostki)then
title=(nazwa_przestrzeni_nazw=="")and mw.title.makeTitle('',nazwa_jednostki)
or mw.title.makeTitle('',nazwa_przestrzeni_nazw..":"..nazwa_jednostki)
nstext=(title)and mw.ustring.gsub(title.nsText,"_"," ") or nil;
else
title=nil;
end;
else
title=nil;
sekcja=pf.args[resources.data.sectionParamIndex];
local complexCategories = {
Linia 362 ⟶ 394:
-- table.insert(result, "[[Kategoria:WP?|"..title.text.."]]")
-- else
table.insert(result, "[[{{Cat}}:{{unit type}} wymagające umieszczenia w odpowiedniej kategorii|".
end,}
local mapParamToReason = {}
Linia 374 ⟶ 406:
-- scan well known reasons with date
for k, i in pairs(mapParamToReason) do
local object =
if object then
local currentDate = object:expand()
Linia 432 ⟶ 464:
end
local sectionParam = scanReasonWithoutDate(resources.data.sectionParamValue)
for i, reason in ipairs(
if(type(i)=="number")then
scanReasonWithoutDate(i,reason)
Linia 438 ⟶ 470:
end
local categories = {}
local bezkategorii=
if((bezkategorii==nil)or(bezkategorii==""))then
for i, v in ipairs(resources.reasons) do
Linia 469 ⟶ 501:
local result = {}
local section = (
local onlyReasonData = resources.reasons[onlyReason]
local mainText = nil
Linia 482 ⟶ 514:
end
if not mainText and not onlyReason then
local date =
if #date > 0 then
date = string.format(resources.data.dateInfix, date)
Linia 495 ⟶ 527:
table.insert(result, mainText)
if
local talkPageMessage, _ = string.gsub((#templates[resources.data.talkSectionTemplate] == 0) and resources.data.talkPage or resources.data.talkSection, resources.data.templatePattern, templates)
table.insert(result, talkPageMessage)
|