kaerus-component-slideshow 0.0.13 → 0.0.14

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: 4818e037339369aebd2aef3fadfff07ab157129f
4
- data.tar.gz: 5af561d86b376a94c65a11016a60d83915662dac
3
+ metadata.gz: 2579d55f78d036cf38f956257d2141511ee7b3fd
4
+ data.tar.gz: 0d9c8127be31a4caa6cf1beb6be8aaeb2e261b01
5
5
  SHA512:
6
- metadata.gz: 8a6b79cd920d6b07e5d88b3389d77367c7dbe5f30abc64cbf500945a5bd73afbb72be68bd2e1fc14d9c1305cfbe785522207d39e147e5fd30d7a51a0d4cc710e
7
- data.tar.gz: bf0fcfdff82dbf32e1ac56c20af6067808897fdc5da9c7b88e2558b52bbc133444c1e6210c37570cd162a05e4aac6b41868694de2efff023925d46c54c46a8ef
6
+ metadata.gz: 5e594ddeb832590b703c2f311765446befb46cd6c931e7bbb869389576a93ee38aac55b173e73ece346979e64bf6e979a8ff9a7a7cdd22f797022643f5a4e725
7
+ data.tar.gz: b64bd8c36e17e7e1b589b3180c6960ddee56caf43807fab4e5190482b503ca97a077cd758cea3046c115d293c39b104823c414abb16d8adddee0047eb01a858c
@@ -1,7 +1,7 @@
1
1
  module Kaerus
2
2
  module Component
3
3
  module Slideshow
4
- VERSION = "0.0.13"
4
+ VERSION = "0.0.14"
5
5
  end
6
6
  end
7
7
  end
@@ -64,7 +64,6 @@ require.aliases = {};
64
64
 
65
65
  require.resolve = function(path) {
66
66
  if (path.charAt(0) === '/') path = path.slice(1);
67
- var index = path + '/index.js';
68
67
 
69
68
  var paths = [
70
69
  path,
@@ -77,10 +76,7 @@ require.resolve = function(path) {
77
76
  for (var i = 0; i < paths.length; i++) {
78
77
  var path = paths[i];
79
78
  if (require.modules.hasOwnProperty(path)) return path;
80
- }
81
-
82
- if (require.aliases.hasOwnProperty(index)) {
83
- return require.aliases[index];
79
+ if (require.aliases.hasOwnProperty(path)) return require.aliases[path];
84
80
  }
85
81
  };
86
82
 
@@ -228,9 +224,9 @@ function Carousel(container,tag) {
228
224
  }
229
225
 
230
226
  /* clone some nodes if we have to few slides */
231
- var min_slides = 4;
227
+ var min_slides = 3;
232
228
 
233
- if(nodes.length === 3) min_slides = 6;
229
+ if(nodes.length === 2) min_slides = 4;
234
230
 
235
231
  for(var i = 0; nodes.length < min_slides; i++){
236
232
  nodes[nodes.length] = nodes[i].cloneNode(true);
@@ -320,13 +316,6 @@ Carousel.prototype.prev = function(){
320
316
  return this;
321
317
  }
322
318
 
323
- Carousel.prototype.getSlide = function(offset, pos){
324
- var index = pos !== undefined ? offset : this.index,
325
- slide = cap(this.slides.length,offset+pos);
326
-
327
- return this.slides[slide];
328
- }
329
-
330
319
  Carousel.prototype.transit = function(index,from){
331
320
 
332
321
  clearClass(this.slides,[ACTIVE_SLIDE,NEXT_SLIDE,PREVIOUS_SLIDE]);
@@ -507,6 +496,7 @@ function Slideshow(container,options){
507
496
  template: template,
508
497
  next:'&rang;',
509
498
  prev:'&lang;',
499
+ auto: true,
510
500
  time: 4000,
511
501
  transition: ['all','1s', 'linear'],
512
502
  beforeTransit: undefined,
@@ -533,7 +523,7 @@ function Slideshow(container,options){
533
523
  var settings = this.settings,
534
524
  id = settings.id,
535
525
  slides = '\n',
536
- dots = '\n',
526
+ navItems = '\n',
537
527
  navId = id + '-nav',
538
528
  childs = container.childNodes;
539
529
 
@@ -541,7 +531,7 @@ function Slideshow(container,options){
541
531
  for(var i = 0, n = 0, l = childs.length; i < l; i++){
542
532
  if(childs[i].nodeType === 1){
543
533
  slides+= '<div id="'+ id + '-s' + n + '">' + childs[i].outerHTML + '</div>\n';
544
- dots+='<li class="dot" id="' + navId + n + '"></li>\n';
534
+ navItems+='<li class="navItem" id="' + navId + n + '"></li>\n';
545
535
  n++;
546
536
  }
547
537
  }
@@ -553,7 +543,7 @@ function Slideshow(container,options){
553
543
  case "{slides}": return slides;
554
544
  case "{next}": return settings.next;
555
545
  case "{prev}": return settings.prev;
556
- case "{nav}": return dots;
546
+ case "{nav}": return navItems;
557
547
  }
558
548
  });
559
549
 
@@ -571,12 +561,17 @@ function Slideshow(container,options){
571
561
 
572
562
  this.slides = this.carousel.slides;
573
563
 
574
- attachHandlers(this);
564
+ attachHandlers(this);
565
+
566
+ /* autostart on initialization */
567
+ if(this.settings.auto !== false){
568
+ this.start(this.settings.auto === true ? 0 : this.settings.auto);
569
+ }
575
570
 
576
571
  return this;
577
572
  },
578
- start: function(){
579
- this.carousel.start(0,this.settings.time);
573
+ start: function(index){
574
+ this.carousel.start(index,this.settings.time);
580
575
 
581
576
  return this;
582
577
  },
@@ -710,10 +705,8 @@ function Slideshow(container,options){
710
705
  transition = settings.transition,
711
706
  beforeTransit = settings.beforeTransit,
712
707
  afterTransit = settings.afterTransit,
713
- dots = nav.getElementsByTagName('li'),
714
- ix, fx, lx = dots.length,
715
- prev, next, show,
716
- width = slideshow.width;
708
+ navItems = nav.getElementsByTagName('li'),
709
+ ix, fx, lx = navItems.length;
717
710
 
718
711
  slideshow.carousel.onChange = function(index,from){
719
712
  ix = index % lx;
@@ -723,7 +716,7 @@ function Slideshow(container,options){
723
716
  beforeTransit(ix, slideshow);
724
717
 
725
718
  if(from !== undefined){
726
- dots[fx].className = "dot";
719
+ navItems[fx].className = "navItem";
727
720
  /* apply transitions after first slide */
728
721
  /* to avoid animations on startup */
729
722
  if(!slideshow.hasTransitions){
@@ -732,23 +725,7 @@ function Slideshow(container,options){
732
725
  }
733
726
  }
734
727
 
735
- dots[ix].className = "active dot";
736
-
737
- prev = slideshow.carousel.getSlide(from,-1);
738
- next = slideshow.carousel.getSlide(from,1);
739
- show = slideshow.carousel.getSlide(from,0);
740
-
741
- applyStyle(prev,'transform','translate3d(0, 0, 0)');
742
- applyStyle(next,'transform','translate3d(0, 0, 0)');
743
- applyStyle(show,'transform','translate3d(0, 0, 0)');
744
-
745
- prev = slideshow.carousel.getSlide(index,-1);
746
- next = slideshow.carousel.getSlide(index,1);
747
- show = slideshow.carousel.getSlide(index,0);
748
-
749
- applyStyle(prev,'transform','translate3d(-' + settings.width + 'px, 0, 0)');
750
- applyStyle(next,'transform','translate3d(' + settings.width + 'px, 0, 0)');
751
- applyStyle(show,'transform','translate3d(0, 0, 0)');
728
+ navItems[ix].className = "active navItem";
752
729
 
753
730
  slideshow.carousel.transit(index,from);
754
731
  }
@@ -765,7 +742,6 @@ function Slideshow(container,options){
765
742
  }
766
743
 
767
744
  applyStyle(elems,'transition',transition);
768
- applyStyle(elems,'transform','translate3d(0, 0, 0)');
769
745
  }
770
746
 
771
747
  function addTransitionEndHandler(elem){
@@ -822,15 +798,15 @@ module.exports = Slideshow;
822
798
  require.register("slideshow/template.js", function(exports, require, module){
823
799
  module.exports = '<div class="slides" id="{id}-slides">{slides}</div>\n<div class="nextSlide" id="{id}-next">{next}</div>\n<div class="prevSlide" id="{id}-prev">{prev}</div>\n<div class="navSlide" id="{id}-nav"><ul>{nav}</ul></div>\n ';
824
800
  });
801
+
802
+
825
803
  require.alias("kaerus-component-carousel/index.js", "slideshow/deps/carousel/index.js");
826
804
  require.alias("kaerus-component-carousel/index.js", "carousel/index.js");
827
805
 
828
806
  require.alias("pgherveou-prefix/index.js", "slideshow/deps/prefix/index.js");
829
807
  require.alias("pgherveou-prefix/index.js", "slideshow/deps/prefix/index.js");
830
808
  require.alias("pgherveou-prefix/index.js", "prefix/index.js");
831
- require.alias("pgherveou-prefix/index.js", "pgherveou-prefix/index.js");
832
-
833
- if (typeof exports == "object") {
809
+ require.alias("pgherveou-prefix/index.js", "pgherveou-prefix/index.js");if (typeof exports == "object") {
834
810
  module.exports = require("slideshow");
835
811
  } else if (typeof define == "function" && define.amd) {
836
812
  define(function(){ return require("slideshow"); });
@@ -4,90 +4,15 @@
4
4
  position: relative;
5
5
  overflow: hidden;
6
6
  color: white;
7
- -webkit-user-select: none;
8
- -moz-user-select: none;
9
- -ms-user-select: none;
10
- -o-user-select: none;
11
- user-select: none;
12
- }
13
-
14
- .slideshow .nextSlide,
15
- .slideshow .prevSlide {
16
- cursor: pointer;
17
- display: inline-block;
18
- position: absolute;
19
- top:0;
20
- bottom: 0;
21
- margin: auto;
22
- line-height: 2.6em;
23
- width: 2.5em;
24
- height: 2.5em;
25
- text-align: center;
26
- border-radius: 2em;
27
- color: black;
28
- background: white;
29
- background-color: white;
30
- -webkit-border-radius: 2em;
31
- -moz-border-radius: 2em;
32
- -ms-border-radius: 2em;
33
- -o-border-radius: 2em;
34
- border-radius: 2em;
35
- z-index: 9999;
36
- }
37
-
38
- .slideshow .nextSlide {
39
- right: 2em;
40
- }
41
-
42
- .slideshow .prevSlide {
43
- left: 2em;
44
- }
45
-
46
- .slideshow .navSlide {
47
- font-size: 2em;
48
- position: absolute;
49
- bottom: 0;
50
- width: 100%;
51
- color: white;
52
- color: rgba(255,255,255,0.5);
53
- z-index: 9999;
54
- }
55
-
56
- .slideshow .navSlide .dot {
57
- width: 0.5em;
58
- text-align: center;
59
- display: inline-block;
60
- list-style-type: none;
61
- }
62
-
63
- .slideshow .navSlide .dot:before {
64
- content: "\0025cb";
65
- }
66
-
67
- .slideshow .navSlide .dot.active:before {
68
- content: "\0025cf";
69
- }
70
-
71
- .slideshow .navSlide ul{
72
- padding-top: 1em;
73
- text-align: center;
74
- margin: 0 auto;
75
- padding-start: 0;
76
- -o-padding-start: 0;
77
- -moz-padding-start: 0;
78
- -webkit-padding-start: 0;
79
7
  }
80
8
 
81
9
  .slideshow .slides .slide{
82
10
  position: absolute;
83
11
  overflow: hidden;
84
- display: none;
12
+ visibility: hidden;
85
13
  width: 100%;
86
14
  height: 100%;
87
- padding: 0;
88
- margin: 0;
89
- top: 0;
90
- left: 0;
15
+ z-index: 0;
91
16
  }
92
17
 
93
18
  .slideshow .slides .slide img {
@@ -95,15 +20,14 @@
95
20
  height: 100%;
96
21
  }
97
22
 
98
- .slideshow .slides .slide .caption {
99
- position: absolute;
100
- display: block;
101
- left: 2em;
102
- top: 2em;
103
- }
104
23
 
105
24
  .slideshow .slides .slide.prev,
106
25
  .slideshow .slides .slide.next,
107
26
  .slideshow .slides .slide.show {
108
- display: block;
27
+ z-index: 1;
28
+ }
29
+
30
+ .slideshow .slides .slide.show {
31
+ visibility: visible;
32
+ z-index: 2;
109
33
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaerus-component-slideshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anders Elo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-22 00:00:00.000000000 Z
11
+ date: 2013-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.0.3
86
+ rubygems_version: 2.0.0
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Created as a component.js module