imported>Oetterer K (Schützte „Modul:Util“: Automatic protection of selected project pages ([Bearbeiten=Nur Administratoren erlauben] (unbeschränkt) [Verschieben=Nur Administratoren erlauben] (unbeschränkt))) |
|||
Zeile 7: | Zeile 7: | ||
function p.getSkin() | function p.getSkin() | ||
− | return mw and mw.bootstrap and mw.bootstrap.getSkin() or 'unknown' | + | -- dont shorten this to return mw and mw.bootstrap and mw.bootstrap.getSkin() or 'unknown' |
+ | -- or dependant templates will show missing module bootstrap when BSC is not loaded | ||
+ | if mw and mw.bootstrap then | ||
+ | return mw.bootstrap.getSkin() | ||
+ | else | ||
+ | return 'unknown' | ||
+ | end | ||
end | end | ||
return p | return p |
Version vom 7. Oktober 2022, 16:56 Uhr
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module implements various general utility functions to be used via #invoke
.
Usage[Quelltext bearbeiten]
{{#invoke:Util|getSkin}}
- returns name of active skin, if Extension:BootstrapComponents is installed, "unknown" otherwise.
local p = {}
function p.globalFileExtension()
-- return '.png'
return '.svg'
end
function p.getSkin()
-- dont shorten this to return mw and mw.bootstrap and mw.bootstrap.getSkin() or 'unknown'
-- or dependant templates will show missing module bootstrap when BSC is not loaded
if mw and mw.bootstrap then
return mw.bootstrap.getSkin()
else
return 'unknown'
end
end
return p