Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Logoform: Difference between revisions

From Neodyland Wiki
m +link
m clear
Line 1: Line 1:


-- Parent gallery parameters
--   parameters


local p = {}
local p = {}


--
--
function p.gallery ( frame )
local args = mw.getCurrentFrame():getParent().args;
local tagtab = {};
local instab = {};
local fmat  = args.f or args.format or "";
local mode  = args.m or args.mode or "";
local insv  = "";
local strg  = "";
tagtab [1]  = "\n";
for _, v in ipairs(args) do
strg = strg .. "\006"  .. v
end
strg = mw.ustring.gsub( strg, "[\n]" , "\006" );
local arg2 = args[2] or ".svg"
if fmat == "" then
if args[2] ~= "" then
if mw.ustring.sub (args[1], 1, 1 ) == "\n" then
local inx = mw.ustring.find( arg2 .. "\n", "\n" );
arg2 = mw.ustring.sub ( arg2, 1, inx - 1 );
inx = string.lower(string.gsub(arg2,"^.*%.([^%.]*)$","%1"));
local map = {svg=1, png=1, jpg=1, jpeg=1, gif=1, tif=1, tiff=1, xcf=1, pdf=1 }
if not map[inx] then
fmat = "2"
end
end
end
end


for _, v in ipairs(mw.text.split(strg , "\006") ) do
 
if fmat == "2" then
if insv == "" then
insv = v;
else
if v == "" then
v = "{{F|{{PAGENAME:" .. insv .. "}}}}";
end
table.insert(instab, insv .. "|<center>" .. v .. "</center>" );
insv = ""
end
else
table.insert(instab, v )
end
end
for i, v in ipairs( instab ) do
if v == "" then
tagtab [1] = tagtab [1] .. "\n"
else
tagtab [1] = tagtab [1] .. "\n" .. v
end end
--
if    mode == 'n' then mode = 'nolines'
elseif mode == 'p' then mode = 'packed'
elseif mode == 'o' then mode = 'packed-overlay'
elseif mode == 'h' then mode = 'packed-hover'
elseif mode == 's' then mode = 'slideshow'
elseif mode == 't' then mode = 'traditional'
end
tagtab [2]  = mode;
tagtab [3]  = args.c or args.caption or '';
tagtab [4]  = args.p or args.perrow or '';
tagtab [5]  = args.w or args.widths or '';
tagtab [6]  = args.h or args.heights or '';
tagtab [7]  = args.s or args.style or '';
tagtab [8]  = args.a or args.attr or args.class or '';
tagtab [9]  = args.t or args.text or '';
tagtab [10]  = fmat;
if fmat == ''  then
tagtab [10] = '1';
if mode == ''  then
tagtab [2] = 'nolines';
end
end
return mw.getCurrentFrame():expandTemplate{ title = "G/layout", args = tagtab };
end


return p;
return p;

Revision as of 21:39, 6 February 2020

Module documentation[ create · purge ]
This documentation is transcluded from Module:Logoform/doc.
--   parameters

local p = {}

--



return p;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.