Skip to content

Commit 2be2a70

Browse files
Add Support Documentation with Payment Section (English & Chinese) (#518)
* Update support/payment/accepted-payment-methods.mdx * Update support/payment/editing-payment-information.mdx * Update support/payment/payment-history.mdx * Update support/payment/unsuccessful-payments.mdx * Update support/payment/payment-currency.mdx * Update support/payment/invoice-information.mdx * Update zh-CN/support/payment/accepted-payment-methods.mdx * Update zh-CN/support/payment/editing-payment-information.mdx * Update zh-CN/support/payment/payment-history.mdx * Update zh-CN/support/payment/unsuccessful-payments.mdx * Update zh-CN/support/payment/payment-currency.mdx * Update zh-CN/support/payment/invoice-information.mdx * Update docs.json * Update docs.json * Update navigation * Update navigation * Update support/payment/accepted-payment-methods.mdx * Update zh-CN/support/payment/accepted-payment-methods.mdx * Update support/payment/accepted-payment-methods.mdx * Update support/payment/payment-history.mdx * Update support/payment/unsuccessful-payments.mdx * Update support/payment/payment-currency.mdx * Update support/payment/invoice-information.mdx * Update support/payment/invoice-information.mdx * Update support/payment/editing-payment-information.mdx * Update support/payment/invoice-information.mdx * Update support/payment/invoice-information.mdx * Update support/payment/payment-currency.mdx * Update zh-CN/support/payment/payment-currency.mdx * Update zh-CN/support/payment/invoice-information.mdx * Update zh-CN/support/payment/invoice-information.mdx * Update zh-CN/support/payment/accepted-payment-methods.mdx * Update zh-CN/support/payment/payment-history.mdx * Update zh-CN/support/payment/unsuccessful-payments.mdx * Update zh-CN/support/payment/payment-currency.mdx * Update zh-CN/support/payment/invoice-information.mdx * Update zh-CN/support/payment/editing-payment-information.mdx * Update zh-CN/support/payment/invoice-information.mdx * Update docs.json * Update docs.json * Update support/payment/unsuccessful-payments.mdx * Update zh-CN/support/payment/unsuccessful-payments.mdx * Update support/payment/accepted-payment-methods.mdx * Update zh-CN/support/payment/accepted-payment-methods.mdx * Add screenshots * Update support/payment/invoice-information.mdx * Update zh-CN/support/payment/invoice-information.mdx * Refine invoice details * Add Alipay/WeChat Pay checkout instructions and images Added images and guidance for enabling Alipay and WeChat Pay by selecting USD during checkout in both English and Chinese documentation. Also removed redundant supported currency lists and FAQ sections from payment currency docs for clarity. * Update support/payment/payment-currency.mdx * Update zh-CN/support/payment/payment-currency.mdx * Fix the language switcher issue * Revise payment history documentation for ComfyUI Updated the steps to access payment history and download invoices, reflecting the new user interface. Added visual walkthroughs and clarified instructions for navigating the Stripe billing portal. Adjusted content in both English and Chinese versions for consistency. * Update sidebar titles --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: ComfyUI Wiki <contact@comfyui-wiki.com>
1 parent ae3b965 commit 2be2a70

21 files changed

+813
-77
lines changed

docs.json

Lines changed: 50 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@
147147
},
148148
{
149149
"group": "3D",
150-
"pages": [
151-
"tutorials/3d/hunyuan3D-2"
152-
]
150+
"pages": ["tutorials/3d/hunyuan3D-2"]
153151
},
154152
{
155153
"group": "Video",
@@ -190,9 +188,7 @@
190188
},
191189
{
192190
"group": "Audio",
193-
"pages": [
194-
"tutorials/audio/ace-step/ace-step-v1"
195-
]
191+
"pages": ["tutorials/audio/ace-step/ace-step-v1"]
196192
},
197193
{
198194
"group": "Partner Nodes",
@@ -209,9 +205,7 @@
209205
},
210206
{
211207
"group": "Google",
212-
"pages": [
213-
"tutorials/partner-nodes/google/gemini"
214-
]
208+
"pages": ["tutorials/partner-nodes/google/gemini"]
215209
},
216210
{
217211
"group": "Stability AI",
@@ -303,9 +297,7 @@
303297
},
304298
{
305299
"group": "Image",
306-
"pages": [
307-
"built-in-nodes/Canny"
308-
]
300+
"pages": ["built-in-nodes/Canny"]
309301
},
310302
{
311303
"group": "Loader",
@@ -317,9 +309,7 @@
317309
},
318310
{
319311
"group": "Latent",
320-
"pages": [
321-
"built-in-nodes/latent/video/trim-video-latent"
322-
]
312+
"pages": ["built-in-nodes/latent/video/trim-video-latent"]
323313
},
324314
{
325315
"group": "Advanced",
@@ -343,17 +333,13 @@
343333
"built-in-nodes/sampling/ksampler",
344334
{
345335
"group": "Custom Sampling",
346-
"pages": [
347-
"built-in-nodes/BasicScheduler"
348-
]
336+
"pages": ["built-in-nodes/BasicScheduler"]
349337
}
350338
]
351339
},
352340
{
353341
"group": "3D",
354-
"pages": [
355-
"built-in-nodes/Load3D"
356-
]
342+
"pages": ["built-in-nodes/Load3D"]
357343
},
358344
{
359345
"group": "Partner Node",
@@ -564,17 +550,11 @@
564550
"pages": [
565551
{
566552
"group": "Workflow JSON",
567-
"pages": [
568-
"specs/workflow_json",
569-
"specs/workflow_json_0.4"
570-
]
553+
"pages": ["specs/workflow_json", "specs/workflow_json_0.4"]
571554
},
572555
{
573556
"group": "Node Definitions",
574-
"pages": [
575-
"specs/nodedef_json",
576-
"specs/nodedef_json_1_0"
577-
]
557+
"pages": ["specs/nodedef_json", "specs/nodedef_json_1_0"]
578558
}
579559
]
580560
}
@@ -583,6 +563,22 @@
583563
{
584564
"tab": "Support",
585565
"pages": [
566+
{
567+
"group": "Billing Support",
568+
"pages": [
569+
{
570+
"group": "Payment",
571+
"pages": [
572+
"support/payment/accepted-payment-methods",
573+
"support/payment/editing-payment-information",
574+
"support/payment/payment-history",
575+
"support/payment/unsuccessful-payments",
576+
"support/payment/payment-currency",
577+
"support/payment/invoice-information"
578+
]
579+
}
580+
]
581+
},
586582
{
587583
"group": "Troubleshooting",
588584
"icon": "bug",
@@ -594,10 +590,7 @@
594590
},
595591
{
596592
"group": "Community",
597-
"pages": [
598-
"community/contributing",
599-
"community/links"
600-
]
593+
"pages": ["community/contributing", "community/links"]
601594
}
602595
]
603596
},
@@ -741,9 +734,7 @@
741734
},
742735
{
743736
"group": "3D",
744-
"pages": [
745-
"zh-CN/tutorials/3d/hunyuan3D-2"
746-
]
737+
"pages": ["zh-CN/tutorials/3d/hunyuan3D-2"]
747738
},
748739
{
749740
"group": "视频",
@@ -784,9 +775,7 @@
784775
},
785776
{
786777
"group": "音频",
787-
"pages": [
788-
"zh-CN/tutorials/audio/ace-step/ace-step-v1"
789-
]
778+
"pages": ["zh-CN/tutorials/audio/ace-step/ace-step-v1"]
790779
},
791780
{
792781
"group": "合作伙伴节点",
@@ -803,9 +792,7 @@
803792
},
804793
{
805794
"group": "Google",
806-
"pages": [
807-
"zh-CN/tutorials/partner-nodes/google/gemini"
808-
]
795+
"pages": ["zh-CN/tutorials/partner-nodes/google/gemini"]
809796
},
810797
{
811798
"group": "Stability AI",
@@ -897,9 +884,7 @@
897884
},
898885
{
899886
"group": "图像",
900-
"pages": [
901-
"zh-CN/built-in-nodes/Canny"
902-
]
887+
"pages": ["zh-CN/built-in-nodes/Canny"]
903888
},
904889
{
905890
"group": "加载器",
@@ -911,9 +896,7 @@
911896
},
912897
{
913898
"group": "潜变量",
914-
"pages": [
915-
"zh-CN/built-in-nodes/latent/video/trim-video-latent"
916-
]
899+
"pages": ["zh-CN/built-in-nodes/latent/video/trim-video-latent"]
917900
},
918901
{
919902
"group": "高级",
@@ -937,17 +920,13 @@
937920
"zh-CN/built-in-nodes/sampling/ksampler",
938921
{
939922
"group": "自定义采样",
940-
"pages": [
941-
"zh-CN/built-in-nodes/BasicScheduler"
942-
]
923+
"pages": ["zh-CN/built-in-nodes/BasicScheduler"]
943924
}
944925
]
945926
},
946927
{
947928
"group": "3D",
948-
"pages": [
949-
"zh-CN/built-in-nodes/Load3D"
950-
]
929+
"pages": ["zh-CN/built-in-nodes/Load3D"]
951930
},
952931
{
953932
"group": "合作伙伴节点",
@@ -1176,6 +1155,22 @@
11761155
{
11771156
"tab": "支持",
11781157
"pages": [
1158+
{
1159+
"group": "账单支持",
1160+
"pages": [
1161+
{
1162+
"group": "支付",
1163+
"pages": [
1164+
"zh-CN/support/payment/accepted-payment-methods",
1165+
"zh-CN/support/payment/editing-payment-information",
1166+
"zh-CN/support/payment/payment-history",
1167+
"zh-CN/support/payment/unsuccessful-payments",
1168+
"zh-CN/support/payment/payment-currency",
1169+
"zh-CN/support/payment/invoice-information"
1170+
]
1171+
}
1172+
]
1173+
},
11791174
{
11801175
"group": "故障排除",
11811176
"icon": "bug",
@@ -1290,12 +1285,7 @@
12901285
]
12911286
},
12921287
"contextual": {
1293-
"options": [
1294-
"copy",
1295-
"view",
1296-
"chatgpt",
1297-
"claude"
1298-
]
1288+
"options": ["copy", "view", "chatgpt", "claude"]
12991289
},
13001290
"integrations": {},
13011291
"redirects": [
97.5 KB
Loading
60 KB
Loading
166 KB
Loading
109 KB
Loading
82 KB
Loading
114 KB
Loading
86.6 KB
Loading

language-switcher-fix.js

Lines changed: 92 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,62 @@
7474
return newPath + search + hash;
7575
}
7676

77+
/**
78+
* Normalize href into a URL object scoped to current origin
79+
*/
80+
function parseHref(href) {
81+
if (!href) {
82+
return null;
83+
}
84+
85+
try {
86+
const url = new URL(href, window.location.origin);
87+
return {
88+
url,
89+
isSameOrigin: url.origin === window.location.origin,
90+
relativePath: url.pathname + url.search + url.hash
91+
};
92+
} catch (error) {
93+
return null;
94+
}
95+
}
96+
97+
/**
98+
* Attach handler to language element
99+
*/
100+
function attachLanguageHandler(element, targetLang) {
101+
if (!element || targetLang === getCurrentLanguage()) {
102+
return false;
103+
}
104+
105+
if (element.getAttribute('data-language-fixed') === 'true') {
106+
return false;
107+
}
108+
109+
const handler = event => {
110+
if (event) {
111+
if (typeof event.preventDefault === 'function') {
112+
event.preventDefault();
113+
}
114+
if (typeof event.stopPropagation === 'function') {
115+
event.stopPropagation();
116+
}
117+
if (typeof event.stopImmediatePropagation === 'function') {
118+
event.stopImmediatePropagation();
119+
}
120+
}
121+
122+
const newPath = convertPathToLanguage(targetLang);
123+
console.log('[Language Switcher] Navigating from', window.location.pathname, 'to', newPath);
124+
window.location.href = newPath;
125+
};
126+
127+
element.addEventListener('click', handler, true);
128+
element.setAttribute('data-language-fixed', 'true');
129+
element.setAttribute('data-target-lang', targetLang);
130+
return true;
131+
}
132+
77133
/**
78134
* Fix language switcher links
79135
*/
@@ -155,8 +211,12 @@
155211
}
156212

157213
const href = link.getAttribute('href');
158-
if (!href) return;
214+
const parsedHref = parseHref(href);
215+
if (!parsedHref || !parsedHref.isSameOrigin) {
216+
return;
217+
}
159218

219+
const { url } = parsedHref;
160220
const linkText = link.textContent.trim().toLowerCase();
161221

162222
// Determine which language this link is for
@@ -166,13 +226,13 @@
166226
targetLang = 'cn';
167227
} else if (linkText.includes('english') || linkText === 'en') {
168228
targetLang = 'en';
169-
} else if (href === '/' && !link.closest('[class*="footer"]')) {
229+
} else if (url.pathname === '/' && !link.closest('[class*="footer"]')) {
170230
// Links to "/" might be English homepage (but not in footer)
171231
const parent = link.closest('[role="menu"], [role="listbox"], [id*="localization"]');
172232
if (parent) {
173233
targetLang = 'en';
174234
}
175-
} else if (href.startsWith('/zh-CN') || href === '/zh-CN/') {
235+
} else if (url.pathname.startsWith('/zh-CN')) {
176236
targetLang = 'cn';
177237
}
178238

@@ -181,27 +241,42 @@
181241

182242
// Only fix if switching to a different language
183243
if (targetLang !== currentLang) {
184-
// Calculate the new path
244+
// Calculate the new path and update the href for visual feedback
185245
const newPath = convertPathToLanguage(targetLang);
186-
187-
// Update the href attribute
188246
link.setAttribute('href', newPath);
189-
link.setAttribute('data-language-fixed', 'true');
190-
link.setAttribute('data-target-lang', targetLang);
191247

192-
// Override the click handler
193-
link.addEventListener('click', function(e) {
194-
e.preventDefault();
195-
e.stopPropagation();
248+
if (attachLanguageHandler(link, targetLang)) {
249+
fixedCount++;
250+
}
251+
}
252+
}
253+
});
196254

197-
const newPath = convertPathToLanguage(targetLang);
198-
console.log('[Language Switcher] Navigating from', window.location.pathname, 'to', newPath);
199-
window.location.href = newPath;
200-
}, true);
255+
// Handle dropdown menu items rendered as div/button elements
256+
const dropdownItems = document.querySelectorAll('[id^="localization-select-item-"]');
201257

202-
fixedCount++;
258+
dropdownItems.forEach(item => {
259+
let targetLang = null;
260+
const itemId = item.id || '';
261+
262+
if (itemId.endsWith('-en')) {
263+
targetLang = 'en';
264+
} else if (itemId.endsWith('-cn')) {
265+
targetLang = 'cn';
266+
}
267+
268+
if (!targetLang) {
269+
const text = item.textContent.trim().toLowerCase();
270+
if (text.includes('english') || text === 'en') {
271+
targetLang = 'en';
272+
} else if (text.includes('中文') || text.includes('chinese') || text === 'cn') {
273+
targetLang = 'cn';
203274
}
204275
}
276+
277+
if (targetLang && attachLanguageHandler(item, targetLang)) {
278+
fixedCount++;
279+
}
205280
});
206281

207282
return fixedCount;

0 commit comments

Comments
 (0)