Module:Shortcut: Difference between revisions

Jump to navigation Jump to search
376 bytes removed ,  5 years ago
redo templatestyles
m (1 revision imported: Basic templates)
enwiki>Galobtter
(redo templatestyles)
Line 55:
 
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Shortcut/styles.css'} })
 
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
:css('position', 'relative')
:css('top', '-3em')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
 
root:newline() -- To match the old [[Template:Shortcut]]
 
-- Shortcut heading
Line 75 ⟶ 72:
shortcutHeading = message(cfg['shortcut-heading'], nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
shortcutHeading = shortcutHeading .. '\n'
end
end
Line 82 ⟶ 78:
local shortcutList = root
:tag('div')
:addClass('shortcutboxmodule-shortcutboxplain plainlist noprint')
:attr('role', 'note')
:css('float', 'right')
:css('border', '1px solid #aaa')
:css('background', '#fff')
:css('margin', '0em 0em 0em 1em')
:css('padding', '.3em .6em .2em .6em')
:css('text-align', 'center')
:css('font-size', '85%')
:css('font-weight', 'bold')
if shortcutHeading then
shortcutList
:tag('div')
:cssaddClass('display','inlinemodule-blockshortcutlist')
:css('border-bottom','1px solid #aaa')
:css('margin-bottom', '.2em')
:css('font-weight', 'normal')
:wikitext(shortcutHeading)
end
local list = shortcutList:tag('ul')
:tag('ul')
for i, item in ipairs(listItems) do
shortcutListlist:tag('li'):wikitext(item)
end
 
return tostring(root)
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu