appscms-tools-theme 3.6.5 → 3.6.7
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/_layouts/feature.html +2 -1
- data/_layouts/home.html +3 -3
- data/assets/js/usageTracking.js +66 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54025741868d133ecbdcfd5d563abfa8c02f80b48fd1387abd564e4fac836f46
|
|
4
|
+
data.tar.gz: bfca025ac2fed0ded5ab34a2f7ab02729a2ec67380414a4cfef53f4049e9b978
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b261cec09acc02f6b7e1b237de84d73fb20564d9513a86bd8bd4720f99a77a1fb39af477517cf722aa858b64c376ccbcf94a14a27ae6519a936fd1c350da716
|
|
7
|
+
data.tar.gz: 79ac73ef06575e7bcda7f38cb0951b15b2609477d0fc87b5f8f1cfa3b4d4138efc30dc0b21ab67ff97ce9d15cb7440d3d08f956671c36de0d66a28d047a2c3dd
|
data/_layouts/feature.html
CHANGED
|
@@ -427,6 +427,7 @@
|
|
|
427
427
|
customblog/recentposts.html -%} {% endif %} {%- endif -%} {%- if
|
|
428
428
|
featureData.author.size > 0 -%} {% include
|
|
429
429
|
featurePageAuthors/featurePageAuthors.html %} {%- endif -%} {% include
|
|
430
|
-
footer/index.html %} {
|
|
430
|
+
footer/index.html %} {%- if site.customCode -%} {%- include customCode.html
|
|
431
|
+
-%} {%- endif -%} {% include script.html %}
|
|
431
432
|
</body>
|
|
432
433
|
</html>
|
data/_layouts/home.html
CHANGED
|
@@ -270,8 +270,7 @@
|
|
|
270
270
|
<div class="container compare-table">
|
|
271
271
|
{%- include fileformat/comparisonfiles.html -%}
|
|
272
272
|
</div>
|
|
273
|
-
{%- endif -%} {%-
|
|
274
|
-
endif -%} {%- assign langen = "en" -%} {%- if
|
|
273
|
+
{%- endif -%} {%- assign langen = "en" -%} {%- if
|
|
275
274
|
site.data[folder][langen][file].categories -%} {% assign categories=
|
|
276
275
|
site.data[folder][langen][file].categories %} {%- else -%} {% assign
|
|
277
276
|
categories= page.categories %} {%- endif -%} {%- if
|
|
@@ -285,6 +284,7 @@
|
|
|
285
284
|
customblog/recentposts.html -%} {% endif %} {%- endif -%} {%- if
|
|
286
285
|
homeData.author.size > 0 -%} {% include
|
|
287
286
|
featurePageAuthors/featurePageAuthors.html %} {%- endif -%} {% include
|
|
288
|
-
footer/index.html %} {
|
|
287
|
+
footer/index.html %} {%- if site.customCode -%} {%- include customCode.html
|
|
288
|
+
-%} {%- endif -%} {% include script.html %}
|
|
289
289
|
</body>
|
|
290
290
|
</html>
|
data/assets/js/usageTracking.js
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
---
|
|
3
|
+
// Generate a unique ID for the user (if not already generated)
|
|
4
|
+
const generateUserID = () => {
|
|
5
|
+
// Check if the user ID is already stored in cookies or local storage
|
|
6
|
+
const storedUserID = getStoredUserID();
|
|
7
|
+
|
|
8
|
+
if (storedUserID) {
|
|
9
|
+
return storedUserID;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Example: Generating a random string
|
|
13
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
14
|
+
let id = '';
|
|
15
|
+
for (let i = 0; i < 10; i++) {
|
|
16
|
+
id += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Store the generated user ID in cookies or local storage
|
|
20
|
+
storeUserID(id);
|
|
21
|
+
|
|
22
|
+
return id;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Get the stored user ID from cookies or local storage
|
|
26
|
+
const getStoredUserID = () => {
|
|
27
|
+
return localStorage.getItem('userID');
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Store the user ID in cookies or local storage
|
|
31
|
+
const storeUserID = (userID) => {
|
|
32
|
+
localStorage.setItem('userID', userID);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Get the current date in YYYY-MM-DD format
|
|
36
|
+
const getCurrentDate = () => {
|
|
37
|
+
const today = new Date();
|
|
38
|
+
const year = today.getFullYear();
|
|
39
|
+
const month = String(today.getMonth() + 1).padStart(2, '0');
|
|
40
|
+
const day = String(today.getDate()).padStart(2, '0');
|
|
41
|
+
return `${year}-${month}-${day}`;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
3
45
|
|
|
4
46
|
let userTrackingCountLimit='{{site.userTrackingCount}}';
|
|
5
47
|
const checkUsage = () => {
|
|
@@ -17,8 +59,19 @@ const checkUsage = () => {
|
|
|
17
59
|
// First usage of the day
|
|
18
60
|
setCookie("featureUsageCount", 1, getExpirationDate());
|
|
19
61
|
}
|
|
20
|
-
|
|
21
|
-
|
|
62
|
+
const userID = generateUserID();
|
|
63
|
+
try {
|
|
64
|
+
|
|
65
|
+
gtag('event', 'feature_used', {
|
|
66
|
+
user_id: userID,
|
|
67
|
+
userID: userID,
|
|
68
|
+
feature: window.location.pathname + location.search
|
|
69
|
+
});
|
|
70
|
+
} catch (error) {
|
|
71
|
+
console.log(error)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
22
75
|
const incrementUsageCount = (count) => {
|
|
23
76
|
const today = new Date().toDateString();
|
|
24
77
|
|
|
@@ -37,10 +90,19 @@ const showShareModal = () => {
|
|
|
37
90
|
const handleShare = () => {
|
|
38
91
|
const usageCount = getCookie("featureUsageCount");
|
|
39
92
|
if (usageCount) {
|
|
40
|
-
|
|
41
|
-
setCookie("featureUsageCount", usageCount , getExpirationDate());
|
|
93
|
+
setCookie("featureUsageCount", 0 , getExpirationDate());
|
|
42
94
|
}
|
|
43
95
|
document.getElementById("shareModal").style.display = "none";
|
|
96
|
+
try {
|
|
97
|
+
const userID = generateUserID();
|
|
98
|
+
gtag('event', 'feature_shared', {
|
|
99
|
+
user_id: userID,
|
|
100
|
+
userID: userID,
|
|
101
|
+
feature: window.location.pathname + location.search
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.log(error)
|
|
105
|
+
}
|
|
44
106
|
};
|
|
45
107
|
|
|
46
108
|
const getCookie = (name) => {
|
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: 3.6.
|
|
4
|
+
version: 3.6.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vivek-appscms
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-06-
|
|
11
|
+
date: 2023-06-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|