alchemy-richmedia-essences 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +36 -18
  4. data/alchemy-richmedia-essences.gemspec +4 -4
  5. data/app/controllers/alchemy/admin/essence_audios_controller.rb +4 -4
  6. data/app/controllers/alchemy/admin/essence_videos_controller.rb +4 -3
  7. data/app/views/alchemy/admin/essence_audios/edit.html.erb +4 -4
  8. data/app/views/alchemy/admin/essence_files/assign.js.erb +9 -0
  9. data/app/views/alchemy/admin/essence_videos/edit.html.erb +4 -3
  10. data/app/views/alchemy/essences/_essence_audio_editor.html.erb +4 -4
  11. data/app/views/alchemy/essences/_essence_audio_view.html.erb +13 -32
  12. data/app/views/alchemy/essences/_essence_video_editor.html.erb +4 -4
  13. data/app/views/alchemy/essences/_essence_video_view.html.erb +15 -34
  14. data/app/views/alchemy/essences/_richmedia_essence_editor.html.erb +6 -5
  15. data/config/routes.rb +0 -1
  16. data/db/migrate/20140814212620_alchemy_essence_video_html5_update.rb +25 -0
  17. data/db/migrate/20150728153847_remove_alchemy_essence_flashes.rb +9 -0
  18. data/db/migrate/20150728172823_alchemy_essence_audio_html5_update.rb +17 -0
  19. data/lib/alchemy-richmedia-essences/ability.rb +0 -1
  20. data/lib/alchemy-richmedia-essences/version.rb +1 -1
  21. metadata +12 -15
  22. data/app/controllers/alchemy/admin/essence_flashes_controller.rb +0 -25
  23. data/app/models/alchemy/essence_flash.rb +0 -8
  24. data/app/views/alchemy/admin/essence_flashes/edit.html.erb +0 -6
  25. data/app/views/alchemy/essences/_essence_flash_editor.html.erb +0 -6
  26. data/app/views/alchemy/essences/_essence_flash_view.html.erb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c368e688fbed9b1e75d5390132a2e96c8aab3a3a
4
- data.tar.gz: 1466c1312100108384f41c867705792d2f2a558d
3
+ metadata.gz: d868ba94d2c79f37ccd320126840d8bd7c803195
4
+ data.tar.gz: a433b359ff064e065c6081f01f0dc1bc08d697b9
5
5
  SHA512:
6
- metadata.gz: 3b4f8af2708993d78972231d631a4c3007474848c2b2cabb1dd972a0b2ffc3e598972294420e7fd9016b6ded9e40b4ce6917fd3c6f60c05a688aa55793ddf162
7
- data.tar.gz: 0e0ca4a660ad8e1f337beab1fddc44008312170ec41426afd80d78b0374836abb56cbc6b83967ac3c140b3bbc5c320e461fa4eb3ed7ffa5fa843c86549d44747
6
+ metadata.gz: ebd2df4a4fd9dfa932ade846c72d4f20aabbb4ef1271dbc3ed3eb53cd47d3923341f6612efc4810d91d5301d7b05c9326014244047e5a2160edd75e88fda1849
7
+ data.tar.gz: adbf22abb6a089dfdb57d3c89703625398d579e3c4813c4df2d6ae0d18357734746012ac56c20501fef820fa0a4dd1decba0b80ce00e0e3493420786f4adfe4a
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2014, magic labs GmbH, Hamburg Germany
1
+ Copyright (c) 2010-2015, magic labs GmbH, Hamburg Germany
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
- # Alchemy CMS Richmedia Essences
1
+ # Alchemy CMS HTML5 Richmedia Essences
2
2
 
3
- Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy CMS powered site.
3
+ Adds HTML5 `EssenceAudio` and `EssenceVideo` essences to your Alchemy CMS powered site.
4
+
5
+ ## Alchemy version
4
6
 
5
7
  This version is compatible with Alchemy version 3.0 and above only.
6
8
 
7
- For Alchemy v2.7.0 please use version 0.2.0.
9
+ Also this plugin does not contain a `EssenceFlash` any more. If you need `EssenceFlash`, you need to use version 0.3-stable.
8
10
 
9
- For Alchemy v2.6.0 and below please use version 0.1.0.
11
+ - For Alchemy v2.7.0 please use version 0.2.0.
12
+ - For Alchemy v2.6.0 and below please use version 0.1.0.
10
13
 
11
14
  ## Installation
12
15
 
@@ -14,31 +17,46 @@ For Alchemy v2.6.0 and below please use version 0.1.0.
14
17
 
15
18
  Add this line to your application's Gemfile:
16
19
 
17
- gem 'alchemy-richmedia-essences'
20
+ ~~~ruby
21
+ gem 'alchemy-richmedia-essences', github: 'AlchemyCMS/alchemy-richmedia-essences'
22
+ ~~~
18
23
 
19
24
  And then execute:
20
25
 
21
- $ bundle
26
+ ~~~shell
27
+ $ bundle install
28
+ ~~~
22
29
 
23
- Or install it yourself as:
30
+ ## Usage
24
31
 
25
- $ gem install alchemy-richmedia-essences
32
+ 1) After installing or updating, prepare your database with:
26
33
 
27
- ## Usage
34
+ ~~~shell
35
+ $ rake alchemy_richmedia_essences:install:migrations db:migrate
36
+ ~~~
37
+
38
+ 2) In your `elements.yml` add one of these essences to your element of choice.
39
+
40
+ ~~~yaml
41
+ # elements.yml
42
+ - name: video
43
+ contents:
44
+ - name: video
45
+ type: EssenceVideo
28
46
 
29
- 1. After installing, prepare your database with:
47
+ - name: audio
48
+ contents:
49
+ - name: audio
50
+ type: EssenceAudio
51
+ ~~~
30
52
 
31
- $ rake alchemy_richmedia_essences:install:migrations db:migrate
53
+ ## Player customization
32
54
 
33
- 2. In your `elements.yml` add one of the shiny new essences to your element of choice.
55
+ This plugin just provides HTML5 `<video>` and `<audio>` tags and no styling at all. The players will appear as the browser vendors provide.
34
56
 
35
- # elements.yml
36
- - name: video
37
- contents:
38
- - name: file
39
- type: EssenceVideo
57
+ If you want a cross browser and customizable player with Flash® fallback, then we strongly recommend something like http://mediaelementjs.com/
40
58
 
41
- That's it!
59
+ There is even a gem https://github.com/tobsch/mediaelement_rails that provides everthing for the Rails' asset pipeline.
42
60
 
43
61
  ## Contributing
44
62
 
@@ -7,14 +7,14 @@ Gem::Specification.new do |gem|
7
7
  gem.name = "alchemy-richmedia-essences"
8
8
  gem.version = Alchemy::Richmedia::Essences::VERSION
9
9
  gem.authors = ["Thomas von Deyen"]
10
- gem.email = ["tvdeyen@gmail.com"]
11
- gem.description = %q{EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS 3.0}
12
- gem.summary = %q{Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy CMS powered site.}
10
+ gem.email = ["tvd@magiclabs.de"]
11
+ gem.description = %q{EssenceAudio and EssenceVideo for Alchemy CMS 3.0}
12
+ gem.summary = %q{Adds EssenceAudio and EssenceVideo essences to your Alchemy CMS powered site.}
13
13
  gem.homepage = "http://alchemy-cms.com"
14
14
  gem.license = 'BSD New'
15
15
 
16
16
  gem.files = `git ls-files`.split($/)
17
17
  gem.require_paths = ["lib"]
18
18
 
19
- gem.add_runtime_dependency 'alchemy_cms', ['>= 3.0.0.rc4']
19
+ gem.add_runtime_dependency 'alchemy_cms', ['>= 3.0.0']
20
20
  end
@@ -15,10 +15,10 @@ module Alchemy
15
15
 
16
16
  def essence_audio_params
17
17
  params.require(:essence_audio).permit(
18
- :width,
19
- :height,
20
- :show_eq,
21
- :show_navigation,
18
+ :autoplay,
19
+ :controls,
20
+ :loop,
21
+ :muted,
22
22
  :attachment_id
23
23
  )
24
24
  end
@@ -17,9 +17,10 @@ module Alchemy
17
17
  params.require(:essence_video).permit(
18
18
  :width,
19
19
  :height,
20
- :allow_fullscreen,
21
- :auto_play,
22
- :show_navigation,
20
+ :autoplay,
21
+ :controls,
22
+ :loop,
23
+ :muted,
23
24
  :attachment_id
24
25
  )
25
26
  end
@@ -1,7 +1,7 @@
1
1
  <%= alchemy_form_for [:admin, @essence_audio] do |f| %>
2
- <%= f.input :width %>
3
- <%= f.input :height %>
4
- <%= f.input :show_eq %>
5
- <%= f.input :show_navigation %>
2
+ <%= f.input :autoplay %>
3
+ <%= f.input :controls %>
4
+ <%= f.input :loop %>
5
+ <%= f.input :muted %>
6
6
  <%= f.submit _t(:save) %>
7
7
  <% end %>
@@ -0,0 +1,9 @@
1
+ $('#<%= @content.dom_id %>').replaceWith('<%= j(
2
+ render "alchemy/essences/#{@content.essence_partial_name}_editor",
3
+ formats: [:html],
4
+ content: @content,
5
+ options: @options
6
+ ) %>');
7
+ Alchemy.closeCurrentDialog();
8
+ Alchemy.setElementDirty($('#element_<%= @content.element.id %>'));
9
+ Alchemy.watchForDialogs($('#<%= @content.dom_id %>'));
@@ -1,8 +1,9 @@
1
1
  <%= alchemy_form_for [:admin, @essence_video] do |f| %>
2
2
  <%= f.input :width %>
3
3
  <%= f.input :height %>
4
- <%= f.input :allow_fullscreen %>
5
- <%= f.input :auto_play %>
6
- <%= f.input :show_navigation %>
4
+ <%= f.input :autoplay %>
5
+ <%= f.input :controls %>
6
+ <%= f.input :loop %>
7
+ <%= f.input :muted %>
7
8
  <%= f.submit _t(:save) %>
8
9
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <%= render(
2
- "alchemy/essences/richmedia_essence_editor",
3
- :options => options,
4
- :content => content,
5
- :controller => 'essence_audios'
2
+ 'alchemy/essences/richmedia_essence_editor',
3
+ options: options,
4
+ content: content,
5
+ controller: 'essence_audios'
6
6
  ) %>
@@ -1,33 +1,14 @@
1
- <%- unless content.essence.attachment.nil? -%>
2
- <%- unless options[:player_cover_image].blank? -%>
3
- <%- i_height = options[:player_cover_image].image_height.to_f -%>
4
- <%- i_width = options[:player_cover_image].image_width.to_f -%>
5
- <%- ratio = i_height / i_width -%>
6
- <%- width = (options[:player_cover_image_width] rescue 320) -%>
7
- <%- height = width * ratio -%>
8
- <%- else -%>
9
- <%- width = content.essence.width.blank? ? (options[:player_size].split('x')[0] rescue 320) : content.essence.width -%>
10
- <%- height = content.essence.height.blank? ? (options[:player_size].split('x')[1] rescue 20) : content.essence.height -%>
11
- <%- end -%>
12
- <div id="alchemy_audio_player_<%= content.id %>">
13
- To watch this video, you need the latest <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Flash-Player</a> and active javascript in your browser.
14
- </div>
15
- <script type="text/javascript" charset="utf-8">
16
- //<!--[CDATA[
17
- var alchemy_audio_player_<%= content.id %> = new SWFObject("/mediaplayer.swf", "mediaplayer", <%= width %>, <%= height %>, "8");
18
- alchemy_audio_player_<%= content.id %>.addVariable("width", <%= width %>);
19
- alchemy_audio_player_<%= content.id %>.addVariable("height", <%= height %>);
20
- alchemy_audio_player_<%= content.id %>.addVariable("backcolor", '<%= options[:player_backcolor] || "0xFFFFFF" %>');
21
- alchemy_audio_player_<%= content.id %>.addVariable("frontcolor", '<%= options[:player_frontcolor] || "0x000000" %>');
22
- alchemy_audio_player_<%= content.id %>.addVariable("lightcolor", '<%= options[:player_lightcolor] || "0xEDEDED" %>');
23
- alchemy_audio_player_<%= content.id %>.addVariable("screencolor", '<%= options[:player_screencolor] || "0x000000" %>');
24
- alchemy_audio_player_<%= content.id %>.addVariable("showeq", '<%= content.essence.show_eq ? "true" : "false" %>');
25
- alchemy_audio_player_<%= content.id %>.addVariable("shownavigation", '<%= content.essence.show_navigation ? "true" : "false" %>');
26
- alchemy_audio_player_<%= content.id %>.addVariable("file", '<%= content.essence.attachment.public_filename %>');
27
- <%- unless options[:player_cover_image].blank? -%>
28
- alchemy_audio_player_<%= content.id %>.addVariable("image", '<%= "/" + options[:player_cover_image].file_name %>');
29
- <%- end -%>
30
- alchemy_audio_player_<%= content.id %>.write("alchemy_audio_player_<%= content.id %>");
31
- //]]-->
32
- </script>
1
+ <%- if content.ingredient -%>
2
+ <%= content_tag :audio,
3
+ controls: content.essence.controls,
4
+ autoplay: content.essence.autoplay,
5
+ loop: content.essence.loop,
6
+ muted: content.essence.muted do %>
7
+ <%= content_tag :source, nil,
8
+ src: alchemy.show_attachment_path(
9
+ content.ingredient,
10
+ format: content.ingredient.suffix
11
+ ),
12
+ type: content.ingredient.file_mime_type %>
13
+ <% end %>
33
14
  <%- end -%>
@@ -1,6 +1,6 @@
1
1
  <%= render(
2
- "alchemy/essences/richmedia_essence_editor",
3
- :options => options,
4
- :content => content,
5
- :controller => 'essence_videos'
2
+ 'alchemy/essences/richmedia_essence_editor',
3
+ options: options,
4
+ content: content,
5
+ controller: 'essence_videos'
6
6
  ) %>
@@ -1,35 +1,16 @@
1
- <%- unless content.essence.attachment.nil? -%>
2
-
3
- <%- width = content.essence.width.blank? ? (options[:player_size].split('x')[0] rescue 480) : content.essence.width -%>
4
- <%- height = content.essence.height.blank? ? (options[:player_size].split('x')[1] rescue 320) : content.essence.height -%>
5
-
6
- <a href="<%= alchemy.show_attachment_path(content.essence.attachment) %>"
7
- id="player_<%= content.id %>"
8
- style="width: <%= width %>px; height: <%= height %>px; display: block">
9
- </a>
10
- <script type="text/javascript" charset="utf-8">
11
- flowplayer("player_<%= content.id %>",
12
- {
13
- src: "/flowplayer-3.2.5.swf",
14
- allowfullscreen: <%= content.essence.allow_fullscreen %>
15
- },
16
- {
17
- clip: {
18
- autoBuffering: true,
19
- autoPlay: false,
20
- scaling: 'fit'
21
- },
22
- plugins: {
23
- controls:
24
- <%- if content.essence.show_navigation -%>
25
- {
26
- fullscreen: <%= content.essence.allow_fullscreen %>
27
- }
28
- <%- else -%>
29
- null
30
- <%- end -%>
31
- }
32
- }
33
- );
34
- </script>
1
+ <%- if content.ingredient -%>
2
+ <%= content_tag :video,
3
+ controls: content.essence.controls,
4
+ autoplay: content.essence.autoplay,
5
+ loop: content.essence.loop,
6
+ muted: content.essence.muted,
7
+ width: content.essence.width,
8
+ height: content.essence.height do %>
9
+ <%= content_tag :source, nil,
10
+ src: alchemy.show_attachment_path(
11
+ content.ingredient,
12
+ format: content.ingredient.suffix
13
+ ),
14
+ type: content.ingredient.file_mime_type %>
15
+ <% end %>
35
16
  <%- end -%>
@@ -1,8 +1,9 @@
1
1
  <div class="content_editor essence_file" id="<%= content.dom_id %>">
2
- <label style="display: inline">
3
- <%= render_content_name(content) %>
4
- <%= delete_content_link(content) %>
5
- </label>
2
+ <% if respond_to?(:content_label) %>
3
+ <%= content_label(content) %>
4
+ <% else %>
5
+ <%= label_and_remove_link(content) %>
6
+ <% end %>
6
7
  <div class="file" id="file_<%= content.id %>">
7
8
  <div class="file_icon">
8
9
  <% if content.ingredient.nil? %>
@@ -51,7 +52,7 @@
51
52
  controller: controller,
52
53
  action: 'edit',
53
54
  options: options.to_json,
54
- id: content
55
+ id: content.essence.id
55
56
  ),
56
57
  {
57
58
  title: _t(:edit_file_properties),
data/config/routes.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  Alchemy::Engine.routes.draw do
2
2
  namespace :admin do
3
3
  resources :essence_audios
4
- resources :essence_flashes
5
4
  resources :essence_videos
6
5
  end
7
6
  end
@@ -0,0 +1,25 @@
1
+ class AlchemyEssenceVideoHtml5Update < ActiveRecord::Migration
2
+ def up
3
+ change_table :alchemy_essence_videos do |t|
4
+ t.change :width, :string
5
+ t.change :height, :string
6
+ t.rename :auto_play, :autoplay
7
+ t.rename :show_navigation, :controls
8
+ end
9
+
10
+ add_column :alchemy_essence_videos, :loop, :boolean, default: false
11
+ add_column :alchemy_essence_videos, :muted, :boolean, default: false
12
+ end
13
+
14
+ def down
15
+ change_table :alchemy_essence_videos do |t|
16
+ t.change :width, :integer
17
+ t.change :height, :integer
18
+ t.rename :autoplay, :auto_play
19
+ t.rename :controls, :show_navigation
20
+ end
21
+
22
+ remove_column :alchemy_essence_videos, :loop, :boolean
23
+ remove_column :alchemy_essence_videos, :muted, :boolean
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ class RemoveAlchemyEssenceFlashes < ActiveRecord::Migration
2
+ def up
3
+ drop_table :alchemy_essence_flashes
4
+ end
5
+
6
+ def down
7
+ raise ActiveRecord::IrreversibleMigration
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ class AlchemyEssenceAudioHtml5Update < ActiveRecord::Migration
2
+ def up
3
+ change_table :alchemy_essence_audios do |t|
4
+ t.boolean :autoplay, default: false
5
+ t.boolean :loop, default: false
6
+ t.boolean :muted, default: false
7
+ t.rename :show_navigation, :controls
8
+ t.remove :width
9
+ t.remove :height
10
+ t.remove :show_eq
11
+ end
12
+ end
13
+
14
+ def down
15
+ raise ActiveRecord::IrreversibleMigration
16
+ end
17
+ end
@@ -8,7 +8,6 @@ module Alchemy
8
8
  return if user.nil?
9
9
  if user.has_role?(:author) || user.has_role?(:editor) || user.has_role?(:admin)
10
10
  can :manage, Alchemy::EssenceAudio
11
- can :manage, Alchemy::EssenceFlash
12
11
  can :manage, Alchemy::EssenceVideo
13
12
  end
14
13
  end
@@ -1,7 +1,7 @@
1
1
  module Alchemy
2
2
  module Richmedia
3
3
  module Essences
4
- VERSION = "0.3.0"
4
+ VERSION = "1.0.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-richmedia-essences
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2015-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -16,17 +16,17 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0.rc4
19
+ version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0.rc4
27
- description: EssenceAudio, EssenceFlash and EssenceVideo for Alchemy CMS 3.0
26
+ version: 3.0.0
27
+ description: EssenceAudio and EssenceVideo for Alchemy CMS 3.0
28
28
  email:
29
- - tvdeyen@gmail.com
29
+ - tvd@magiclabs.de
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
@@ -38,23 +38,22 @@ files:
38
38
  - Rakefile
39
39
  - alchemy-richmedia-essences.gemspec
40
40
  - app/controllers/alchemy/admin/essence_audios_controller.rb
41
- - app/controllers/alchemy/admin/essence_flashes_controller.rb
42
41
  - app/controllers/alchemy/admin/essence_videos_controller.rb
43
42
  - app/models/alchemy/essence_audio.rb
44
- - app/models/alchemy/essence_flash.rb
45
43
  - app/models/alchemy/essence_video.rb
46
44
  - app/views/alchemy/admin/essence_audios/edit.html.erb
47
- - app/views/alchemy/admin/essence_flashes/edit.html.erb
45
+ - app/views/alchemy/admin/essence_files/assign.js.erb
48
46
  - app/views/alchemy/admin/essence_videos/edit.html.erb
49
47
  - app/views/alchemy/essences/_essence_audio_editor.html.erb
50
48
  - app/views/alchemy/essences/_essence_audio_view.html.erb
51
- - app/views/alchemy/essences/_essence_flash_editor.html.erb
52
- - app/views/alchemy/essences/_essence_flash_view.html.erb
53
49
  - app/views/alchemy/essences/_essence_video_editor.html.erb
54
50
  - app/views/alchemy/essences/_essence_video_view.html.erb
55
51
  - app/views/alchemy/essences/_richmedia_essence_editor.html.erb
56
52
  - config/routes.rb
57
53
  - db/migrate/20121113171023_create_alchemy_richmedia_essences.rb
54
+ - db/migrate/20140814212620_alchemy_essence_video_html5_update.rb
55
+ - db/migrate/20150728153847_remove_alchemy_essence_flashes.rb
56
+ - db/migrate/20150728172823_alchemy_essence_audio_html5_update.rb
58
57
  - lib/alchemy-richmedia-essences.rb
59
58
  - lib/alchemy-richmedia-essences/ability.rb
60
59
  - lib/alchemy-richmedia-essences/engine.rb
@@ -79,10 +78,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
78
  version: '0'
80
79
  requirements: []
81
80
  rubyforge_project:
82
- rubygems_version: 2.2.2
81
+ rubygems_version: 2.4.8
83
82
  signing_key:
84
83
  specification_version: 4
85
- summary: Adds EssenceAudio, EssenceFlash and EssenceVideo essences to your Alchemy
86
- CMS powered site.
84
+ summary: Adds EssenceAudio and EssenceVideo essences to your Alchemy CMS powered site.
87
85
  test_files: []
88
- has_rdoc:
@@ -1,25 +0,0 @@
1
- module Alchemy
2
- class Admin::EssenceFlashesController < Alchemy::Admin::BaseController
3
- authorize_resource class: Alchemy::EssenceFlash
4
- before_filter :load_essence
5
-
6
- def update
7
- @essence_flash.update(essence_flash_params)
8
- end
9
-
10
- private
11
-
12
- def load_essence
13
- @essence_flash = EssenceFlash.find(params[:id])
14
- end
15
-
16
- def essence_flash_params
17
- params.require(:essence_flash).permit(
18
- :width,
19
- :height,
20
- :player_version,
21
- :attachment_id
22
- )
23
- end
24
- end
25
- end
@@ -1,8 +0,0 @@
1
- module Alchemy
2
- class EssenceFlash < ActiveRecord::Base
3
- acts_as_essence ingredient_column: 'attachment',
4
- preview_text_method: 'name'
5
-
6
- belongs_to :attachment
7
- end
8
- end
@@ -1,6 +0,0 @@
1
- <%= alchemy_form_for [:admin, @essence_flash] do |f| %>
2
- <%= f.input :width %>
3
- <%= f.input :height %>
4
- <%= f.input :player_version %>
5
- <%= f.submit _t(:save) %>
6
- <% end %>
@@ -1,6 +0,0 @@
1
- <%= render(
2
- "alchemy/essences/richmedia_essence_editor",
3
- :options => options,
4
- :content => content,
5
- :controller => 'essence_flashes'
6
- ) %>
@@ -1,26 +0,0 @@
1
- <%- unless content.essence.attachment.nil? -%>
2
- <%- width = content.essence.width.blank? ? (options[:flash_movie_size].split('x')[0] rescue 320) : content.essence.width -%>
3
- <%- height = content.essence.height.blank? ? (options[:flash_movie_size].split('x')[1] rescue 200) : content.essence.height -%>
4
- <%- player_version = content.essence.player_version.blank? ? "8" : content.essence.player_version -%>
5
- <div class="flash_film">
6
- <div id="swf_container_<%= content.id %>">
7
- Sie brauchen den neusten <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Flash-Player</a> und Sie müssen JavaScript aktivieren.
8
- </div>
9
- <script type="text/javascript" charset="utf-8">
10
- var flashvars = {};
11
- var params = {};
12
- var attributes = {};
13
- swfobject.embedSWF(
14
- "<%= content.essence.attachment.public_filename %>",
15
- "swf_container_<%= content.id %>",
16
- '<%= width %>',
17
- '<%= height %>',
18
- '<%= player_version %>',
19
- false,
20
- flashvars,
21
- params,
22
- attributes
23
- );
24
- </script>
25
- </div>
26
- <%- end -%>