mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Open the deletion token copy prompt when creating a paste
This commit is contained in:
parent
76515c0108
commit
f63b94f8c1
@ -62,6 +62,9 @@ export function setupButtons() {
|
|||||||
}
|
}
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
|
// Give the user the chance to copy the deletion token
|
||||||
|
prompt("The deletion token for your paste is:", data.deletionToken);
|
||||||
|
|
||||||
// Redirect the user to the paste page
|
// Redirect the user to the paste page
|
||||||
let address = location.protocol + "//" + location.host + "/" + data.id;
|
let address = location.protocol + "//" + location.host + "/" + data.id;
|
||||||
if (data.suggestedSyntaxType) address += "." + data.suggestedSyntaxType;
|
if (data.suggestedSyntaxType) address += "." + data.suggestedSyntaxType;
|
||||||
@ -75,7 +78,7 @@ export function setupButtons() {
|
|||||||
document.getElementById("btn_delete").addEventListener("click", function() {
|
document.getElementById("btn_delete").addEventListener("click", function() {
|
||||||
spinner.surround(async function() {
|
spinner.surround(async function() {
|
||||||
// Ask the user for the deletion token
|
// Ask the user for the deletion token
|
||||||
const deletionToken = window.prompt("Deletion Token:");
|
const deletionToken = prompt("Deletion Token:");
|
||||||
if (!deletionToken) return;
|
if (!deletionToken) return;
|
||||||
|
|
||||||
// Delete the paste
|
// Delete the paste
|
||||||
|
Loading…
Reference in New Issue
Block a user