cec-nuxt-lib 0.6.9 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -32,9 +32,6 @@ const sizeString = (n) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const regex =
|
|
36
|
-
/^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
37
|
-
|
|
38
35
|
const abbr = (data) => {
|
|
39
36
|
return `<abbr title="${text(data.entryDescription)}">${text(data.entryTitle)}</abbr>`;
|
|
40
37
|
};
|
|
@@ -5,6 +5,9 @@ import { useState } from '#app';
|
|
|
5
5
|
const searchTerm = useState('searchTerm', () => 'Enter keywords:');
|
|
6
6
|
const showSiteSearch = useState('showSiteSearch');
|
|
7
7
|
|
|
8
|
+
const regex =
|
|
9
|
+
/^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
10
|
+
|
|
8
11
|
// Cookie control config.
|
|
9
12
|
const config = {
|
|
10
13
|
apiKey: 'c1a902dfad207b122cca32738e623af375e1d2ee',
|
|
@@ -124,41 +127,37 @@ onMounted(() => {
|
|
|
124
127
|
let found = false;
|
|
125
128
|
if (hash) {
|
|
126
129
|
hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
|
|
127
|
-
Array.from(document.getElementsByTagName('LABEL'))
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
130
|
+
let l = Array.from(document.getElementsByTagName('LABEL')).filter((e) =>
|
|
131
|
+
e.innerText.toLowerCase().includes(hash)
|
|
132
|
+
);
|
|
133
|
+
if (l.length && l[0].parentNode.tagName === 'SECTION') {
|
|
134
|
+
let el = l[0].previousElementSibling;
|
|
135
|
+
if (el.tagName === 'INPUT') {
|
|
136
|
+
el.checked = true;
|
|
137
|
+
el.scrollIntoView();
|
|
138
|
+
found = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
141
|
if (!found) {
|
|
142
|
-
Array.from(document.getElementsByTagName('H3'))
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
}
|
|
142
|
+
let h3s = Array.from(document.getElementsByTagName('H3')).filter((e) =>
|
|
143
|
+
e.innerHTML.toLowerCase().includes(hash)
|
|
144
|
+
);
|
|
145
|
+
if (h3s) {
|
|
146
|
+
let parent = h3s[0].parentNode;
|
|
147
|
+
if (parent.tagName === 'ARTICLE') {
|
|
148
|
+
let el = parent.previousElementSibling;
|
|
149
|
+
let input =
|
|
150
|
+
el.tagName === 'LABEL'
|
|
151
|
+
? el.control
|
|
152
|
+
: el.tagName === 'INPUT'
|
|
153
|
+
? el
|
|
154
|
+
: undefined;
|
|
155
|
+
if (input) {
|
|
156
|
+
input.checked = true;
|
|
157
|
+
el.scrollIntoView();
|
|
160
158
|
}
|
|
161
|
-
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
163
|
}
|
package/package.json
CHANGED