Skip to content

Commit f134db0

Browse files
Fix API to AI.
1 parent 04bd757 commit f134db0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: code.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ const name = document.getElementById('aiform-name').value;
3131
return false;
3232
});
3333

34-
document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight API will send you the response soon.</p>';
34+
document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight AI will send you the response soon.</p>';
3535

3636
return false;

Diff for: form.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>JSight AI</h1>
1414
<input type='text' id='aiform-name'/><br/>
1515
<label for='aiform-email'>Email <span class='required'>*</span></label>
1616
<input type='text' id='aiform-email'/><br/>
17-
<button onclick="const name = document.getElementById('aiform-name').value; const email = document.getElementById('aiform-email').value; if(name == '') { alert('Fill your name!'); return false; } if(email == '') { alert('Fill your email!'); return false; } const data = { name: name, email: email }; fetch('https://jsightforms-ce0e.restdb.io/rest/aiform', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-apikey': '63f3ae20478852088da684cf', }, body: JSON.stringify(data), }) .then((response) => response.json()) .then((data) => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); return false; }); document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight API will send you the response soon.</p>'; return false;">Improve API</button>
17+
<button onclick="const name = document.getElementById('aiform-name').value; const email = document.getElementById('aiform-email').value; if(name == '') { alert('Fill your name!'); return false; } if(email == '') { alert('Fill your email!'); return false; } const data = { name: name, email: email }; fetch('https://jsightforms-ce0e.restdb.io/rest/aiform', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-apikey': '63f3ae20478852088da684cf', }, body: JSON.stringify(data), }) .then((response) => response.json()) .then((data) => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); return false; }); document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight AI will send you the response soon.</p>'; return false;">Improve API</button>
1818
</form>
1919
</div>
2020
</div>

Diff for: online-editor-custom-messages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"id": "own",
44
"regex": "editor",
5-
"content": "<html><body><style> #aiform button {background: #8338ff; border-radius: 4px; box-shadow: 0 4px 16px rgb(131 56 255 / 25%), 0 0 12px rgb(131 56 255 / 4%), 0 2px 2px rgb(131 56 255 / 5%); color: #fff; font-size: 1.6rem; font-weight: 600; line-height: 2.4rem; margin-top: 1.5rem; padding: 1rem 4.6rem;} #aiform input {padding: 0.5rem; margin: 0.5rem 0.7rem; border: 1px solid #aaa; width: 300px;} #aiform .required {color: red;} </style><h1>JSight AI</h1><div id='jsightai-form'><p>Our smart JSight AI can automatically improve your <b>“GYM REST API”</b> API design. <br />Please fill the form below and press the “Improve API” button. JSight AI will send the improved API version to your email.</p><div><form id='aiform'><label for='aiform-name'>Name <span class='required'>*</span></label><input type='text' id='aiform-name'/><br/><label for='aiform-email'>Email <span class='required'>*</span></label><input type='text' id='aiform-email'/><br/><button onclick=\"const name = document.getElementById('aiform-name').value; const email = document.getElementById('aiform-email').value; if(name == '') { alert('Fill your name!'); return false; } if(email == '') { alert('Fill your email!'); return false; } const data = { name: name, email: email }; fetch('https://jsightforms-ce0e.restdb.io/rest/aiform', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-apikey': '63f3ae20478852088da684cf', }, body: JSON.stringify(data), }) .then((response) => response.json()) .then((data) => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); return false; }); document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight API will send you the response soon.</p>'; return false;\">Improve API</button></form></div></div></body></html>"
5+
"content": "<html><body><style> #aiform button {background: #8338ff; border-radius: 4px; box-shadow: 0 4px 16px rgb(131 56 255 / 25%), 0 0 12px rgb(131 56 255 / 4%), 0 2px 2px rgb(131 56 255 / 5%); color: #fff; font-size: 1.6rem; font-weight: 600; line-height: 2.4rem; margin-top: 1.5rem; padding: 1rem 4.6rem;} #aiform input {padding: 0.5rem; margin: 0.5rem 0.7rem; border: 1px solid #aaa; width: 300px;} #aiform .required {color: red;} </style><h1>JSight AI</h1><div id='jsightai-form'><p>Our smart JSight AI can automatically improve your <b>“GYM REST API”</b> API design. <br />Please fill the form below and press the “Improve API” button. JSight AI will send the improved API version to your email.</p><div><form id='aiform'><label for='aiform-name'>Name <span class='required'>*</span></label><input type='text' id='aiform-name'/><br/><label for='aiform-email'>Email <span class='required'>*</span></label><input type='text' id='aiform-email'/><br/><button onclick=\"const name = document.getElementById('aiform-name').value; const email = document.getElementById('aiform-email').value; if(name == '') { alert('Fill your name!'); return false; } if(email == '') { alert('Fill your email!'); return false; } const data = { name: name, email: email }; fetch('https://jsightforms-ce0e.restdb.io/rest/aiform', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-apikey': '63f3ae20478852088da684cf', }, body: JSON.stringify(data), }) .then((response) => response.json()) .then((data) => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); return false; }); document.getElementById('jsightai-form').innerHTML = '<p>Your API improvement request has been submitted. JSight AI will send you the response soon.</p>'; return false;\">Improve API</button></form></div></div></body></html>"
66
},
77
{
88
"id": "R3-jotform-script",

0 commit comments

Comments
 (0)