« Module:Version imprimable » : différence entre les versions

Contenu supprimé Contenu ajouté
Aucun résumé des modifications
+ classes CSS, utilisation de la classe CSS error existante
Ligne 62 :
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<span styleclass="color:red;error">Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</span> ' .. BookName .. '\n\n') end
end
end
Ligne 95 :
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<span styleclass="color:red;error">Incorrect book or chapter name</span>' else chapter = '' end
end
 
Ligne 125 :
 
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<span styleclass="color:red;error">Chapter = ' .. chapter .. ' => book name or another subpage name</span> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<span styleclass=\"color:red;error\">No book subpage into the internal link:</span> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<span styleclass=\"color:red;error\">No internal link</span> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
Ligne 191 :
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="navlinks noprint"\n| style="text-align:left; width:33%; font-size:90%;" class="navprevious" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" class="navtitle" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" class="navnext" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
Ligne 215 :
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<span styleclass=\"color:red;error\">No internal link</span>") ~= nil then
fullPageName = nil
else
Ligne 233 :
if (subpageName ~= nil and subpageName ~= "") then
if found == true or homepage == true then
if debug then table.insert(footer, "<span styleclass=\"color:red;error\">Previous & next chapter insertion</span>\n") end
 
if homepage == false then
Ligne 248 :
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<span styleclass=\"color:red;error\">Page</span> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
Ligne 254 :
previousChapter = subpageName
else
if debug then table.insert(footer, "<span styleclass=\"color:red;error\">The current page</span> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<span styleclass=\"color:red;error\">The page</span> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
Ligne 265 :
 
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<span styleclass=\"color:red;error\">No next chapter</span>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)