scrollytelling-counter 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35cd95942dcabc85332e75a0f03c35a218112ce5
|
4
|
+
data.tar.gz: b492d325261f30819a53dba6586aa346990bcb90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86e1c0802dd9f249dec2d032893c4f7305c2b27d2de0bba156f1fe1065e115072b186a9dc58c08aef4f9836ae1434ec97fce7c6e3285f7d5b581e97909e18d3
|
7
|
+
data.tar.gz: 3063d8a71666bf167573dc355942e4fc62dc6d993cd0c8ddb06491b9598d7ff3a32eb06cd5e8fe1be628648bcbbc5a92cf620af7ccdd4376efa74e2a5a6db0ab
|
data/README.md
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
<script>
|
2
|
+
pageflow.Counter = {
|
3
|
+
placeAfter: $('.options li:first-child'),
|
4
|
+
counter: $('<li class="counter"></li>'),
|
5
|
+
total: pageflow.pages.length,
|
6
|
+
|
7
|
+
init: function() {
|
8
|
+
this.placeAfter.after(this.counter);
|
9
|
+
|
10
|
+
// Init first page
|
11
|
+
this.setCounter(pageflow.atmo.slideshow.currentPage().index());
|
12
|
+
|
13
|
+
// Listen to page changes
|
14
|
+
pageflow.events.on('page:change', this.updateCounter.bind(this));
|
15
|
+
},
|
16
|
+
|
17
|
+
setCounter: function(index) {
|
18
|
+
var pageNumber = index + 1;
|
19
|
+
this.counter.html(pageNumber + " | " + this.total);
|
20
|
+
},
|
21
|
+
|
22
|
+
updateCounter: function(page) {
|
23
|
+
this.setCounter(page.index)
|
24
|
+
}
|
25
|
+
};
|
26
|
+
|
27
|
+
pageflow.Counter.init();
|
28
|
+
</script>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrollytelling-counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Baaij
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- Rakefile
|
68
68
|
- app/assets/javascript/scrollytelling/counter.js
|
69
69
|
- app/assets/stylesheets/scrollytelling/counter.scss
|
70
|
+
- app/views/scrollytelling/counter/widget.html.erb
|
70
71
|
- bin/console
|
71
72
|
- bin/setup
|
72
73
|
- lib/scrollytelling/counter.rb
|