Modul:LinkISBN: Unterschied zwischen den Versionen
(local) |
(Wartung) |
||
Zeile 1: | Zeile 1: | ||
-- | -- documentation | ||
local LinkISBN = { | |||
suite = 'LinkISBN', | |||
serial = '2019-07-09', | |||
item = 65157187 | |||
} | |||
-- module variable, i18n | |||
local li = { | local li = { | ||
invalid = ' <span class="error">Ungültige ISBN</span>', | invalid = ' <span class="error">Ungültige ISBN</span>', | ||
Zeile 12: | Zeile 19: | ||
} | } | ||
-- module import | |||
local ci = require( 'Module:Check_isxn' ) | local ci = require( 'Module:Check_isxn' ) | ||
local lb = require( 'Module:LinkBase' ) | local lb = require( 'Module:LinkBase' ) | ||
Zeile 47: | Zeile 55: | ||
function li.linkISBNSet( args ) | function li.linkISBNSet( args ) | ||
args.isbn = args.isbn or args[1] or '' | args.isbn = args.isbn or args[1] or '' | ||
args.noerror = yn( args.noerror or '', false ) | args.noerror = yn( args.noerror or '', false ) | ||
Zeile 56: | Zeile 61: | ||
end | end | ||
local ns = mw.title.getCurrentTitle().namespace | |||
local isDemo = ns == 10 or ns == 828 | |||
local result = '', i, s | local result = '', i, s | ||
Zeile 65: | Zeile 73: | ||
s = li.linkISBN( items[ i ], args.noerror, isDemo ) | s = li.linkISBN( items[ i ], args.noerror, isDemo ) | ||
if s ~= '' then | if s ~= '' then | ||
result = ( result ~= '' and result .. ', ' or '' ) .. s | |||
end | end | ||
end | end |