jekyll_example_embed 0.0.2 → 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll_example_embed.rb +9 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e2072ce9f170b5b370e91a8e107500c08c72900
4
- data.tar.gz: ff8e92214de2fe110ea17afd3fe2dacd1d7f95a9
3
+ metadata.gz: bd2b2a2183dedcda22070d831392c4b877c747be
4
+ data.tar.gz: fa72a2a03fc3a245a2e1b6299001b36eb1f3ed20
5
5
  SHA512:
6
- metadata.gz: 2ee4163db3fd5945ed091fac30f80254a21c50602473372e341f2a08164b8ea9fa437163bc81b5bdbf2f8a9cb6be517ced0649111a3c20259845349f1aa04d0f
7
- data.tar.gz: e5cc4cb5253e4e50be86dbba49604a61b3743db6693d526c8555497a6fcbb9feef178657a61cb90a30d4165bf2a362e688997fddab47471ab77f8238c59dd7f9
6
+ metadata.gz: 1902fb8c87133efd12f148ae497f3b751176855977d96e6165fa35c55ed098f961c1fc1390c2d6ae824460cff16bca164f7987c3801e7848b1c0c85f79b7e37c
7
+ data.tar.gz: d121fa2549624169f96c579f503b7296a8212f00eb4c9b5a382fce9a97280b053a57008d4696ccc5999c86baac966f7f68cd8f5b0cafdb1fe74c830b65455e38
@@ -26,10 +26,18 @@ module Jekyll
26
26
  '<h5>Source</h5>',
27
27
  highlight,
28
28
  '<h5>Result</h5>',
29
- %{<iframe src="#{document.url}" frameBorder="0"></iframe>}
29
+ %{<iframe src="#{document.url}" frameBorder="0" onload="#{auto_resize}"></iframe>}
30
30
  ].join("\n")
31
31
  end
32
32
 
33
+ private
34
+
35
+ def auto_resize
36
+ ["this.height = this.contentWindow.document.body.scrollHeight + 'px'",
37
+ "this.width = this.contentWindow.document.body.scrollWidth + 'px'"
38
+ ].join(';')
39
+ end
40
+
33
41
  Liquid::Template.register_tag('example_embed', Jekyll::ExampleEmbedTag)
34
42
  end
35
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_example_embed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sonny Michaud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-14 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michaud.sonny@gmail.com