-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex-ca-fr.html
148 lines (127 loc) · 5.63 KB
/
index-ca-fr.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width,initial-scale=1" name="viewport" />
<title>Scénarios de PCAR</title>
<!-- Load stylesheet -->
<link rel="stylesheet" href="https://www.canada.ca/etc/designs/canada/cdts/gcweb/v5_0_2/cdts/cdts-styles.css" />
<!-- Load/activate closure template scripts -->
<script
src="https://www.canada.ca/etc/designs/canada/cdts/gcweb/v5_0_2/cdts/compiled/wet-fr.js"
data-cdts-setup='{"cdnEnv": "prod"}'
></script>
</head>
<body>
<!-- template top and no-script fallback -->
<div id="def-top"></div>
<div id="wb-cont">
<div id="app"></div>
</div>
<!-- template footer and no-script fallback -->
<div id="def-footer"></div>
<script type="text/javascript">
// URL Parsing for Language Switch
var url = new URL(window.location.href);
var hashParams = url.hash.split('/');
// If there's an empty item at the end of the paramater list (occurs if there's a trailing slash in the URL), clear it.
if (hashParams.at(-1).length === 0) {
hashParams.pop();
}
// If content after the last slash in the URL is an anchor, clear it.
if (hashParams.at(-1).startsWith('#')) {
hashParams.pop();
}
// Finally, extract the StoryRAMP ID from the URL. If it has an anchor tag in it, remove it since it's not useful on the new page.
var productID = hashParams.pop();
if (productID.includes('#')) {
productID = productID.split('#')[0];
}
// Check to see if the 'editor' route is included in the URL. If so, keep it.
var hasEditor = hashParams.pop() === 'editor';
// Build new URL route.
var newURLRoute = hasEditor ? 'editor/' + productID : productID;
var defTop = document.getElementById('def-top');
defTop.outerHTML = wet.builder.top({
lngLinks: [
{
lang: 'en',
href: 'index-ca-en.html#/en/' + newURLRoute,
text: 'English'
}
]
});
document.addEventListener('Storylines-Loaded', (payload) => {
const breadcrumbs = payload.detail.config.breadcrumbs ?? []; // default to an empty array if this property isn't defined.
const breadcrumbList = document.querySelectorAll('#wb-bc > .container > .breadcrumb')[0];
const firstElement = breadcrumbList.children[0]; // should be the `Canada.ca` breadcrumb.
// Reset the breadcrumb list.
breadcrumbList.innerHTML = ``;
// Add the `Canada.ca` element back to the list of breadcrumbs.
breadcrumbList.appendChild(firstElement);
// Create an HTML li element for each of the breadcrumbs to add and then append them to the breadcrumb list.
breadcrumbs.forEach((b) => {
const node = document.createElement('li');
node.innerHTML = `<a href="${b.href}">${b.title}</a>`;
breadcrumbList.appendChild(node);
});
});
document.querySelectorAll('.wb-sl').forEach(function (skipLink) {
skipLink.setAttribute('href', url.href.split(/#[^\/]/)[0] + '#' + skipLink.href.split('#')[1]);
});
var interval = setInterval(function () {
var links = document.querySelectorAll('.wb-sl');
if (links.length === 3) {
clearInterval(interval);
links[2].setAttribute('href', url.href.split(/#[^\/]/)[0] + '?' + links[2].href.split('?')[1]);
}
}, 200);
</script>
<script>
var defFooter = document.getElementById('def-footer');
defFooter.outerHTML = wet.builder.footer({});
</script>
<script type="module" src="/src/main.ts"></script>
<style>
html {
font-size: 16px;
}
</style>
</body>
</html>
<!-- START OF SmartSource Data Collector TAG -->
<!-- Copyright (c) 1996-2021 Webtrends Inc. All rights reserved. -->
<!-- Version: 9.4.0 -->
<script src="scripts/webtrends.js" type="text/javascript"></script>
<!-- ----------------------------------------------------------------------------------- -->
<!-- Warning: The two script blocks below must remain inline. Moving them to an external -->
<!-- JavaScript include file can cause serious problems with cross-domain tracking. -->
<!-- ----------------------------------------------------------------------------------- -->
<script type="text/javascript">
//<![CDATA[
var _tag = new WebTrends();
_tag.dcsGetId();
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
_tag.dcsCustom = function () {
// Add custom parameters here.
//_tag.DCSext.param_name=param_value;
};
_tag.dcsCollect();
//]]>
</script>
<noscript>
<div>
<img
alt="DCSIMG"
id="DCSIMG"
width="1"
height="1"
src="https://sdc.ncr.ec.gc.ca/dcs2kf7dq10000kzg8kpqz5gp_3q4i/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=9.4.0&dcssip=www.environmental-maps.canada.ca"
/>
</div>
</noscript>
<!-- END OF SmartSource Data Collector TAG -->