mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
sharing in progress
This commit is contained in:
parent
416d975685
commit
01fba58718
@ -3,23 +3,33 @@ function enable_sharing() {
|
||||
let name = $("#share_name").val()
|
||||
let email = $("#share_email").val()
|
||||
if (name && email) {
|
||||
$.post("https://gradio.app/send_email", {
|
||||
"url": config["ngrok_socket_url"],
|
||||
"name": name,
|
||||
"email": email
|
||||
}).done(function() {
|
||||
$("#share_message").text("Shared successfully.");
|
||||
}).fail(function() {
|
||||
$("#share_message").text("Failed to share.");
|
||||
}).always(function() {
|
||||
$("#share_form").hide();
|
||||
$("#share_complete").show();
|
||||
});
|
||||
$.ajax({
|
||||
"url" : "https://gradio.app/send_email",
|
||||
"type": "POST",
|
||||
"crossDomain": true,
|
||||
"data": JSON.stringify({
|
||||
"url": config["ngrok_socket_url"],
|
||||
"name": name,
|
||||
"email": email
|
||||
}),
|
||||
"success": function() {
|
||||
$("#share_message").text("Shared successfully.");
|
||||
$("#share_more").text("Share more");
|
||||
},
|
||||
"error": function() {
|
||||
$("#share_message").text("Failed to share.");
|
||||
$("#share_more").text("Try again");
|
||||
},
|
||||
"complete": function() {
|
||||
$("#share_form").hide();
|
||||
$("#share_complete").show();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$("#share_more").click(function (evt) {
|
||||
$("#share_form").show();
|
||||
$("#share_complete").hide();
|
||||
$("#share_complete").hide();
|
||||
})
|
||||
|
@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div id="share_complete">
|
||||
<span id="share_message"></span>
|
||||
<button class="secondary" id="share_more">Share more</button>
|
||||
<button class="secondary" id="share_more"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="panels">
|
||||
|
Loading…
Reference in New Issue
Block a user