-
Notifications
You must be signed in to change notification settings - Fork 12
/
cptaib variant url redirect.html
92 lines (51 loc) · 2.21 KB
/
cptaib variant url redirect.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
<script>
const cptaibVur = ( codePrefixSuffix, label, options, variantsUrlMap ) => {
/*
cptaib variant url redirect
License : < https://tinyurl.com/s872fb68 >
Version : 0.2.1
SS Versions : 7.1, 7.0
v7.1
Fluid
Engine
Compatible : Yes
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 : configurator page text and image blocks
By : Thomas Creedon < http://www.tomsWeb.consulting/ >
*/
// do not change anything below, there be the borg here
const debugFlag = false;
if ( debugFlag ) {
console.log ( codePrefixSuffix );
console.log ( label );
console.log ( options );
console.log ( variantsUrlMap );
}
let keys = Object.keys ( localStorage );
keys = $.map ( keys, function ( key ) {
const b = key.startsWith ( `${ codePrefixSuffix },${ label },` );
if ( ! b ) key = null;
return key;
} );
const variants = $.map ( options, function ( option ) {
key = $.map ( keys, function ( key ) {
const b = key.endsWith ( `,${ option }` );
if ( ! b ) key = null;
return key;
} )
[ 0 ];
const variant = localStorage.getItem ( key );
return variant;
} )
.join ( ',' );
location = variantsUrlMap [ variants ];
};
</script>