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

Version Path
keppler-2.1.22 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.21 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.20 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.19 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.18 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.18 testing-with-2.1.18/app/assets/javascripts/admin/swal.js
keppler-2.1.17 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.16 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.15 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.14 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.13 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.12 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.11 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.10 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.9 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.8 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.7 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.6 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.5 installer/core/app/assets/javascripts/admin/swal.js
keppler-2.1.4 installer/core/app/assets/javascripts/admin/swal.js