appscms-tools-theme 4.6.8 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/assets/css/tools.css CHANGED
@@ -875,7 +875,6 @@ ul li {
875
875
  justify-content: center;
876
876
  }
877
877
 
878
-
879
878
  .how-to-video .youtube-play-btn-wrapper {
880
879
  position: absolute;
881
880
  top: 0%;
@@ -1842,7 +1841,6 @@ ol li::marker {
1842
1841
  margin-top: 8px;
1843
1842
  text-transform: capitalize;
1844
1843
  }
1845
- .file-text
1846
- {
1844
+ .file-text {
1847
1845
  font-size: 17px;
1848
- }
1846
+ }
@@ -210,3 +210,76 @@ if (processingBtn) {
210
210
  history.back();
211
211
  });
212
212
  }
213
+
214
+ if ("{{ site.navigationSearch }}" === "true") {
215
+ // Fetch data from data.json
216
+ async function fetchData() {
217
+ const response = await fetch('/alllinks.json');
218
+ const data = await response.json();
219
+ return data.featuredLinks;
220
+ }
221
+
222
+ // Filter data based on search query
223
+ function filterData(data, query) {
224
+ return data.filter(item => item.name.toLowerCase().includes(query.toLowerCase()));
225
+ }
226
+
227
+ // Display filtered results
228
+ function displayResults(results) {
229
+ const resultsContainer = document.getElementById('results');
230
+ resultsContainer.style.display = results.length ? 'block' : 'none';
231
+ resultsContainer.innerHTML = results.length
232
+ ? results.map(result => `<div class="result-item"><a href="${result.url}" target="_blank">${result.name}</a></div>`).join('')
233
+ : '<p>No results found</p>';
234
+ }
235
+ function mobileDisplayResults(results) {
236
+ const mobileResultsContainer = document.querySelector('.mobile-searchbarResults');
237
+ mobileResultsContainer.style.display = results.length ? 'block' : 'none';
238
+ mobileResultsContainer.innerHTML = results.length
239
+ ? results.map(result => `<div class="mobile-result-item"><a href="${result.url}" target="_blank">${result.name}</a></div>`).join('')
240
+ : '<p>No results found</p>';
241
+ }
242
+
243
+ // Handle search input
244
+ const searchInput = document.querySelector('.search-input');
245
+ const mobileSearchInput = document.querySelector('.mobile-search-input');
246
+ searchInput.addEventListener('input', async (event) => {
247
+ const query = event.target.value;
248
+ const data = await fetchData();
249
+ const filteredResults = filterData(data, query);
250
+ displayResults(filteredResults);
251
+
252
+ gtag('event', 'search', {
253
+ 'event_category': 'engagement',
254
+ 'event_label': 'Search Box',
255
+ 'value': query
256
+ });
257
+
258
+ });
259
+ mobileSearchInput.addEventListener('input', async (event) => {
260
+ const query = event.target.value;
261
+ const data = await fetchData();
262
+ const filteredResults = filterData(data, query);
263
+ mobileDisplayResults(filteredResults);
264
+
265
+ gtag('event', 'search', {
266
+ 'event_category': 'engagement',
267
+ 'event_label': 'Search Box',
268
+ 'value': query
269
+ });
270
+
271
+ });
272
+
273
+ // Hide results when clicking outside search input and results container
274
+ document.addEventListener('click', (event) => {
275
+ const resultsContainer = document.getElementById('results');
276
+ const mobileResultsContainer = document.querySelector('.mobile-searchbarResults');
277
+
278
+ if (!searchInput.contains(event.target) && !resultsContainer.contains(event.target)) {
279
+ resultsContainer.style.display = 'none';
280
+ }
281
+ if (!mobileSearchInput.contains(event.target) && !mobileResultsContainer.contains(event.target)) {
282
+ mobileResultsContainer.style.display = 'none';
283
+ }
284
+ });
285
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.8
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll