Module:ScriptItem: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 883: Line 883:
local parts = p.split(p.getDisplayedName(frame), ".")
local parts = p.split(p.getDisplayedName(frame), ".")
local rows = {}
if #parts >= 2  then
if args.type == 'variable' or args.type == 'function' then
local rows = {}
for i=1,(#parts)-1,1 do
if args.type == 'variable' or args.type == 'function' then
rows[i] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[i].."</span>", "Namespace"..(i == 1 and " (Global)" or " (Nested)") }
for i=1,(#parts)-1,1 do
rows[i] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[i].."</span>", "Namespace"..(i == 1 and " (Global)" or " (Nested)") }
end
rows[#parts] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[#parts].."</span>", p.properCase(args.type) }
elseif args.type == 'property' or args.type == 'method' then
rows[1] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..p.properCase(parts[1]).."</span>", "Object (JS Object, Lua Userdata, Squirrel Userdata)" }
rows[2] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[2].."</span>", p.properCase(args.type) }
end
if #rows > 0 then
table.insert(out, "<div style='margin-top: 20px;'></div>")
table.insert(out, "\n'''Break-down'''<br>\n"..p.table(false, rows, { 110, 400 }, false))
end
end
rows[#parts] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[#parts].."</span>", p.properCase(args.type) }
elseif args.type == 'property' or args.type == 'method' then
rows[1] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..p.properCase(parts[1]).."</span>", "Object (JS Object, Lua Userdata, Squirrel Userdata)" }
rows[2] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[2].."</span>", p.properCase(args.type) }
end
if #rows > 0 then
table.insert(out, "<div style='margin-top: 20px;'></div>")
table.insert(out, "\n'''Break-down'''<br>\n"..p.table(false, rows, { 110, 400 }, false))
end
end
end
end
6,834

edits