http://proplan.55bet-pro.com/wiki/index.php?action=history&feed=atom&title=M%C3%B3dulo%3ALua_banner
Módulo:Lua banner - Histórico de revisão-55BET Pro
2026-04-05T00:24:59Z
Histórico de revisões para esta página neste wiki
MediaWiki 1.42.7
http://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:Lua_banner&diff=165&oldid=prev
Módulo:Lua banner - Histórico de revisão-55BET Pro
2024-06-27T11:12:00Z
<p>uma edição</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="pt-BR">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Edição anterior</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Edição das 08h12min de 27 de junho de 2024</td>
</tr><tr><td colspan="2" class="diff-notice" lang="pt-BR"><div class="mw-diff-empty">(Sem diferença)</div>
</td></tr></table>
Henryzord
http://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:Lua_banner&diff=164&oldid=prev
Módulo:Lua banner - Histórico de revisão-55BET Pro
2024-04-05T02:45:24Z
<p>protect against "mw.title.new()" returns "nil"</p>
<p><b>Página nova</b></p><div>-- This module implements the {{lua}} template.<br />
local yesno = require('Module:Yesno')<br />
local mList = require('Module:List')<br />
local mTableTools = require('Module:TableTools')<br />
local mMessageBox = require('Module:Message box')<br />
<br />
local p = {}<br />
<br />
function p.main(frame)<br />
local origArgs = frame:getParent().args<br />
local args = {}<br />
for k, v in pairs(origArgs) do<br />
v = v:match('^%s*(.-)%s*$')<br />
if v ~= '' then<br />
args[k] = v<br />
end<br />
end<br />
return p._main(args)<br />
end<br />
<br />
function p._main(args)<br />
local modules = mTableTools.compressSparseArray(args)<br />
local box = p.renderBox(modules)<br />
local trackingCategories = p.renderTrackingCategories(args, modules)<br />
return box .. trackingCategories<br />
end<br />
<br />
function p.renderBox(modules)<br />
local boxArgs = {}<br />
if #modules < 1 then<br />
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'<br />
else<br />
local moduleLinks = {}<br />
for i, module in ipairs(modules) do<br />
moduleLinks[i] = string.format('[[:%s]]', module)<br />
local maybeSandbox = mw.title.new(module .. '/sandbox')<br />
if maybeSandbox and maybeSandbox.exists then<br />
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)<br />
end<br />
end<br />
local moduleList = mList.makeList('bulleted', moduleLinks)<br />
local title = mw.title.getCurrentTitle()<br />
if title.subpageText == "doc" then<br />
title = title.basePageTitle<br />
end<br />
if title.contentModel == "Scribunto" then<br />
boxArgs.text = 'This module depends on the following other modules:' .. moduleList<br />
else<br />
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList<br />
end<br />
end<br />
boxArgs.type = 'notice'<br />
boxArgs.small = true<br />
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'<br />
return mMessageBox.main('mbox', boxArgs)<br />
end<br />
<br />
function p.renderTrackingCategories(args, modules, titleObj)<br />
if yesno(args.nocat) then<br />
return ''<br />
end<br />
<br />
local cats = {}<br />
<br />
-- Error category<br />
if #modules < 1 then<br />
cats[#cats + 1] = 'Lua templates with errors'<br />
end<br />
<br />
-- Lua templates category<br />
titleObj = titleObj or mw.title.getCurrentTitle()<br />
local subpageBlacklist = {<br />
doc = true,<br />
sandbox = true,<br />
sandbox2 = true,<br />
testcases = true<br />
}<br />
if not subpageBlacklist[titleObj.subpageText] then<br />
local protCatName<br />
if titleObj.namespace == 10 then<br />
local category = args.category<br />
if not category then<br />
local categories = {<br />
['Module:String'] = 'Templates based on the String Lua module',<br />
['Module:Math'] = 'Templates based on the Math Lua module',<br />
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',<br />
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'<br />
}<br />
category = modules[1] and categories[modules[1]]<br />
category = category or 'Lua-based templates'<br />
end <br />
cats[#cats + 1] = category<br />
protCatName = "Templates using under-protected Lua modules"<br />
elseif titleObj.namespace == 828 then<br />
protCatName = "Modules depending on under-protected modules"<br />
end<br />
if not args.noprotcat and protCatName then<br />
local protLevels = {<br />
autoconfirmed = 1,<br />
extendedconfirmed = 2,<br />
templateeditor = 3,<br />
sysop = 4<br />
}<br />
local currentProt<br />
if titleObj.id ~= 0 then<br />
-- id is 0 (page does not exist) if am previewing before creating a template.<br />
currentProt = titleObj.protectionLevels["edit"][1]<br />
end<br />
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end<br />
for i, module in ipairs(modules) do<br />
if module ~= "WP:libraryUtil" then<br />
local moduleTitle = mw.title.new(module)<br />
local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1]<br />
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end<br />
if moduleProt < currentProt then<br />
cats[#cats + 1] = protCatName<br />
break<br />
end<br />
end<br />
end<br />
end<br />
end<br />
for i, cat in ipairs(cats) do<br />
cats[i] = string.format('[[Category:%s]]', cat)<br />
end<br />
return table.concat(cats)<br />
end<br />
<br />
return p</div>
infobox>Uzume