cec-nuxt-lib 0.7.0 → 0.7.2
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,10 @@ import { useState } from '#app';
|
|
|
5
5
|
const searchTerm = useState('searchTerm', () => 'Enter keywords:');
|
|
6
6
|
const showSiteSearch = useState('showSiteSearch');
|
|
7
7
|
|
|
8
|
+
const baseUrl = useState('baseUrl');
|
|
9
|
+
const path = useState('path');
|
|
10
|
+
const title = useState('title');
|
|
11
|
+
|
|
8
12
|
const regex =
|
|
9
13
|
/^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
10
14
|
|
|
@@ -127,41 +131,37 @@ onMounted(() => {
|
|
|
127
131
|
let found = false;
|
|
128
132
|
if (hash) {
|
|
129
133
|
hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
|
|
130
|
-
Array.from(document.getElementsByTagName('LABEL'))
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
});
|
|
134
|
+
let l = Array.from(document.getElementsByTagName('LABEL')).filter((e) =>
|
|
135
|
+
e.innerText.toLowerCase().includes(hash)
|
|
136
|
+
);
|
|
137
|
+
if (l.length && l[0].parentNode.tagName === 'SECTION') {
|
|
138
|
+
let el = l[0].previousElementSibling;
|
|
139
|
+
if (el.tagName === 'INPUT') {
|
|
140
|
+
el.checked = true;
|
|
141
|
+
el.scrollIntoView();
|
|
142
|
+
found = true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
144
145
|
if (!found) {
|
|
145
|
-
Array.from(document.getElementsByTagName('H3'))
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
146
|
+
let h3s = Array.from(document.getElementsByTagName('H3')).filter((e) =>
|
|
147
|
+
e.innerHTML.toLowerCase().includes(hash)
|
|
148
|
+
);
|
|
149
|
+
if (h3s) {
|
|
150
|
+
let parent = h3s[0].parentNode;
|
|
151
|
+
if (parent.tagName === 'ARTICLE') {
|
|
152
|
+
let el = parent.previousElementSibling;
|
|
153
|
+
let input =
|
|
154
|
+
el.tagName === 'LABEL'
|
|
155
|
+
? el.control
|
|
156
|
+
: el.tagName === 'INPUT'
|
|
157
|
+
? el
|
|
158
|
+
: undefined;
|
|
159
|
+
if (input) {
|
|
160
|
+
input.checked = true;
|
|
161
|
+
el.scrollIntoView();
|
|
163
162
|
}
|
|
164
|
-
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
package/package.json
CHANGED