appscms-tools-theme 5.1.6 → 5.1.8
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/home/.DS_Store +0 -0
- data/_data/home/en/ens.json +143 -0
- data/_includes/.DS_Store +0 -0
- data/_includes/appscms/.DS_Store +0 -0
- data/_includes/appscms/scripts/script.html +3 -2
- data/_includes/script.html +159 -93
- data/_layouts/content-tool-ai copy.html +261 -0
- data/_layouts/content-tool-ai-2.html +353 -0
- data/_layouts/content-tool-ai.html +272 -229
- data/assets/.DS_Store +0 -0
- data/assets/css/content-tool-ai.css +1 -1
- data/assets/images/content-tool-logo.png +0 -0
- data/assets/js/appscms-login.js +32 -133
- data/assets/js/blog-topic-ideas.js +57 -0
- data/assets/js/human-written-blog-post.js +57 -0
- data/assets/js/instagram-caption.js +57 -0
- data/assets/js/instagram-hashtag-generator.js +10 -0
- data/assets/js/instagram-name-generator.js +61 -0
- metadata +10 -2
data/assets/js/appscms-login.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
---
|
2
2
|
---
|
3
|
+
|
3
4
|
const profileButton = document.getElementById("profileButton");
|
4
5
|
const userModal = document.getElementById("userModal");
|
5
6
|
let isModalOpen = false;
|
@@ -39,7 +40,6 @@ const closeModalBtn = document.querySelector(".close-modal-btn");
|
|
39
40
|
function openModal() {
|
40
41
|
if (modalOverlayy && sideModal) {
|
41
42
|
modalOverlayy.style.display = "block";
|
42
|
-
// Slight delay for the overlay to appear before the modal slides in
|
43
43
|
setTimeout(() => {
|
44
44
|
sideModal.style.right = "0";
|
45
45
|
}, 50);
|
@@ -50,7 +50,6 @@ function openModal() {
|
|
50
50
|
function closeModal() {
|
51
51
|
if (sideModal && modalOverlayy) {
|
52
52
|
sideModal.style.right = "-90%";
|
53
|
-
// Wait for the animation to complete before hiding the overlay
|
54
53
|
setTimeout(() => {
|
55
54
|
modalOverlayy.style.display = "none";
|
56
55
|
}, 300);
|
@@ -70,7 +69,6 @@ if (modalOverlayy) {
|
|
70
69
|
modalOverlayy.addEventListener("click", closeModal);
|
71
70
|
}
|
72
71
|
|
73
|
-
// Prevent closing when clicking inside the modal
|
74
72
|
if (sideModal) {
|
75
73
|
sideModal.addEventListener("click", function (event) {
|
76
74
|
event.stopPropagation();
|
@@ -89,35 +87,25 @@ let firebaseConfig;
|
|
89
87
|
|
90
88
|
async function loadFirebaseConfig() {
|
91
89
|
try {
|
92
|
-
// Try to get config from Netlify function
|
93
90
|
const hostname = window.location.hostname;
|
94
|
-
const port = window.location.port;
|
95
|
-
|
96
91
|
let baseUrl = "";
|
97
92
|
|
98
|
-
// Development environment detection
|
99
93
|
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
100
|
-
|
101
|
-
// Default Netlify CLI functions port is 8888, but could be 9000 or custom
|
102
|
-
baseUrl = "http://localhost:9000"; // Adjust this if your Netlify Functions are on a different port
|
94
|
+
baseUrl = "http://localhost:9000";
|
103
95
|
}
|
104
96
|
|
105
|
-
// Make the request to the Netlify function with credentials included
|
106
|
-
|
107
97
|
const response = await fetch(
|
108
|
-
|
98
|
+
`${baseUrl}/.netlify/functions/get-firebase-config`
|
109
99
|
);
|
110
100
|
|
111
101
|
if (response.ok) {
|
112
102
|
firebaseConfig = await response.json();
|
113
103
|
|
114
|
-
// Check if we got all required config fields
|
115
104
|
if (
|
116
105
|
firebaseConfig.apiKey &&
|
117
106
|
firebaseConfig.authDomain &&
|
118
107
|
firebaseConfig.projectId
|
119
108
|
) {
|
120
|
-
// Initialize Firebase with the config
|
121
109
|
if (typeof firebase !== "undefined") {
|
122
110
|
initializeFirebase();
|
123
111
|
} else {
|
@@ -138,7 +126,6 @@ async function loadFirebaseConfig() {
|
|
138
126
|
function initializeFirebase() {
|
139
127
|
if (!firebase.apps.length) {
|
140
128
|
firebase.initializeApp(firebaseConfig);
|
141
|
-
|
142
129
|
setupAuthListeners();
|
143
130
|
}
|
144
131
|
}
|
@@ -150,9 +137,7 @@ function setupAuthListeners() {
|
|
150
137
|
.getRedirectResult()
|
151
138
|
.then((result) => {
|
152
139
|
if (result && result.user) {
|
153
|
-
//
|
154
|
-
// Auth state observer will handle the UI update
|
155
|
-
} else if (result) {
|
140
|
+
// Successful redirect login
|
156
141
|
}
|
157
142
|
})
|
158
143
|
.catch((error) => {
|
@@ -162,14 +147,12 @@ function setupAuthListeners() {
|
|
162
147
|
}
|
163
148
|
});
|
164
149
|
|
165
|
-
// DOM Elements
|
166
150
|
const loginForm = document.getElementById("loginForm");
|
167
151
|
const signupForm = document.getElementById("signupForm");
|
168
152
|
const forgotPasswordForm = document.getElementById("forgotPasswordForm");
|
169
153
|
const userAvatar = document.getElementById("userAvatar");
|
170
154
|
const profileUserAvatar = document.querySelector(".profile-user-avatar");
|
171
155
|
|
172
|
-
// Switch between login and signup
|
173
156
|
const showSignupBtn = document.getElementById("showSignup");
|
174
157
|
if (showSignupBtn) {
|
175
158
|
showSignupBtn.addEventListener("click", (e) => {
|
@@ -190,7 +173,6 @@ function setupAuthListeners() {
|
|
190
173
|
});
|
191
174
|
}
|
192
175
|
|
193
|
-
// Show forgot password form
|
194
176
|
const forgotPasswordBtn = document.getElementById("forgotPassword");
|
195
177
|
if (forgotPasswordBtn) {
|
196
178
|
forgotPasswordBtn.addEventListener("click", (e) => {
|
@@ -200,7 +182,6 @@ function setupAuthListeners() {
|
|
200
182
|
});
|
201
183
|
}
|
202
184
|
|
203
|
-
// Back to login from forgot password
|
204
185
|
const backToLoginBtn = document.getElementById("backToLogin");
|
205
186
|
if (backToLoginBtn) {
|
206
187
|
backToLoginBtn.addEventListener("click", () => {
|
@@ -211,7 +192,6 @@ function setupAuthListeners() {
|
|
211
192
|
});
|
212
193
|
}
|
213
194
|
|
214
|
-
// Handle reset password form submission
|
215
195
|
const resetPasswordForm = document.getElementById("resetPasswordForm");
|
216
196
|
if (resetPasswordForm) {
|
217
197
|
resetPasswordForm.addEventListener("submit", (e) => {
|
@@ -221,7 +201,6 @@ function setupAuthListeners() {
|
|
221
201
|
|
222
202
|
const email = resetEmail.value;
|
223
203
|
|
224
|
-
// This is the correct way to set up redirects - Firebase will handle adding the continueUrl internally
|
225
204
|
const actionCodeSettings = {
|
226
205
|
url: "https://pdftoolkit-develop.netlify.app/",
|
227
206
|
handleCodeInApp: false,
|
@@ -230,7 +209,6 @@ function setupAuthListeners() {
|
|
230
209
|
auth
|
231
210
|
.sendPasswordResetEmail(email, actionCodeSettings)
|
232
211
|
.then(() => {
|
233
|
-
// Show success message
|
234
212
|
const resetSuccess = document.getElementById("resetSuccess");
|
235
213
|
if (resetSuccess) resetSuccess.style.display = "block";
|
236
214
|
resetPasswordForm.reset();
|
@@ -241,7 +219,6 @@ function setupAuthListeners() {
|
|
241
219
|
});
|
242
220
|
}
|
243
221
|
|
244
|
-
// Toggle password visibility
|
245
222
|
const toggleLoginPassword = document.getElementById("toggleLoginPassword");
|
246
223
|
if (toggleLoginPassword) {
|
247
224
|
toggleLoginPassword.addEventListener("click", () => {
|
@@ -264,7 +241,6 @@ function setupAuthListeners() {
|
|
264
241
|
});
|
265
242
|
}
|
266
243
|
|
267
|
-
// Email/Password Login
|
268
244
|
const emailLoginForm = document.getElementById("emailLoginForm");
|
269
245
|
if (emailLoginForm) {
|
270
246
|
emailLoginForm.addEventListener("submit", (e) => {
|
@@ -273,22 +249,15 @@ function setupAuthListeners() {
|
|
273
249
|
const loginPassword = document.getElementById("loginPassword");
|
274
250
|
if (!loginEmail || !loginPassword) return;
|
275
251
|
|
276
|
-
const email = loginEmail.value;
|
277
|
-
const password = loginPassword.value;
|
278
|
-
|
279
252
|
auth
|
280
|
-
.signInWithEmailAndPassword(
|
281
|
-
.then((
|
282
|
-
// Signed in
|
283
|
-
const user = userCredential.user;
|
284
|
-
})
|
253
|
+
.signInWithEmailAndPassword(loginEmail.value, loginPassword.value)
|
254
|
+
.then(() => {})
|
285
255
|
.catch((error) => {
|
286
256
|
alert(`Login error: ${error.message}`);
|
287
257
|
});
|
288
258
|
});
|
289
259
|
}
|
290
260
|
|
291
|
-
// Email/Password Signup
|
292
261
|
const emailSignupForm = document.getElementById("emailSignupForm");
|
293
262
|
if (emailSignupForm) {
|
294
263
|
emailSignupForm.addEventListener("submit", (e) => {
|
@@ -297,29 +266,22 @@ function setupAuthListeners() {
|
|
297
266
|
const signupPassword = document.getElementById("signupPassword");
|
298
267
|
if (!signupEmail || !signupPassword) return;
|
299
268
|
|
300
|
-
const email = signupEmail.value;
|
301
|
-
const password = signupPassword.value;
|
302
|
-
|
303
269
|
auth
|
304
|
-
.createUserWithEmailAndPassword(
|
305
|
-
.then((
|
306
|
-
// Signed up
|
307
|
-
const user = userCredential.user;
|
308
|
-
})
|
270
|
+
.createUserWithEmailAndPassword(signupEmail.value, signupPassword.value)
|
271
|
+
.then(() => {})
|
309
272
|
.catch((error) => {
|
310
273
|
alert(`Signup error: ${error.message}`);
|
311
274
|
});
|
312
275
|
});
|
313
276
|
}
|
314
277
|
|
315
|
-
// Google Login
|
316
278
|
const googleLoginBtn = document.getElementById("googleLogin");
|
317
279
|
if (googleLoginBtn) {
|
318
280
|
googleLoginBtn.addEventListener("click", () => {
|
319
281
|
const provider = new firebase.auth.GoogleAuthProvider();
|
320
282
|
auth
|
321
283
|
.signInWithPopup(provider)
|
322
|
-
.then((
|
284
|
+
.then(() => {})
|
323
285
|
.catch((error) => {
|
324
286
|
alert(`Google login error: ${error.message}`);
|
325
287
|
});
|
@@ -332,24 +294,22 @@ function setupAuthListeners() {
|
|
332
294
|
const provider = new firebase.auth.GoogleAuthProvider();
|
333
295
|
auth
|
334
296
|
.signInWithPopup(provider)
|
335
|
-
.then((
|
297
|
+
.then(() => {})
|
336
298
|
.catch((error) => {
|
337
299
|
alert(`Google signup error: ${error.message}`);
|
338
300
|
});
|
339
301
|
});
|
340
302
|
}
|
341
303
|
|
342
|
-
// Facebook Login
|
343
304
|
const facebookLoginBtn = document.getElementById("facebookLogin");
|
344
305
|
if (facebookLoginBtn) {
|
345
306
|
facebookLoginBtn.addEventListener("click", () => {
|
346
307
|
const provider = new firebase.auth.FacebookAuthProvider();
|
347
308
|
provider.addScope("email");
|
348
309
|
|
349
|
-
// Try popup instead of redirect for Facebook
|
350
310
|
auth
|
351
311
|
.signInWithPopup(provider)
|
352
|
-
.then((
|
312
|
+
.then(() => {})
|
353
313
|
.catch((error) => {
|
354
314
|
console.error("Facebook login error:", error);
|
355
315
|
alert(`Facebook login error: ${error.message}`);
|
@@ -357,40 +317,30 @@ function setupAuthListeners() {
|
|
357
317
|
});
|
358
318
|
}
|
359
319
|
|
360
|
-
// Twitter Login - Try using popup method first
|
361
320
|
const twitterLoginBtn = document.getElementById("twitterLogin");
|
362
321
|
if (twitterLoginBtn) {
|
363
322
|
twitterLoginBtn.addEventListener("click", () => {
|
364
323
|
const provider = new firebase.auth.TwitterAuthProvider();
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
.
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
});
|
383
|
-
} else {
|
384
|
-
alert(`Twitter login error: ${error.message}`);
|
385
|
-
}
|
386
|
-
});
|
387
|
-
} catch (e) {
|
388
|
-
console.error("Exception during Twitter login:", e);
|
389
|
-
}
|
324
|
+
auth
|
325
|
+
.signInWithPopup(provider)
|
326
|
+
.then(() => {})
|
327
|
+
.catch((error) => {
|
328
|
+
console.error("Twitter popup error:", error);
|
329
|
+
if (
|
330
|
+
error.code === "auth/popup-blocked" ||
|
331
|
+
error.code === "auth/popup-closed-by-user"
|
332
|
+
) {
|
333
|
+
auth.signInWithRedirect(provider).catch((redirectError) => {
|
334
|
+
console.error("Twitter redirect error:", redirectError);
|
335
|
+
alert(`Twitter login error: ${redirectError.message}`);
|
336
|
+
});
|
337
|
+
} else {
|
338
|
+
alert(`Twitter login error: ${error.message}`);
|
339
|
+
}
|
340
|
+
});
|
390
341
|
});
|
391
342
|
}
|
392
343
|
|
393
|
-
// Logout
|
394
344
|
const logoutBtn = document.getElementById("logoutBtn");
|
395
345
|
if (logoutBtn) {
|
396
346
|
logoutBtn.addEventListener("click", () => {
|
@@ -409,7 +359,6 @@ function setupAuthListeners() {
|
|
409
359
|
});
|
410
360
|
}
|
411
361
|
|
412
|
-
// Auth state observer
|
413
362
|
auth.onAuthStateChanged((user) => {
|
414
363
|
if (user) {
|
415
364
|
const email = user.email || "No email available";
|
@@ -419,7 +368,6 @@ function setupAuthListeners() {
|
|
419
368
|
let displayName =
|
420
369
|
user.displayName || (user.email ? user.email.split("@")[0] : "User");
|
421
370
|
|
422
|
-
// Special handling for Twitter users who might not have email
|
423
371
|
if (
|
424
372
|
user.providerData[0].providerId === "twitter.com" &&
|
425
373
|
!user.displayName
|
@@ -442,7 +390,6 @@ function setupAuthListeners() {
|
|
442
390
|
const loginModalButton = document.querySelector(".login-modal-button");
|
443
391
|
if (loginModalButton) loginModalButton.style.display = "none";
|
444
392
|
|
445
|
-
// Set initials for avatar
|
446
393
|
const initials = displayName
|
447
394
|
.split(" ")
|
448
395
|
.map((n) => n[0])
|
@@ -465,12 +412,14 @@ function setupAuthListeners() {
|
|
465
412
|
const userProfileSection = document.querySelector(
|
466
413
|
".user-profile-section"
|
467
414
|
);
|
468
|
-
if (userProfileSection)
|
415
|
+
if (userProfileSection)
|
416
|
+
userProfileSection.style.display = "flex";
|
469
417
|
|
470
418
|
const profileLoginContainer = document.querySelector(
|
471
419
|
".profile-login-container"
|
472
420
|
);
|
473
|
-
if (profileLoginContainer)
|
421
|
+
if (profileLoginContainer)
|
422
|
+
profileLoginContainer.style.display = "none";
|
474
423
|
|
475
424
|
const avatarLarge = document.querySelector(".avatar-large");
|
476
425
|
if (avatarLarge) avatarLarge.textContent = initials;
|
@@ -488,55 +437,6 @@ function setupAuthListeners() {
|
|
488
437
|
if (forgotPasswordForm) forgotPasswordForm.style.display = "none";
|
489
438
|
}
|
490
439
|
});
|
491
|
-
const OPERATION_LIMIT = "{{ site.OPERATION_LIMIT }}"; // Set based on site config
|
492
|
-
const STORAGE_KEY = "user_operations";
|
493
|
-
|
494
|
-
function getOperationCount() {
|
495
|
-
const storedCount = localStorage.getItem(STORAGE_KEY);
|
496
|
-
return storedCount ? parseInt(storedCount, 10) : 0;
|
497
|
-
}
|
498
|
-
|
499
|
-
function incrementOperationCount() {
|
500
|
-
let currentCount = getOperationCount();
|
501
|
-
|
502
|
-
if (currentCount >= OPERATION_LIMIT) {
|
503
|
-
showSignupPopup();
|
504
|
-
return false; // Prevent further uploads
|
505
|
-
}
|
506
|
-
|
507
|
-
localStorage.setItem(STORAGE_KEY, currentCount + 1);
|
508
|
-
return true;
|
509
|
-
}
|
510
|
-
|
511
|
-
function showSignupPopup() {
|
512
|
-
auth.onAuthStateChanged((user) => {
|
513
|
-
if (user) {
|
514
|
-
console.log(user);
|
515
|
-
}
|
516
|
-
else{
|
517
|
-
openModal()
|
518
|
-
document.querySelector('.close-modal-btn').style.display="none"
|
519
|
-
}
|
520
|
-
})
|
521
|
-
|
522
|
-
}
|
523
|
-
|
524
|
-
function hideSignupPopup() {
|
525
|
-
closeModal()
|
526
|
-
}
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
// Attach event listener to all file inputs
|
531
|
-
document.querySelectorAll("input[type='file']").forEach(input => {
|
532
|
-
input.addEventListener("change", function () {
|
533
|
-
if (incrementOperationCount()) {
|
534
|
-
console.log("File uploaded in:", this);
|
535
|
-
} else {
|
536
|
-
this.value = ""; // Reset the input field
|
537
|
-
}
|
538
|
-
});
|
539
|
-
});
|
540
440
|
}
|
541
441
|
|
542
442
|
// Initialize the app
|
@@ -545,4 +445,3 @@ if (document.readyState === "loading") {
|
|
545
445
|
} else {
|
546
446
|
loadFirebaseConfig();
|
547
447
|
}
|
548
|
-
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// Auto-generated JS for Blog Topic Ideas
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
3
|
+
const form = document.getElementById("contentToolForm");
|
4
|
+
const editor = document.querySelector("#editor .ql-editor");
|
5
|
+
|
6
|
+
const tool = "blog-topic-ideas";
|
7
|
+
|
8
|
+
let input0 = form.querySelector('[name="input0"]');
|
9
|
+
let language = form.querySelector('[name="language"]');
|
10
|
+
let tone = form.querySelector('[name="tone"]');
|
11
|
+
|
12
|
+
form.addEventListener("submit", async function (e) {
|
13
|
+
e.preventDefault();
|
14
|
+
|
15
|
+
const formData = new FormData(form);
|
16
|
+
const options = {};
|
17
|
+
let inputIndex = 0;
|
18
|
+
|
19
|
+
for (const [key, value] of formData.entries()) {
|
20
|
+
if (key === "language" || key === "tone") {
|
21
|
+
options[key] = value;
|
22
|
+
} else {
|
23
|
+
options[`input[${inputIndex}]`] = value;
|
24
|
+
inputIndex++;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
const body = {
|
29
|
+
tool: tool,
|
30
|
+
llm: "gemini",
|
31
|
+
model_name: "gemini-2.0-flash",
|
32
|
+
options: options
|
33
|
+
};
|
34
|
+
|
35
|
+
try {
|
36
|
+
const response = await fetch(`http://localhost:8000/api/v1/name-and-title-tools/${tool}`, {
|
37
|
+
method: "POST",
|
38
|
+
headers: {
|
39
|
+
"Content-Type": "application/json"
|
40
|
+
},
|
41
|
+
body: JSON.stringify(body)
|
42
|
+
});
|
43
|
+
|
44
|
+
const data = await response.json();
|
45
|
+
|
46
|
+
if (data.output && editor) {
|
47
|
+
editor.innerHTML += "<p>" + data.output + "</p>";
|
48
|
+
} else {
|
49
|
+
editor.innerHTML += "<p><em>No output received from server.</em></p>";
|
50
|
+
}
|
51
|
+
|
52
|
+
} catch (err) {
|
53
|
+
console.error("❌ API Error:", err);
|
54
|
+
editor.innerHTML += "<p style='color:red;'>Error: " + err.message + "</p>";
|
55
|
+
}
|
56
|
+
});
|
57
|
+
});
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// Auto-generated JS for Human Written Blog Post
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
3
|
+
const form = document.getElementById("contentToolForm");
|
4
|
+
const editor = document.querySelector("#editor .ql-editor");
|
5
|
+
|
6
|
+
const tool = "human-written-blog-post";
|
7
|
+
|
8
|
+
let input0 = form.querySelector('[name="input0"]');
|
9
|
+
let language = form.querySelector('[name="language"]');
|
10
|
+
let tone = form.querySelector('[name="tone"]');
|
11
|
+
|
12
|
+
form.addEventListener("submit", async function (e) {
|
13
|
+
e.preventDefault();
|
14
|
+
|
15
|
+
const formData = new FormData(form);
|
16
|
+
const options = {};
|
17
|
+
let inputIndex = 0;
|
18
|
+
|
19
|
+
for (const [key, value] of formData.entries()) {
|
20
|
+
if (key === "language" || key === "tone") {
|
21
|
+
options[key] = value;
|
22
|
+
} else {
|
23
|
+
options[`input[${inputIndex}]`] = value;
|
24
|
+
inputIndex++;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
const body = {
|
29
|
+
tool: tool,
|
30
|
+
llm: "gemini",
|
31
|
+
model_name: "gemini-2.0-flash",
|
32
|
+
options: options
|
33
|
+
};
|
34
|
+
|
35
|
+
try {
|
36
|
+
const response = await fetch(`http://localhost:8000/api/v1/name-and-title-tools/${tool}`, {
|
37
|
+
method: "POST",
|
38
|
+
headers: {
|
39
|
+
"Content-Type": "application/json"
|
40
|
+
},
|
41
|
+
body: JSON.stringify(body)
|
42
|
+
});
|
43
|
+
|
44
|
+
const data = await response.json();
|
45
|
+
|
46
|
+
if (data.output && editor) {
|
47
|
+
editor.innerHTML += "<p>" + data.output + "</p>";
|
48
|
+
} else {
|
49
|
+
editor.innerHTML += "<p><em>No output received from server.</em></p>";
|
50
|
+
}
|
51
|
+
|
52
|
+
} catch (err) {
|
53
|
+
console.error("❌ API Error:", err);
|
54
|
+
editor.innerHTML += "<p style='color:red;'>Error: " + err.message + "</p>";
|
55
|
+
}
|
56
|
+
});
|
57
|
+
});
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// Auto-generated JS for Instagram Caption
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
3
|
+
const form = document.getElementById("contentToolForm");
|
4
|
+
const editor = document.querySelector("#editor .ql-editor");
|
5
|
+
|
6
|
+
const tool = "instagram-caption";
|
7
|
+
|
8
|
+
let input0 = form.querySelector('[name="input0"]');
|
9
|
+
let language = form.querySelector('[name="language"]');
|
10
|
+
let tone = form.querySelector('[name="tone"]');
|
11
|
+
|
12
|
+
form.addEventListener("submit", async function (e) {
|
13
|
+
e.preventDefault();
|
14
|
+
|
15
|
+
const formData = new FormData(form);
|
16
|
+
const options = {};
|
17
|
+
let inputIndex = 0;
|
18
|
+
|
19
|
+
for (const [key, value] of formData.entries()) {
|
20
|
+
if (key === "language" || key === "tone") {
|
21
|
+
options[key] = value;
|
22
|
+
} else {
|
23
|
+
options[`input[${inputIndex}]`] = value;
|
24
|
+
inputIndex++;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
const body = {
|
29
|
+
tool: tool,
|
30
|
+
llm: "gemini",
|
31
|
+
model_name: "gemini-2.0-flash",
|
32
|
+
options: options
|
33
|
+
};
|
34
|
+
|
35
|
+
try {
|
36
|
+
const response = await fetch(`http://localhost:8000/api/v1/name-and-title-tools/${tool}`, {
|
37
|
+
method: "POST",
|
38
|
+
headers: {
|
39
|
+
"Content-Type": "application/json"
|
40
|
+
},
|
41
|
+
body: JSON.stringify(body)
|
42
|
+
});
|
43
|
+
|
44
|
+
const data = await response.json();
|
45
|
+
|
46
|
+
if (data.output && editor) {
|
47
|
+
editor.innerHTML += "<p>" + data.output + "</p>";
|
48
|
+
} else {
|
49
|
+
editor.innerHTML += "<p><em>No output received from server.</em></p>";
|
50
|
+
}
|
51
|
+
|
52
|
+
} catch (err) {
|
53
|
+
console.error("❌ API Error:", err);
|
54
|
+
editor.innerHTML += "<p style='color:red;'>Error: " + err.message + "</p>";
|
55
|
+
}
|
56
|
+
});
|
57
|
+
});
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// JS for Instagram Hashtag Generator
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
3
|
+
let input0 = document.querySelector('[name="input0"]');
|
4
|
+
let input1 = document.querySelector('[name="input1"]');
|
5
|
+
let input2 = document.querySelector('[name="input2"]');
|
6
|
+
let language = document.querySelector('[name="language"]');
|
7
|
+
let tone = document.querySelector('[name="tone"]');
|
8
|
+
|
9
|
+
// Add event listeners or processing logic here
|
10
|
+
});
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// Auto-generated JS for Instagram Name Generator
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
3
|
+
const form = document.getElementById("contentToolForm");
|
4
|
+
const editor = document.querySelector("#editor .ql-editor");
|
5
|
+
|
6
|
+
const tool = "instagram-name-generator";
|
7
|
+
|
8
|
+
let input0 = form.querySelector('[name="input0"]');
|
9
|
+
let input1 = form.querySelector('[name="input1"]');
|
10
|
+
let language = form.querySelector('[name="language"]');
|
11
|
+
let tone = form.querySelector('[name="tone"]');
|
12
|
+
|
13
|
+
form.addEventListener("submit", async function (e) {
|
14
|
+
e.preventDefault();
|
15
|
+
|
16
|
+
const formData = new FormData(form);
|
17
|
+
const options = {};
|
18
|
+
let inputIndex = 0;
|
19
|
+
|
20
|
+
for (const [key, value] of formData.entries()) {
|
21
|
+
if (key === "language" || key === "tone") {
|
22
|
+
options[key] = value;
|
23
|
+
} else {
|
24
|
+
options[`input[${inputIndex}]`] = value;
|
25
|
+
inputIndex++;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
const body = {
|
30
|
+
tool: tool,
|
31
|
+
llm: "gemini",
|
32
|
+
model_name: "gemini-2.0-flash",
|
33
|
+
options: options,
|
34
|
+
};
|
35
|
+
|
36
|
+
try {
|
37
|
+
const response = await fetch(
|
38
|
+
`http://localhost:8000/api/v1/social-media-tools/${tool}`,
|
39
|
+
{
|
40
|
+
method: "POST",
|
41
|
+
headers: {
|
42
|
+
"Content-Type": "application/json",
|
43
|
+
},
|
44
|
+
body: JSON.stringify(body),
|
45
|
+
}
|
46
|
+
);
|
47
|
+
|
48
|
+
const data = await response.json();
|
49
|
+
|
50
|
+
if (data.output && editor) {
|
51
|
+
editor.innerHTML += "<p>" + data.output + "</p>";
|
52
|
+
} else {
|
53
|
+
editor.innerHTML += "<p><em>No output received from server.</em></p>";
|
54
|
+
}
|
55
|
+
} catch (err) {
|
56
|
+
console.error("❌ API Error:", err);
|
57
|
+
editor.innerHTML +=
|
58
|
+
"<p style='color:red;'>Error: " + err.message + "</p>";
|
59
|
+
}
|
60
|
+
});
|
61
|
+
});
|
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: 5.1.
|
4
|
+
version: 5.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vivek-appscms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- _data/home/de/da.json
|
102
102
|
- _data/home/de/de.json
|
103
103
|
- _data/home/en/en.json
|
104
|
+
- _data/home/en/ens.json
|
104
105
|
- _data/home/en/photoeffects.json
|
105
106
|
- _data/home/en/posters.json
|
106
107
|
- _data/home/hi/hi.json
|
@@ -236,6 +237,8 @@ files:
|
|
236
237
|
- _layouts/calculator.html
|
237
238
|
- _layouts/categories.html
|
238
239
|
- _layouts/contactUs.html
|
240
|
+
- _layouts/content-tool-ai copy.html
|
241
|
+
- _layouts/content-tool-ai-2.html
|
239
242
|
- _layouts/content-tool-ai.html
|
240
243
|
- _layouts/contenttool-feature.html
|
241
244
|
- _layouts/contenttool-home.html
|
@@ -555,6 +558,7 @@ files:
|
|
555
558
|
- assets/js/appscms-search.js
|
556
559
|
- assets/js/appscms-theme.js
|
557
560
|
- assets/js/batch.js
|
561
|
+
- assets/js/blog-topic-ideas.js
|
558
562
|
- assets/js/calculator-tooltip.js
|
559
563
|
- assets/js/devtools.js
|
560
564
|
- assets/js/face-api.js
|
@@ -564,6 +568,10 @@ files:
|
|
564
568
|
- assets/js/frame.js
|
565
569
|
- assets/js/googledrive.js
|
566
570
|
- assets/js/homeResult.js
|
571
|
+
- assets/js/human-written-blog-post.js
|
572
|
+
- assets/js/instagram-caption.js
|
573
|
+
- assets/js/instagram-hashtag-generator.js
|
574
|
+
- assets/js/instagram-name-generator.js
|
567
575
|
- assets/js/manifest.json
|
568
576
|
- assets/js/models/age_gender_model-shard1
|
569
577
|
- assets/js/models/age_gender_model-weights_manifest.json
|