appscms-tools-theme 5.2.2 → 5.2.3
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/feature/en/3_shop_posters.json +456 -1
- data/_data/home/en/ens.json +4 -4
- data/_data/templates.json +17459 -0
- data/_data/vintage/en/test.json +142 -0
- data/_includes/.DS_Store +0 -0
- data/_includes/appscms/footer/ai-image-tools-footer.html +14 -0
- data/_includes/appscms/head/head.html +61 -36
- data/_includes/appscms/headings/ai-image-tools-headings.html +24 -0
- data/_includes/appscms/navbars/ai-image-tools-navbar.html +446 -0
- data/_includes/appscms/scripts/script.html +17 -3
- data/_layouts/ai-image-generator.html +307 -0
- data/_layouts/ai-image-home.html +160 -0
- data/_layouts/ai-image-pricing.html +366 -0
- data/assets/css/ai-image-generator.css +547 -0
- data/assets/css/ai-image-home.css +760 -0
- data/assets/css/appscms-variables.css +1 -1
- data/assets/js/appscms-login.js +1 -1
- data/assets/js/get-credits.js +91 -0
- metadata +13 -2
data/assets/js/appscms-login.js
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
|
|
2
|
+
async function getAuthToken() {
|
|
3
|
+
return new Promise((resolve) => {
|
|
4
|
+
// First try to get from localStorage (set by Firebase auth)
|
|
5
|
+
const storedToken = localStorage.getItem("authToken");
|
|
6
|
+
if (storedToken) {
|
|
7
|
+
resolve(storedToken);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// If Firebase is available and user is logged in, get fresh token
|
|
12
|
+
if (typeof firebase !== "undefined" && firebase.auth) {
|
|
13
|
+
try {
|
|
14
|
+
const user = firebase.auth().currentUser;
|
|
15
|
+
if (user) {
|
|
16
|
+
user
|
|
17
|
+
.getIdToken(true) // Force refresh
|
|
18
|
+
.then((token) => {
|
|
19
|
+
// Save to localStorage for faster access
|
|
20
|
+
localStorage.setItem("authToken", token);
|
|
21
|
+
resolve(token);
|
|
22
|
+
})
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
console.warn("Failed to get auth token:", error);
|
|
25
|
+
resolve(null);
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
console.warn("User not logged in");
|
|
29
|
+
resolve(null);
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.warn("Firebase check error:", error);
|
|
33
|
+
resolve(null);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
// Fallback to session storage
|
|
37
|
+
const sessionToken = sessionStorage.getItem("authToken");
|
|
38
|
+
resolve(sessionToken || null);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const BACKEND_API_URL = 'https://us-central1-appscms-develop.cloudfunctions.net/ai_image_tools/api/v1/image-tools-routes';
|
|
43
|
+
|
|
44
|
+
async function getUserCredits() {
|
|
45
|
+
try {
|
|
46
|
+
const authToken = await getAuthToken();
|
|
47
|
+
if (!authToken) {
|
|
48
|
+
throw new Error("User not authenticated");
|
|
49
|
+
}
|
|
50
|
+
const res = await fetch(`${BACKEND_API_URL}/remaining-credits`, {
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: {
|
|
53
|
+
"Authorization": `Bearer ${authToken}`,
|
|
54
|
+
"Content-Type": "application/json"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
if (!res.ok) {
|
|
59
|
+
const errorText = await res.text();
|
|
60
|
+
let errorMsg = "Failed to fetch credits";
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const errorJson = JSON.parse(errorText);
|
|
64
|
+
errorMsg = errorJson.detail || errorMsg;
|
|
65
|
+
} catch { }
|
|
66
|
+
|
|
67
|
+
throw new Error(errorMsg);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const data = await res.json();
|
|
71
|
+
|
|
72
|
+
return data;
|
|
73
|
+
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Get credits error:", error);
|
|
76
|
+
showError(error.message || "Unable to fetch credits");
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
(async () => {
|
|
82
|
+
const creditData = await getUserCredits();
|
|
83
|
+
|
|
84
|
+
if (creditData) {
|
|
85
|
+
const creditEl = document.querySelector("#showCredits");
|
|
86
|
+
if (creditEl) {
|
|
87
|
+
creditEl.innerHTML = `Credits: ${creditData.credits}`;
|
|
88
|
+
console.log("Credits:", creditData.credits);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})();
|
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.2.
|
|
4
|
+
version: 5.2.3
|
|
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-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -160,7 +160,9 @@ files:
|
|
|
160
160
|
- _data/privacy/en/privacyPolicy.json
|
|
161
161
|
- _data/rating/rating.json
|
|
162
162
|
- _data/review/trustpilot.json
|
|
163
|
+
- _data/templates.json
|
|
163
164
|
- _data/termAndCondition/en/termAndCondition.json
|
|
165
|
+
- _data/vintage/en/test.json
|
|
164
166
|
- _includes/.DS_Store
|
|
165
167
|
- _includes/Atest.html
|
|
166
168
|
- _includes/Rating/rating.html
|
|
@@ -184,11 +186,13 @@ files:
|
|
|
184
186
|
- _includes/appscms/faq/faq.html
|
|
185
187
|
- _includes/appscms/featurePageAuthors/featurePageAuthors.html
|
|
186
188
|
- _includes/appscms/featurehighlight/featurehighlight.html
|
|
189
|
+
- _includes/appscms/footer/ai-image-tools-footer.html
|
|
187
190
|
- _includes/appscms/footer/footer.html
|
|
188
191
|
- _includes/appscms/footer/products.html
|
|
189
192
|
- _includes/appscms/footer/static-footer.html
|
|
190
193
|
- _includes/appscms/head/bloghead.html
|
|
191
194
|
- _includes/appscms/head/head.html
|
|
195
|
+
- _includes/appscms/headings/ai-image-tools-headings.html
|
|
192
196
|
- _includes/appscms/headings/contenttool-headings.html
|
|
193
197
|
- _includes/appscms/headings/devtool-headings.html
|
|
194
198
|
- _includes/appscms/headings/headings.html
|
|
@@ -198,6 +202,7 @@ files:
|
|
|
198
202
|
- _includes/appscms/howto/howto.html
|
|
199
203
|
- _includes/appscms/infographics/infographics.html
|
|
200
204
|
- _includes/appscms/loaders/loader.html
|
|
205
|
+
- _includes/appscms/navbars/ai-image-tools-navbar.html
|
|
201
206
|
- _includes/appscms/navbars/devtool-navbar.html
|
|
202
207
|
- _includes/appscms/navbars/devtool-toolbar.html
|
|
203
208
|
- _includes/appscms/navbars/navbar.html
|
|
@@ -258,6 +263,9 @@ files:
|
|
|
258
263
|
- _includes/staticfooter.html
|
|
259
264
|
- _includes/userTracking.html
|
|
260
265
|
- _layouts/aboutUs.html
|
|
266
|
+
- _layouts/ai-image-generator.html
|
|
267
|
+
- _layouts/ai-image-home.html
|
|
268
|
+
- _layouts/ai-image-pricing.html
|
|
261
269
|
- _layouts/allAuthors.html
|
|
262
270
|
- _layouts/appscms-about.html
|
|
263
271
|
- _layouts/appscms-audio.html
|
|
@@ -325,6 +333,8 @@ files:
|
|
|
325
333
|
- assets/cloud.svg
|
|
326
334
|
- assets/cross.svg
|
|
327
335
|
- assets/css/adblocker.css
|
|
336
|
+
- assets/css/ai-image-generator.css
|
|
337
|
+
- assets/css/ai-image-home.css
|
|
328
338
|
- assets/css/appscms-blog.css
|
|
329
339
|
- assets/css/appscms-calculator.css
|
|
330
340
|
- assets/css/appscms-contenttool.css
|
|
@@ -615,6 +625,7 @@ files:
|
|
|
615
625
|
- assets/js/faceSystem.js
|
|
616
626
|
- assets/js/featureResult.js
|
|
617
627
|
- assets/js/frame.js
|
|
628
|
+
- assets/js/get-credits.js
|
|
618
629
|
- assets/js/googledrive.js
|
|
619
630
|
- assets/js/homeResult.js
|
|
620
631
|
- assets/js/manifest.json
|