jekyll-wns 4.1.1 β†’ 4.2.1

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
  SHA256:
3
- metadata.gz: 39db2c4912ad62b82e3f5f8f35a2a1d8885e03ffc8a3f52ca993889e86985cbc
4
- data.tar.gz: 2d7cdf9fcbf3b0c7dc99d3d264268a8b11a9d55b05219653c4b6bc92eb4acc35
3
+ metadata.gz: 104dc7939f1c3a81372cf2b9d24ab46562f6368d173573b3246377b1c4189f9e
4
+ data.tar.gz: e491889d693921266971921c96bff5a283602ec246c328e34760873483a96495
5
5
  SHA512:
6
- metadata.gz: 9e3c6c0297e48963461abc3884daec9f7cbf6ce0e98ae97e157396975cda4fc93d2c8ceecfda5a0b7408ae886a4da5e2ed83ce5f6874dd2fe57d39b5daee1eba
7
- data.tar.gz: c834e2ed3707525e08cb4f517aeabaf8b7102972bd6f0e4138207cc86edbaf420c38f7d61e75bf3dec30362a37fd48fde78a1d2a678a50d321c97013db7e36ab
6
+ metadata.gz: 57ddf6562fda69eb06d5ebea185c9a0d08918a850ddb91a25ecbfaf77f4c75cc818ee45e13d090ba7ff20db3e5c93324745fe8959702f717b836db126a09f974
7
+ data.tar.gz: 7f050031c6a574bd720d496b40ce290a9b57e0bb6769271010db344dacb1c5daee6ad4362f132c6028aee159441efc325b3e0a15c14faa99da9d15763e7a7021
data/README.md CHANGED
@@ -99,12 +99,13 @@ plugins:
99
99
  The following snippet should be integrated into your site for the tag to properly work:
100
100
 
101
101
  ```javascript
102
- function loadYouTube() {
103
- var videos = d.getElementsByClassName('youtube');
104
- for (var i = 0; i < videos.length; i++) {
105
- videos[i].innerHTML = d.getElementById(videos[i].getAttribute('data-videoid')).innerHTML;
106
- }
102
+ function loadYouTube(e = null) {
103
+ if (e == null) return;
104
+ var i = e.target.getAttribute('data-videoid');
105
+ d.getElementById(i).innerHTML = d.getElementById('yt-' + i).innerHTML
107
106
  }
107
+
108
+ $('.youtube a:last-child').on('click', loadYouTube);
108
109
  ```
109
110
 
110
111
  ```liquid
data/jekyll-wns.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-wns"
5
- spec.version = "4.1.1"
5
+ spec.version = "4.2.1"
6
6
  spec.authors = ["Thai Chung"]
7
7
  spec.email = ["mail@0xReki.de"]
8
8
  spec.summary = "Collection of Filters, Tags and Hooks I use."
data/js/youtube.js CHANGED
@@ -1,6 +1,7 @@
1
- function loadYouTube() {
2
- var videos = d.getElementsByClassName('youtube');
3
- for (var i = 0; i < videos.length; i++) {
4
- videos[i].innerHTML = d.getElementById(videos[i].getAttribute('data-videoid')).innerHTML;
5
- }
1
+ function loadYouTube(e = null) {
2
+ if (e == null) return;
3
+ var i = e.target.getAttribute('data-videoid');
4
+ d.getElementById(i).innerHTML = d.getElementById('yt-' + i).innerHTML
6
5
  }
6
+
7
+ $('.youtube a:last-child').on('click', loadYouTube);
@@ -0,0 +1,20 @@
1
+ module WNS
2
+ module LabelPronounciation
3
+
4
+ def self.enabled?(doc)
5
+ wns = doc.site.config["wns"] || {}
6
+ labels = wns["label_pronounciation"] || []
7
+ labels.length > 0
8
+ end
9
+
10
+ def self.label_unicode!(doc)
11
+ if LabelUnicode::enabled?(doc)
12
+ wns = doc.site.config["wns"] || {}
13
+ labels = wns["label_pronounciation"] || false
14
+ for i in (0..(labels.length()) - 1) do
15
+ doc.content = doc.content.gsub(Regexp.new("\b#{labels[i]["term"]}\b"), "<span aria-label='#{labels[i]["pronounciation"]}'>\\1</span>")
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -9,16 +9,14 @@ module WNS
9
9
  def render(context)
10
10
  case @text
11
11
  when "leaves"
12
- '<p style="text-align:center" data-mce-style="text-align:center">πŸ™ πŸ™‘ πŸ™“ πŸ™’ πŸ™ πŸ™‘ πŸ™“ πŸ™’ πŸ™ πŸ™‘ πŸ™“ πŸ™’</p>'
12
+ '<p style="text-align:center" data-mce-style="text-align:center" aria-hidden="true">πŸ™ πŸ™‘ πŸ™“ πŸ™’ πŸ™ πŸ™‘ πŸ™“ πŸ™’ πŸ™ πŸ™‘ πŸ™“ πŸ™’</p>'
13
13
  when "wave"
14
- '<p style="text-align:center;letter-spacing:-.13em" data-mce-style="text-align:center;letter-spacing:-.13em">◠◑◠◑◠◑◠◑◠◑◠◑◠◑◠◑◠◑◠◑◠‏</p>'
14
+ '<p style="text-align:center;letter-spacing:-.13em" data-mce-style="text-align:center;letter-spacing:-.13em" aria-hidden="true">β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— β—‘β— </p>'
15
15
  when "wall"
16
- '<p style="text-align:center;letter-spacing:-.2em" data-mce-style="text-align:center;letter-spacing:-.2em">⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍</p>'
16
+ '<p style="text-align:center;letter-spacing:-.2em" data-mce-style="text-align:center;letter-spacing:-.2em" aria-hidden="true">⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍⚎⚍</p>'
17
17
  else
18
- '<p style="text-align:center" data-mce-style="text-align:center">πŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™Ώ</p>'
18
+ '<p style="text-align:center" data-mce-style="text-align:center" aria-hidden="true">πŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™ΏπŸ™ΎπŸ™Ώ</p>'
19
19
  end
20
20
  end
21
21
  end
22
22
  end
23
-
24
-
@@ -2,6 +2,7 @@ Jekyll::Hooks.register :pages, :pre_render do |document|
2
2
  if document.path =~ /(.md|.html)/
3
3
  WNS::Abbreviations::replace_abbreviations! document
4
4
  WNS::LabelUnicode::label_unicode! document
5
+ WNS::LabelPronounciation::label_unicode! document
5
6
  WNS::Quads::insert_quads_into_document! document
6
7
  end
7
8
  end
@@ -15,6 +16,7 @@ end
15
16
  Jekyll::Hooks.register :posts, :pre_render do |document|
16
17
  WNS::Abbreviations::replace_abbreviations! document
17
18
  WNS::LabelUnicode::label_unicode! document
19
+ WNS::LabelPronounciation::label_unicode! document
18
20
  WNS::Quads::insert_quads_into_document! document
19
21
  end
20
22
 
data/lib/jekyll-wns.rb CHANGED
@@ -3,6 +3,7 @@ require 'jekyll'
3
3
 
4
4
  require_relative 'jekyll-wns/assets/abbreviations'
5
5
  require_relative 'jekyll-wns/assets/label_unicode'
6
+ require_relative 'jekyll-wns/assets/label_pronounciation'
6
7
  require_relative 'jekyll-wns/assets/quads'
7
8
 
8
9
  require_relative 'jekyll-wns/assets/digest_filters'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-wns
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Chung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-mp3info
@@ -42,6 +42,7 @@ files:
42
42
  - lib/jekyll-wns/assets/abbreviations.rb
43
43
  - lib/jekyll-wns/assets/digest_filters.rb
44
44
  - lib/jekyll-wns/assets/file_property_filters.rb
45
+ - lib/jekyll-wns/assets/label_pronounciation.rb
45
46
  - lib/jekyll-wns/assets/label_unicode.rb
46
47
  - lib/jekyll-wns/assets/quads.rb
47
48
  - lib/jekyll-wns/assets/quads_filter.rb