effective_bootstrap 0.10.3 → 0.10.4

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: ab58cb9ff09bb4d53ce47b37f1db3cf508d8e444d72fddb97ca866e2690d9f6a
4
- data.tar.gz: 3979d703db18b9b0df9fc8a27b116ac03e135733e3133623edc1079bbb4616dd
3
+ metadata.gz: ce183f7b5ec8710057b26c596d126df576635f2f056c2b5f691c817aa043d49d
4
+ data.tar.gz: 2e4697f95f477939c744e6fd7e7e44426f15975b192fae10c7061baaab384096
5
5
  SHA512:
6
- metadata.gz: 68b4fef7ed6d28496b22022df65da88723b666e858edc0798dbfdded29bea2758aad1c80d9ebda1bfed47b1f59e0bf5837755e12e24b663ad38a33daa965b6e8
7
- data.tar.gz: 7017b3cce94f970274d7fe9b12ae0b0e94e3fbf63bb2493e0ff67f44c36c1b6d53bec1c5836d2921f1189f20d309207279285dc76df6a33e0ab44df83ab76c61
6
+ metadata.gz: bf040655168c88bfe628a87182d061147ecc7b82554e268fa9b1ac75cbbf2cdb911326642c730a568d60438762cb71da7fcdc57f2f46622bf40f99d8051d9392
7
+ data.tar.gz: 01ab704d07b028abc72d72311e6ac090bc68de56993c1be93d8b74945d8cccb560275d50ba71fcdfb798834cb99f07ee615f378c262236a284791bdf6f98fc78
@@ -0,0 +1,12 @@
1
+ // reveal_mail_to
2
+ $(document).on('click', '[data-mailto-rot13]', function(event) {
3
+ event.preventDefault();
4
+
5
+ var $link = $(event.currentTarget);
6
+
7
+ var email = $link.data('mailto-rot13').replace(/[a-zA-Z]/g, function(c) {
8
+ return String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
9
+ });
10
+
11
+ $link.attr('href', 'mailto:' + email).html(email).removeAttr('data-mailto-rot13');
12
+ });
@@ -3,6 +3,7 @@
3
3
  //= require ./effective_bootstrap/form
4
4
  //= require ./effective_bootstrap/logic
5
5
  //= require ./effective_bootstrap/other
6
+ //= require ./effective_bootstrap/reveal_mail_to
6
7
  //= require ./effective_bootstrap/tabs
7
8
 
8
9
  //= require ./effective_datetime/input
@@ -470,6 +470,11 @@ module EffectiveBootstrapHelper
470
470
  # Let Kaminari override this method.
471
471
  alias_method(:paginate, :bootstrap_paginate) unless (respond_to?(:paginate) || defined?(Kaminari))
472
472
 
473
+ def reveal_mail_to(email)
474
+ raise('expected an email') unless email.kind_of?(String) && email.include?('@')
475
+ link_to 'Click to reveal email', '#', 'data-mailto-rot13' => email.tr('A-Za-z', 'N-ZA-Mn-za-m')
476
+ end
477
+
473
478
  # Tabs DSL
474
479
  # Inserts both the tablist and the tabpanel
475
480
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.10.3'.freeze
2
+ VERSION = '0.10.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -428,6 +428,7 @@ files:
428
428
  - app/assets/javascripts/effective_bootstrap/form.js.coffee
429
429
  - app/assets/javascripts/effective_bootstrap/logic.js.coffee
430
430
  - app/assets/javascripts/effective_bootstrap/other.js.coffee
431
+ - app/assets/javascripts/effective_bootstrap/reveal_mail_to.js
431
432
  - app/assets/javascripts/effective_bootstrap/tabs.js
432
433
  - app/assets/javascripts/effective_bootstrap_editor.js
433
434
  - app/assets/javascripts/effective_checks/initialize.js.coffee