Module:File license: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
no edit summary
No edit summary
No edit summary
Line 31: Line 31:
sourceText = " from " .. source
sourceText = " from " .. source
end
end
local copyrightHolderData = mw.loadData("Module:File license/data/copyright holders")
local imageCode = ""
local imageCode = ""
Line 36: Line 38:
imageCode = '<span style="margin-top:5px;float:left;margin-right:10px;">[[File:' .. image .. '|' .. tostring(imageSize) .. "px]]</span>"
imageCode = '<span style="margin-top:5px;float:left;margin-right:10px;">[[File:' .. image .. '|' .. tostring(imageSize) .. "px]]</span>"
else
else
local imageData = mw.loadData("Module:File license/data/images")
if copyrightHolderData[copyrightHolder][2] then
if imageData[copyrightHolder] then
imageCode = '<span style="margin-top:5px;float:left;margin-right:10px;">[[File:' .. copyrightHolderData[copyrightHolder][2] .. '|' .. tostring(imageSize) .. "px]]</span>"
imageCode = '<span style="margin-top:5px;float:left;margin-right:10px;">[[File:' .. imageData[copyrightHolder] .. '|' .. tostring(imageSize) .. "px]]</span>"
end
end
end
end
Line 44: Line 45:
local copyrightHolderText = ""
local copyrightHolderText = ""
if copyrightHolder ~= "" then
if copyrightHolder ~= "" then
local copyrightHolderData = mw.loadData("Module:File license/data/copyright holders")
if copyrightHolderData[copyrightHolder][1] then
if copyrightHolderData[copyrightHolder] then
copyrightHolderText = frame:preprocess(copyrightHolderData[copyrightHolder][1])
copyrightHolderText = frame:preprocess(copyrightHolderData[copyrightHolder])
elseif copyrightHolderDisplay then
elseif copyrightHolderDisplay then
copyrightHolderText = "[[" .. copyrightHolder .. "|" .. copyrightHolderDisplay .. "]]"
copyrightHolderText = "[[" .. copyrightHolder .. "|" .. copyrightHolderDisplay .. "]]"
else
else
copyrightHolderText = copyrightHolder
copyrightHolderText = frame:preprocess(copyrightHolder)
end
end
end
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.