Модуль:Webarchive: відмінності між версіями
[неперевірена версія] | [неперевірена версія] |
Вилучено вміст Додано вміст
Створена сторінка: --[[ ---------------------------------- Lua module implementing the {{webarchive}} template. A merger of the functionality of three templates: {{... |
Немає опису редагування |
||
Рядок 332:
end
ulx.url1.service = "
ulx.url1.tail = "
if mw.ustring.find( host, "archive.org", 1, plain ) then
ulx.url1.service = "wayback"
ulx.url1.tail = "
tracking = "Category:Webarchive template wayback links"
elseif mw.ustring.find( host, "webcitation.org", 1, plain ) then
ulx.url1.service = "webcite"
ulx.url1.tail = "
tracking = "Category:Webarchive template webcite links"
elseif mw.ustring.find( host, "archive.is", 1, plain ) then
ulx.url1.service = "
ulx.url1.tail = "
tracking = "Category:Webarchive template archiveis links"
elseif mw.ustring.find( host, "archive.today", 1, plain ) then
ulx.url1.service = "archiveis"
ulx.url1.tail = "
tracking = "Category:Webarchive template archiveis links"
elseif mw.ustring.find( host, "archive-it", 1, plain ) then
ulx.url1.service = "archiveit"
ulx.url1.tail = "
elseif mw.ustring.find( host, "arquivo.pt", 1, plain) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "loc.gov", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "webharvest.gov", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "bibalex.org", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "collectionscanada", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "haw.nsk", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "nlib.ee", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "vefsafn.is", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "proni.gov", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "uni-lj.si", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "stanford.edu", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "nationalarchives.gov.uk", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "parliament.uk", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "webarchive.org.uk", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "nlb.gov.sg", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "nlb.gov.sg", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "screenshots.com", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "wikiwix.com", 1, plain ) then
ulx.url1.tail = "
elseif mw.ustring.find( host, "perma.cc", 1, plain ) then
ulx.url1.tail = "
else
tracking = "Category:Webarchive template unknown archives"
Рядок 428:
ulx[argurl2]["date"] = args[argdate]
else
ulx[argurl2]["date"] = inlineRed("[
end
argtitle = "title" .. j
Рядок 504:
if ulx.url1.format == "none" then
if not ulx.url1.title and not ulx.url1.date then -- No title. No date
sand = "[" .. ulx.url1.url .. "
elseif not ulx.url1.title and ulx.url1.date then -- No title. Date.
if ulx.url1.service == "wayback" then
Рядок 510:
period2 = ""
end
sand = "[" .. ulx.url1.url .. "
elseif ulx.url1.title and not ulx.url1.date then -- Title. No date.
sand = "[" .. ulx.url1.url .. " " .. ulx.url1.title .. "]" .. ulx.url1.tail
Рядок 520:
if ulx.url1.extraurls > 0 then -- For multiple archive URLs
local tot = ulx.url1.extraurls + 1
sand = sand .. period2 .. "
for i=2,tot do
local indx = "url" .. i
Рядок 543:
else
if ulx.url1.format == "addlarchives" then -- Multiple archive services
displayheader = "
else -- Multiple pages from the same archive
displayheader = "
end
local tot = 1 + ulx.url1.extraurls
Рядок 558:
else
if not displayfield then
displayfield = "
end
end
Рядок 588:
local url1 = trimArg(args.url) or trimArg(args.url1)
if not url1 then
return inlineError("url", "
end
if mw.ustring.find( url1, "https://web.http", 1, plain ) then -- track bug
Рядок 617:
local udate = decodeWaybackDate( uri1.path, ldf )
if udate ~= date then
date = udate .. inlineRed("<sup>[
end
end
Рядок 626:
if udate == "query" then -- skip
elseif udate ~= date then
date = udate .. inlineRed("<sup>[
end
end
Рядок 632:
date = decodeWaybackDate( uri1.path, "iso" )
if not date then
date = inlineRed("[
end
elseif not date and ulx.url1.service == "webcite" then
date = decodeWebciteDate( uri1.path, "iso" )
if date == "query" then
date = inlineRed("[
elseif not date then
date = inlineRed("[
end
elseif not date then
date = inlineRed("[
end
ulx.url1.date = date
Рядок 672:
local rend = createRendering()
if not rend then
rend = '<span style="font-size:100%" class="error citation-comment">
track["Category:Webarchive template errors"] = 1
end
|