Changes

Jump to navigation Jump to search
219 bytes added ,  19:31, 18 August 2022
Updated from sandbox: export default classes through new function p.defaultClasses
Line 104: Line 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
   Line 141: Line 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' }
Anonymous user

Navigation menu