МетаЭра

Исходный код вики SpinnerMacro

Редактировал(а) Вячеслав Мясоед 2024-12-06 11:52

Скрыть последних авторов
Вячеслав Мясоед 1.1 1 = Todos =
2
3 Add message for screen readers when loaded ok.
4
5 ----
6
7 The {{code}}spinner{{/code}} macro displays a spinner within its container when this container uses attribute {{code}}aria-busy{{/code}} to reflect its content loading state. The spinner is displayed/hidden automatically when the attribute {{code}}aria-busy{{/code}} of its container is set to {{code language="text"}}true{{/code}} / respectively to {{code language="text"}}false{{/code}}. See also the documentation of the [[{{code}}aria-busy{{/code}}>>https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-busy]] and [[{{code}}aria-live{{/code}}>>https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live]] attributes.
8
9 = Example =
10
11 (% class="row" %)(((
12 (% class="col-xs-12 col-sm-5" %)(((
13 (% aria-busy="true" %)(((
14 {{spinner color="@brand-primary" thickness="3px" size="30px" top="10px"/}}
15 )))
16 )))
17 (% class="col-xs-12 col-sm-5" %)(((
18 {{code language="text"}}
19 (% aria-busy="true" %)(((
20 {{spinner color="@brand-primary"
21 thickness="3px" size="30px" top="10px"/}}
22 )))
23 {{/code}}
24 )))
25 )))
26
27 = Macro Parameters =
28
29 {{velocity}}
30 #set ($parameters = $doc.getObjects('XWiki.WikiMacroParameterClass'))
31 |=Name|=Description|=Mandatory|=Default value
32 #foreach ($parameter in $parameters)
33 #set ($mandatory = $parameter.getValue('mandatory') == 1)
34 #if ($mandatory)
35 #set ($mandatory = 'yes')
36 #else
37 #set ($mandatory = 'no')
38 #end
39 |$parameter.getValue('name')|$parameter.getValue('description')|$mandatory|$parameter.getValue('defaultValue')
40 #end
41 {{/velocity}}
42
43 = Limitations =
44
45 At the moment, having several spinners on the same page with different styles is not supported. The styling needs to be set manually in this case, until it becomes possible in XWiki to include several times the same SSX page with different query parameters.