Home
Random
Log in
Settings
About the Honkai: Nexus Anima Wiki
Disclaimers
Search
Editing
Module
:
Tt/Draft
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local lib = require('Module:Feature') function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { parentFirst = true, wrappers = { 'Template:Tt', 'Template:Tt/Draft' } }) args[1] = args[1] or '<i>Missing text</i>' -- Return plain text if no tooltip given if lib.isEmpty(args[2]) then return args[1] end return p._main(args, nil, frame) end function p._main(args, options, frame) local text = args[1] local tooltip = mw.text.decode(args[2], true) local header = lib.isNotEmpty(args.header) and mw.text.decode(args.header, true) or nil local class = lib.isNotEmpty(args.class) and args.class .. ' custom-tt-wrapper toggle-tooltip' or 'custom-tt-wrapper toggle-tooltip' local out = mw.html.create() --check for link format if lib.isNotEmpty(args.link) then local link = tostring(args.link) args.link = nil local base = tostring(p._main(args, {notoggle = true}, frame)) -- tt on label for hover as otherwise the <a> default title takes priority local linkTo = '[[' .. lib.ternary(link == '1', text, link) .. '|' .. base .. ']]' return p._main({ linkTo, args[2], header = args.header, class = args.class }, {nohover = true}, frame) -- external tt for collapsible for the separated clickable end -- preprocess tooltip text if lib.isNotEmpty(tooltip) then tooltip = frame:preprocess(tooltip) end -- Build toggle tooltip local toggle = out:tag('span'):addClass(class) -- Optional toggleable text but plain text must be there for gadget if not options or not options.notoggle then toggle:addClass(' mw-collapsible mw-made-collapsible mw-collapsed hnaw-collapsible') -- move tooltip to detached icon when text is clickable if lib.isNotEmpty(args.link) or (text:find('%[%[') and text:find('%]%]')) then toggle:wikitext(text, ' ') -- infoicon with semi-hidden text for screen readers text = '<span class="screen-reader-text">Tooltip for ' .. text:gsub('%[%[?[^|%]]+|', ''):gsub('%[', ''):gsub('%]', '') .. '</span>ⓘ' end toggle :tag('span') :addClass('mw-collapsible-toggle mw-collapsible-toggle-default mw-collapsible-toggle-collapsed custom-tt toggle-tooltip') :wikitext(text) :done() local collapsibleContent = toggle :tag('span') :addClass('mw-collapsible-content custom-tt mobileonly') if header then collapsibleContent :tag('span') :addClass('tt-header') :wikitext(header) :done() end collapsibleContent:wikitext(tooltip) collapsibleContent:done() else toggle:wikitext(text) end toggle:allDone() return out end --for modules that need the plain text input function p.CleanTT(tx) local full = tx local result = tx for display in string.gmatch(full, '<span[^>]*class="[^"]*custom%-tt%-wrapper[^"]*"[^>]*>' .. '<span[^>]*class="[^"]*mw%-collapsible%-toggle[^"]*"[^>]*>(.-)</span>' .. '<span[^>]*class="[^"]*mw%-collapsible%-content[^"]*"[^>]*>.-</span></span>' ) do local escDisplay = display:gsub("([^%w])", "%%%1") local search_str = '<span[^>]*class="[^"]*custom%-tt%-wrapper[^"]*"[^>]*>' .. '<span[^>]*class="[^"]*mw%-collapsible%-toggle[^"]*"[^>]*>' .. escDisplay .. '</span>' .. '<span[^>]*class="[^"]*mw%-collapsible%-content[^"]*"[^>]*>.-</span></span>' result = result:gsub(search_str, display) end return result end return p
Summary:
Please note that all contributions to Honkai: Nexus Anima Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Honkai Nexus Anima Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
Dynamic Page List
:
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
:
¹
^2{
}^2
^2{¹}^2
Parser Functions
:
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup:
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices:
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder Image|}}
Magic Words
:
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
References:
<ref></ref>
{{Reflist}}
{{Ref/Arti|}}
{{Ref/ArtiSet|}}
{{Ref/BB|}}
{{Ref/Book|}}
{{Ref/CS|}}
{{Ref/Companion|}}
{{Ref/Domain|}}
{{Ref/Enemy|}}
{{Ref/Food|}}
{{Ref/Furnishing|}}
{{Ref/HEO|}}
{{Ref/Item|}}
{{Ref/Loading|}}
{{Ref/Location|}}
{{Ref/Manga|}}
{{Ref/NPC|}}
{{Ref/Outfit|}}
{{Ref/Quest|}}
{{Ref/Talent|}}
{{Ref/VO|}}
{{Ref/VP|}}
{{Ref/Weapon|}}
{{Ref/Wildlife|}}
HTML Entities:
—
,
­
Page included on this page:
Module:Tt/Draft/doc
(
view source
)