lalala 4.0.0.dev.388 → 4.0.0.dev.393

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d455d04941fbba81dee21d7cea88fbfe64c77f9
4
- data.tar.gz: 863c022c791fd66ea4d40a99aae9752db8c5d9f7
3
+ metadata.gz: b63c67fe2f3d26a7d84d032a951285dc30f83722
4
+ data.tar.gz: 1da275695985f601e639bb730be01f5c2e4f99d8
5
5
  SHA512:
6
- metadata.gz: 3502c6efdf7bf4d5d5b8f4d1243a4d4645842d6e0cfd110683a4c3cbed0ec56fd7610dff75e103ff1449b567f43ee9747aab3e83c89ab7d81248423794511a39
7
- data.tar.gz: 529bbac1b78081af35a7bcf526a1d2347094d502fc7e50c727eb18d42e41e850f7e69184c2b8aaf80665770a93fbab96168a9bc4b6659c2453cb69b508900dee
6
+ metadata.gz: 053b7db4c1d5a70f370e0a6e79c438a414155cb6762d32705684c5c948280c827d3748dba546f023aca32d0060483ca9512adae0af368b1e73d57a7ed00b1712
7
+ data.tar.gz: b3410e602d28cd67683c44fe5e32dc0d071964c8d9ca41fd703a37c4130453211fefab632307399551e46b2fd77bf638c22c2493d99a98d3963cf251412d6660
@@ -0,0 +1,36 @@
1
+ class Lalala::Markdown::Handlers::Soundcloud < Lalala::Markdown::Handlers::Base
2
+
3
+ def initialize(options={})
4
+ options.assert_valid_keys(:width, :height)
5
+
6
+ options = {
7
+ width: 560,
8
+ height: 166
9
+ }.merge(options)
10
+
11
+ @options = options
12
+ end
13
+
14
+ def image(url, alt=nil, title=nil)
15
+ unless %r|^soundcloud[:]//(.+)$| === url
16
+ return ""
17
+ end
18
+
19
+ id = $1
20
+
21
+ helpers.content_tag :span, class: "embed-container is-soundcloud" do
22
+ helpers.content_tag(
23
+ :iframe,
24
+ "",
25
+ class: "soundcloud-embed js-soundcloud-embed",
26
+ width: @options[:width],
27
+ height: @options[:height],
28
+ src: "//w.soundcloud.com/player/?auto_play=false&hide_related=true&show_comments=false&show_user=false&show_reposts=false&visual=false",
29
+ :"data-url" => "https://soundcloud.com/oembed?format=json&url=https://soundcloud.com/#{id}",
30
+ frameborder: 0,
31
+ allowfullscreen: true
32
+ )
33
+ end
34
+ end
35
+
36
+ end
@@ -23,16 +23,18 @@ class Lalala::Markdown::Handlers::Vimeo < Lalala::Markdown::Handlers::Base
23
23
 
24
24
  id = $1
25
25
 
26
- helpers.content_tag(
27
- :iframe,
28
- "",
29
- width: @options[:width],
30
- height: @options[:height],
31
- src: "//player.vimeo.com/video/#{id}?portrait=#{@options[:show_portrait]}&title=#{@options[:show_title]}&badge=#{@options[:show_badge]}&byline=#{@options[:show_byline]}&color=#{@options[:color]}&wmode=transparent",
32
-
33
- frameborder: 0,
34
- allowfullscreen: true
35
- )
26
+ helpers.content_tag :span, class: "embed-container is-vimeo" do
27
+ helpers.content_tag(
28
+ :iframe,
29
+ "",
30
+ width: @options[:width],
31
+ height: @options[:height],
32
+ src: "//player.vimeo.com/video/#{id}?portrait=#{@options[:show_portrait]}&title=#{@options[:show_title]}&badge=#{@options[:show_badge]}&byline=#{@options[:show_byline]}&color=#{@options[:color]}&wmode=transparent",
33
+
34
+ frameborder: 0,
35
+ allowfullscreen: true
36
+ )
37
+ end
36
38
  end
37
39
 
38
40
  end
@@ -18,15 +18,19 @@ class Lalala::Markdown::Handlers::YouTube < Lalala::Markdown::Handlers::Base
18
18
 
19
19
  id = $1
20
20
 
21
- helpers.content_tag(
22
- :iframe,
23
- "",
24
- width: @options[:width],
25
- height: @options[:height],
26
- src: "http://www.youtube.com/embed/#{id}?rel=0",
27
- frameborder: 0,
28
- allowfullscreen: true
29
- )
21
+ helpers.content_tag :span, class: "embed-container is-youtube" do
22
+ helpers.content_tag(
23
+ :iframe,
24
+ "",
25
+ width: @options[:width],
26
+ height: @options[:height],
27
+ src: "http://www.youtube.com/embed/#{id}?rel=0",
28
+ frameborder: 0,
29
+ allowfullscreen: true
30
+ )
31
+ end
32
+
33
+
30
34
  end
31
35
 
32
36
  end
@@ -1,6 +1,6 @@
1
1
  class Lalala::Markdown::HtmlRenderer < Redcarpet::Render::HTML
2
2
 
3
- URI_PATTERN = %r{\A(lalala|youtube|vimeo)[:][/]{2}.+\Z}
3
+ URI_PATTERN = %r{\A(lalala|youtube|vimeo|soundcloud)[:][/]{2}.+\Z}
4
4
 
5
5
  def initialize(options)
6
6
  @options = options.dup
@@ -10,6 +10,7 @@ class Lalala::Markdown
10
10
  require 'lalala/markdown/handlers/base'
11
11
  require 'lalala/markdown/handlers/youtube'
12
12
  require 'lalala/markdown/handlers/vimeo'
13
+ require 'lalala/markdown/handlers/soundcloud'
13
14
  end
14
15
 
15
16
  PARSER_OPTIONS = [
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "388"
3
+ BUILD = "393"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.388
4
+ version: 4.0.0.dev.393
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-02-10 00:00:00.000000000 Z
16
+ date: 2015-06-09 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activeadmin
@@ -1471,6 +1471,7 @@ files:
1471
1471
  - lib/lalala/markdown.rb
1472
1472
  - lib/lalala/markdown/active_model.rb
1473
1473
  - lib/lalala/markdown/handlers/base.rb
1474
+ - lib/lalala/markdown/handlers/soundcloud.rb
1474
1475
  - lib/lalala/markdown/handlers/vimeo.rb
1475
1476
  - lib/lalala/markdown/handlers/youtube.rb
1476
1477
  - lib/lalala/markdown/html_renderer.rb