pageflow-oembed 1.0.0 → 1.0.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
  SHA1:
3
- metadata.gz: 2371778074195896b81827f2a795f3499c18b6d8
4
- data.tar.gz: 4b9135c2b5bb7d7e59497ec26459fc6ebbe29076
3
+ metadata.gz: 768e67651b4278343646a683061082b75803f7af
4
+ data.tar.gz: 0c9df1cbfe40cb14740b3eb57170d7cb45304dd3
5
5
  SHA512:
6
- metadata.gz: ce5e2fedf29871d021fc32c0b3c4d79ddb047b8b8dc9420d94b2c70365b33f44e4b48b658d79d13761aaa6c263dba276044dc0cb115ed760b603f863e2b64bad
7
- data.tar.gz: 82eca1dd591e3db49682543d02eeeef157f23870525a8c8bb0676e195c3a3fcb102a2559cdd15411c22b026c7dc590fae48a23e10afbb61027acb5924fbfdc6c
6
+ metadata.gz: bbc5417af0cf5e20ffed703cd89c48173625366adbe87b1fa9c0c116011151654c62301def80b64947247b303edf3965bdf30e08e10bf221517e7e003a6e5115
7
+ data.tar.gz: 86ba5adcc366f271755bfd02bbf8cce48463f6787cdefb38444bded60cf8a0874baa5546ea4dcae273a3a4f43f21389d1b2043b1a38aef5b148ead6245ed1e34
data/CHANGELOG ADDED
@@ -0,0 +1,8 @@
1
+ Version 1.0.1—16 July 2017
2
+
3
+ Bugfix: tweet ID is now correctly parsed from the link.
4
+
5
+ Version 1.0.0—16 July 2017
6
+
7
+ Twitter support. Doesn't actually use oEmbed, because the Twitter SDK
8
+ handles everything for us.
data/README.md CHANGED
@@ -91,6 +91,16 @@ Add it to the asset pipeline:
91
91
  //= require pageflow/oembed
92
92
  ```
93
93
 
94
+ Finally, mount it in `routes.rb`:
95
+
96
+ ```ruby
97
+ Rails.application.routes.draw do
98
+ ...
99
+ mount Pageflow::Oembed::Engine, at: '/oembed'
100
+ ...
101
+ end
102
+ ```
103
+
94
104
  ## Usage
95
105
 
96
106
  In the Pageflow editor, insert a plain old link into the content text. Voila!
@@ -39,7 +39,8 @@ pageflow.widgetTypes.register('pageflow_oembed', {
39
39
 
40
40
  embedTwitter: function(link) {
41
41
  var url = link.getAttribute('href');
42
- var tweetId = url.slice(-18);
42
+ var match = /(\d+)$/.exec(url);
43
+ tweetId = match[0];
43
44
  var theme = this.page(link).classList.contains('invert') ? 'light' : 'dark';
44
45
 
45
46
  link.insertAdjacentHTML('beforebegin', '<span id="tweet-'+tweetId+'"></span>')
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
2
  module Oembed
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow-oembed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joost Baaij
@@ -121,6 +121,7 @@ files:
121
121
  - ".gitignore"
122
122
  - ".rspec"
123
123
  - ".travis.yml"
124
+ - CHANGELOG
124
125
  - CODE_OF_CONDUCT.md
125
126
  - Gemfile
126
127
  - LICENSE.txt