Sha256: 89200291d0515396f968a91c6ac2b4467ec7b7c0c8c38e0951e0fec869bd4a52
Contents?: true
Size: 1.06 KB
Versions: 31
Compression:
Stored size: 1.06 KB
Contents
$(document).on('turbolinks:load', function() { $(function ($) { $('.delete').click(function(e){ e.preventDefault() swal({ title: 'Submit your Github username', input: 'text', inputAttributes: { autocapitalize: 'off' }, showCancelButton: true, confirmButtonText: 'Look up', showLoaderOnConfirm: true, preConfirm: (login) => { return fetch(`//api.github.com/users/${login}`) .then(response => { if (!response.ok) { throw new Error(response.statusText) } return response.json() }) .catch(error => { swal.showValidationError( `Request failed: ${error}` ) }) }, allowOutsideClick: () => !swal.isLoading() }).then((result) => { if (result.value) { swal({ title: `${result.value.login}'s avatar`, imageUrl: result.value.avatar_url }) } }) }) }); });
Version data entries
31 entries across 30 versions & 1 rubygems