appscms-tools-theme 4.5.4 → 4.5.5

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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/_data/about/en/about.json +16 -16
  3. data/_data/blog/nav.json +14 -14
  4. data/_data/feature/en/batch-conversion.json +192 -192
  5. data/_data/feature/en/compress-pdf.json +305 -348
  6. data/_data/feature/en/devtools.json +321 -321
  7. data/_data/feature/en/face-detection.json +156 -156
  8. data/_data/feature/en/split-pdf.json +221 -221
  9. data/_data/feature/en/theframe.json +160 -160
  10. data/_data/footer/en/data.json +2 -2
  11. data/_data/header/en/data.json +412 -412
  12. data/_data/home/en/en.json +356 -356
  13. data/_data/home/en/posters.json +322 -322
  14. data/_includes/appscms/customblog/contenttool-recent-posts.html +94 -93
  15. data/_includes/appscms/customblog/pageRelatedPosts.html +62 -62
  16. data/_includes/appscms/customblog/recentposts.html +67 -67
  17. data/_includes/appscms/customblog/relatedBlogs.html +82 -82
  18. data/_includes/appscms/customblog/relatedposts.html +193 -192
  19. data/_includes/appscms/extras/appscms-postbox.html +57 -60
  20. data/_includes/appscms/featurePageAuthors/featurePageAuthors.html +85 -85
  21. data/_includes/appscms/head/bloghead.html +128 -128
  22. data/_includes/appscms/head/head.html +182 -72
  23. data/_includes/appscms/headings/contenttool-headings.html +33 -33
  24. data/_includes/appscms/headings/devtool-headings.html +38 -38
  25. data/_includes/appscms/home/contenttool-feature-boxes.html +19 -19
  26. data/_includes/appscms/home/devtool-feature-boxes.html +70 -70
  27. data/_includes/appscms/infographics/infographics.html +159 -159
  28. data/_includes/appscms/loaders/loader.html +4 -4
  29. data/_includes/appscms/navbars/devtool-navbar.html +50 -50
  30. data/_includes/appscms/navbars/devtool-toolbar.html +100 -100
  31. data/_includes/appscms/recent-posts/recent_posts.html +90 -92
  32. data/_includes/appscms/recent-posts/related_categories_post.html +194 -194
  33. data/_includes/appscms/searchbar/devtool-searchbar.html +63 -63
  34. data/_includes/appscms/usp/usp.html +90 -90
  35. data/_includes/author_bio.html +41 -41
  36. data/_includes/authorpagehead/index.html +47 -47
  37. data/_includes/authors/authors.html +39 -39
  38. data/_includes/batch-conversion.html +141 -141
  39. data/_includes/bookmark.html +6 -6
  40. data/_includes/cssfile/links.html +54 -54
  41. data/_includes/custom-head.html +138 -138
  42. data/_includes/customCode.html +1 -1
  43. data/_includes/customScripts.html +1 -1
  44. data/_includes/customblog/pageRelatedPosts.html +87 -87
  45. data/_includes/customblog/recentposts.html +67 -67
  46. data/_includes/customblog/relatedBlogs.html +86 -86
  47. data/_includes/customblog/relatedposts.html +201 -201
  48. data/_includes/dropdown/langdropdown.html +32 -32
  49. data/_includes/feature.html +39 -39
  50. data/_includes/featurePageAuthors/featurePageAuthors.html +101 -101
  51. data/_includes/footer/index.html +537 -537
  52. data/_includes/google-analytics.html +32 -32
  53. data/_includes/head/index.html +623 -623
  54. data/_includes/header/blogHeader.html +34 -34
  55. data/_includes/header/index.html +192 -192
  56. data/_includes/infographics/infographics.html +241 -241
  57. data/_includes/paginationBlogPage.html +70 -70
  58. data/_includes/postbox.html +65 -32
  59. data/_includes/script.html +493 -493
  60. data/_includes/section/count.html +32 -32
  61. data/_includes/section/recent_posts.html +94 -66
  62. data/_includes/section/related_categories_post.html +196 -196
  63. data/_includes/share/socialshare.html +21 -21
  64. data/_includes/userTracking.html +14 -14
  65. data/_layouts/aboutUs.html +175 -99
  66. data/_layouts/allAuthors.html +131 -131
  67. data/_layouts/appscms-about.html +163 -163
  68. data/_layouts/appscms-audio.html +33 -33
  69. data/_layouts/appscms-author.html +436 -436
  70. data/_layouts/appscms-authors.html +145 -171
  71. data/_layouts/appscms-batch.html +141 -141
  72. data/_layouts/appscms-blog.html +94 -55
  73. data/_layouts/appscms-calculator.html +93 -93
  74. data/_layouts/appscms-categories.html +26 -26
  75. data/_layouts/appscms-contact.html +132 -132
  76. data/_layouts/appscms-disclaimer.html +124 -124
  77. data/_layouts/appscms-download.html +289 -289
  78. data/_layouts/appscms-feature-result.html +96 -96
  79. data/_layouts/appscms-help.html +25 -25
  80. data/_layouts/appscms-imagekit.html +96 -96
  81. data/_layouts/appscms-post.html +243 -243
  82. data/_layouts/appscms-privacy-policy.html +781 -781
  83. data/_layouts/appscms-terms-and-conditions.html +646 -646
  84. data/_layouts/appscms-video.html +33 -33
  85. data/_layouts/audio.html +33 -33
  86. data/_layouts/author.html +409 -409
  87. data/_layouts/batch.html +177 -177
  88. data/_layouts/blog-1.html +116 -84
  89. data/_layouts/blog.html +131 -131
  90. data/_layouts/calculator.html +99 -99
  91. data/_layouts/contenttool-feature.html +45 -45
  92. data/_layouts/contenttool-home.html +53 -53
  93. data/_layouts/devtool-blog.html +132 -132
  94. data/_layouts/devtool-feature.html +54 -54
  95. data/_layouts/devtool-home.html +53 -53
  96. data/_layouts/devtools.html +57 -57
  97. data/_layouts/feature-1.html +406 -406
  98. data/_layouts/feature.html +351 -351
  99. data/_layouts/featureResultPage.html +82 -82
  100. data/_layouts/frame.html +222 -222
  101. data/_layouts/home.html +281 -281
  102. data/_layouts/homeResultPage.html +32 -32
  103. data/_layouts/imagekit.html +308 -308
  104. data/_layouts/photo-effects-home.html +190 -190
  105. data/_layouts/post.html +233 -233
  106. data/assets/app.js +75 -75
  107. data/assets/css/appscms-blog.css +505 -505
  108. data/assets/css/appscms-contenttool.css +1384 -1384
  109. data/assets/css/appscms-home.css +5 -5
  110. data/assets/css/appscms-imagekit.css +855 -855
  111. data/assets/css/appscms-variables.css +19 -19
  112. data/assets/css/blog.css +510 -510
  113. data/assets/css/calculators.css +46 -46
  114. data/assets/css/devtool-main.css +1350 -1350
  115. data/assets/css/devtools.css +105 -105
  116. data/assets/css/feature-1.css +293 -293
  117. data/assets/css/imagekit copy.css +848 -848
  118. data/assets/css/imagekit.css +848 -848
  119. data/assets/css/tools.css +1847 -1847
  120. data/assets/images/close-button.svg +31 -31
  121. data/assets/images/digipaint.svg +6 -6
  122. data/assets/images/logo.svg +2 -2
  123. data/assets/images/manthink.svg +3552 -3552
  124. data/assets/images/search-icon.svg +2 -2
  125. data/assets/js/batch.js +256 -256
  126. data/assets/js/devtools.js +81 -81
  127. data/assets/js/sharePage.js +65 -65
  128. data/assets/js/usageTracking.js +143 -143
  129. data/assets/js/usageTrackingEvents.js +6 -6
  130. data/assets/js/webvitals.js +4 -4
  131. metadata +3 -3
@@ -1,82 +1,82 @@
1
- let input_editor, output_editor, data;
2
- output_editor = ace.edit("output_editor");
3
- output_editor.setReadOnly(true)
4
- output_editor.session.setMode("ace/mode/json");
5
- input_editor = ace.edit("input_editor");
6
- input_editor.session.setMode("ace/mode/json");
7
- let upload_div_inner = document.getElementById("upload_div_inner")
8
- let file_upload = document.getElementById("file_upload")
9
- let format_btn = document.getElementById("format_btn")
10
- let inputcopyButton = document.querySelector("#inputcopy");
11
- let outputcopyButton = document.querySelector("#outputcopy");
12
- let deleteEditorInputTxt = document.querySelector(".input_editor_bar .cross_icon");
13
- let deleteEditorOuputTxt = document.querySelector(".output_editor_bar .cross_icon");
14
- const siteName = file_upload.dataset.sitename
15
- let selectedFile
16
-
17
- upload_div_inner.onclick = function () {
18
- document.querySelector("#file_upload").click();
19
- };
20
- file_upload.onchange = function (e) {
21
- var input = e.target.files[0];
22
- selectedFile = input
23
- input_editor = ace.edit("input_editor");
24
- input_editor.session.setMode("ace/mode/json");
25
- var reader = new FileReader();
26
- reader.onload = function () {
27
- input_editor.setValue(reader.result);
28
- }
29
- reader.readAsText(input);
30
- };
31
- document.querySelector("#input_editor_bar .save_icon").onclick = function () {
32
- file_saving_decision(1);
33
- };
34
- editorActions();
35
- function editorActions() {
36
- deleteEditorInputTxt.onclick = function () {
37
- input_editor.setValue("");
38
- }
39
- deleteEditorOuputTxt.onclick = function () {
40
- output_editor.setValue("");
41
- }
42
- inputcopyButton.addEventListener("click", (e) => {
43
- const el = document.createElement("textarea");
44
- el.value = input_editor.getValue();
45
- document.body.appendChild(el);
46
- el.select();
47
- document.execCommand("copy");
48
- e.target.setAttribute('data-original-title', 'Copied !')
49
- })
50
- outputcopyButton.addEventListener("click", (e) => {
51
- const el = document.createElement("textarea");
52
- el.value = output_editor.getValue();
53
- document.body.appendChild(el);
54
- el.select();
55
- document.execCommand("copy");
56
- e.target.setAttribute('data-original-title', 'Copied !')
57
- })
58
- }
59
- function file_saving_decision(flag) {
60
- if (flag == 1) {
61
- if (input_editor.getValue == "" || input_editor.getValue == undefined) {
62
- return false;
63
- } else {
64
- file_download(input_editor.getValue(), "application/json", "json");
65
- }
66
- } else if (flag == 0) {
67
- if (output_editor.getValue == "" || output_editor.getValue == undefined) {
68
- return false;
69
- } else {
70
- file_download(output_editor.getValue(), "text/plain", "txt");
71
- }
72
- }
73
- }
74
- function file_download(code, mimetype, extension) {
75
- var a = document.createElement("a");
76
- var data = new Blob([code], {
77
- type: mimetype,
78
- });
79
- a.href = window.URL.createObjectURL(data);
80
- a.download = `${siteName}.` + extension;
81
- a.click();
1
+ let input_editor, output_editor, data;
2
+ output_editor = ace.edit("output_editor");
3
+ output_editor.setReadOnly(true)
4
+ output_editor.session.setMode("ace/mode/json");
5
+ input_editor = ace.edit("input_editor");
6
+ input_editor.session.setMode("ace/mode/json");
7
+ let upload_div_inner = document.getElementById("upload_div_inner")
8
+ let file_upload = document.getElementById("file_upload")
9
+ let format_btn = document.getElementById("format_btn")
10
+ let inputcopyButton = document.querySelector("#inputcopy");
11
+ let outputcopyButton = document.querySelector("#outputcopy");
12
+ let deleteEditorInputTxt = document.querySelector(".input_editor_bar .cross_icon");
13
+ let deleteEditorOuputTxt = document.querySelector(".output_editor_bar .cross_icon");
14
+ const siteName = file_upload.dataset.sitename
15
+ let selectedFile
16
+
17
+ upload_div_inner.onclick = function () {
18
+ document.querySelector("#file_upload").click();
19
+ };
20
+ file_upload.onchange = function (e) {
21
+ var input = e.target.files[0];
22
+ selectedFile = input
23
+ input_editor = ace.edit("input_editor");
24
+ input_editor.session.setMode("ace/mode/json");
25
+ var reader = new FileReader();
26
+ reader.onload = function () {
27
+ input_editor.setValue(reader.result);
28
+ }
29
+ reader.readAsText(input);
30
+ };
31
+ document.querySelector("#input_editor_bar .save_icon").onclick = function () {
32
+ file_saving_decision(1);
33
+ };
34
+ editorActions();
35
+ function editorActions() {
36
+ deleteEditorInputTxt.onclick = function () {
37
+ input_editor.setValue("");
38
+ }
39
+ deleteEditorOuputTxt.onclick = function () {
40
+ output_editor.setValue("");
41
+ }
42
+ inputcopyButton.addEventListener("click", (e) => {
43
+ const el = document.createElement("textarea");
44
+ el.value = input_editor.getValue();
45
+ document.body.appendChild(el);
46
+ el.select();
47
+ document.execCommand("copy");
48
+ e.target.setAttribute('data-original-title', 'Copied !')
49
+ })
50
+ outputcopyButton.addEventListener("click", (e) => {
51
+ const el = document.createElement("textarea");
52
+ el.value = output_editor.getValue();
53
+ document.body.appendChild(el);
54
+ el.select();
55
+ document.execCommand("copy");
56
+ e.target.setAttribute('data-original-title', 'Copied !')
57
+ })
58
+ }
59
+ function file_saving_decision(flag) {
60
+ if (flag == 1) {
61
+ if (input_editor.getValue == "" || input_editor.getValue == undefined) {
62
+ return false;
63
+ } else {
64
+ file_download(input_editor.getValue(), "application/json", "json");
65
+ }
66
+ } else if (flag == 0) {
67
+ if (output_editor.getValue == "" || output_editor.getValue == undefined) {
68
+ return false;
69
+ } else {
70
+ file_download(output_editor.getValue(), "text/plain", "txt");
71
+ }
72
+ }
73
+ }
74
+ function file_download(code, mimetype, extension) {
75
+ var a = document.createElement("a");
76
+ var data = new Blob([code], {
77
+ type: mimetype,
78
+ });
79
+ a.href = window.URL.createObjectURL(data);
80
+ a.download = `${siteName}.` + extension;
81
+ a.click();
82
82
  }
@@ -1,65 +1,65 @@
1
- document
2
- .getElementsByClassName("close-share-modal")[0]
3
- .addEventListener("click", function () {
4
- document.getElementsByClassName("shareModal")[0].style.display = "none";
5
- });
6
-
7
- document
8
- .getElementsByClassName("facebook")[0]
9
- .addEventListener("click", function () {
10
- window.open(
11
- "https://www.facebook.com/sharer/sharer.php?u=" +
12
- encodeURIComponent(window.location.href)
13
- );
14
- });
15
-
16
- document
17
- .getElementsByClassName("instagram")[0]
18
- .addEventListener("click", function () {
19
- window.open("https://www.instagram.com/");
20
- });
21
-
22
- document
23
- .getElementsByClassName("twitter")[0]
24
- .addEventListener("click", function () {
25
- window.open(
26
- "https://twitter.com/share?url=" +
27
- encodeURIComponent(window.location.href)
28
- );
29
- });
30
-
31
- document
32
- .getElementsByClassName("whatsapp")[0]
33
- .addEventListener("click", function () {
34
- window.open(
35
- "https://api.whatsapp.com/send?text=" +
36
- encodeURIComponent(window.location.href)
37
- );
38
- });
39
-
40
- document
41
- .getElementsByClassName("telegram")[0]
42
- .addEventListener("click", function () {
43
- window.open(
44
- "https://telegram.me/share/url?url=" +
45
- encodeURIComponent(window.location.href)
46
- );
47
- });
48
-
49
- document
50
- .getElementsByClassName("pinterest")[0]
51
- .addEventListener("click", function () {
52
- window.open(
53
- "https://pinterest.com/pin/create/button/?url=" +
54
- encodeURIComponent(window.location.href)
55
- );
56
- });
57
-
58
- document
59
- .getElementsByClassName("linkedin")[0]
60
- .addEventListener("click", function () {
61
- window.open(
62
- "https://www.linkedin.com/shareArticle?mini=true&url=" +
63
- encodeURIComponent(window.location.href)
64
- );
65
- });
1
+ document
2
+ .getElementsByClassName("close-share-modal")[0]
3
+ .addEventListener("click", function () {
4
+ document.getElementsByClassName("shareModal")[0].style.display = "none";
5
+ });
6
+
7
+ document
8
+ .getElementsByClassName("facebook")[0]
9
+ .addEventListener("click", function () {
10
+ window.open(
11
+ "https://www.facebook.com/sharer/sharer.php?u=" +
12
+ encodeURIComponent(window.location.href)
13
+ );
14
+ });
15
+
16
+ document
17
+ .getElementsByClassName("instagram")[0]
18
+ .addEventListener("click", function () {
19
+ window.open("https://www.instagram.com/");
20
+ });
21
+
22
+ document
23
+ .getElementsByClassName("twitter")[0]
24
+ .addEventListener("click", function () {
25
+ window.open(
26
+ "https://twitter.com/share?url=" +
27
+ encodeURIComponent(window.location.href)
28
+ );
29
+ });
30
+
31
+ document
32
+ .getElementsByClassName("whatsapp")[0]
33
+ .addEventListener("click", function () {
34
+ window.open(
35
+ "https://api.whatsapp.com/send?text=" +
36
+ encodeURIComponent(window.location.href)
37
+ );
38
+ });
39
+
40
+ document
41
+ .getElementsByClassName("telegram")[0]
42
+ .addEventListener("click", function () {
43
+ window.open(
44
+ "https://telegram.me/share/url?url=" +
45
+ encodeURIComponent(window.location.href)
46
+ );
47
+ });
48
+
49
+ document
50
+ .getElementsByClassName("pinterest")[0]
51
+ .addEventListener("click", function () {
52
+ window.open(
53
+ "https://pinterest.com/pin/create/button/?url=" +
54
+ encodeURIComponent(window.location.href)
55
+ );
56
+ });
57
+
58
+ document
59
+ .getElementsByClassName("linkedin")[0]
60
+ .addEventListener("click", function () {
61
+ window.open(
62
+ "https://www.linkedin.com/shareArticle?mini=true&url=" +
63
+ encodeURIComponent(window.location.href)
64
+ );
65
+ });
@@ -1,143 +1,143 @@
1
- // Generate a unique ID for the user (if not already generated)
2
- const generateUserID = () => {
3
- // Check if the user ID is already stored in cookies or local storage
4
- const storedUserID = getStoredUserID();
5
-
6
- if (storedUserID) {
7
- return storedUserID;
8
- }
9
-
10
- // Example: Generating a random string
11
- const characters =
12
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
13
- let id = "";
14
- for (let i = 0; i < 10; i++) {
15
- id += characters.charAt(Math.floor(Math.random() * characters.length));
16
- }
17
-
18
- // Store the generated user ID in cookies or local storage
19
- storeUserID(id);
20
-
21
- return id;
22
- };
23
-
24
- // Get the stored user ID from cookies or local storage
25
- const getStoredUserID = () => {
26
- return localStorage.getItem("userID");
27
- };
28
-
29
- // Store the user ID in cookies or local storage
30
- const storeUserID = (userID) => {
31
- localStorage.setItem("userID", userID);
32
- };
33
-
34
- // Get the current date in YYYY-MM-DD format
35
- const getCurrentDate = () => {
36
- const today = new Date();
37
- const year = today.getFullYear();
38
- const month = String(today.getMonth() + 1).padStart(2, "0");
39
- const day = String(today.getDate()).padStart(2, "0");
40
- return `${year}-${month}-${day}`;
41
- };
42
-
43
- let userTrackingCountLimit = "20";
44
- const checkUsage = () => {
45
- const today = new Date().toDateString();
46
- const usageCount = getCookie("featureUsageCount");
47
-
48
- if (usageCount) {
49
- // User has already used the feature today
50
- if (usageCount >= Number(userTrackingCountLimit)) {
51
- showShareModal();
52
- } else {
53
- incrementUsageCount(usageCount);
54
- }
55
- } else {
56
- // First usage of the day
57
- setCookie("featureUsageCount", 1, getExpirationDate());
58
- }
59
- const userID = generateUserID();
60
- try {
61
- if ((usageCount + 1) % 5 === 0) {
62
- gtag("event", `feature_used_${usageCount + 1}_times`, {
63
- user_id: userID,
64
- userID: userID,
65
- feature: window.location.pathname + location.search,
66
- });
67
- }
68
- } catch (error) {
69
- console.log(error);
70
- }
71
-
72
- try {
73
- gtag("event", "feature_used", {
74
- user_id: userID,
75
- userID: userID,
76
- feature: window.location.pathname + location.search,
77
- });
78
- } catch (error) {
79
- console.log(error);
80
- }
81
- };
82
- const incrementUsageCount = (count) => {
83
- const today = new Date().toDateString();
84
-
85
- if (count >= Number(userTrackingCountLimit)) {
86
- showShareModal();
87
- } else {
88
- count++;
89
- setCookie("featureUsageCount", count, getExpirationDate());
90
- }
91
- };
92
-
93
- const showShareModal = () => {
94
- document.getElementById("shareModal").style.display = "block";
95
- };
96
-
97
- const handleShare = () => {
98
- const usageCount = getCookie("featureUsageCount");
99
- if (usageCount) {
100
- setCookie("featureUsageCount", 0, getExpirationDate());
101
- }
102
- document.getElementById("shareModal").style.display = "none";
103
- try {
104
- const userID = generateUserID();
105
- gtag("event", "feature_shared", {
106
- user_id: userID,
107
- userID: userID,
108
- feature: window.location.pathname + location.search,
109
- });
110
- } catch (error) {
111
- console.log(error);
112
- }
113
- };
114
-
115
- const getCookie = (name) => {
116
- const cookies = document.cookie.split(";");
117
- for (let i = 0; i < cookies.length; i++) {
118
- const cookie = cookies[i].trim();
119
- if (cookie.indexOf(name + "=") === 0) {
120
- return parseInt(cookie.substring((name + "=").length, cookie.length));
121
- }
122
- }
123
- return null;
124
- };
125
-
126
- const setCookie = (name, value, expires) => {
127
- document.cookie = `${name}=${value};expires=${expires};path=/`;
128
- };
129
-
130
- const getExpirationDate = () => {
131
- const date = new Date();
132
- date.setTime(date.getTime() + 24 * 60 * 60 * 1000); // 24 hours in milliseconds
133
- return date.toUTCString();
134
- };
135
- const socialShare = document.querySelectorAll(".social-share");
136
-
137
- if (socialShare) {
138
- Array.from(socialShare).map((item) => {
139
- item.addEventListener("click", () => {
140
- handleShare();
141
- });
142
- });
143
- }
1
+ // Generate a unique ID for the user (if not already generated)
2
+ const generateUserID = () => {
3
+ // Check if the user ID is already stored in cookies or local storage
4
+ const storedUserID = getStoredUserID();
5
+
6
+ if (storedUserID) {
7
+ return storedUserID;
8
+ }
9
+
10
+ // Example: Generating a random string
11
+ const characters =
12
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
13
+ let id = "";
14
+ for (let i = 0; i < 10; i++) {
15
+ id += characters.charAt(Math.floor(Math.random() * characters.length));
16
+ }
17
+
18
+ // Store the generated user ID in cookies or local storage
19
+ storeUserID(id);
20
+
21
+ return id;
22
+ };
23
+
24
+ // Get the stored user ID from cookies or local storage
25
+ const getStoredUserID = () => {
26
+ return localStorage.getItem("userID");
27
+ };
28
+
29
+ // Store the user ID in cookies or local storage
30
+ const storeUserID = (userID) => {
31
+ localStorage.setItem("userID", userID);
32
+ };
33
+
34
+ // Get the current date in YYYY-MM-DD format
35
+ const getCurrentDate = () => {
36
+ const today = new Date();
37
+ const year = today.getFullYear();
38
+ const month = String(today.getMonth() + 1).padStart(2, "0");
39
+ const day = String(today.getDate()).padStart(2, "0");
40
+ return `${year}-${month}-${day}`;
41
+ };
42
+
43
+ let userTrackingCountLimit = "20";
44
+ const checkUsage = () => {
45
+ const today = new Date().toDateString();
46
+ const usageCount = getCookie("featureUsageCount");
47
+
48
+ if (usageCount) {
49
+ // User has already used the feature today
50
+ if (usageCount >= Number(userTrackingCountLimit)) {
51
+ showShareModal();
52
+ } else {
53
+ incrementUsageCount(usageCount);
54
+ }
55
+ } else {
56
+ // First usage of the day
57
+ setCookie("featureUsageCount", 1, getExpirationDate());
58
+ }
59
+ const userID = generateUserID();
60
+ try {
61
+ if ((usageCount + 1) % 5 === 0) {
62
+ gtag("event", `feature_used_${usageCount + 1}_times`, {
63
+ user_id: userID,
64
+ userID: userID,
65
+ feature: window.location.pathname + location.search,
66
+ });
67
+ }
68
+ } catch (error) {
69
+ console.log(error);
70
+ }
71
+
72
+ try {
73
+ gtag("event", "feature_used", {
74
+ user_id: userID,
75
+ userID: userID,
76
+ feature: window.location.pathname + location.search,
77
+ });
78
+ } catch (error) {
79
+ console.log(error);
80
+ }
81
+ };
82
+ const incrementUsageCount = (count) => {
83
+ const today = new Date().toDateString();
84
+
85
+ if (count >= Number(userTrackingCountLimit)) {
86
+ showShareModal();
87
+ } else {
88
+ count++;
89
+ setCookie("featureUsageCount", count, getExpirationDate());
90
+ }
91
+ };
92
+
93
+ const showShareModal = () => {
94
+ document.getElementById("shareModal").style.display = "block";
95
+ };
96
+
97
+ const handleShare = () => {
98
+ const usageCount = getCookie("featureUsageCount");
99
+ if (usageCount) {
100
+ setCookie("featureUsageCount", 0, getExpirationDate());
101
+ }
102
+ document.getElementById("shareModal").style.display = "none";
103
+ try {
104
+ const userID = generateUserID();
105
+ gtag("event", "feature_shared", {
106
+ user_id: userID,
107
+ userID: userID,
108
+ feature: window.location.pathname + location.search,
109
+ });
110
+ } catch (error) {
111
+ console.log(error);
112
+ }
113
+ };
114
+
115
+ const getCookie = (name) => {
116
+ const cookies = document.cookie.split(";");
117
+ for (let i = 0; i < cookies.length; i++) {
118
+ const cookie = cookies[i].trim();
119
+ if (cookie.indexOf(name + "=") === 0) {
120
+ return parseInt(cookie.substring((name + "=").length, cookie.length));
121
+ }
122
+ }
123
+ return null;
124
+ };
125
+
126
+ const setCookie = (name, value, expires) => {
127
+ document.cookie = `${name}=${value};expires=${expires};path=/`;
128
+ };
129
+
130
+ const getExpirationDate = () => {
131
+ const date = new Date();
132
+ date.setTime(date.getTime() + 24 * 60 * 60 * 1000); // 24 hours in milliseconds
133
+ return date.toUTCString();
134
+ };
135
+ const socialShare = document.querySelectorAll(".social-share");
136
+
137
+ if (socialShare) {
138
+ Array.from(socialShare).map((item) => {
139
+ item.addEventListener("click", () => {
140
+ handleShare();
141
+ });
142
+ });
143
+ }
@@ -1,6 +1,6 @@
1
- const inputBoxOfFeatureFile = document.querySelector("#inputbox");
2
- if (inputBoxOfFeatureFile) {
3
- inputBoxOfFeatureFile.addEventListener("click", () => {
4
- checkUsage();
5
- });
6
- }
1
+ const inputBoxOfFeatureFile = document.querySelector("#inputbox");
2
+ if (inputBoxOfFeatureFile) {
3
+ inputBoxOfFeatureFile.addEventListener("click", () => {
4
+ checkUsage();
5
+ });
6
+ }
@@ -1,5 +1,5 @@
1
-
2
- webVitals.onCLS(console.log);
3
- webVitals.onFID(console.log);
4
- webVitals.onLCP(console.log);
1
+
2
+ webVitals.onCLS(console.log);
3
+ webVitals.onFID(console.log);
4
+ webVitals.onLCP(console.log);
5
5
  webVitals.onINP(console.log);
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.5.4
4
+ version: 4.5.5
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-04-26 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -611,7 +611,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
611
611
  - !ruby/object:Gem::Version
612
612
  version: '0'
613
613
  requirements: []
614
- rubygems_version: 3.3.26
614
+ rubygems_version: 3.4.10
615
615
  signing_key:
616
616
  specification_version: 4
617
617
  summary: Appscms theme for all tools