xxxxxxxxxx
Swal.fire({
title: "Submit your Github username",
input: "text",
inputAttributes: {
autocapitalize: "off"
},
showCancelButton: true,
confirmButtonText: "Look up",
showLoaderOnConfirm: true,
preConfirm: async (login) => {
try {
const githubUrl = `
https://api.github.com/users/${login}
`;
const response = await fetch(githubUrl);
if (!response.ok) {
return Swal.showValidationMessage(`
${JSON.stringify(await response.json())}
`);
}
return response.json();
} catch (error) {
Swal.showValidationMessage(`
Request failed: ${error}
`);
}
},
allowOutsideClick: () => !Swal.isLoading()
}).then((result) => {
if (result.isConfirmed) {
Swal.fire({
title: `${result.value.login}'s avatar`,
imageUrl: result.value.avatar_url
});
}
});
xxxxxxxxxx
./gradlew wrapper --gradle-version <version>
Example: ./gradlew wrapper --gradle-version 7.2
xxxxxxxxxx
// avoid updating the "distributionUrl" in gradle-wrapper.properties esp for major updates
gradle wrapper --gradle-version=8.5 --distribution-type=all
xxxxxxxxxx
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
xxxxxxxxxx
swal({
title: "Good job!",
text: "You clicked the button!",
icon: "success",
button: "Aww yiss!",
});
xxxxxxxxxx
//import sweetalert
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
//Alert
<script>swal("My title", "My description", "success");</script>
xxxxxxxxxx
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Your work has been saved',
showConfirmButton: false,
timer: 1500
})
xxxxxxxxxx
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'Your work has been saved',
showConfirmButton: false,
timer: 1500
})