word-games-theme 2.9.4 → 2.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebb79dc0f063db51be2c1c982e979e05e9f1d8ed6584ed2f9223f03fc1e7f557
4
- data.tar.gz: 3842931fcae3d7632924eb95b2d738e07141ef779d18c5f3e3ab3779567d05bf
3
+ metadata.gz: d4cdc2afd0e570d207ead4677ebf3eb23ba3f68724ed092c9988d94bed79aa0a
4
+ data.tar.gz: 566c252604863daad298e81d96167e9b5a345b64c7674288f61d91ceae79277f
5
5
  SHA512:
6
- metadata.gz: f54f722ef5deca02fd2feeedfaa98fb64a2207e954d0bb06cdd490598ee9279af66969eec8d88e770c953e6ba7ede7e0fcce1362f8ba928dbd6b34cf141f3583
7
- data.tar.gz: 7230c55447d7f948e61e8a4ec7f976940a0e21e5cb22dd5e2b2807362b08cbe6afa96ffd3789ab9f881d36adfa70c70a19eff33362dc87003666f71d5de78231
6
+ metadata.gz: f5688c177b39d42fb44ada6bf115a5f0f619dec711a1f1a296191d383f565c07a08fa6f6235edfae8883be1d55bde178fffa7dd001e160d5b7adc48c6a7afe6a
7
+ data.tar.gz: 04afdd27295eeff067f1f484885bbdfa1f7dd53e64e250c1fe771ccb53b9dec1556dc3c9def588bdd42fbbb24bf192a8f26345ac1dca4014618afea6bc60e1a9
@@ -32,17 +32,19 @@
32
32
  <meta name="robots" content="noindex" />
33
33
  {%- endif -%}
34
34
 
35
- {% assign whitelist_urls = site.whitelist_urls %}
36
- {% if site.noindex_languages contains page.lang %}
35
+
36
+
37
+ {% assign whitelist_urls = site.data.noindexURLs.whitelist_urls %}
38
+ {% assign noindex_languages = site.data.noindexURLs.noindex_languages %}
39
+ {% if noindex_languages contains page.lang %}
37
40
  {% unless whitelist_urls contains page.url %}
38
41
  <meta name="robots" content="noindex" />
39
42
  {% endunless %}
40
43
  {% endif %}
41
-
42
- {% if site.blacklist_urls %}
43
- {% if site.blacklist_urls contains page.url %}
44
- <meta name="robots" content="noindex">
45
- {% endif %}
44
+
45
+ {% assign blacklist_urls = site.data.noindexURLs.blacklist_urls %}
46
+ {% if blacklist_urls contains page.url %}
47
+ <meta name="robots" content="noindex" />
46
48
  {% endif %}
47
49
 
48
50
 
data/assets/js/theme.js CHANGED
@@ -2,7 +2,6 @@
2
2
  ---
3
3
 
4
4
  console.log(document.querySelectorAll('*').length);
5
-
6
5
  if ("{{ site.removeBootstrapJs }}" === "true") {
7
6
  const languagesModal = document.querySelector("#staticBackdrop");
8
7
  const intModalBtn = document.querySelector("#int-modal-btn");
@@ -24,57 +23,32 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
24
23
  });
25
24
  }
26
25
 
27
-
28
26
  var mediaQuery = window.matchMedia("(max-width: 768px)")
29
- let navbarDropdown = document.querySelector("#navbarDropdown");
30
- let dropmenu = document.querySelector(".dropmenu");
31
- // navbarDropdown.addEventListener("click", () => {
32
- // if (dropmenu.classList.contains("show")) {
33
- // dropmenu.classList.remove("show");
34
- // dropmenu.style.display = "none"
35
- // } else {
36
- // dropmenu.classList.add("show");
37
- // if (mediaQuery.matches) {
38
- // dropmenu.style.display = "block"
39
- // } else {
40
- // dropmenu.style.display = "grid"
41
- // dropmenu.style.padding = "3.5rem"
42
- // dropmenu.style.gridTemplateColumns = "auto auto";
43
- // dropmenu.style.columnGap = "5rem";
44
- // dropmenu.style.rowGap = "1rem";
45
- // dropmenu.style.borderBottom = "1px solid rgba(0, 0, 0, 0.1)"
46
- // dropmenu.style.borderLeft = "1px solid rgba(0, 0, 0, 0.1)"
47
- // dropmenu.style.borderRight = "1px solid rgba(0, 0, 0, 0.1)"
48
- // }
49
-
50
- // }
51
- // });
52
-
53
-
27
+
54
28
  const wordGamesToolbarListItems = document.querySelectorAll(
55
29
  ".wordgames-toolbar-list-item-span"
56
30
  );
57
-
58
- Array.from(wordGamesToolbarListItems).map((item) => {
59
- item.addEventListener("click", (e) => {
60
- e.preventDefault();
61
- var style = window.getComputedStyle(item.nextElementSibling);
62
- var maxHeight = style.getPropertyValue("max-height");
63
- console.log(maxHeight)
64
- if (maxHeight && maxHeight !== "0px") {
65
- // If the item is expanded, collapse it
66
- item.nextElementSibling.style.maxHeight = "0";
67
- item.nextElementSibling.style.opacity = "0";
68
- item.nextElementSibling.style.height = "0";
69
- } else {
70
- // If the item is collapsed, expand it
71
- item.nextElementSibling.style.maxHeight =
72
- item.nextElementSibling.scrollHeight + "px";
73
- item.nextElementSibling.style.opacity = "1";
74
- item.nextElementSibling.style.height = "auto";
75
- }
31
+ if (mediaQuery.matches) {
32
+ Array.from(wordGamesToolbarListItems).map((item) => {
33
+ item.addEventListener("click", (e) => {
34
+ e.preventDefault();
35
+ var style = window.getComputedStyle(item.nextElementSibling);
36
+ var maxHeight = style.getPropertyValue("max-height");
37
+ if (maxHeight && maxHeight !== "0px") {
38
+ // If the item is expanded, collapse it
39
+ item.nextElementSibling.style.maxHeight = "0";
40
+ item.nextElementSibling.style.opacity = "0";
41
+ item.nextElementSibling.style.height = "0";
42
+ } else {
43
+ // If the item is collapsed, expand it
44
+ item.nextElementSibling.style.maxHeight =
45
+ item.nextElementSibling.scrollHeight + "px";
46
+ item.nextElementSibling.style.opacity = "1";
47
+ item.nextElementSibling.style.height = "auto";
48
+ }
49
+ });
76
50
  });
77
- });
51
+ }
78
52
 
79
53
 
80
54
 
@@ -83,7 +57,6 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
83
57
  const menuIcon = '/assets/images/hamburger-menu.svg';
84
58
  const closeIcon = '/assets/images/close-menu.svg';
85
59
  const imgElement = navbarToggler.querySelector('img');
86
-
87
60
  navbarToggler.addEventListener('click', () => {
88
61
  if (navBar.classList.contains('show')) {
89
62
  navBar.classList.remove('show');
@@ -99,22 +72,26 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
99
72
 
100
73
  }
101
74
 
75
+ const worker = new Worker('/assets/js/search-worker.js');
76
+ function fetchData() {
77
+ return new Promise((resolve, reject) => {
78
+ worker.postMessage({
79
+ type: "api",
80
+ endpoint: `/alllinks.json`
81
+ });
102
82
 
83
+ worker.onmessage = (event) => {
84
+ resolve(event.data.data.featuredLinks);
85
+ };
103
86
 
104
-
105
- // Fetch data from data.json
106
- async function fetchData() {
107
- const response = await fetch('/alllinks.json');
108
- const data = await response.json();
109
- return data.featuredLinks;
87
+ worker.onerror = (error) => {
88
+ reject(error);
89
+ };
90
+ });
110
91
  }
111
-
112
- // Filter data based on search query
113
92
  function filterData(data, query) {
114
93
  return data.filter(item => item.name.toLowerCase().includes(query.toLowerCase()));
115
94
  }
116
-
117
- // Display filtered results
118
95
  function displayResults(results) {
119
96
  const resultsContainer = document.getElementById('results');
120
97
  resultsContainer.style.display = results.length ? 'block' : 'none';
@@ -122,12 +99,14 @@ function displayResults(results) {
122
99
  ? results.map(result => `<div class="result-item"><a href="${result.url}" target="_blank">${result.name}</a></div>`).join('')
123
100
  : '<p>No results found</p>';
124
101
  }
125
-
126
- // Handle search input
127
102
  const searchInput = document.querySelector('.searchBar input');
103
+ let data;
128
104
  searchInput.addEventListener('input', async (event) => {
129
105
  const query = event.target.value;
130
- const data = await fetchData();
106
+ if (!data) {
107
+ // Fetch the data only if it hasn't been fetched before
108
+ data = await fetchData();
109
+ }
131
110
  const filteredResults = filterData(data, query);
132
111
  displayResults(filteredResults);
133
112
 
@@ -136,10 +115,7 @@ searchInput.addEventListener('input', async (event) => {
136
115
  'event_label': 'Search Box',
137
116
  'value': query
138
117
  });
139
-
140
118
  });
141
-
142
- // Hide results when clicking outside search input and results container
143
119
  document.addEventListener('click', (event) => {
144
120
  const resultsContainer = document.getElementById('results');
145
121
  if (!searchInput.contains(event.target) && !resultsContainer.contains(event.target)) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word-games-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.4
4
+ version: 2.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll