-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmarquee.vtl
65 lines (53 loc) · 2.7 KB
/
marquee.vtl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#** ===========================================================================
MARQUEE NEWSTICKER
This Confluence user macro adds an HTML5 marquee element to your page.
Version: 1.2.0
Updated: 2021-01-09
Author/s: George Lewe
Source: https://github.com/glewe/confluence-user-macros
License: GNU LGPLv3
Macro Body processing: Rendered
*#
#** ---------------------------------------------------------------------------
PARAMETER
*#
## @param ScrollDirection:title=Scroll Direction|type=enum|default=Right|enumValues=Left,Right
## @param ScrollSpeed:title=Scroll Speed|type=int|desc=Enter a numeric value for the speed. The higher the number, the faster the scroll. Default is 5.|default=5
## @param Padding:title=Padding|type=string|desc=Enter the padding of the scroll box in pixels (add suffix 'px', e.g. 1px). Default: 2px (No border)|default=6px
## @param BackgroundColor:title=Background Color|type=string|desc=Enter the background color in hexadecimal starting with a #. Leave emtpy for none. <a href="http://hslpicker.com/">Color Picker</a>|default=inherit
## @param BorderWidth:title=Border Width|type=string|desc=Enter the border width in pixels (add suffix 'px', e.g. 1px). Default: 0px (No border)|default=0px
## @param BorderRadius:title=Border Radius|type=string|desc=Enter the border radius in pixels (add suffix 'px', e.g. 1px). A border radius creates rounded corners. Default: 0px (No border)|default=0px
## @param BorderColor:title=Border Color|type=string|desc=Enter the border color in hexadecimal starting with a #. Default: #000000 (Black). <a href="http://hslpicker.com/">Color Picker</a>|default=#000000
#** ---------------------------------------------------------------------------
PROCESS INPUT
*#
#if (!$paramScrollDirection)
#set ($paramScrollDirection="Right")
#end
#if (!$paramScrollSpeed)
#set ($paramScrollSpeed="5")
#end
#if (!$paramPadding)
#set ($paramPadding="6px")
#end
#if (!$paramBackgroundColor)
#set ($paramBackgroundColor="inherit")
#end
#if (!$paramBorderWidth)
#set ($paramBorderWidth="0px")
#end
#if (!$paramBorderRadius)
#set ($paramBorderRadius="0px")
#end
#if (!$paramBorderColor)
#set ($paramBorderColor="#000000")
#end
#** ---------------------------------------------------------------------------
OUTPUT
*#
<!-- User Macro: Marquee START -->
<marquee behavior="scroll" direction="$paramScrollDirection" scrollamount="$paramScrollSpeed" onmouseover="this.stop();" onmouseout="this.start();" style="background-color: $paramBackgroundColor;padding: $paramPadding; border: $paramBorderWidth solid $paramBorderColor; border-radius: $paramBorderRadius; margin-top:6px; margin-bottom:6px;">
#set($body=$body)
$body
</marquee>
<!-- User Macro: Marquee END -->