effective_bootstrap 0.10.3 → 0.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap/reveal_mail_to.js +12 -0
- data/app/assets/javascripts/effective_bootstrap/tabs.js +6 -6
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/helpers/effective_bootstrap_helper.rb +7 -2
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ba2eb5dbf37fdf09730ef6cfb8c37ab0897ed37b7a0089b1128d63a97e0cce9
|
4
|
+
data.tar.gz: 1a35f8b75f1ba029541d35b56cc74ca5b94274e367ccf6515b896c14cdf505a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82d3bd6f546c27a1291b7fa38c659a81cd7e601cf5cbcb16def771d09728ad44929faa58abe1de332b812dbe2a95e08ffac6c6b26cc84327d5fb5df46cd0758a
|
7
|
+
data.tar.gz: 576b9152be489de519cc2cee490ff5f6d340f53bc023a1f4f087f398462a7101ed5180f293225ac9cdcb8923c2e3d38d1dd610f8abbf6967c3db57460190225a
|
@@ -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,13 +3,13 @@ $(document).ready(function() {
|
|
3
3
|
|
4
4
|
if ($tab_with_error.length > 0) {
|
5
5
|
$(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
|
6
|
-
|
7
|
-
var $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
|
6
|
+
return true;
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
} else if (document.location.search.length > 0) {
|
9
|
+
var tab = new URLSearchParams(document.location.search).get('tab');
|
10
|
+
if(tab.length == 0) { return false; }
|
11
|
+
|
12
|
+
$('.nav.nav-tabs').find("a[href^='#" + tab + "']").tab('show');
|
13
13
|
}
|
14
14
|
});
|
15
15
|
|
@@ -105,7 +105,7 @@ module EffectiveBootstrapHelper
|
|
105
105
|
def collapse(label, opts = {}, &block)
|
106
106
|
raise 'expected a block' unless block_given?
|
107
107
|
|
108
|
-
return
|
108
|
+
return accordion_collapse(label, opts, &block) if @_accordion_active
|
109
109
|
|
110
110
|
id = "collapse-#{effective_bootstrap_unique_id}"
|
111
111
|
show = (opts.delete(:show) == true)
|
@@ -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
|
|
@@ -487,7 +492,7 @@ module EffectiveBootstrapHelper
|
|
487
492
|
raise 'expected a block' unless block_given?
|
488
493
|
|
489
494
|
@_tab_mode = :tablist
|
490
|
-
@_tab_active =
|
495
|
+
@_tab_active = :first if active.nil?
|
491
496
|
@_tab_unique = effective_bootstrap_unique_id if unique
|
492
497
|
|
493
498
|
content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) do
|
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.
|
4
|
+
version: 0.10.6
|
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-
|
11
|
+
date: 2022-03-28 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
|