Sha256: 9d9c5e33c53762f1af0e2e973176f2f42bdd20ef98a7b9e0c126d7a7c11958be

Contents?: true

Size: 1.92 KB

Versions: 57

Compression:

Stored size: 1.92 KB

Contents

// eslint-disable-next-line import/no-extraneous-dependencies
import 'core-js/stable'
// eslint-disable-next-line import/no-extraneous-dependencies
import 'regenerator-runtime/runtime'
import * as Mousetrap from 'mousetrap'
import { Application } from 'stimulus'
import { Turbo } from '@hotwired/turbo-rails'
import { definitionsFromContext } from 'stimulus/webpack-helpers'
import Rails from '@rails/ujs'
import tippy from 'tippy.js'

// Toastr alerts
import '../js/toastr'

Rails.start()

window.Turbolinks = Turbo

Mousetrap.bind('r r r', () => Turbo.visit(window.location.href, { action: 'replace' }))

function initTippy() {
  tippy('[data-tippy="tooltip"]', {
    theme: 'light',
    content(reference) {
      const title = reference.getAttribute('title')
      reference.removeAttribute('title')

      return title
    },
  })
}
window.initTippy = initTippy

const application = Application.start()

const context = require.context('./../js/controllers', true, /\.js$/)
application.load(definitionsFromContext(context))

const fieldsContext = require.context('./../js/controllers/fields', true, /\.js$/)
application.load(definitionsFromContext(fieldsContext))

document.addEventListener('turbo:load', () => {
  document.body.classList.remove('turbo-loading')
  initTippy()
})
document.addEventListener('turbo:visit', () => document.body.classList.add('turbo-loading'))
document.addEventListener('turbo:submit-start', () => document.body.classList.add('turbo-loading'))
document.addEventListener('turbo:before-cache', () => {
  document.querySelectorAll('[data-turbo-remove-before-cache]').forEach((element) => element.remove())
})

// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
const images = require.context('../images', true)
const imagePath = (name) => images(name, true)

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
avo-1.17.1 app/packs/entrypoints/application.js
avo-1.17.0 app/packs/entrypoints/application.js
avo-1.16.4 app/packs/entrypoints/application.js
avo-1.16.3 app/packs/entrypoints/application.js
avo-1.16.2 app/packs/entrypoints/application.js
avo-1.16.1 app/packs/entrypoints/application.js
avo-1.16.0 app/packs/entrypoints/application.js
avo-1.15.0 app/packs/entrypoints/application.js
avo-1.15.0.pre.1 app/packs/entrypoints/application.js
avo-1.14.0 app/packs/entrypoints/application.js
avo-1.13.3 app/packs/entrypoints/application.js
avo-1.13.2 app/packs/entrypoints/application.js
avo-1.13.1 app/packs/entrypoints/application.js
avo-1.13.0 app/packs/entrypoints/application.js
avo-1.12.4 app/packs/entrypoints/application.js
avo-1.12.3 app/packs/entrypoints/application.js
avo-1.12.2 app/packs/entrypoints/application.js
avo-1.12.1 app/packs/entrypoints/application.js
avo-1.12.0 app/packs/entrypoints/application.js
avo-1.11.6 app/packs/entrypoints/application.js