octopress-littlefoot 1.0.1 → 1.0.2

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: 9536c8039f26f3e7d932432ef24438553c07fb95
4
- data.tar.gz: 234f8249d386228d5c0472dca7b5f41f1fba66b6
3
+ metadata.gz: acc05be38e8286efff1c13bdd6d8dbdf1f41468d
4
+ data.tar.gz: 8fddf61dc8b2fcda7f124604172165731fcdf1c5
5
5
  SHA512:
6
- metadata.gz: 8993e8c436106c8a2c280e1a372e5726c761a03eccf22548b892bb1224490a464c1c8069df8a26a463047583166d267b8cffa6de56f41f0f9c3fe586d6b2e76f
7
- data.tar.gz: cd09900e30771108e058467e4fb57e4b51be5a54be0e6ac568017d67a51dfc77f25452b0d0d811732185670cdecbb45b97c859b3c21c124698c999500585f061
6
+ metadata.gz: 395b70b8c2b57c9dd88e193d32ba93889311b4281a8b428c668a34c456efc6c3510dabcb242f8ef5a7d5e5774a612966d70591b6e53ae52b61b9c22c5701aa1b
7
+ data.tar.gz: e969c0aae551ee8dd37aef67cc28e94d48f82e8910612ac5e934ca62a55d54de4c551db5f39abba4be1eb4f77396e6ddf16a36778ad8e5d812cf77132f8b71ea
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.2 (2015-05-30)
4
+ - Added a `dom.readyState` check in case script is downloaded after `DOMContentLoaded` event due to asynchronous Javascript loading.
3
5
 
4
6
  ### 1.0.1 (2015-05-09)
5
7
  - Updated dependencies
@@ -4,24 +4,31 @@
4
4
  initialize: function(){
5
5
  self = this
6
6
 
7
- document.addEventListener("DOMContentLoaded", function(event) {
8
- var anchors = document.querySelectorAll("sup[id^=fnref] a")
7
+ if (document.readyState == 'interactive') {
8
+ self.setup()
9
+ } else {
10
+ document.addEventListener("DOMContentLoaded", function(event) {
11
+ self.setup()
12
+ })
13
+ }
9
14
 
10
- if (anchors.length > 0) {
15
+ },
11
16
 
12
- Array.prototype.forEach.call(anchors, function(anchor){
13
- self.setup(anchor)
14
- })
17
+ setup: function (anchor) {
18
+ var anchors = document.querySelectorAll("sup[id^=fnref] a")
15
19
 
16
- document.addEventListener("click", self.click.bind(self))
20
+ if (anchors.length > 0) {
17
21
 
18
- document.querySelector('div.footnotes').remove()
19
- }
20
- })
22
+ Array.prototype.forEach.call(anchors, function(anchor){
23
+ self.addFootnote(anchor)
24
+ })
21
25
 
26
+ document.addEventListener("click", self.click.bind(self))
27
+ document.querySelector('div.footnotes').remove()
28
+ }
22
29
  },
23
30
 
24
- setup: function (anchor) {
31
+ addFootnote: function(anchor) {
25
32
  // We want to add the footnote adjacent to the footnote <sup> element
26
33
  var sup = getParent(anchor, 'sup')
27
34
  sup.insertAdjacentHTML('afterend', this.template.wrapper(anchor));
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Littlefoot
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-littlefoot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-09 00:00:00.000000000 Z
11
+ date: 2015-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
- description: Fancy footnote popovers with native Javascript
83
+ description:
84
84
  email:
85
85
  - brandon@imathis.com
86
86
  executables: []