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
@@ -1,299 +0,0 @@
|
|
1
|
-
// Auto-generated JS for Product Description
|
2
|
-
document.addEventListener("DOMContentLoaded", function () {
|
3
|
-
const form = document.getElementById("contentToolForm");
|
4
|
-
const tool = "product_description";
|
5
|
-
|
6
|
-
// Wait for Quill to be initialized
|
7
|
-
let quill;
|
8
|
-
const checkQuill = setInterval(() => {
|
9
|
-
if (window.quill) {
|
10
|
-
quill = window.quill;
|
11
|
-
clearInterval(checkQuill);
|
12
|
-
}
|
13
|
-
}, 100);
|
14
|
-
|
15
|
-
let input0 = form.querySelector('[name="input0"]');
|
16
|
-
let input1 = form.querySelector('[name="input1"]');
|
17
|
-
let language = form.querySelector('[name="language"]');
|
18
|
-
let tone = form.querySelector('[name="tone"]');
|
19
|
-
|
20
|
-
form.addEventListener("submit", async function (e) {
|
21
|
-
e.preventDefault();
|
22
|
-
|
23
|
-
// Check if Quill is available
|
24
|
-
if (!quill) {
|
25
|
-
console.error("Quill editor not found");
|
26
|
-
return;
|
27
|
-
}
|
28
|
-
|
29
|
-
// Show loading state
|
30
|
-
const submitButton = form.querySelector('button[type="submit"]');
|
31
|
-
const originalText = submitButton ? submitButton.textContent : '';
|
32
|
-
if (submitButton) {
|
33
|
-
submitButton.textContent = 'Generating...';
|
34
|
-
submitButton.disabled = true;
|
35
|
-
}
|
36
|
-
|
37
|
-
const options = {};
|
38
|
-
|
39
|
-
options["input[0]"] = input0.value;
|
40
|
-
options["input[1]"] = input1.value;
|
41
|
-
options["language"] = language.value;
|
42
|
-
options["tone"] = tone.value;
|
43
|
-
|
44
|
-
const body = {
|
45
|
-
tool: tool,
|
46
|
-
llm: "gemini",
|
47
|
-
model_name: "gemini-2.0-flash",
|
48
|
-
options: options
|
49
|
-
};
|
50
|
-
|
51
|
-
try {
|
52
|
-
const response = await fetch("https://contentool-api.onrender.com/api/v1/ecommerce-tools/product-description", {
|
53
|
-
method: "POST",
|
54
|
-
headers: {
|
55
|
-
"Content-Type": "application/json"
|
56
|
-
},
|
57
|
-
body: JSON.stringify(body)
|
58
|
-
});
|
59
|
-
|
60
|
-
const data = await response.json();
|
61
|
-
|
62
|
-
if (data.result) {
|
63
|
-
// Clear the editor first
|
64
|
-
quill.setText('');
|
65
|
-
|
66
|
-
// Parse and render markdown content
|
67
|
-
renderMarkdownToQuill(data.result, quill);
|
68
|
-
|
69
|
-
console.log("✅ Content generated successfully");
|
70
|
-
} else {
|
71
|
-
quill.setText("No output received from server.");
|
72
|
-
}
|
73
|
-
} catch (err) {
|
74
|
-
console.error("❌ API Error:", err);
|
75
|
-
quill.setText("Error: " + err.message);
|
76
|
-
} finally {
|
77
|
-
// Reset button state
|
78
|
-
if (submitButton) {
|
79
|
-
submitButton.textContent = originalText;
|
80
|
-
submitButton.disabled = false;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
});
|
84
|
-
});
|
85
|
-
|
86
|
-
// Function to render markdown content to Quill editor
|
87
|
-
function renderMarkdownToQuill(markdownText, quill) {
|
88
|
-
// Clear editor
|
89
|
-
quill.setText('');
|
90
|
-
|
91
|
-
let index = 0;
|
92
|
-
const lines = markdownText.split('\n');
|
93
|
-
|
94
|
-
lines.forEach((line, lineIndex) => {
|
95
|
-
if (line.trim() === '') {
|
96
|
-
// Empty line - add line break
|
97
|
-
if (lineIndex < lines.length - 1) {
|
98
|
-
quill.insertText(index, '\n');
|
99
|
-
index += 1;
|
100
|
-
}
|
101
|
-
return;
|
102
|
-
}
|
103
|
-
|
104
|
-
// Handle different markdown patterns
|
105
|
-
if (line.startsWith('**') && line.endsWith('**') && line.length > 4) {
|
106
|
-
// Bold text (like **Product Title:** or **Key Features:**)
|
107
|
-
const text = line.replace(/^\*\*(.*?)\*\*$/, '$1');
|
108
|
-
quill.insertText(index, text, { 'bold': true });
|
109
|
-
index += text.length;
|
110
|
-
} else if (line.includes('**')) {
|
111
|
-
// Mixed bold and normal text (like **Product Title:** Coffee Mug)
|
112
|
-
const parts = line.split('**');
|
113
|
-
for (let i = 0; i < parts.length; i++) {
|
114
|
-
if (parts[i]) {
|
115
|
-
if (i % 2 === 1) {
|
116
|
-
// Odd index = bold text
|
117
|
-
quill.insertText(index, parts[i], { 'bold': true });
|
118
|
-
index += parts[i].length;
|
119
|
-
} else {
|
120
|
-
// Even index = normal text
|
121
|
-
quill.insertText(index, parts[i]);
|
122
|
-
index += parts[i].length;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
} else if (line.startsWith('- ')) {
|
127
|
-
// Bullet points
|
128
|
-
const text = line.substring(2); // Remove '- '
|
129
|
-
quill.insertText(index, '• ' + text);
|
130
|
-
index += text.length + 2;
|
131
|
-
} else if (line.match(/^\d+\.\s/)) {
|
132
|
-
// Numbered lists
|
133
|
-
const match = line.match(/^(\d+\.\s)(.*)$/);
|
134
|
-
if (match) {
|
135
|
-
const number = match[1];
|
136
|
-
const content = match[2];
|
137
|
-
|
138
|
-
// Insert number in bold
|
139
|
-
quill.insertText(index, number, { 'bold': true });
|
140
|
-
index += number.length;
|
141
|
-
|
142
|
-
// Insert content in normal text
|
143
|
-
quill.insertText(index, content);
|
144
|
-
index += content.length;
|
145
|
-
} else {
|
146
|
-
quill.insertText(index, line);
|
147
|
-
index += line.length;
|
148
|
-
}
|
149
|
-
} else if (line.startsWith('### ')) {
|
150
|
-
// Headers (H3)
|
151
|
-
const text = line.substring(4);
|
152
|
-
quill.insertText(index, text, { 'bold': true });
|
153
|
-
index += text.length;
|
154
|
-
} else if (line.startsWith('## ')) {
|
155
|
-
// Headers (H2)
|
156
|
-
const text = line.substring(3);
|
157
|
-
quill.insertText(index, text, { 'bold': true, 'size': 'large' });
|
158
|
-
index += text.length;
|
159
|
-
} else if (line.startsWith('# ')) {
|
160
|
-
// Headers (H1)
|
161
|
-
const text = line.substring(2);
|
162
|
-
quill.insertText(index, text, { 'bold': true, 'size': 'huge' });
|
163
|
-
index += text.length;
|
164
|
-
} else if (line.startsWith('*') && line.endsWith('*') && line.length > 2) {
|
165
|
-
// Italic text
|
166
|
-
const text = line.replace(/^\*(.*?)\*$/, '$1');
|
167
|
-
quill.insertText(index, text, { 'italic': true });
|
168
|
-
index += text.length;
|
169
|
-
} else {
|
170
|
-
// Normal text
|
171
|
-
quill.insertText(index, line);
|
172
|
-
index += line.length;
|
173
|
-
}
|
174
|
-
|
175
|
-
// Add line break if not the last line
|
176
|
-
if (lineIndex < lines.length - 1) {
|
177
|
-
quill.insertText(index, '\n');
|
178
|
-
index += 1;
|
179
|
-
}
|
180
|
-
});
|
181
|
-
}
|
182
|
-
|
183
|
-
// Alternative function using marked.js if available
|
184
|
-
function renderMarkdownToQuillWithMarked(markdownText, quill) {
|
185
|
-
if (typeof marked !== 'undefined') {
|
186
|
-
try {
|
187
|
-
// Convert markdown to HTML
|
188
|
-
const html = marked.parse(markdownText);
|
189
|
-
|
190
|
-
// Create a temporary div to parse HTML
|
191
|
-
const tempDiv = document.createElement('div');
|
192
|
-
tempDiv.innerHTML = html;
|
193
|
-
|
194
|
-
// Clear editor
|
195
|
-
quill.setText('');
|
196
|
-
|
197
|
-
let index = 0;
|
198
|
-
|
199
|
-
// Process each child element
|
200
|
-
tempDiv.childNodes.forEach((node) => {
|
201
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
202
|
-
const text = node.textContent.trim();
|
203
|
-
if (text) {
|
204
|
-
quill.insertText(index, text);
|
205
|
-
index += text.length;
|
206
|
-
}
|
207
|
-
} else if (node.nodeType === Node.ELEMENT_NODE) {
|
208
|
-
switch (node.tagName.toLowerCase()) {
|
209
|
-
case 'h1':
|
210
|
-
quill.insertText(index, node.textContent, { 'bold': true, 'size': 'huge' });
|
211
|
-
index += node.textContent.length;
|
212
|
-
break;
|
213
|
-
case 'h2':
|
214
|
-
quill.insertText(index, node.textContent, { 'bold': true, 'size': 'large' });
|
215
|
-
index += node.textContent.length;
|
216
|
-
break;
|
217
|
-
case 'h3':
|
218
|
-
case 'h4':
|
219
|
-
case 'h5':
|
220
|
-
case 'h6':
|
221
|
-
quill.insertText(index, node.textContent, { 'bold': true });
|
222
|
-
index += node.textContent.length;
|
223
|
-
break;
|
224
|
-
case 'strong':
|
225
|
-
case 'b':
|
226
|
-
quill.insertText(index, node.textContent, { 'bold': true });
|
227
|
-
index += node.textContent.length;
|
228
|
-
break;
|
229
|
-
case 'em':
|
230
|
-
case 'i':
|
231
|
-
quill.insertText(index, node.textContent, { 'italic': true });
|
232
|
-
index += node.textContent.length;
|
233
|
-
break;
|
234
|
-
case 'ul':
|
235
|
-
node.querySelectorAll('li').forEach((li) => {
|
236
|
-
quill.insertText(index, '• ' + li.textContent + '\n');
|
237
|
-
index += li.textContent.length + 3;
|
238
|
-
});
|
239
|
-
break;
|
240
|
-
case 'ol':
|
241
|
-
node.querySelectorAll('li').forEach((li, i) => {
|
242
|
-
const number = `${i + 1}. `;
|
243
|
-
quill.insertText(index, number, { 'bold': true });
|
244
|
-
index += number.length;
|
245
|
-
quill.insertText(index, li.textContent + '\n');
|
246
|
-
index += li.textContent.length + 1;
|
247
|
-
});
|
248
|
-
break;
|
249
|
-
case 'p':
|
250
|
-
const pText = node.textContent.trim();
|
251
|
-
if (pText) {
|
252
|
-
quill.insertText(index, pText + '\n');
|
253
|
-
index += pText.length + 1;
|
254
|
-
}
|
255
|
-
break;
|
256
|
-
case 'br':
|
257
|
-
quill.insertText(index, '\n');
|
258
|
-
index += 1;
|
259
|
-
break;
|
260
|
-
default:
|
261
|
-
const defaultText = node.textContent.trim();
|
262
|
-
if (defaultText) {
|
263
|
-
quill.insertText(index, defaultText);
|
264
|
-
index += defaultText.length;
|
265
|
-
}
|
266
|
-
}
|
267
|
-
}
|
268
|
-
});
|
269
|
-
|
270
|
-
// Add final formatting cleanup
|
271
|
-
if (index > 0) {
|
272
|
-
quill.insertText(index, '\n');
|
273
|
-
}
|
274
|
-
|
275
|
-
} catch (error) {
|
276
|
-
console.error('Error parsing markdown with marked.js:', error);
|
277
|
-
// Fallback to basic markdown parsing
|
278
|
-
renderMarkdownToQuill(markdownText, quill);
|
279
|
-
}
|
280
|
-
} else {
|
281
|
-
// Fallback to basic markdown parsing
|
282
|
-
renderMarkdownToQuill(markdownText, quill);
|
283
|
-
}
|
284
|
-
}
|
285
|
-
|
286
|
-
// Enhanced function that tries marked.js first, then falls back to basic parsing
|
287
|
-
function renderContentToQuill(content, quill) {
|
288
|
-
// Try to detect if content is markdown
|
289
|
-
const hasMarkdownPatterns = /\*\*|\*|#{1,6}\s|^\s*[-*+]\s|^\s*\d+\.\s/m.test(content);
|
290
|
-
|
291
|
-
if (hasMarkdownPatterns && typeof marked !== 'undefined') {
|
292
|
-
renderMarkdownToQuillWithMarked(content, quill);
|
293
|
-
} else if (hasMarkdownPatterns) {
|
294
|
-
renderMarkdownToQuill(content, quill);
|
295
|
-
} else {
|
296
|
-
// Plain text
|
297
|
-
quill.setText(content);
|
298
|
-
}
|
299
|
-
}
|
data/assets/js/redirectResult.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
const button = document.getElementById('btn')
|
2
|
-
let script = document.currentScript
|
3
|
-
let fileName = script.dataset.filename
|
4
|
-
let permalink = script.dataset.permalink
|
5
|
-
|
6
|
-
const params = new URLSearchParams(window.location.search)
|
7
|
-
button.addEventListener("click", (e) => {
|
8
|
-
window.location = window.location.protocol + "//" + window.location.host +
|
9
|
-
`${permalink}` + '/' + "result" + '?' + 'fileName' + "=" + btoa(fileName);
|
10
|
-
})
|
data/assets/js/sharePage.js
DELETED
@@ -1,65 +0,0 @@
|
|
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
|
-
});
|
data/assets/js/testing-batch.js
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
zipFileType = 'svg'
|
2
|
-
renderFileTypes = ['svg']
|
3
|
-
const batchConversion = async (file, indexValue) => {
|
4
|
-
return new Promise((resolve, reject) => {
|
5
|
-
if (file) {
|
6
|
-
const reader = new FileReader()
|
7
|
-
reader.readAsDataURL(file)
|
8
|
-
reader.onload = (e) => {
|
9
|
-
if (e.target.result) {
|
10
|
-
let image = new Image()
|
11
|
-
let canvas = document.createElement('canvas')
|
12
|
-
canvas.setAttribute('id', 'canvas-img')
|
13
|
-
let ctx = canvas.getContext('2d')
|
14
|
-
image.onload = () => {
|
15
|
-
canvas.width = image.width
|
16
|
-
canvas.height = image.height
|
17
|
-
// counter.innerHTML = e.target.value + "%"
|
18
|
-
let filters = document.querySelector('#applyFilter')
|
19
|
-
if (filters.getAttribute('data-filter') === 'opacity') {
|
20
|
-
ctx.globalAlpha = filters.value
|
21
|
-
ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
|
22
|
-
resolve([indexValue, canvas.toDataURL('image/png'), 'image'])
|
23
|
-
} else {
|
24
|
-
ctx.filter =
|
25
|
-
filters.getAttribute('data-filter') +
|
26
|
-
'(' +
|
27
|
-
filters.value +
|
28
|
-
filters.getAttribute('data-scale') +
|
29
|
-
') '
|
30
|
-
ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
|
31
|
-
resolve([indexValue, canvas.toDataURL('image/png'), 'image'])
|
32
|
-
}
|
33
|
-
}
|
34
|
-
image.src = e.target.result
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
38
|
-
})
|
39
|
-
}
|
data/assets/js/theme.js
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
---
|
2
|
-
---
|
3
|
-
|
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
|
-
}, 10000);
|
20
|
-
}
|
21
|
-
});
|
22
|
-
let getLayout = document.getElementById("header");
|
23
|
-
const layout = getLayout.dataset.layout;
|
24
|
-
if (layout == "feature-1") {
|
25
|
-
var removeNav = () => {
|
26
|
-
let homeLink = document.getElementById("home-link");
|
27
|
-
homeLink.style.marginRight = "10px";
|
28
|
-
document.getElementById("h1-img-wrapper").prepend(homeLink);
|
29
|
-
|
30
|
-
document.getElementById("header").style.display = "none";
|
31
|
-
document.querySelector(".feature1-h1").style.width = "100%";
|
32
|
-
document.querySelector(".feature1-h2").style.display = "none";
|
33
|
-
console.log(document.querySelector(".feature1-flex-container"));
|
34
|
-
document.querySelector(".feature1-flex-container").style.paddingTop =
|
35
|
-
"0rem";
|
36
|
-
document.querySelector(".feature1-flex-container").style.paddingBottom =
|
37
|
-
"0rem";
|
38
|
-
};
|
39
|
-
} else {
|
40
|
-
var removeNav = () => {
|
41
|
-
let homeLink = document.getElementById("home-link");
|
42
|
-
homeLink.style.marginRight = "10px";
|
43
|
-
document.getElementById("h1-img-wrapper").prepend(homeLink);
|
44
|
-
document
|
45
|
-
.getElementById("h1-img-wrapper")
|
46
|
-
.style.setProperty("align-items", "unset", "important");
|
47
|
-
document.getElementById("header").style.display = "none";
|
48
|
-
document.getElementById("h1-img").style.display = "none";
|
49
|
-
document.getElementById("feature-h1").style.width = "100%";
|
50
|
-
document.getElementById("feature-h2").style.display = "none";
|
51
|
-
let safeUiAlert = document.getElementById("safeui-alert");
|
52
|
-
if (safeUiAlert) {
|
53
|
-
safeUiAlert.style.display = "none";
|
54
|
-
}
|
55
|
-
};
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
if ("{{ site.removeBootstrapJs }}"==="true") {
|
62
|
-
const languagesModal = document.querySelector("#staticBackdrop");
|
63
|
-
const intModalBtn = document.querySelector("#int-modal-btn");
|
64
|
-
const closeBtn = document.querySelector("#close-modal");
|
65
|
-
|
66
|
-
if(intModalBtn){
|
67
|
-
intModalBtn.addEventListener("click", () => {
|
68
|
-
languagesModal.style.display = "block";
|
69
|
-
languagesModal.classList.add("show");
|
70
|
-
let modal = document.createElement("div");
|
71
|
-
modal.classList.add("modal-backdrop", "show");
|
72
|
-
document.body.appendChild(modal);
|
73
|
-
});
|
74
|
-
closeBtn.addEventListener("click", () => {
|
75
|
-
languagesModal.style.display = "none";
|
76
|
-
languagesModal.classList.remove("show");
|
77
|
-
let modal = document.querySelector(".modal-backdrop");
|
78
|
-
document.body.removeChild(modal);
|
79
|
-
});
|
80
|
-
}
|
81
|
-
let navbarDropdown = document.querySelector("#navbarDropdown");
|
82
|
-
let dropmenu = document.querySelector(".dropmenu");
|
83
|
-
navbarDropdown.addEventListener("click", () => {
|
84
|
-
if (dropmenu.classList.contains("show")) {
|
85
|
-
dropmenu.classList.remove("show");
|
86
|
-
dropmenu.style.display = "none"
|
87
|
-
} else {
|
88
|
-
dropmenu.classList.add("show");
|
89
|
-
dropmenu.style.display = "block"
|
90
|
-
dropmenu.style.padding = ".5rem 0"
|
91
|
-
}
|
92
|
-
});
|
93
|
-
const navbarToggler=document.querySelector('.navbar-toggler')
|
94
|
-
const navBar=document.querySelector('#navbarSupportedContent')
|
95
|
-
navbarToggler.addEventListener('click',()=>{
|
96
|
-
if (navBar.classList.contains("show")) {
|
97
|
-
navBar.classList.remove("show");
|
98
|
-
navBar.style.display = "none"
|
99
|
-
} else {
|
100
|
-
navBar.classList.add("show");
|
101
|
-
navBar.style.display = "block"
|
102
|
-
}
|
103
|
-
})
|
104
|
-
}
|
data/assets/js/usageTracking.js
DELETED
@@ -1,143 +0,0 @@
|
|
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
|
-
}
|
data/assets/js/userUsageCount.js
DELETED
File without changes
|