-
Notifications
You must be signed in to change notification settings - Fork 13
/
cover page action navigation link add.html
123 lines (70 loc) · 3.38 KB
/
cover page action navigation link add.html
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<script>
$( ( ) => {
/*
begin cover page action navigation link add
License : < https://tinyurl.com/s872fb68 >
Version : 0.1d0
SS Version : 7.0
v7.0 Templates : Bedford ( Anya, Bryant, Hayden )
Brine ( Aria, Blend, Burke, Cacao, Clay, Fairfield,
Feed, Foster, Greenwich, Hatch, Heights, Hunter, Hyde,
Impact, Jaunt, Juke, Keene, Kin, Lincoln, Maple, Margot,
Marta, Mentor, Mercer, Miller, Mojave, Moksha, Motto,
Nueva, Pedro, Pursuit, Rally, Rover, Royce, Sofia,
Sonora, Stella, Thorne, Vow, Wav, West )
your template is not listed? then it is not currently
supported
Dependencies : jQuery
By : Thomas Creedon < http://www.tomsWeb.consulting/ >
*/
const textUrls = [
/*
following is an example of a new link data structure. copy the example
new link data structure and paste after the example new link data
structure. remove the forward slash asterisk and asterisk forward
slash lines from before and after the copied example. repeat for as
many new links you want to create. this has been done once initially
*/
/*
{
text : '[enter link text here between single quotes]',
url : '[enter url here between single quotes]'
},
*/
{
text : '[enter link text here between single quotes]',
url : '[enter url here between single quotes]'
},
]
/*
targetAtttributeValue is an optional setting. enter _self | _blank |
_parent | _top | framename see < https://mzl.la/2Q0JROF > between single
quotes
*/
const targetAtttributeValue = '';
/*
originalTargetAttributeAdd is an optional setting. use false or
true. when true the target attribute will be added to SS's built-in
action links
*/
const originalTargetAttributeAdd = false;
// do not change anything below, there be the borg here
const selector = '.sqs-slide-wrapper[ data-slide-type="cover-page" ] ' +
'.sqs-slice-navigation ul';
const $elements = $( selector );
if ( ! $elements.length ) return; // bail if no list
if ( originalTargetAttributeAdd && targetAtttributeValue )
$( 'a', $elements ).attr ( 'target', targetAtttributeValue );
$.each ( textUrls, function ( i, o ) {
const $li = $( `<li>
<a href="${ o.url }">
${ o.text }
</a>
</li>` );
if ( targetAtttributeValue )
$( 'a', $li ).attr ( 'target', targetAtttributeValue );
$li.appendTo ( $elements );
} );
/* end cover page action navigation link add */
} );
</script>