copy_tuner_client 0.14.1 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b43b5c8067dd3666dccb82ed7a98df2ba4bc062c3f12d540fecfe74ac7988b72
4
- data.tar.gz: 49d07a02e6f7db85afc39cf7bde5453231fe2ba112e29a7ed10581a4890d39dc
3
+ metadata.gz: 26adaa006e804e9c509487d5b7828552870c6009b99d7aee76a3762458d2395e
4
+ data.tar.gz: 37e7dc18874e645182753e0901ffc66290c6900beeb40901c3517b46592ec8de
5
5
  SHA512:
6
- metadata.gz: 4342ff5bea8a937980ab0e0656ae273d533803a07167c383761456addb425cadbe9712cfc0327474f8e4d35d04523bf5839c5dcb347a818aca4fdca33c36e9be
7
- data.tar.gz: 0a8553e3ca6cf15b6a41c4ab4bc9e6b8c0150e8025c379d2fab9aa46618a6c960799fa8efada1b00a32ee2864a44c043c1282e7deace4019489aa0a1f62d1380
6
+ metadata.gz: fee3134bfc9dedd074a545d91f3ace4d0edb4e5d299a5c33cd055a77249c769e2dc0bb3fa67091c843c62a13f54100a61cb9753cf18b95c330335f513617a26d
7
+ data.tar.gz: a39cd58e37c7c062916a27044c9aba40d1f0dc82c5acfe3404ac4e2961e41de91dc94a7e8ab829a91e6b6b8c07cde211f99669c5306d6be1de187637d09973ab
@@ -368,6 +368,7 @@ const start = () => {
368
368
  const { url, data } = window.CopyTuner;
369
369
  appendCopyTunerBar(url);
370
370
  const copyray2 = new Copyray(url, data);
371
+ window.CopyTuner.toggle = () => copyray2.toggle();
371
372
  document.addEventListener("keydown", (event) => {
372
373
  if (copyray2.isShowing && ["Escape", "Esc"].includes(event.key)) {
373
374
  copyray2.hide();
@@ -5,12 +5,10 @@ module CopyTunerClient
5
5
  # Becomes:
6
6
  # <!--COPYRAY views.home.index.message-->message
7
7
  def self.augment_template(source, key)
8
- augmented = if source.present?
9
- escape = CopyTunerClient.configuration.html_escape && !source.html_safe?
10
- "<!--COPYRAY #{key}-->#{escape ? ERB::Util.html_escape(source) : source}"
11
- else
12
- source
13
- end
8
+ return source if source.blank? || !source.is_a?(String)
9
+
10
+ escape = CopyTunerClient.configuration.html_escape && !source.html_safe?
11
+ augmented = "<!--COPYRAY #{key}-->#{escape ? ERB::Util.html_escape(source) : source}"
14
12
  augmented.html_safe
15
13
  end
16
14
  end
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.14.1'.freeze
3
+ VERSION = '0.14.2'.freeze
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
data/src/main.ts CHANGED
@@ -6,6 +6,7 @@ declare global {
6
6
  interface Window {
7
7
  CopyTuner: {
8
8
  url: string
9
+ toggle?: () => void
9
10
  // TODO: type
10
11
  data: object
11
12
  }
@@ -33,6 +34,7 @@ const start = () => {
33
34
 
34
35
  appendCopyTunerBar(url)
35
36
  const copyray = new Copyray(url, data)
37
+ window.CopyTuner.toggle = () => copyray.toggle()
36
38
 
37
39
  document.addEventListener('keydown', (event) => {
38
40
  // @ts-expect-error TS2339
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_tuner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SonicGarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n