bootstrap-slider-rails 5.2.6 → 5.3.0

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: 34b81a5c1cb167b3ca99d691c5f2ac770abf4c1b
4
- data.tar.gz: 51e40d5659395c2f7911994da9dcd65321a65866
3
+ metadata.gz: a4b8db8799a1c5aa754e789c56b52e2244a0718e
4
+ data.tar.gz: c8f20ca0e18a05982901bcb487fd4413686d1a93
5
5
  SHA512:
6
- metadata.gz: 5c5e05498aa92919bb0416926274ec7d71a6b4f71c73f092969758f45125712dfeb6e5827a5366b04a6b602c51c7fdd21926fea4235a82be5309fe9f6cb56719
7
- data.tar.gz: 66d17a80d30faebaf6fde7462f22eef88a73258e5423da0d211e546a92f8254014e0252ce37bdd6ae50e5f6afcf95ee3cb975679cd2c7f38dafd69cc46fa5ed2
6
+ metadata.gz: 8d7a9f4427967117befa03d22e5d1511938ad6c58073f73fe2154c028925e90cc12b22be46819bb37bd0f0936d0efbd68b117791ec630ec655aea3b5a9aeed4b
7
+ data.tar.gz: 104ba5f7727a4cfddb2ccfb0d65b934549423908f3da0f880fd8047e3ad12acb728397483a2263f4fc0b3262792f84e130cf4791a97848ae9070a88b2e6910da
data/Dockerfile CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  # ~~~~ Image base ~~~~
7
7
  # Base image with the latest Ruby only
8
- FROM litaio/ruby:2.2.2
8
+ FROM ruby:2.2.3
9
9
  MAINTAINER Guillaume Hain zedtux@zedroot.org
10
10
 
11
11
 
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require 'bundler/gem_tasks'
2
2
  require 'fileutils'
3
3
 
4
4
  desc 'Update the Bootstrap-slider Javascript and CSS files'
5
- task :update_slider do
6
- def download_slider(version)
5
+ task :update do
6
+ def download(version)
7
7
  base_url = 'https://raw.githubusercontent.com/seiyria/bootstrap-slider'
8
8
  puts "Downlading Bootstrap-slider #{version} ..."
9
9
  `curl -o vendor/assets/javascripts/bootstrap-slider.js \
@@ -14,6 +14,6 @@ task :update_slider do
14
14
 
15
15
  FileUtils.mkdir_p('vendor/assets/javascripts')
16
16
  FileUtils.mkdir_p('vendor/assets/stylesheets')
17
- download_slider(BootstrapSlider::Rails::VERSION)
17
+ download(BootstrapSlider::Rails::VERSION)
18
18
  puts "\e[32mDone!\e[0m"
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module BootstrapSlider
2
2
  module Rails
3
- VERSION = '5.2.6'
3
+ VERSION = '5.3.0'
4
4
  end
5
5
  end
@@ -416,14 +416,33 @@
416
416
 
417
417
  sliderMinHandle = document.createElement("div");
418
418
  sliderMinHandle.className = "slider-handle min-slider-handle";
419
+ sliderMinHandle.setAttribute('role', 'slider');
420
+ sliderMinHandle.setAttribute('aria-valuemin', this.options.min);
421
+ sliderMinHandle.setAttribute('aria-valuemax', this.options.max);
419
422
 
420
423
  sliderMaxHandle = document.createElement("div");
421
424
  sliderMaxHandle.className = "slider-handle max-slider-handle";
425
+ sliderMaxHandle.setAttribute('role', 'slider');
426
+ sliderMaxHandle.setAttribute('aria-valuemin', this.options.min);
427
+ sliderMaxHandle.setAttribute('aria-valuemax', this.options.max);
422
428
 
423
429
  sliderTrack.appendChild(sliderTrackLow);
424
430
  sliderTrack.appendChild(sliderTrackSelection);
425
431
  sliderTrack.appendChild(sliderTrackHigh);
426
432
 
433
+ /* Add aria-labelledby to handle's */
434
+ var isLabelledbyArray = Array.isArray(this.options.labelledby);
435
+ if (isLabelledbyArray && this.options.labelledby[0]) {
436
+ sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby[0]);
437
+ }
438
+ if (isLabelledbyArray && this.options.labelledby[1]) {
439
+ sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby[1]);
440
+ }
441
+ if (!isLabelledbyArray && this.options.labelledby) {
442
+ sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby);
443
+ sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby);
444
+ }
445
+
427
446
  /* Create ticks */
428
447
  this.ticks = [];
429
448
  if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
@@ -474,14 +493,17 @@
474
493
  /* Create tooltip elements */
475
494
  var sliderTooltip = document.createElement("div");
476
495
  sliderTooltip.className = "tooltip tooltip-main";
496
+ sliderTooltip.setAttribute('role', 'presentation');
477
497
  createAndAppendTooltipSubElements(sliderTooltip);
478
498
 
479
499
  var sliderTooltipMin = document.createElement("div");
480
500
  sliderTooltipMin.className = "tooltip tooltip-min";
501
+ sliderTooltipMin.setAttribute('role', 'presentation');
481
502
  createAndAppendTooltipSubElements(sliderTooltipMin);
482
503
 
483
504
  var sliderTooltipMax = document.createElement("div");
484
505
  sliderTooltipMax.className = "tooltip tooltip-max";
506
+ sliderTooltipMax.setAttribute('role', 'presentation');
485
507
  createAndAppendTooltipSubElements(sliderTooltipMax);
486
508
 
487
509
 
@@ -730,7 +752,8 @@
730
752
  ticks_snap_bounds: 0,
731
753
  scale: 'linear',
732
754
  focus: false,
733
- tooltip_position: null
755
+ tooltip_position: null,
756
+ labelledby: null
734
757
  },
735
758
 
736
759
  getElement: function() {
@@ -985,7 +1008,10 @@
985
1008
  }
986
1009
 
987
1010
  this.handle1.style[this.stylePos] = positionPercentages[0]+'%';
1011
+ this.handle1.setAttribute('aria-valuenow', this._state.value[0]);
1012
+
988
1013
  this.handle2.style[this.stylePos] = positionPercentages[1]+'%';
1014
+ this.handle2.setAttribute('aria-valuenow', this._state.value[1]);
989
1015
 
990
1016
  /* Position ticks and labels */
991
1017
  if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
@@ -1000,7 +1026,7 @@
1000
1026
  if (this.options.orientation !== 'vertical') {
1001
1027
  this.tickLabelContainer.style[styleMargin] = -labelSize/2 + 'px';
1002
1028
  }
1003
-
1029
+
1004
1030
  extraMargin = this.tickLabelContainer.offsetHeight;
1005
1031
  } else {
1006
1032
  /* Chidren are position absolute, calculate height by finding the max offsetHeight of a child */
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-slider-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.6
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedr Browne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-03 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.4.8
99
+ rubygems_version: 2.5.0
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: This Gem integrates Seiyara's fork of Bootstrap Slider with Rails, exposing