Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.
Änderungen
Zur Navigation springen
Zur Suche springen
Zeile 1:
Zeile 1:
− +
Zeile 12:
Zeile 12:
− +
− +
Zeile 29:
Zeile 29:
+
+
+
+
+
+
+
+
+
+
+
+
+
Zeile 44:
Zeile 57:
− +
− apply )
Zeile 68:
Zeile 80:
− +
+
+
− +
− +
− Config.frame = mw.getCurrentFrame() +
− +
− Config.errCat = false +
− Config.errHide = false
− scope = string.format( "%s error", Config.errClass )
− else
− scope = Config.errClass
− +
− style = "style='display:none'" +
+
+
+
+
− style = "" +
− end+
− if Config.errClasses then+
− scope = string.format( "%s %s",+
− scope, Config.errClasses )+
+
+
+
+
+
+
+
+
+
+
− r = string.format( "<span class=\"%s\" %s>%s</span>",
− scope, style, story )
Zeile 123:
Zeile 145:
− +
Zeile 152:
Zeile 174:
− +
− +
− +
− util = util.URIutil(); +
− util = "library URIutil invalid"; +
− +
− +
− +
− +
Zeile 178:
Zeile 200:
− +
Zeile 236:
Zeile 258:
− +
Zeile 251:
Zeile 273:
− +
− frame:getTitle(),+
− r )
Modul:Vorlage:Handle (Quelltext anzeigen)
Version vom 10. Januar 2018, 12:11 Uhr
, 12:11, 10. Jan. 20182018-01-10
local Serial = "2016-11-24"
local Serial = "2018-01-10"
--[=[
--[=[
Template:Handle {{DOI}} {{HDL}}
Template:Handle {{DOI}} {{HDL}}
doi = { showArticle = "Digital Object Identifier",
doi = { showArticle = "Digital Object Identifier",
showName = "DOI",
showName = "DOI",
stemURL = "https://doi.org/" },
stemURL = "//doi.org/" },
hdl = { showArticle = false,
hdl = { showArticle = false,
showName = "Handle",
showName = "Handle",
stemURL = "https://hdl.handle.net/" },
stemURL = "//hdl.handle.net/" },
errCat = false,
errCat = false,
errClass = "error_Handle",
errClass = "error_Handle",
de = "(zurzeit nicht erreichbar)" }
de = "(zurzeit nicht erreichbar)" }
}
}
Config.fault = function ( alert )
-- Format error message by class=error
-- Parameter:
-- alert -- string, error message
-- Returns:
-- string, HTML span
return tostring( mw.html.create( "span" )
:addClass( "error" )
:wikitext( alert ) )
end -- Config.fault()
end
end
else
else
r = string.format( "<span class=\"error\">????.%s.????</span>",
r = Config.fault( string.format( "????.%s.????", apply ) )
end
end
return r
return r
local function fault( alert, add )
local function failed( alert, add )
-- Format message with class="error" or similar
-- Format message with class="error" or similar
-- alert -- string, with message key
-- alert -- string, with message key
-- add -- string, with additional information, or nil
-- add -- string, with additional information, or nil
-- Returns message with markup
-- Returns message with markup
local lucky, TemplUtl = pcall( require, "Module:TemplUtl" )
local scope = Config.errClass
local story = factory( alert )
local story = factory( alert )
local r, scope, style
local r
if add then
if add then
story = string.format( "%s %s", story, add )
story = string.format( "%s %s", story, add )
end
end
if not Config.frame then
if Config.errClasses then
scope = string.format( "%s %s", scope, Config.errClasses )
end
end
if Config.frame:preprocess( "{{REVISIONID}}" ) == "" then
if type( TemplUtl ) == "table" then
TemplUtl = TemplUtl.TemplUtl()
end
end
if Config.errHide then
if type( TemplUtl ) == "table" and
type( TemplUtl.failure ) == "function" then
r = TemplUtl.failure( story,
not Config.errHide,
scope,
Config.frame )
else
else
-- LEGACY and global wiki mode
local element = mw.html.create( "span" )
:addClass( scope )
if not Config.frame then
Config.frame = mw.getCurrentFrame()
end
if Config.frame:preprocess( "{{REVISIONID}}" ) == "" then
Config.errCat = false
Config.errHide = false
element:addClass( "error" )
end
if Config.errHide then
element:css( "display", "none" )
end
r = tostring( element:wikitext( story ) )
end
end
if Config.errCat then
if Config.errCat then
if Config.errNS then
if Config.errNS then
end
end
return r
return r
end -- fault()
end -- failed()
table.concat( unknown, " " ),
table.concat( unknown, " " ),
Config.scheme )
Config.scheme )
r = fault( "errUnkown", r )
r = failed( "errUnkown", r )
else
else
local lucky, util = pcall( require, "Module:URIutil" );
local lucky, URIutil = pcall( require, "Module:URIutil" )
if lucky then
if lucky then
if type( util ) == "table" then
if type( URIutil ) == "table" then
URIutil = URIutil.URIutil()
else
else
URIutil = "library URIutil invalid"
end
end
end
end
if type( util ) ~= "table" then
if type( URIutil ) ~= "table" then
error( util, 0 );
error( URIutil, 0 )
end
end
if util[ "is" .. Config.showName ]( access ) then
if URIutil[ "is" .. Config.showName ]( access ) then
r = util[ "link" .. Config.showName ]( access )
r = URIutil[ "link" .. Config.showName ]( access )
if Config.showArticle then
if Config.showArticle then
r = string.format( "[[%s|%s]]:%s",
r = string.format( "[[%s|%s]]:%s",
end
end
else
else
r = fault( "errInvalid",
r = failed( "errInvalid",
string.format( "%s=%s",
string.format( "%s=%s",
Config.showName,
Config.showName,
Config.errHide = false
Config.errHide = false
Config.errClass = "error"
Config.errClass = "error"
r = fault( "errScheme", argsF.scheme )
r = failed( "errScheme", argsF.scheme )
end
end
else
else
lucky, r = pcall( p.main, frame.args, frame:getParent().args )
lucky, r = pcall( p.main, frame.args, frame:getParent().args )
if not lucky then
if not lucky then
r = string.format( "<span class=\"error\">%s * %s</span>",
r = Config.fault( string.format( "%s * %s",
frame:getTitle(), r ) )
end
end
return r
return r