Module:Gallery and Module:Gallery/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
Returning to the new version + fixes tested in the sandbox and in a local mediawiki. The problem was because the parser was interpreting the pipe as part of the url in the reported case. |
Automatically detecting if in main or Sandbox. Reducing the difference between versions helps working with it and prevents mistakes. (I also tested on a local mediawiki) |
||
Line 3: | Line 3: | ||
local p = {} |
local p = {} |
||
local moduleName = mw.getCurrentFrame():getTitle() |
|||
⚫ | |||
local isSandbox = mw.ustring.match(moduleName, "sandbox") ~= nil |
|||
⚫ | |||
local cssRootClass = 'mod-gallery' .. (isSandbox and '-sb' or '') |
|||
local yesno = require('Module:Yesno') |
local yesno = require('Module:Yesno') |
||
local plaintextModule = require('Module:Plain text') |
local plaintextModule = require('Module:Plain text') |
||
Line 100: | Line 105: | ||
local tbl = mw.html.create('div') |
local tbl = mw.html.create('div') |
||
tbl:addClass( |
tbl:addClass(cssRootClass) |
||
if args.state then |
if args.state then |
||
tbl |
tbl |
||
:addClass(' |
:addClass(cssRootClass .. '-collapsible') |
||
:addClass('collapsible') |
:addClass('collapsible') |
||
:addClass(args.state) |
:addClass(args.state) |
||
Line 112: | Line 117: | ||
tbl:cssText(args.style) |
tbl:cssText(args.style) |
||
else |
else |
||
tbl:addClass(' |
tbl:addClass(cssRootClass .. '-default') |
||
end |
end |
||
if args.align then |
if args.align then |
||
tbl:addClass(' |
tbl:addClass(cssRootClass .. '-' .. args.align:lower()) |
||
end |
end |
||