appscms-tools-theme 5.1.8 → 5.2.0
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.
- checksums.yaml +4 -4
- data/_data/.DS_Store +0 -0
- data/_data/aitools/en/ai-article-writer.json +184 -0
- data/_data/aitools/en/all-in-one-social-post.json +217 -0
- data/_data/aitools/en/amazon-product-bullet-points-generator.json +224 -0
- data/_data/aitools/en/amazon-product-description-generator.json +237 -0
- data/_data/aitools/en/blog-conclusion-generator.json +253 -0
- data/_data/aitools/en/blog-content-calendar.json +232 -0
- data/_data/aitools/en/blog-introduction-generator.json +246 -0
- data/_data/aitools/en/blog-outline-generator.json +232 -0
- data/_data/aitools/en/blog-section-generator.json +253 -0
- data/_data/aitools/en/blog-title-generator.json +232 -0
- data/_data/aitools/en/blog-topic-ideas.json +232 -0
- data/_data/aitools/en/brand-name-generator.json +215 -0
- data/_data/aitools/en/caption-generator.json +271 -0
- data/_data/aitools/en/engagement-post-generator.json +251 -0
- data/_data/aitools/en/facebook-post.json +232 -0
- data/_data/aitools/en/hidden-fact-finder.json +232 -0
- data/_data/aitools/en/human-written-blog-post.json +232 -0
- data/_data/aitools/en/instagram-bio-generator.json +246 -0
- data/_data/aitools/en/instagram-caption.json +232 -0
- data/_data/aitools/en/instagram-carousel.json +250 -0
- data/_data/aitools/en/instagram-hashtag-generator.json +246 -0
- data/_data/aitools/en/instagram-name-generator.json +239 -0
- data/_data/aitools/en/instagram-threads-generator.json +239 -0
- data/_data/aitools/en/interactive-content-creator.json +252 -0
- data/_data/aitools/en/linkedin-hashtag-generator.json +239 -0
- data/_data/aitools/en/linkedin-post.json +232 -0
- data/_data/aitools/en/motivational-posts.json +239 -0
- data/_data/aitools/en/pinterest-pin.json +217 -0
- data/_data/aitools/en/platform-specific-content-generator.json +246 -0
- data/_data/aitools/en/product-description.json +222 -0
- data/_data/aitools/en/quick-article-writer.json +253 -0
- data/_data/aitools/en/replies-for-facebook.json +239 -0
- data/_data/aitools/en/replies-for-instagram.json +239 -0
- data/_data/aitools/en/replies-for-linkedin.json +239 -0
- data/_data/aitools/en/replies-for-twitter.json +239 -0
- data/_data/aitools/en/rewrite-article-with-keywords.json +246 -0
- data/_data/aitools/en/script-for-instagram-reel.json +246 -0
- data/_data/aitools/en/script-for-tiktok-video.json +246 -0
- data/_data/aitools/en/seo-optimized-blog-post.json +239 -0
- data/_data/aitools/en/snapchat-caption-maker.json +245 -0
- data/_data/aitools/en/social-media-bio-creator.json +274 -0
- data/_data/aitools/en/social-media-bio-generator.json +246 -0
- data/_data/aitools/en/social-media-calendar.json +250 -0
- data/_data/aitools/en/tiktok-caption.json +232 -0
- data/_data/aitools/en/tiktok-username-generator.json +239 -0
- data/_data/aitools/en/twitter-poll-generator.json +250 -0
- data/_data/aitools/en/twitter-post.json +272 -0
- data/_data/contenttool/en/features.json +217 -10
- data/_includes/.DS_Store +0 -0
- data/_includes/appscms/.DS_Store +0 -0
- data/_includes/appscms/customblog/pageRelatedPosts.html +1 -1
- data/_layouts/appscms-feature.html +1 -1
- data/_layouts/content-tool-ai copy 2.html +6611 -0
- data/_layouts/content-tool-ai.html +305 -44
- data/assets/.DS_Store +0 -0
- data/assets/css/content-tool-ai.css +815 -11
- metadata +50 -67
- data/assets/js/.DS_Store +0 -0
- data/assets/js/TopScroll.js +0 -8
- data/assets/js/adBlocker.js +0 -68
- data/assets/js/ads.js +0 -8
- data/assets/js/append-div.js +0 -10
- data/assets/js/appscms-infographics.js +0 -0
- data/assets/js/appscms-login.js +0 -447
- data/assets/js/appscms-search-home1.js +0 -136
- data/assets/js/appscms-search.js +0 -133
- data/assets/js/appscms-theme.js +0 -459
- data/assets/js/batch.js +0 -219
- data/assets/js/blog-topic-ideas.js +0 -57
- data/assets/js/calculator-tooltip.js +0 -3
- data/assets/js/devtools.js +0 -82
- data/assets/js/face-api.js +0 -38064
- data/assets/js/face-detection.js +0 -303
- data/assets/js/faceSystem.js +0 -0
- data/assets/js/featureResult.js +0 -48
- data/assets/js/frame.js +0 -264
- data/assets/js/googledrive.js +0 -158
- data/assets/js/homeResult.js +0 -37
- data/assets/js/human-written-blog-post.js +0 -57
- data/assets/js/instagram-caption.js +0 -57
- data/assets/js/instagram-hashtag-generator.js +0 -10
- data/assets/js/instagram-name-generator.js +0 -61
- data/assets/js/manifest.json +0 -17
- data/assets/js/models/age_gender_model-shard1 +0 -0
- data/assets/js/models/age_gender_model-weights_manifest.json +0 -1
- data/assets/js/models/face_expression_model-shard1 +0 -0
- data/assets/js/models/face_expression_model-weights_manifest.json +0 -1
- data/assets/js/models/face_landmark_68_model-shard1 +0 -0
- data/assets/js/models/face_landmark_68_model-weights_manifest.json +0 -1
- data/assets/js/models/face_landmark_68_tiny_model-shard1 +0 -0
- data/assets/js/models/face_landmark_68_tiny_model-weights_manifest.json +0 -1
- data/assets/js/models/face_recognition_model-shard1 +0 -0
- data/assets/js/models/face_recognition_model-shard2 +0 -6
- data/assets/js/models/face_recognition_model-weights_manifest.json +0 -1
- data/assets/js/models/mtcnn_model-shard1 +0 -0
- data/assets/js/models/mtcnn_model-weights_manifest.json +0 -1
- data/assets/js/models/ssd_mobilenetv1_model-shard1 +0 -0
- data/assets/js/models/ssd_mobilenetv1_model-shard2 +8 -137
- data/assets/js/models/ssd_mobilenetv1_model-weights_manifest.json +0 -1
- data/assets/js/models/tiny_face_detector_model-shard1 +0 -0
- data/assets/js/models/tiny_face_detector_model-weights_manifest.json +0 -1
- data/assets/js/multiselect.js +0 -185
- data/assets/js/partytown/debug/partytown-atomics.js +0 -929
- data/assets/js/partytown/debug/partytown-media.js +0 -374
- data/assets/js/partytown/debug/partytown-sandbox-sw.js +0 -920
- data/assets/js/partytown/debug/partytown-sw.js +0 -59
- data/assets/js/partytown/debug/partytown-ww-atomics.js +0 -2699
- data/assets/js/partytown/debug/partytown-ww-sw.js +0 -2691
- data/assets/js/partytown/debug/partytown.js +0 -114
- data/assets/js/partytown/partytown-atomics.js +0 -600
- data/assets/js/partytown/partytown-media.js +0 -2
- data/assets/js/partytown/partytown-sw.js +0 -50
- data/assets/js/perspective.min.js +0 -182
- data/assets/js/photo-effects.json +0 -85
- data/assets/js/redirectResult.js +0 -10
- data/assets/js/sharePage.js +0 -65
- data/assets/js/testing-batch.js +0 -39
- data/assets/js/theme.js +0 -104
- data/assets/js/usageTracking.js +0 -143
- data/assets/js/usageTrackingEvents.js +0 -6
- data/assets/js/userUsageCount.js +0 -0
- data/assets/js/webvitals.js +0 -5
data/assets/js/appscms-theme.js
DELETED
@@ -1,459 +0,0 @@
|
|
1
|
-
---
|
2
|
-
---
|
3
|
-
console.log(document.querySelectorAll('*').length);
|
4
|
-
|
5
|
-
if ("{{ site.safeui }}"==="true") {
|
6
|
-
document.addEventListener("DOMContentLoaded", function () {
|
7
|
-
var safuiAlert = document.querySelector("#safeui-alert");
|
8
|
-
if (safuiAlert) {
|
9
|
-
setTimeout(function () {
|
10
|
-
safuiAlert.style.transition = "1s";
|
11
|
-
safuiAlert.style.height = "0";
|
12
|
-
safuiAlert.style.paddingTop = "0";
|
13
|
-
safuiAlert.style.paddingBottom = "0";
|
14
|
-
safuiAlert.style.marginTop = "0";
|
15
|
-
safuiAlert.style.marginBottom = "0";
|
16
|
-
setTimeout(function () {
|
17
|
-
safuiAlert.parentNode.removeChild(safuiAlert);
|
18
|
-
}, 1000);
|
19
|
-
}, 7000);
|
20
|
-
}
|
21
|
-
});
|
22
|
-
}
|
23
|
-
const hamburger = document.querySelector("#hamburger");
|
24
|
-
const closeNavHam = document.querySelector("#close-nav-ham");
|
25
|
-
const appscmsToolbar = document.querySelector(".appscms-toolbar");
|
26
|
-
const appscmsToolbarListItems = document.querySelectorAll(
|
27
|
-
".appscms-toolbar-list-item-span"
|
28
|
-
);
|
29
|
-
closeNavHam.addEventListener("click", () => {
|
30
|
-
if (hamburger.dataset.open === "1") {
|
31
|
-
hamburger.dataset.open = "0";
|
32
|
-
appscmsToolbar.style.right = "-272px";
|
33
|
-
appscmsToolbar.style.display = "none";
|
34
|
-
hamburger.innerHTML = ` <svg
|
35
|
-
style="font-size:25px"
|
36
|
-
stroke="currentColor"
|
37
|
-
fill="currentColor"
|
38
|
-
stroke-width="0"
|
39
|
-
viewBox="0 0 512 512"
|
40
|
-
aria-hidden="true"
|
41
|
-
focusable="false"
|
42
|
-
height="50px"
|
43
|
-
width="1em"
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
45
|
-
>
|
46
|
-
<path
|
47
|
-
fill="none"
|
48
|
-
stroke-linecap="round"
|
49
|
-
stroke-miterlimit="10"
|
50
|
-
stroke-width="48"
|
51
|
-
d="M88 152h336M88 256h336M88 360h336"
|
52
|
-
></path>
|
53
|
-
</svg>`;
|
54
|
-
}
|
55
|
-
})
|
56
|
-
hamburger.addEventListener("click", () => {
|
57
|
-
if (hamburger.dataset.open === "1") {
|
58
|
-
hamburger.dataset.open = "0";
|
59
|
-
appscmsToolbar.style.right = "-272px";
|
60
|
-
appscmsToolbar.style.display = "none";
|
61
|
-
hamburger.innerHTML = ` <svg
|
62
|
-
style="font-size:25px"
|
63
|
-
stroke="currentColor"
|
64
|
-
fill="currentColor"
|
65
|
-
stroke-width="0"
|
66
|
-
viewBox="0 0 512 512"
|
67
|
-
aria-hidden="true"
|
68
|
-
focusable="false"
|
69
|
-
height="50px"
|
70
|
-
width="1em"
|
71
|
-
xmlns="http://www.w3.org/2000/svg"
|
72
|
-
>
|
73
|
-
<path
|
74
|
-
fill="none"
|
75
|
-
stroke-linecap="round"
|
76
|
-
stroke-miterlimit="10"
|
77
|
-
stroke-width="48"
|
78
|
-
d="M88 152h336M88 256h336M88 360h336"
|
79
|
-
></path>
|
80
|
-
</svg>`;
|
81
|
-
} else {
|
82
|
-
hamburger.dataset.open = "1";
|
83
|
-
appscmsToolbar.style.right = "0px";
|
84
|
-
appscmsToolbar.style.display = "block";
|
85
|
-
hamburger.innerHTML = `<svg height="50px"
|
86
|
-
width="1em" style="font-size:25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g clip-path="url(#clip0_429_11083)"> <path d="M7 7.00006L17 17.0001M7 17.0001L17 7.00006" stroke="#ffffff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"></path> </g> <defs> <clipPath id="clip0_429_11083"> <rect width="24" height="24" fill="white"></rect> </clipPath> </defs> </g></svg>`;
|
87
|
-
}
|
88
|
-
});
|
89
|
-
Array.from(appscmsToolbarListItems).map((item) => {
|
90
|
-
item.addEventListener("click", (e) => {
|
91
|
-
e.preventDefault();
|
92
|
-
var style = window.getComputedStyle(item.nextElementSibling);
|
93
|
-
var maxHeight = style.getPropertyValue("max-height");
|
94
|
-
console.log(maxHeight)
|
95
|
-
if (maxHeight && maxHeight !== "0px") {
|
96
|
-
// If the item is expanded, collapse it
|
97
|
-
item.nextElementSibling.style.maxHeight = "0";
|
98
|
-
item.nextElementSibling.style.opacity = "0";
|
99
|
-
item.nextElementSibling.style.height = "0";
|
100
|
-
} else {
|
101
|
-
// If the item is collapsed, expand it
|
102
|
-
item.nextElementSibling.style.maxHeight =
|
103
|
-
item.nextElementSibling.scrollHeight + "px";
|
104
|
-
item.nextElementSibling.style.opacity = "1";
|
105
|
-
item.nextElementSibling.style.height = "auto";
|
106
|
-
}
|
107
|
-
});
|
108
|
-
});
|
109
|
-
|
110
|
-
if ("{{ site.removeBootstrapJs }}" === "true") {
|
111
|
-
const languagesModal = document.querySelector("#staticBackdrop");
|
112
|
-
const intModalBtn = document.querySelector("#int-modal-btn");
|
113
|
-
const closeBtn = document.querySelector("#close-modal");
|
114
|
-
|
115
|
-
if (intModalBtn) {
|
116
|
-
intModalBtn.addEventListener("click", () => {
|
117
|
-
languagesModal.style.display = "block";
|
118
|
-
languagesModal.classList.add("show");
|
119
|
-
let modal = document.createElement("div");
|
120
|
-
modal.classList.add("modal-backdrop", "show");
|
121
|
-
document.body.appendChild(modal);
|
122
|
-
});
|
123
|
-
closeBtn.addEventListener("click", () => {
|
124
|
-
languagesModal.style.display = "none";
|
125
|
-
languagesModal.classList.remove("show");
|
126
|
-
let modal = document.querySelector(".modal-backdrop");
|
127
|
-
document.body.removeChild(modal);
|
128
|
-
});
|
129
|
-
}
|
130
|
-
}
|
131
|
-
|
132
|
-
document.addEventListener("DOMContentLoaded", function() {
|
133
|
-
const downloadButton = document.getElementById("download-button");
|
134
|
-
|
135
|
-
if (downloadButton) {
|
136
|
-
const loader = document.querySelector(".button-loader");
|
137
|
-
const downloadSvg = downloadButton.querySelector("#download-svg");
|
138
|
-
const savingData = document.getElementById("saving-data");
|
139
|
-
|
140
|
-
downloadButton.addEventListener("click", function() {
|
141
|
-
|
142
|
-
loader.style.display = "block";
|
143
|
-
downloadSvg.style.visibility = "hidden";
|
144
|
-
|
145
|
-
|
146
|
-
// Show saving data message
|
147
|
-
savingData.style.display = "flex";
|
148
|
-
|
149
|
-
// Your additional code can go here
|
150
|
-
// Add your code logic here to execute when the button is clicked
|
151
|
-
|
152
|
-
});
|
153
|
-
}
|
154
|
-
|
155
|
-
});
|
156
|
-
|
157
|
-
// Check if the button exists
|
158
|
-
const processingBtn = document.getElementById('processing-btn');
|
159
|
-
const buttonLoader = document.querySelector('.button-loader');
|
160
|
-
if (processingBtn && buttonLoader) {
|
161
|
-
processingBtn.addEventListener('click', (event) => {
|
162
|
-
buttonLoader.style.display = 'block';
|
163
|
-
requestAnimationFrame(() => {
|
164
|
-
requestAnimationFrame(() => {
|
165
|
-
history.back();
|
166
|
-
});
|
167
|
-
});
|
168
|
-
}, { passive: true });
|
169
|
-
}
|
170
|
-
|
171
|
-
|
172
|
-
// if ("{{ site.navigationSearch }}" === "true") {
|
173
|
-
// // Fetch data directly from alllinks.json
|
174
|
-
// fetch("/alllinks.json")
|
175
|
-
// .then((response) => response.json())
|
176
|
-
// .then((data) => {
|
177
|
-
// // Check if the URL includes "/hi" to determine the language
|
178
|
-
// if (window.location.pathname.includes("/hi")) {
|
179
|
-
// window.fetchedData = data.featuredLinkshi; // Use Hindi data
|
180
|
-
// } else {
|
181
|
-
// window.fetchedData = data.featuredLinks; // Use English data
|
182
|
-
// }
|
183
|
-
// })
|
184
|
-
// .catch((error) => {
|
185
|
-
// console.error("Error fetching data:", error);
|
186
|
-
// });
|
187
|
-
|
188
|
-
// // Filter data based on search query
|
189
|
-
// function filterData(data, query) {
|
190
|
-
// return data.filter((item) =>
|
191
|
-
// item.name.toLowerCase().includes(query.toLowerCase())
|
192
|
-
// );
|
193
|
-
// }
|
194
|
-
|
195
|
-
// // Display filtered results
|
196
|
-
// function displayResults(results) {
|
197
|
-
// const resultsContainer = document.getElementById("results");
|
198
|
-
// resultsContainer.style.display = results.length ? "block" : "none";
|
199
|
-
// resultsContainer.innerHTML = results.length
|
200
|
-
// ? results
|
201
|
-
// .map(
|
202
|
-
// (result) =>
|
203
|
-
// `<div class="result-item"><a href="${result.url}" target="_blank">${result.name}</a></div>`
|
204
|
-
// )
|
205
|
-
// .join("")
|
206
|
-
// : "<p>No results found</p>";
|
207
|
-
// }
|
208
|
-
|
209
|
-
// function mobileDisplayResults(results) {
|
210
|
-
// const mobileResultsContainer = document.querySelector(
|
211
|
-
// ".mobile-searchbarResults"
|
212
|
-
// );
|
213
|
-
// mobileResultsContainer.style.display = results.length ? "block" : "none";
|
214
|
-
// mobileResultsContainer.innerHTML = results.length
|
215
|
-
// ? results
|
216
|
-
// .map(
|
217
|
-
// (result) =>
|
218
|
-
// `<div class="mobile-result-item"><a href="${result.url}" target="_blank">${result.name}</a></div>`
|
219
|
-
// )
|
220
|
-
// .join("")
|
221
|
-
// : "<p>No results found</p>";
|
222
|
-
// }
|
223
|
-
|
224
|
-
// // Handle search input
|
225
|
-
// const searchInput = document.querySelector(".search-input");
|
226
|
-
|
227
|
-
// searchInput.addEventListener("input", (event) => {
|
228
|
-
// const query = event.target.value;
|
229
|
-
// const data = window.fetchedData || [];
|
230
|
-
// const filteredResults = filterData(data, query);
|
231
|
-
// displayResults(filteredResults);
|
232
|
-
|
233
|
-
// gtag("event", "search", {
|
234
|
-
// event_category: "engagement",
|
235
|
-
// event_label: "Search Box",
|
236
|
-
// value: query,
|
237
|
-
// });
|
238
|
-
// });
|
239
|
-
|
240
|
-
// const mobileSearchInput = document.querySelector(".mobile-search-input");
|
241
|
-
// mobileSearchInput.addEventListener("input", (event) => {
|
242
|
-
// const query = event.target.value;
|
243
|
-
// const data = window.fetchedData || [];
|
244
|
-
// const filteredResults = filterData(data, query);
|
245
|
-
// mobileDisplayResults(filteredResults);
|
246
|
-
|
247
|
-
// gtag("event", "search", {
|
248
|
-
// event_category: "engagement",
|
249
|
-
// event_label: "Search Box",
|
250
|
-
// value: query,
|
251
|
-
// });
|
252
|
-
// });
|
253
|
-
|
254
|
-
// // Hide results when clicking outside search input and results container
|
255
|
-
// document.addEventListener("click", (event) => {
|
256
|
-
// const resultsContainer = document.getElementById("results");
|
257
|
-
|
258
|
-
// if (
|
259
|
-
// !searchInput.contains(event.target) &&
|
260
|
-
// !resultsContainer.contains(event.target)
|
261
|
-
// ) {
|
262
|
-
// resultsContainer.style.display = "none";
|
263
|
-
// }
|
264
|
-
// if (!window.location.pathname.includes("/hi")) {
|
265
|
-
// const mobileResultsContainer = document.querySelector(
|
266
|
-
// ".mobile-searchbarResults"
|
267
|
-
// );
|
268
|
-
// if (
|
269
|
-
// !mobileSearchInput.contains(event.target) &&
|
270
|
-
// !mobileResultsContainer.contains(event.target)
|
271
|
-
// ) {
|
272
|
-
// mobileResultsContainer.style.display = "none";
|
273
|
-
// }
|
274
|
-
// }
|
275
|
-
// });
|
276
|
-
// }
|
277
|
-
|
278
|
-
if ("{{ site.navigationSearch }}" === "true") {
|
279
|
-
// Define supported languages and their corresponding data keys
|
280
|
-
const SUPPORTED_LANGUAGES = {
|
281
|
-
de: 'featuredLinksde',
|
282
|
-
da: 'featuredLinksda',
|
283
|
-
es: 'featuredLinkses',
|
284
|
-
id: 'featuredLinksid',
|
285
|
-
it: 'featuredLinksit',
|
286
|
-
nl: 'featuredLinksnl',
|
287
|
-
pl: 'featuredLinkspl',
|
288
|
-
pt: 'featuredLinkspt',
|
289
|
-
sv: 'featuredLinkssv',
|
290
|
-
tr: 'featuredLinkstr',
|
291
|
-
vi: 'featuredLinksvi',
|
292
|
-
hi: 'featuredLinkshi',
|
293
|
-
fr: 'featuredLinksfr',
|
294
|
-
};
|
295
|
-
|
296
|
-
// Helper function to get current language from URL
|
297
|
-
function getCurrentLanguage() {
|
298
|
-
const path = window.location.pathname;
|
299
|
-
return Object.keys(SUPPORTED_LANGUAGES).find(lang =>
|
300
|
-
path.includes(`/${lang}`)
|
301
|
-
) || 'en';
|
302
|
-
}
|
303
|
-
|
304
|
-
// Fetch data directly from alllinks.json
|
305
|
-
fetch("/alllinks.json")
|
306
|
-
.then((response) => response.json())
|
307
|
-
.then((data) => {
|
308
|
-
// Store all data globally
|
309
|
-
window.allData = data;
|
310
|
-
const currentLang = getCurrentLanguage();
|
311
|
-
// Set initial data based on current language
|
312
|
-
window.fetchedData = currentLang === 'en'
|
313
|
-
? data.featuredLinks
|
314
|
-
: data[SUPPORTED_LANGUAGES[currentLang]];
|
315
|
-
})
|
316
|
-
.catch((error) => {
|
317
|
-
console.error("Error fetching data:", error);
|
318
|
-
});
|
319
|
-
|
320
|
-
// Filter data based on search query
|
321
|
-
function filterData(data, query) {
|
322
|
-
return data ? data.filter((item) =>
|
323
|
-
item.name.toLowerCase().includes(query.toLowerCase())
|
324
|
-
) : [];
|
325
|
-
}
|
326
|
-
|
327
|
-
// Display filtered results
|
328
|
-
function displayResults(primaryResults, secondaryResults = [], container) {
|
329
|
-
const resultsContainer = container || document.getElementById("results");
|
330
|
-
const currentLang = getCurrentLanguage();
|
331
|
-
|
332
|
-
// Combine results, with primary results first
|
333
|
-
const combinedResults = [...primaryResults];
|
334
|
-
if (primaryResults.length < 4) {
|
335
|
-
// Only add secondary results if primary results are less than 4
|
336
|
-
secondaryResults.forEach(result => {
|
337
|
-
// Check if this result isn't already in primary results
|
338
|
-
if (!primaryResults.some(pr => pr.url === result.url)) {
|
339
|
-
combinedResults.push(result);
|
340
|
-
}
|
341
|
-
});
|
342
|
-
}
|
343
|
-
|
344
|
-
resultsContainer.style.display = combinedResults.length ? "block" : "none";
|
345
|
-
|
346
|
-
if (combinedResults.length === 0) {
|
347
|
-
resultsContainer.innerHTML = "<p>No results found</p>";
|
348
|
-
return;
|
349
|
-
}
|
350
|
-
|
351
|
-
// Get language display name for the indicator
|
352
|
-
const getLanguageDisplayName = () => {
|
353
|
-
try {
|
354
|
-
return new Intl.DisplayNames(['en'], { type: 'language' }).of('en');
|
355
|
-
} catch (e) {
|
356
|
-
return 'English';
|
357
|
-
}
|
358
|
-
};
|
359
|
-
|
360
|
-
// Display results with language indicators
|
361
|
-
resultsContainer.innerHTML = combinedResults
|
362
|
-
.map((result, index) => {
|
363
|
-
const isSecondary = index >= primaryResults.length;
|
364
|
-
return `
|
365
|
-
<div class="result-item ${isSecondary ? 'secondary-result' : ''}">
|
366
|
-
<a href="${result.url}" target="_blank">${result.name}</a>
|
367
|
-
${isSecondary ? `<span class="language-indicator"></span>` : ''}
|
368
|
-
</div>
|
369
|
-
`;
|
370
|
-
})
|
371
|
-
.join("");
|
372
|
-
}
|
373
|
-
|
374
|
-
function handleSearch(event, isDesktop = true) {
|
375
|
-
const query = event.target.value.trim();
|
376
|
-
const container = isDesktop ?
|
377
|
-
document.getElementById("results") :
|
378
|
-
document.querySelector(".mobile-searchbarResults");
|
379
|
-
|
380
|
-
if (!query) {
|
381
|
-
container.style.display = "none";
|
382
|
-
return;
|
383
|
-
}
|
384
|
-
|
385
|
-
const currentLang = getCurrentLanguage();
|
386
|
-
const currentLangData = currentLang === 'en'
|
387
|
-
? window.allData.featuredLinks
|
388
|
-
: window.allData[SUPPORTED_LANGUAGES[currentLang]];
|
389
|
-
|
390
|
-
// First, search in current language data
|
391
|
-
const primaryResults = filterData(currentLangData, query);
|
392
|
-
|
393
|
-
// If primary results are less than 4, also search in English data
|
394
|
-
const englishResults = primaryResults.length < 4 ?
|
395
|
-
filterData(window.allData.featuredLinks, query) :
|
396
|
-
[];
|
397
|
-
|
398
|
-
// Display results with current language first, then English if needed
|
399
|
-
displayResults(primaryResults, englishResults, container);
|
400
|
-
|
401
|
-
gtag("event", "search", {
|
402
|
-
event_category: "engagement",
|
403
|
-
event_label: "Search Box",
|
404
|
-
value: query,
|
405
|
-
});
|
406
|
-
}
|
407
|
-
|
408
|
-
// Set up desktop search
|
409
|
-
const searchInput = document.querySelector(".search-input");
|
410
|
-
searchInput.addEventListener("input", (event) => handleSearch(event, true));
|
411
|
-
|
412
|
-
// Set up mobile search
|
413
|
-
const mobileSearchInput = document.querySelector(".mobile-search-input");
|
414
|
-
mobileSearchInput.addEventListener("input", (event) => handleSearch(event, false));
|
415
|
-
|
416
|
-
// Hide results when clicking outside
|
417
|
-
document.addEventListener("click", (event) => {
|
418
|
-
const resultsContainer = document.getElementById("results");
|
419
|
-
const mobileResultsContainer = document.querySelector(".mobile-searchbarResults");
|
420
|
-
|
421
|
-
if (!searchInput.contains(event.target) && !resultsContainer.contains(event.target)) {
|
422
|
-
resultsContainer.style.display = "none";
|
423
|
-
}
|
424
|
-
|
425
|
-
if (!mobileSearchInput.contains(event.target) && !mobileResultsContainer.contains(event.target)) {
|
426
|
-
mobileResultsContainer.style.display = "none";
|
427
|
-
}
|
428
|
-
});
|
429
|
-
}
|
430
|
-
document.addEventListener("DOMContentLoaded", function () {
|
431
|
-
const scrollContainer = document.querySelector(".appscms-toolbar-list");
|
432
|
-
const scrollLeft = document.querySelector(".scroll-left");
|
433
|
-
const scrollRight = document.querySelector(".scroll-right");
|
434
|
-
|
435
|
-
function updateScrollButtons() {
|
436
|
-
scrollLeft.style.display =
|
437
|
-
scrollContainer.scrollLeft > 0 ? "block" : "none";
|
438
|
-
scrollRight.style.display =
|
439
|
-
scrollContainer.scrollWidth >
|
440
|
-
scrollContainer.clientWidth + scrollContainer.scrollLeft
|
441
|
-
? "block"
|
442
|
-
: "none";
|
443
|
-
}
|
444
|
-
|
445
|
-
scrollLeft.addEventListener("click", function () {
|
446
|
-
scrollContainer.scrollLeft -= 120; // Adjust this value as needed
|
447
|
-
updateScrollButtons();
|
448
|
-
});
|
449
|
-
|
450
|
-
scrollRight.addEventListener("click", function () {
|
451
|
-
scrollContainer.scrollLeft += 120; // Adjust this value as needed
|
452
|
-
updateScrollButtons();
|
453
|
-
});
|
454
|
-
|
455
|
-
scrollContainer.addEventListener("scroll", updateScrollButtons);
|
456
|
-
|
457
|
-
// Initial check to hide buttons if necessary
|
458
|
-
updateScrollButtons();
|
459
|
-
});
|
data/assets/js/batch.js
DELETED
@@ -1,219 +0,0 @@
|
|
1
|
-
const getScript = document.currentScript;
|
2
|
-
const pageTool = getScript.dataset.tool;
|
3
|
-
const lang = getScript.dataset.lang;
|
4
|
-
const inputBox = document.querySelector(".upload-btn");
|
5
|
-
const addFiles = document.querySelector(".add-more-files");
|
6
|
-
const fileDropBox = document.querySelector(".box");
|
7
|
-
const workspace = document.querySelector(".workspace");
|
8
|
-
const selectedFilesList = document.querySelector(".selectedFilesList");
|
9
|
-
const downloadButton = document.querySelector("#download-button");
|
10
|
-
const submitButton = document.querySelector("#submit-button");
|
11
|
-
const showProcessingFiles = document.querySelector(".files-processing-list");
|
12
|
-
let zipFileType = null;
|
13
|
-
let renderFileTypes = null;
|
14
|
-
|
15
|
-
const showLoader = () => {
|
16
|
-
showLoading();
|
17
|
-
};
|
18
|
-
const closeLoader = () => {};
|
19
|
-
|
20
|
-
fileDropBox.addEventListener("dragover", (e) => {
|
21
|
-
e.preventDefault();
|
22
|
-
});
|
23
|
-
fileDropBox.addEventListener("drop", (e) => {
|
24
|
-
e.preventDefault();
|
25
|
-
handleFile(e.dataTransfer.files[0]);
|
26
|
-
});
|
27
|
-
const fileOnChange = () => {
|
28
|
-
handleFile(file.files);
|
29
|
-
};
|
30
|
-
inputBox.onclick = function () {
|
31
|
-
document.querySelector("#file").click();
|
32
|
-
};
|
33
|
-
const fileOnChange2 = () => {
|
34
|
-
addMoreFiles(document.querySelector("#file2").files);
|
35
|
-
};
|
36
|
-
addFiles.onclick = function () {
|
37
|
-
document.querySelector("#file2").click();
|
38
|
-
};
|
39
|
-
let files = [];
|
40
|
-
let fileName = "";
|
41
|
-
let blobList = [];
|
42
|
-
const addMoreFiles = (addFiles) => {
|
43
|
-
handleFile(addFiles);
|
44
|
-
};
|
45
|
-
const onSubmit = (files) => {
|
46
|
-
blobList = [];
|
47
|
-
Promise.all(
|
48
|
-
files.map((item, index) => {
|
49
|
-
document.querySelector(
|
50
|
-
`#loader-${index}`
|
51
|
-
).innerHTML = `<span class="processing">processing</span>
|
52
|
-
<div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div>`;
|
53
|
-
return new Promise((resolve, reject) => {
|
54
|
-
batchConversion(item, index).then(([indexValue, blob, type]) => {
|
55
|
-
blobList.push({ blob: blob, fileName: item });
|
56
|
-
document.querySelector(
|
57
|
-
`#loader-${indexValue}`
|
58
|
-
).innerHTML = `<span class="done">finished</span>`;
|
59
|
-
document.querySelector(`#download-${indexValue}`).style.display =
|
60
|
-
"inline-block";
|
61
|
-
resolve();
|
62
|
-
});
|
63
|
-
}).catch((error) => {
|
64
|
-
console.log(error);
|
65
|
-
});
|
66
|
-
})
|
67
|
-
).then(() => {
|
68
|
-
document.querySelector(".bottom-section-container").style.display = "flex";
|
69
|
-
document.querySelector(".bottom-section-container").style.padding =
|
70
|
-
"20px .75rem";
|
71
|
-
document.querySelector("#download-zip").style.display = "block";
|
72
|
-
let zip = new JSZip();
|
73
|
-
let zipFiles = zip.folder(`safeimagekit-batch-images`);
|
74
|
-
blobList.map((item) => {
|
75
|
-
zipFiles.file(
|
76
|
-
`safeimagekit-batch-${item.fileName.name.split(".")[0]}.${
|
77
|
-
zipFileType ? zipFileType : "png"
|
78
|
-
}`,
|
79
|
-
getBase64String(item.blob),
|
80
|
-
{ base64: true }
|
81
|
-
);
|
82
|
-
});
|
83
|
-
|
84
|
-
document.querySelector("#download-zip").addEventListener("click", () => {
|
85
|
-
zip.generateAsync({ type: "blob" }).then(function (content) {
|
86
|
-
saveAs(content, `safeimagekit-batch-conversion.zip`);
|
87
|
-
if (lang === "en") {
|
88
|
-
window.location.href = `/download?tool=${pageTool}`;
|
89
|
-
} else {
|
90
|
-
window.location.href = `/${lang}/download?tool=${pageTool}`;
|
91
|
-
}
|
92
|
-
});
|
93
|
-
});
|
94
|
-
});
|
95
|
-
};
|
96
|
-
let renderFileTypesHtml = ` <option value="png">png</option>
|
97
|
-
<option value="jpg">jpg</option>
|
98
|
-
<option value="jpeg">jpeg</option>
|
99
|
-
<option value="webp">webp</option>
|
100
|
-
`;
|
101
|
-
|
102
|
-
const renderFiles = (files) => {
|
103
|
-
if (renderFileTypes !== null) {
|
104
|
-
renderFileTypesHtml = "";
|
105
|
-
renderFileTypes.map((i) => {
|
106
|
-
renderFileTypesHtml += `<option value="${i}">${i}</option>`;
|
107
|
-
});
|
108
|
-
}
|
109
|
-
files.map((file, index) => {
|
110
|
-
if (file) {
|
111
|
-
let filename = file.name;
|
112
|
-
if (file.name.split(".")[0].length > 10) {
|
113
|
-
let fName = file.name.split(".")[0];
|
114
|
-
let fExtention = file.name.split(".")[1];
|
115
|
-
filename =
|
116
|
-
fName.substr(0, 9) + "..." + fName.substr(-3) + "." + fExtention;
|
117
|
-
}
|
118
|
-
let loader = "Ready";
|
119
|
-
showProcessingFiles.innerHTML += `
|
120
|
-
<tr>
|
121
|
-
<th scope="row" class="file-icon-row">
|
122
|
-
<img src="/assets/images/file.png" alt="file" class="file-icon">
|
123
|
-
</th>
|
124
|
-
<td class="fileName">${filename}</td>
|
125
|
-
<td id=loader-${index} class="file-processing"><span class="ready">${loader}</span></td>
|
126
|
-
<td>
|
127
|
-
<div class="download-format ">
|
128
|
-
<select name="image-format" id="image-format">
|
129
|
-
${renderFileTypesHtml}
|
130
|
-
</select>
|
131
|
-
</div>
|
132
|
-
|
133
|
-
</td>
|
134
|
-
<td class="file-download-button text-right">
|
135
|
-
<button style="display:none;" id=download-${index} data-type="image" onclick="handleDownload(this)" class="btn download-file-btn">
|
136
|
-
<svg class="download-icon" width="16px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
|
137
|
-
fill="currentColor">
|
138
|
-
<path
|
139
|
-
d="M18 20H5V15H6V19H17V15H18V20ZM12 4V15.19L14.3 13L15 13.6667L11.5 17L8 13.6667L8.7 13L11 15.19V4H12Z">
|
140
|
-
</path>
|
141
|
-
</svg> Download
|
142
|
-
</button>
|
143
|
-
</td>
|
144
|
-
</tr>
|
145
|
-
`;
|
146
|
-
}
|
147
|
-
});
|
148
|
-
};
|
149
|
-
|
150
|
-
const handleFile = (file) => {
|
151
|
-
showProcessingFiles.innerHTML = "";
|
152
|
-
if (file) {
|
153
|
-
for (let i = 0; i < file.length; i++) {
|
154
|
-
files.push(file[i]);
|
155
|
-
stopLoading();
|
156
|
-
workspace.style.display = "block";
|
157
|
-
document.querySelector("#file").style.display = "block";
|
158
|
-
let listItem = document.createElement("li");
|
159
|
-
listItem.style.listStyle = "none";
|
160
|
-
let getFileSize = formatBytes(file[i].size);
|
161
|
-
listItem.innerHTML = `${file[i].name} (${getFileSize})`;
|
162
|
-
// selectedFilesList.appendChild(listItem)
|
163
|
-
}
|
164
|
-
}
|
165
|
-
renderFiles(files);
|
166
|
-
submitButton.addEventListener("click", () => onSubmit(files));
|
167
|
-
};
|
168
|
-
const formatBytes = (bytes, decimals = 2) => {
|
169
|
-
if (bytes === 0) return "0 Bytes";
|
170
|
-
|
171
|
-
const k = 1024;
|
172
|
-
const dm = decimals < 0 ? 0 : decimals;
|
173
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
174
|
-
|
175
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
176
|
-
|
177
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
178
|
-
};
|
179
|
-
const handleDownload = (e) => {
|
180
|
-
let find = blobList[Number(e.id.replace(/^\D+/g, ""))].blob;
|
181
|
-
let fileName = blobList[Number(e.id.replace(/^\D+/g, ""))].fileName.name;
|
182
|
-
|
183
|
-
let format = document.querySelector("#image-format").value;
|
184
|
-
|
185
|
-
switch (e.dataset.type) {
|
186
|
-
case "image":
|
187
|
-
let a = document.createElement("a");
|
188
|
-
a.href = find;
|
189
|
-
a.download = `safeimagekit-batch-${fileName.split(".")[0]}.${format}`;
|
190
|
-
document.body.appendChild(a);
|
191
|
-
a.click();
|
192
|
-
break;
|
193
|
-
default:
|
194
|
-
break;
|
195
|
-
}
|
196
|
-
};
|
197
|
-
const showLoading = () => {
|
198
|
-
document.querySelector("#file-loader").style.display = "flex";
|
199
|
-
document.querySelector(".file-input").style.display = "none";
|
200
|
-
};
|
201
|
-
const stopLoading = () => {
|
202
|
-
fileDropBox.style.display = "none";
|
203
|
-
};
|
204
|
-
|
205
|
-
const getBase64String = (dataURL) => {
|
206
|
-
const idx = dataURL.indexOf("base64,") + "base64,".length;
|
207
|
-
return dataURL.substring(idx);
|
208
|
-
};
|
209
|
-
const dataURLtoBlob = (dataurl) => {
|
210
|
-
let arr = dataurl.split(","),
|
211
|
-
mime = arr[0].match(/:(.*?);/)[1],
|
212
|
-
bstr = atob(arr[1]),
|
213
|
-
n = bstr.length,
|
214
|
-
u8arr = new Uint8Array(n);
|
215
|
-
while (n--) {
|
216
|
-
u8arr[n] = bstr.charCodeAt(n);
|
217
|
-
}
|
218
|
-
return new Blob([u8arr], { type: mime });
|
219
|
-
};
|