Content deleted Content added
check gallery files for non-free content |
allow filenames to be specified in {{Transclude files as random slideshow}} |
||
Line 95:
function makeTranscludedGalleryLinesTables(args)
local namespaceNumber = function(pagetitle)
local titleObject = mw.title.new(pagetitle)
return titleObject and titleObject.namespace
local lines = {}
local i = 1
while args[i] do
if namespaceNumber(args[i]) == 6 then -- file namespace
local line = makeGalleryLine(args[i], args['caption'..i], args['credit'..i])
local content, pagename = excerptModule.getContent(args[i])▼
if not pagename then▼
else
return error('Cannot read a valid page for "' .. args[i] .. '"', 0)▼
▲ local content, pagename = excerptModule.getContent(args[i])
▲ if not pagename then
▲ return error('Cannot read a valid page for "' .. args[i] .. '"', 0)
▲ end
end
if args['section'..i] then
content = excerptModule.cleanupText(content)▼
content = excerptModule.getsection(content, args['section'..i]) or ''
end▼
▲ content = excerptModule.cleanupText(content)
if galleryFiles then▼
for _, f in pairs(galleryFiles) do▼
▲ if galleryFiles then
local isOkay = excerptModule.checkimage(filename)▼
▲ for _, f in pairs(galleryFiles) do
if isOkay then▼
local filename = string.gsub(f, '{{!}}.*', '')
▲ table.insert(lines, f)
▲ local isOkay = excerptModule.checkimage(filename)
▲ if isOkay then
table.insert(lines, f)▼
end
end
end
▲ end
local otherFiles = excerptModule.parse(content, {fileflags="1-100"}, true)▼
if otherFiles then
▲ local otherFiles = excerptModule.parse(content, {fileflags="1-100"}, true)
if f and f ~= '' and mw.ustring.sub(f, 1, 5) == 'File:' then▼
table.insert(lines, f)
▲ if f and f ~= '' and mw.ustring.sub(f, 1, 5) == 'File:' then
end
▲ table.insert(lines, f)
end
end
end
i = i + 1
end
|