va_common 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: f135ca8a4acbd32342b3569db96fe27c3053bf0b
4
- data.tar.gz: 914008f8c921653e69af17935d74bfed60ae1356
3
+ metadata.gz: 24b5e3e5cf54c3312067db5876f88cb87cda3717
4
+ data.tar.gz: 7f22c91152fca0ad4a0cd63bd192633444cdcfee
5
5
  SHA512:
6
- metadata.gz: 81fcd86145203a60e5c6f5c4f2d28a73aa33b653b388397c63f7f684ed56ac038c08f36e5206fc73ca6d75754856056789b98157824b7ebf7087a672d38b4c07
7
- data.tar.gz: db3c0a8458ef047efd508ce810f9fbffa73227546c4b9fd74651749609680f57b8279887ec7c755fb01d514e65159491294536718fffbb5af946d89981ada732
6
+ metadata.gz: dfb414d373c47225cd8ea9c652000047f233d894395a9537641acaf148d0d4d67889632f354d576977ae8aad36b189e1f0b3d9cc91fd2360928097ddaa5f1657
7
+ data.tar.gz: 6c3fb535be3b9e914e874064394b7dd7ceacf55399953671cc43ce50d462dba22721f23f4154ff69e1435dbf63cb645559ad968e24013a7dead4dc1aefad5327
@@ -0,0 +1,75 @@
1
+ $(document).ready(function(){
2
+
3
+ /*
4
+ * jQuery accessible simple (non-modal) tooltip window, using ARIA
5
+ * Website: http://a11y.nicolas-hoffmann.net/simple-tooltip/
6
+ * License MIT: https://github.com/nico3333fr/jquery-accessible-simple-tooltip-aria/blob/master/LICENSE
7
+ */
8
+
9
+ // loading tooltip ------------------------------------------------------------------------------------------------------------
10
+ // init
11
+ $js_simple_tooltips = $('.js-simple-tooltip');
12
+ if ( $js_simple_tooltips.length ) { // if there are at least one :)
13
+
14
+ $js_simple_tooltips.each( function(index_to_expand) {
15
+ var $this = $(this) ,
16
+ index_lisible = index_to_expand+1,
17
+ options = $this.data(),
18
+ $tooltip_text = options.simpletooltipText || '',
19
+ $tooltip_prefix_class = typeof options.simpletooltipPrefixClass !== 'undefined' ? options.simpletooltipPrefixClass + '-' : '',
20
+ $tooltip_content_id = typeof options.simpletooltipContentId !== 'undefined' ? '#' + options.simpletooltipContentId : '',
21
+ $tooltip_code;
22
+
23
+ $this.attr({
24
+ 'aria-describedby' : 'label_simpletooltip_' + index_lisible
25
+ });
26
+
27
+ $this.wrap( '<span class="' + $tooltip_prefix_class + 'simpletooltip_container"></span>' );
28
+
29
+ $tooltip_code = '<span class="js-simpletooltip ' + $tooltip_prefix_class + 'simpletooltip" id="label_simpletooltip_' + index_lisible + '" role="tooltip" aria-hidden="true">';
30
+ if ( $tooltip_text !== '' ) {
31
+ $tooltip_code += '' + $tooltip_text + '';
32
+ }
33
+ else {
34
+ if ( $tooltip_content_id !== '' && $($tooltip_content_id).length ) {
35
+ $tooltip_code += $($tooltip_content_id).html();
36
+ }
37
+ }
38
+ $tooltip_code += '</span>';
39
+
40
+ $( $tooltip_code ).insertAfter($this);
41
+
42
+ });
43
+
44
+
45
+ // events ------------------
46
+ $( 'body' ).on( 'mouseenter focusin', '.js-simple-tooltip', function( event ) {
47
+ var $this = $(this),
48
+ $tooltip_to_show = $('#' + $this.attr( 'aria-describedby' ));
49
+
50
+ $tooltip_to_show.attr( 'aria-hidden', 'false');
51
+
52
+ })
53
+ .on( "mouseleave focusout", ".js-simple-tooltip", function( event ) {
54
+ var $this = $(this),
55
+ $tooltip_to_show = $('#' + $this.attr( 'aria-describedby' ));
56
+
57
+ $tooltip_to_show.attr( 'aria-hidden', 'true');
58
+ });
59
+
60
+ // close esc key
61
+ $( 'body' ).on( "keydown", ".js-simple-tooltip", function( event ) {
62
+ var $this = $(this),
63
+ $tooltip_to_show = $('#' + $this.attr( 'aria-describedby' ));
64
+
65
+ if ( event.keyCode == 27 ) { // esc
66
+ $tooltip_to_show.attr( 'aria-hidden', 'true');
67
+ }
68
+
69
+ });
70
+
71
+
72
+ }
73
+
74
+
75
+ });