appscms-tools-theme 5.1.9 → 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/all-in-one-social-post.json +217 -0
- data/_data/aitools/en/amazon-product-bullet-points-generator.json +2 -0
- data/_data/aitools/en/amazon-product-description-generator.json +15 -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/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/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/_layouts/appscms-feature.html +1 -1
- data/_layouts/content-tool-ai.html +38 -156
- data/assets/.DS_Store +0 -0
- data/assets/css/content-tool-ai.css +42 -12
- metadata +44 -78
- data/_includes/aitools/ai-article-writer.html +0 -0
- data/_includes/aitools/amazon-product-bullet-points-generator.html +0 -0
- data/_includes/aitools/amazon-product-description-generator.html +0 -0
- data/_includes/aitools/brand-name-generator.html +0 -0
- data/_includes/aitools/product-description.html +0 -0
- 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/ai-article-writer.js +0 -0
- data/assets/js/amazon-product-bullet-points-generator.js +0 -464
- data/assets/js/amazon-product-bullet-points-generator3.js +0 -176
- data/assets/js/amazon-product-description-generator.js +0 -309
- 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/brand-name-generator.js +0 -127
- 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/product-description.js +0 -299
- 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-search.js
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
let features = [];
|
2
|
-
let featureshi = [];
|
3
|
-
let featuresar = [];
|
4
|
-
let featuresda = [];
|
5
|
-
let featuresde = [];
|
6
|
-
let featureses = [];
|
7
|
-
let featuresfr = [];
|
8
|
-
let featuresid = [];
|
9
|
-
let featuresit = [];
|
10
|
-
let featuresja = [];
|
11
|
-
let featuresko = [];
|
12
|
-
let featuresnl = [];
|
13
|
-
let featurespl = [];
|
14
|
-
let featurespt = [];
|
15
|
-
let featuresru = [];
|
16
|
-
let featuressv = [];
|
17
|
-
let featuresth = [];
|
18
|
-
let featurestr = [];
|
19
|
-
let featuresuk = [];
|
20
|
-
let featuresvi = [];
|
21
|
-
let featureszh = [];
|
22
|
-
let featureszhtw = [];
|
23
|
-
|
24
|
-
// Fetch data from searchbar.json
|
25
|
-
const fetchFeatures = async () => {
|
26
|
-
try {
|
27
|
-
const response = await fetch('/searchbar.json');
|
28
|
-
const data = await response.json();
|
29
|
-
features = data.features;
|
30
|
-
featureshi = data.featureshi;
|
31
|
-
featuresar = data.featuresar;
|
32
|
-
featuresda = data.featuresda;
|
33
|
-
featuresde = data.featuresde;
|
34
|
-
featureses = data.featureses;
|
35
|
-
featuresfr = data.featuresfr;
|
36
|
-
featuresid = data.featuresid;
|
37
|
-
featuresit = data.featuresit;
|
38
|
-
featuresja = data.featuresja;
|
39
|
-
featuresko = data.featuresko;
|
40
|
-
featuresnl = data.featuresnl;
|
41
|
-
featurespl = data.featurespl;
|
42
|
-
featurespt = data.featurespt;
|
43
|
-
featuresru = data.featuresru;
|
44
|
-
featuressv = data.featuressv;
|
45
|
-
featuresth = data.featuresth;
|
46
|
-
featurestr = data.featurestr;
|
47
|
-
featuresuk = data.featuresuk;
|
48
|
-
featuresvi = data.featuresvi;
|
49
|
-
featureszh = data.featureszh;
|
50
|
-
featureszhtw = data.featureszhtw;
|
51
|
-
} catch (error) {
|
52
|
-
console.error('Error loading features:', error);
|
53
|
-
featureList.innerHTML = '<div class="error-msg">Error loading features</div>';
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
const getFeatureSet = () => {
|
58
|
-
const currentUrl = window.location.pathname;
|
59
|
-
if (currentUrl.includes('/hi')) return featureshi;
|
60
|
-
if (currentUrl.includes('/ar')) return featuresar;
|
61
|
-
if (currentUrl.includes('/da')) return featuresda;
|
62
|
-
if (currentUrl.includes('/de')) return featuresde;
|
63
|
-
if (currentUrl.includes('/es')) return featureses;
|
64
|
-
if (currentUrl.includes('/fr')) return featuresfr;
|
65
|
-
if (currentUrl.includes('/id')) return featuresid;
|
66
|
-
if (currentUrl.includes('/it')) return featuresit;
|
67
|
-
if (currentUrl.includes('/ja')) return featuresja;
|
68
|
-
if (currentUrl.includes('/ko')) return featuresko;
|
69
|
-
if (currentUrl.includes('/nl')) return featuresnl;
|
70
|
-
if (currentUrl.includes('/pl')) return featurespl;
|
71
|
-
if (currentUrl.includes('/pt')) return featurespt;
|
72
|
-
if (currentUrl.includes('/ru')) return featuresru;
|
73
|
-
if (currentUrl.includes('/sv')) return featuressv;
|
74
|
-
if (currentUrl.includes('/th')) return featuresth;
|
75
|
-
if (currentUrl.includes('/tr')) return featurestr;
|
76
|
-
if (currentUrl.includes('/uk')) return featuresuk;
|
77
|
-
if (currentUrl.includes('/vi')) return featuresvi;
|
78
|
-
if (currentUrl.includes('/zh')) return featureszh;
|
79
|
-
if (currentUrl.includes('/zh-tw')) return featureszhtw;
|
80
|
-
return features;
|
81
|
-
};
|
82
|
-
const featureList = document.querySelector('#appscms-tools-section-row');
|
83
|
-
const renderFeatures = (query) => {
|
84
|
-
featureList.innerHTML = "";
|
85
|
-
const currentFeatures = getFeatureSet();
|
86
|
-
const filteredFeatures = currentFeatures.filter(currentFeatures =>
|
87
|
-
currentFeatures.name.toLowerCase().includes(query.toLowerCase())
|
88
|
-
);
|
89
|
-
|
90
|
-
if (filteredFeatures.length > 0) {
|
91
|
-
filteredFeatures.forEach(item => {
|
92
|
-
const listItem = document.createElement("div");
|
93
|
-
const classNames = "col-xl-4 col-lg-6 col-md-6 appscms-tool-container";
|
94
|
-
let classList = classNames.split(" ");
|
95
|
-
classList.forEach(function (className) {
|
96
|
-
listItem.classList.add(className);
|
97
|
-
});
|
98
|
-
listItem.innerHTML = `
|
99
|
-
<a href="${item.url}">
|
100
|
-
<div class="appscms-tool">
|
101
|
-
<div class="tool-top" style="background: ${item.color};">
|
102
|
-
<div class="tool-img">
|
103
|
-
<img crossorigin="anonymous" src="${item.icon}" alt="img" />
|
104
|
-
</div>
|
105
|
-
<div class="tool-text">${truncate(item.description, 67, '..')}</div>
|
106
|
-
</div>
|
107
|
-
<div class="tool-heading">${truncate(item.name, 33, '..')}</div>
|
108
|
-
</div>
|
109
|
-
</a>
|
110
|
-
`;
|
111
|
-
featureList.appendChild(listItem);
|
112
|
-
});
|
113
|
-
}
|
114
|
-
else {
|
115
|
-
let msg = document.createElement('div')
|
116
|
-
msg.classList.add('no-result-found-msg')
|
117
|
-
msg.innerHTML = "No search results found!"
|
118
|
-
featureList.appendChild(msg)
|
119
|
-
}
|
120
|
-
};
|
121
|
-
function truncate(str, length, ending = '..') {
|
122
|
-
if (!str) return '';
|
123
|
-
return str.length > length ? str.substring(0, length) + ending : str;
|
124
|
-
}
|
125
|
-
|
126
|
-
const searchInput = document.querySelector('#search-features');
|
127
|
-
searchInput.addEventListener("input", function () {
|
128
|
-
const query = searchInput.value.trim();
|
129
|
-
renderFeatures(query);
|
130
|
-
});
|
131
|
-
|
132
|
-
// Initialize by fetching data
|
133
|
-
fetchFeatures();
|
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
|
-
});
|