Modul:Hatnote: Unterschied zwischen den Versionen

Updated from sandbox: export default classes through new function p.defaultClasses
(Fix for fragile conditional)
(Updated from sandbox: export default classes through new function p.defaultClasses)
Zeile 104: Zeile 104:
disambiguator = disambiguator or 'disambiguation'
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
end


Zeile 141: Zeile 149:
hatnote
hatnote
:attr('role', 'note')
:attr('role', 'note')
:addClass(inline == 1 and 'hatnote-inline' or 'hatnote')
:addClass(p.defaultClasses(inline))
:addClass('navigation-not-searchable')
:addClass(extraclasses)
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
:wikitext(s)
 
return mw.getCurrentFrame():extensionTag{
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
Anonymer Benutzer