Modulo:Webarchive: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
importo da en.wiki
 
Moroboshi (discussione | contributi)
Nessun oggetto della modifica
Riga 1:
--[[ ----------------------------------
Lua module implementing the {{webarchive}} template.
 
A merger of the functionality of three templates: {{wayback}}, {{webcite}} and {{cite archives}}
Lua module implementing the {{webarchive}} template.
 
A merger of the functionality of three templates: {{wayback}}, {{webcite}} and {{cite archives}}
]]
Line 11 ⟶ 10:
--[[--------------------------< inlineError >-----------------------
 
Critical error. Render output completely in red. Add to tracking category.
 
]]
Line 24 ⟶ 23:
--[[--------------------------< inlineRed >-----------------------
 
Render a text fragment in red, such as a warning as part of the final output.
Add tracking category.
 
]]
Line 43 ⟶ 42:
--[[--------------------------< trimArg >-----------------------
 
trimArg returns nil if arg is "" while trimArg2 returns 'true' if arg is ""
trimArg2 is for args that might accept an empty value, as an on/off switch like nolink=
 
]]
Line 65 ⟶ 64:
--[[--------------------------< base62 >-----------------------
 
Convert base-62 to base-10
Credit: https://de.wikipedia.org/wiki/Modul:Expr
 
]]
Line 100 ⟶ 99:
--[[--------------------------< tableLength >-----------------------
 
Given a 1-D table, return number of elements
 
]]
Line 113 ⟶ 112:
--[[--------------------------< dateFormat >-----------------------
 
Given a date string, return its format: dmy, mdy, iso, ymd
If unable to determine return nil
 
]]
Line 156 ⟶ 155:
--[[--------------------------< makeDate >-----------------------
 
Given a zero-padded 4-digit year, 2-digit month and 2-digit day, return a full date in df format
df = mdy, dmy, iso, ymd
 
]]
Line 208 ⟶ 207:
--[[--------------------------< decodeWebciteDate >-----------------------
 
Given a URI-path to Webcite (eg. /67xHmVFWP) return the encoded date in df format
 
]]
Line 324 ⟶ 323:
--[[--------------------------< serviceName >-----------------------
 
Given a ___domain extracted by mw.uri.new() (eg. web.archive.org) set tail string and service ID
 
]]
Line 345 ⟶ 344:
ulx.url1.service = "wayback"
ulx.url1.tail = " all'" .. bracketopen .. "Internet Archive" .. bracketclose
tracking = "Categoria:Template Webarchive collegamenti all'Internet Archive'"
elseif mw.ustring.find( host, "webcitation.org", 1, plain ) then
ulx.url1.service = "webcite"
Line 427 ⟶ 426:
--[[--------------------------< parseExtraArgs >-----------------------
 
Parse numbered arguments starting at 2, such as url2..url10, date2..date10, title2..title10
For example: {{webarchive |url=.. |url4=.. |url7=..}}
Three url arguments not in numeric sequence (1..4..7).
Function only processes arguments numbered 2 or greater (in this case 4 and 7)
It creates numeric sequenced table entries like:
urlx.url2.url = <argument value for url4>
urlx.url3.url = <argument value for url7>
Returns the number of URL arguments found numbered 2 or greater (in this case returns "2")
 
]]
Line 475 ⟶ 474:
--[[--------------------------< comma >-----------------------
 
Given a date string, return "," if it's MDY
 
]]
Line 492 ⟶ 491:
--[[--------------------------< createTracking >-----------------------
 
Return data in track[] ie. tracking categories
 
]]