update npm

This commit is contained in:
2022-02-25 22:03:28 -05:00
committed by oliviasculley
parent e16fbba810
commit 7745765fc0
3 changed files with 797 additions and 5005 deletions

View File

@ -39,6 +39,10 @@ const liveSocket = new LiveSocket('/live', Socket, {
hooks: { MaintainAttrs }
})
// alpine.js
window.Alpine = Alpine
Alpine.start()
// Show progress bar on live navigation and form submits
topbar.config({ barColors: { 0: '#29d' }, shadowColor: 'rgba(0, 0, 0, .3)' })
window.addEventListener('phx:page-loading-start', info => topbar.show())
@ -53,6 +57,12 @@ liveSocket.connect()
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket
// alpine.js
window.Alpine = Alpine
Alpine.start()
// Copy to clipboard
window.addEventListener('lokal:clipcopy', (event) => {
if ('clipboard' in navigator) {
const text = event.target.textContent
navigator.clipboard.writeText(text)
} else {
window.alert('Sorry, your browser does not support clipboard copy.')
}
})