embeditor-rails 2.0.1 → 2.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: ab39f41f2cff708e76aa03ba6a04a8868e2f1df1
4
- data.tar.gz: 5d1e1afa80d9ef2b0cb5f940459ac566d7ac5dfe
3
+ metadata.gz: d607da8783df9c2ff9085e183d2cd6eace3af3b4
4
+ data.tar.gz: ae361d188a8b63167100a0f8ec9ddf9c1cbae81f
5
5
  SHA512:
6
- metadata.gz: 628a1ffecfe6cc703b785d8118e988edfd1151e0edf247817f826c1ba7ade757311aee788087d62fc3e25ac16fa9fe228370de2ef411b126c45d7ffbce014582
7
- data.tar.gz: 09a46fbf31bea8ea82afc1d4e927aecc250e2e7d79b675742f38ef1772c0be75d6d01b929c1375e6fe749252a04e6618bbd98e3fc7dcc3c021896673be2aec16
6
+ metadata.gz: 5d7415c6c964db5ad3725a7060438fde54b2a59958d4e70df9e72abe5c621afbb7087d9af3908667620b7b6829afca45dd2b87d837478ce6208dfa2692656b4b
7
+ data.tar.gz: 877fca3a1141536f0bbb73dbc379063e966fe6205c5704ca5678b5918a38667e858006e7537e2402bc36efec4a58bc8efd355929bc1287be8b752975989cacb4
@@ -66,7 +66,7 @@ class Embeditor.Adapter
66
66
 
67
67
  _buildDisplayOptions: (data) ->
68
68
  @_defaultsWithoutEmptyStrings(data, # What the user wants
69
- @options[@adapter]?['display'], # What the developer wants
69
+ @options[@className]?['display'], # What the developer wants
70
70
  @options['display'], # What the developer wants globally
71
71
  @adapter.DisplayDefaults # What Embeditor wants
72
72
  )
@@ -80,7 +80,7 @@ class Embeditor.Adapter
80
80
  # 4. This adapter's default options (fallback options).
81
81
  _buildQueryParams: (data) ->
82
82
  @_defaultsWithoutEmptyStrings(data,
83
- @options[@adapter]?['query'],
83
+ @options[@className]?['query'],
84
84
  @options['query'],
85
85
  @adapter.QueryDefaults
86
86
  )
@@ -95,6 +95,6 @@ class Embeditor.Adapter
95
95
  continue if !source
96
96
 
97
97
  for prop,value of source
98
- obj[prop] = source[prop] if !obj[prop]
98
+ obj[prop] = source[prop] if !obj[prop] and value
99
99
 
100
100
  obj
@@ -1,2 +1,7 @@
1
- class Embeditor.Adapters.DocumentCloud extends Embeditor.Adapter
1
+ class Embeditor.Adapters.DocumentCloud extends Embeditor.Adapters.Oembed
2
2
  className: "DocumentCloud"
3
+ @Endpoint = "http://www.documentcloud.org/api/oembed.json"
4
+
5
+ @QueryDefaults =
6
+ maxheight : 700
7
+ responsive : true
@@ -1,7 +1,7 @@
1
1
  class Embeditor.Adapters.Embedly extends Embeditor.Adapters.Oembed
2
2
  className: "Embedly"
3
3
 
4
- @Endpoint = "http://api.embed.ly/1/oembed"
4
+ @Endpoint = "https://api.embed.ly/1/oembed"
5
5
 
6
6
  # This object should hold any keys that we want to
7
7
  # send to the API. Any key not in this object will
@@ -0,0 +1,19 @@
1
+ class Embeditor.Adapters.Ranker extends Embeditor.Adapters.Oembed
2
+ className: "Ranker"
3
+ @Endpoint = "http://widget.ranker.com/oembed"
4
+
5
+ swap: ->
6
+ matcher = /\/(\d+)/
7
+ id = matcher.exec(@href)[1]
8
+
9
+ $.ajax
10
+ url : "#{@adapter.Endpoint}/#{id}"
11
+ type : 'GET'
12
+ dataType : 'json'
13
+ data : _.extend(@queryParams)
14
+
15
+ success: (data, textStatus, jqXHR) =>
16
+ @embedData(data)
17
+
18
+ error: (jqXHR, textStatus, errorThrown) =>
19
+ console.log('[embeditor oembed] error.', jqXHR)
@@ -0,0 +1,28 @@
1
+ class Embeditor.Adapters.YouTube extends Embeditor.Adapters.StaticTemplate
2
+ className: "YouTube"
3
+
4
+ @VideoTemplate = Embeditor.Template('youtube')
5
+ @PlaylistTemplate = Embeditor.Template('youtube_playlist')
6
+
7
+ @QueryDefaults =
8
+ maxwidth : 560
9
+ maxheight : 315
10
+
11
+ @Matchers = [
12
+ /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/i,
13
+ /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?list=|(embed|v)\/))([^\?&"'>]+)/i
14
+ ]
15
+
16
+ swap: ->
17
+ match = @_parseUrl()
18
+ return false if not match
19
+
20
+ id = match[5]
21
+
22
+ template = if id.length > 11 then YouTube.PlaylistTemplate else YouTube.VideoTemplate
23
+
24
+ @embed template
25
+ maxheight : @queryParams.maxheight
26
+ maxwidth : @queryParams.maxwidth
27
+ id : id
28
+
@@ -2,7 +2,7 @@ window.Embeditor = {
2
2
  Adapters : {}
3
3
 
4
4
  DefaultAdapters :
5
- 'youtube' : 'Embedly'
5
+ 'youtube' : 'YouTube'
6
6
  'vimeo' : 'Embedly'
7
7
  'brightcove' : 'Brightcove'
8
8
  'ustream' : 'Embedly'
@@ -11,7 +11,7 @@ window.Embeditor = {
11
11
  'googlemaps' : 'Embedly'
12
12
  'googlefusion' : 'GoogleFusion'
13
13
  'scribd' : 'Embedly'
14
- # 'documentcloud' : 'DocumentCloud'
14
+ 'documentcloud' : 'DocumentCloud'
15
15
  'polldaddy' : 'Polldaddy'
16
16
  'facebook' : 'Embedly'
17
17
  'storify' : 'Storify'
@@ -22,6 +22,7 @@ window.Embeditor = {
22
22
  'instagram' : 'Instagram'
23
23
  'soundcloud' : 'Embedly'
24
24
  'spotify' : 'Embedly'
25
+ 'ranker' : 'Ranker'
25
26
  'other' : 'Embedly'
26
27
 
27
28
  TemplatePath : 'embeditor/templates/'
@@ -0,0 +1 @@
1
+ <iframe width="<%=@maxwidth%>" height="<%=@maxheight%>" src="https://www.youtube.com/embed/<%=@id%>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
@@ -0,0 +1 @@
1
+ <iframe width="<%=@maxwidth%>" height="<%=@maxheight%>" src="https://www.youtube.com/embed/videoseries?list=<%=@listid%>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
@@ -1,5 +1,5 @@
1
1
  module Embeditor
2
2
  module Rails
3
- VERSION = "2.0.1"
3
+ VERSION = "2.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embeditor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Ricker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-22 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -102,10 +102,12 @@ files:
102
102
  - app/assets/javascripts/embeditor/adapters/instagram.js.coffee
103
103
  - app/assets/javascripts/embeditor/adapters/oembed.js.coffee
104
104
  - app/assets/javascripts/embeditor/adapters/polldaddy.js.coffee
105
+ - app/assets/javascripts/embeditor/adapters/ranker.js.coffee
105
106
  - app/assets/javascripts/embeditor/adapters/rebel_mouse.js.coffee
106
107
  - app/assets/javascripts/embeditor/adapters/static_template.js.coffee
107
108
  - app/assets/javascripts/embeditor/adapters/storify.js.coffee
108
109
  - app/assets/javascripts/embeditor/adapters/twitter.js.coffee
110
+ - app/assets/javascripts/embeditor/adapters/youtube.js.coffee
109
111
  - app/assets/javascripts/embeditor/embeditor.js.coffee
110
112
  - app/assets/javascripts/embeditor/templates.js
111
113
  - app/assets/javascripts/embeditor/templates/brightcove.jst.eco
@@ -117,6 +119,8 @@ files:
117
119
  - app/assets/javascripts/embeditor/templates/rebel_mouse.jst.eco
118
120
  - app/assets/javascripts/embeditor/templates/storify.jst.eco
119
121
  - app/assets/javascripts/embeditor/templates/twitter.jst.eco
122
+ - app/assets/javascripts/embeditor/templates/youtube.jst.eco
123
+ - app/assets/javascripts/embeditor/templates/youtube_playlist.jst.eco
120
124
  - app/assets/javascripts/embeditor/utility.js.coffee
121
125
  - lib/embeditor-rails.rb
122
126
  - lib/embeditor-rails/version.rb
@@ -140,8 +144,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
144
  version: '0'
141
145
  requirements: []
142
146
  rubyforge_project:
143
- rubygems_version: 2.2.2
147
+ rubygems_version: 2.5.1
144
148
  signing_key:
145
149
  specification_version: 4
146
150
  summary: Embeditor plugin for Rails.
147
151
  test_files: []
152
+ has_rdoc: