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 768:
Zeile 768:
− local s = fetch( "urn" ).sns;
− +
− r = string.format( ":%s:", area );+
− if s:match( r ) then+
− s = "[^%w%(%)%+,%-%.:=@;%$_!%*'].*$";+
− r = acquire:match( s );+
− else+
− r = string.format( ":%s:", area );+
− end+
− if not r then+
− r = false;+
− if area == "isbn" then+
− if not URIutil.isISBNvalid( acquire ) then+
− r = acquire;+
− end+
− elseif area == "issn" then+
− if not URIutil.isISSNvalid( acquire ) then+
− r = acquire;+
+
+
+
+
+
Zeile 1.435:
Zeile 1.439:
− +
Zeile 1.444:
Zeile 1.448:
+
Zeile 1.450:
Zeile 1.455:
− +
+
+
+
+
+
+
+
+
+
Zeile 1.465:
Zeile 1.479:
− +
+
+
+
+
Zeile 1.486:
Zeile 1.504:
+
Zeile 1.505:
Zeile 1.524:
+
Zeile 1.685:
Zeile 1.705:
− elseif mw.text.trim( attempt ) == "" then
− r = false;
− +
+
+
+
+
+
+
+
Zeile 1.823:
Zeile 1.848:
− URIutil.linkURN( attempt, alter, false, false, alert, at );+
Zeile 1.863:
Zeile 1.888:
− +
2019-01-01
local URIutil = { suite = "URIutil",
local URIutil = { suite = "URIutil",
serial = "2018-07-03",
serial = "2019-01-01",
item = 19644443 };
item = 19644443 };
--[=[
--[=[
-- Returns false if no problem detected
-- Returns false if no problem detected
-- string with violation
-- string with violation
local r;
local r;
if type( s ) == "string" then
if area == "urn" then
r = "urn:";
else
local s = fetch( "urn" ).sns;
if type( s ) == "string" then
r = string.format( ":%s:", area );
if s:match( r ) then
s = "[^%w%(%)%+,%-%.:=@;%$_!%*'].*$";
r = acquire:match( s );
else
r = string.format( ":%s:", area );
end
if not r then
r = false;
if area == "isbn" then
if not URIutil.isISBNvalid( acquire ) then
r = acquire;
end
elseif area == "issn" then
if not URIutil.isISSNvalid( acquire ) then
r = acquire;
end
end
end
end
end
function URIutil.linkURN( attempt, alter, any1, any2, alert, at )
function URIutil.linkURN( attempt, alter, any1, any2, alert, at, alone )
-- Retrieve bracketed titled external URN link
-- Retrieve bracketed titled external URN link
-- Precondition:
-- Precondition:
-- alert -- string, with title of maintenance category, or nil
-- alert -- string, with title of maintenance category, or nil
-- at -- fragment, or nil
-- at -- fragment, or nil
-- alone -- true, if link text not preceded by "urn:"
-- Postcondition:
-- Postcondition:
-- Returns
-- Returns
local r2 = true;
local r2 = true;
local r;
local r;
if not URIutil.mayURI( attempt, true ) then
if URIutil.mayURN( attempt ) then
local e = mw.html.create( "span" )
:addClass( "invalid-URN" )
:wikitext( attempt );
local s = flop( alert );
r = tostring( e ) .. fault( "(?!?!)" );
if s then
r = r .. s;
end
else
local s = attempt:match( "^%s*[uU][rR][nN]:(%S+)%s*$" );
local s = attempt:match( "^%s*[uU][rR][nN]:(%S+)%s*$" );
if s then
if s then
s = string.format( "%s:%s", space, sign );
s = string.format( "%s:%s", space, sign );
if r then
if r then
r = r:gsub( "%$1", "urn:" .. s );
if alone then
r2 = true;
else
r = r:gsub( "%$1", "urn:" .. s );
end
if at then
if at then
r = string.format( "%s#%s", r, at );
r = string.format( "%s#%s", r, at );
space, sign );
space, sign );
end
end
r2 = not alone;
else
else
s = "link" .. space:upper();
s = "link" .. space:upper();
r = mw.text.trim( attempt );
r = mw.text.trim( attempt );
end
end
r2 = false;
end
end
return r, r2;
return r, r2;
r = s;
r = s;
end
end
else
else
r = "urn:";
s = mw.text.trim( attempt );
if s == "" then
r = false;
elseif s:match( "^https?://" ) then
r = "http:";
else
r = "urn:";
end
end
end
end
end
-- Returns link, or plain string if bad URN
-- Returns link, or plain string if bad URN
local r, l =
local r, l =
URIutil.linkURN( attempt, alter, false, false, alert, at, true );
if l then
if l then
local s = fetch( "config" ).supportURN;
local s = fetch( "config" ).supportURN;
local vsn = ent:formatPropertyValues( "P348" );
local vsn = ent:formatPropertyValues( "P348" );
if type( vsn ) == "table" and
if type( vsn ) == "table" and
type( vsn.value) == "string" and
type( vsn.value ) == "string" and
vsn.value ~= "" then
vsn.value ~= "" then
r = vsn.value;
r = vsn.value;