lato 3.11.12 → 3.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7baced60fcb66e212666ae63936af3b4ac2e251e6f8aff2cedc08888defe3cde
|
4
|
+
data.tar.gz: 81bf058b8f8e0c9cd84ca0508e0747bf4fc7d1e9cdb49c2a6d96c36392985743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0765b08353b74ad25b94c4dc31f905949ab0b02ff5aa47abf85d9f48cc68cda9cbccf4a4970bc4f46d7db9c062469a320e76df5dd182d979e6d9a1c04d01a50
|
7
|
+
data.tar.gz: 2864f98cdb5082b304aed65a45b9394be794a37229fbf1b511cdb253d9b614c4baae26ec5c1219584563a1d642de015f70bc22a3c6cb8250c92e217a2dfe432d
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [
|
5
|
+
'input',
|
6
|
+
'button'
|
7
|
+
]
|
8
|
+
|
9
|
+
connect() {
|
10
|
+
if (this.hasButtonTarget) {
|
11
|
+
this.buttonTargetOriginalHTML = this.buttonTarget.innerHTML
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
onButtonClick(e) {
|
16
|
+
e.preventDefault()
|
17
|
+
|
18
|
+
this.copy()
|
19
|
+
}
|
20
|
+
|
21
|
+
copy() {
|
22
|
+
if (!this.hasInputTarget) return
|
23
|
+
|
24
|
+
// Copy the text inside the text field
|
25
|
+
this.inputTarget.select()
|
26
|
+
this.inputTarget.setSelectionRange(0, 99999) // For mobile devices
|
27
|
+
|
28
|
+
// Copy the text inside the text field
|
29
|
+
navigator.clipboard.writeText(this.inputTarget.value)
|
30
|
+
|
31
|
+
// Manage button state
|
32
|
+
if (this.hasButtonTarget) {
|
33
|
+
this.buttonTarget.innerHTML = this.buttonTarget.dataset.copyText || 'Copied!'
|
34
|
+
|
35
|
+
if (this._copyTimeout) clearTimeout(this._copyTimeout)
|
36
|
+
this._copyTimeout = setTimeout(() => {
|
37
|
+
this.buttonTarget.innerHTML = this.buttonTargetOriginalHTML
|
38
|
+
}, 2000)
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
data/lib/lato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.11.
|
4
|
+
version: 3.11.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- app/assets/javascripts/lato/controllers/lato_action_controller.js
|
159
159
|
- app/assets/javascripts/lato/controllers/lato_aside_opener_controller.js
|
160
160
|
- app/assets/javascripts/lato/controllers/lato_confirm_controller.js
|
161
|
+
- app/assets/javascripts/lato/controllers/lato_copyclip_controller.js
|
161
162
|
- app/assets/javascripts/lato/controllers/lato_feedback_controller.js
|
162
163
|
- app/assets/javascripts/lato/controllers/lato_form_controller.js
|
163
164
|
- app/assets/javascripts/lato/controllers/lato_guide_controller.js
|