concerto_iframe 0.0.5 → 0.0.6

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: fa7d2d0ab8e0634979bad0f8a24615c80e527bec
4
- data.tar.gz: e07332086774ad064a4c9eed316842abceecc2aa
3
+ metadata.gz: 372ce5f2ba07aefb851856323a81ba3f8d27dde6
4
+ data.tar.gz: df9bbc226ea1d814764ff4289de911652e6a36e3
5
5
  SHA512:
6
- metadata.gz: 73928ad7b2ae396d414d66016e0574485fcd747999dfdb9e6598b754b2689eac3c2514d9b1e7735bf93fdac713fe216c5d3587aa84bf88fd2eddd294ee9aa2f4
7
- data.tar.gz: 7d09629d75b7ebfab1f6e386068467dd9a697185acdaeced464024b14f66885c59c2f04b2430927eb9504517feab808a04e47a727e6519a7ba5d89c380ee9457
6
+ metadata.gz: ef34055ff31d3b654988c29303809aafd15cda222a13969abd4a5c11f96f24e98f849ab882058a47ce6487d895809a55acb0da5a43c8645edf5cfecd372b5d84
7
+ data.tar.gz: a1ffe9cdc942c27b5eab8bafd4de176e185cb287a21e8977fbb6a0b91aed34bbd62de0cd2624fdd11d7aa0d28b8cf35d0ffbe1f87d174ba65179d32a4ec241dc
data/README.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # Concerto 2 iframe Plugin
2
- This plugin provides support to render a custom iframe, in Concerto 2. It requires the latest version of concerto 2.
2
+ This plugin provides support to render a custom iframe, in Concerto 2. It requires the latest version of Concerto 2.
3
3
 
4
- As of the EchoInchworm beta release, this plugin is included in Concerto 2 and you do _not_ need to perform the manual installation steps below.
5
-
6
- 1. Add to your Gemfile: ```gem 'concerto_iframe'```
7
- 2. ```bundle install```
8
- 3. ```rails generate concerto_iframe:install install```
9
-
10
- The last step produces a lot of output, if it runs successfully, because it recompiles the frontend js files.
4
+ To install this plugin, go to the Plugin management page in concerto, select RubyGems as the source and "concerto_iframe" as the gem name.
11
5
 
12
6
  Concerto 2 iframe is licensed under the Apache License, Version 2.0.
data/app/models/iframe.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  class Iframe < Content
2
- DISPLAY_NAME = "IFrame"
3
-
4
2
  after_initialize :set_kind, :create_config, :load_info
5
3
 
6
4
  after_find :load_config
@@ -1,6 +1,6 @@
1
1
  <%= javascript_include_tag "concerto_iframe/application.js" %>
2
2
  <fieldset>
3
- <legend><span><%= Iframe::DISPLAY_NAME %></span></legend>
3
+ <legend><span><%= Iframe.display_name %></span></legend>
4
4
  <div class="row-fluid">
5
5
  <%= form.fields_for :config do |config| %>
6
6
  <div>
@@ -1,3 +1,3 @@
1
1
  <div style="width: 100%; height: 100%; text-align: center;">
2
- <iframe id="iframe" type="text/html" width="100%" height="100%" src="<%=raw content.config['url'] %>" scrolling="no" frameborder="0"></iframe>
2
+ <iframe id="iframe" type="text/html" width="100%" height="100%" src="<%=raw content.config['url'] %>" scrolling="no" frameborder="0" marginwidth="0"></iframe>
3
3
  </div>
@@ -0,0 +1,35 @@
1
+ <!--
2
+ The `concerto-iframe` element provides embedded content.
3
+ @element concerto-content
4
+ @status alpha
5
+ -->
6
+ <polymer-element name="concerto-iframe" attributes="path" constructor="ConcertoIframe" extends="concerto-content">
7
+ <template>
8
+ <style>
9
+ :host {
10
+ display: block;
11
+ width: 100%;
12
+ height: 100%;
13
+ }
14
+ :host(.core-transition) {
15
+ overflow: hidden;
16
+ }
17
+ #iframe {
18
+ width: 100%;
19
+ height: 100%;
20
+ }
21
+ </style>
22
+ <iframe id="iframe" frameBorder="0"></iframe>
23
+ </template>
24
+
25
+ <script>
26
+ Polymer({
27
+ domReady: function() {
28
+ this.$.iframe.src = this.path;
29
+ }
30
+ });
31
+ </script>
32
+ </polymer-element>
33
+ <script>
34
+ registerContentType("concerto-iframe", "ConcertoIframe");
35
+ </script>
@@ -0,0 +1,4 @@
1
+ en:
2
+ activerecord:
3
+ models:
4
+ iframe: 'IFrame'
@@ -5,5 +5,12 @@ module ConcertoIframe
5
5
  initializer "register content type" do |app|
6
6
  app.config.content_types << Iframe
7
7
  end
8
+
9
+ # Define plugin information for the Concerto application to read
10
+ def plugin_info(plugin_info_class)
11
+ @plugin_info ||= plugin_info_class.new do
12
+ add_view_hook "frontend/ScreensController", :concerto_frontend_plugins, partial: "frontend/concerto_iframe.html"
13
+ end
14
+ end
8
15
  end
9
16
  end
@@ -1,3 +1,4 @@
1
+
1
2
  module ConcertoIframe
2
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
3
4
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concerto_iframe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Frederickson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-21 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '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
26
  version: '0'
27
27
  description: Adds support for custom iframes, in Concerto 2
@@ -31,6 +31,9 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - LICENSE
35
+ - README.md
36
+ - Rakefile
34
37
  - app/assets/javascripts/concerto_iframe/application.js
35
38
  - app/assets/javascripts/concerto_iframe/iframe.js
36
39
  - app/assets/stylesheets/concerto_iframe/application.css
@@ -42,22 +45,21 @@ files:
42
45
  - app/views/contents/iframe/_render_grid.html.erb
43
46
  - app/views/contents/iframe/_render_tile.html.erb
44
47
  - app/views/contents/iframe/_tab_icon.html.erb
48
+ - app/views/frontend/_concerto_iframe.html
49
+ - config/locales/en.yml
45
50
  - config/routes.rb
51
+ - lib/concerto_iframe.rb
46
52
  - lib/concerto_iframe/engine.rb
47
53
  - lib/concerto_iframe/version.rb
48
- - lib/concerto_iframe.rb
49
- - lib/generators/concerto_iframe/install_generator.rb
50
- - lib/tasks/concerto_iframe_tasks.rake
51
- - public/frontend_js/contents/iframe.js
52
- - LICENSE
53
- - Rakefile
54
- - README.md
55
54
  - test/concerto_iframe_test.rb
55
+ - test/dummy/README.rdoc
56
+ - test/dummy/Rakefile
56
57
  - test/dummy/app/assets/javascripts/application.js
57
58
  - test/dummy/app/assets/stylesheets/application.css
58
59
  - test/dummy/app/controllers/application_controller.rb
59
60
  - test/dummy/app/helpers/application_helper.rb
60
61
  - test/dummy/app/views/layouts/application.html.erb
62
+ - test/dummy/config.ru
61
63
  - test/dummy/config/application.rb
62
64
  - test/dummy/config/boot.rb
63
65
  - test/dummy/config/database.yml
@@ -73,13 +75,10 @@ files:
73
75
  - test/dummy/config/initializers/wrap_parameters.rb
74
76
  - test/dummy/config/locales/en.yml
75
77
  - test/dummy/config/routes.rb
76
- - test/dummy/config.ru
77
78
  - test/dummy/public/404.html
78
79
  - test/dummy/public/422.html
79
80
  - test/dummy/public/500.html
80
81
  - test/dummy/public/favicon.ico
81
- - test/dummy/Rakefile
82
- - test/dummy/README.rdoc
83
82
  - test/dummy/script/rails
84
83
  - test/fixtures/concerto_iframe/iframes.yml
85
84
  - test/integration/navigation_test.rb
@@ -95,17 +94,17 @@ require_paths:
95
94
  - lib
96
95
  required_ruby_version: !ruby/object:Gem::Requirement
97
96
  requirements:
98
- - - '>='
97
+ - - ">="
99
98
  - !ruby/object:Gem::Version
100
99
  version: '0'
101
100
  required_rubygems_version: !ruby/object:Gem::Requirement
102
101
  requirements:
103
- - - '>='
102
+ - - ">="
104
103
  - !ruby/object:Gem::Version
105
104
  version: '0'
106
105
  requirements: []
107
106
  rubyforge_project:
108
- rubygems_version: 2.0.14
107
+ rubygems_version: 2.4.5
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: custom iframe support for Concerto 2
@@ -1,30 +0,0 @@
1
- require 'rails/generators'
2
-
3
- module ConcertoIframe
4
- class InstallGenerator < Rails::Generators::Base
5
- source_root File.expand_path('../../../../', __FILE__)
6
-
7
- desc 'Copy the Iframe JavaScript to the frontend and register it.'
8
-
9
- def install
10
- copy_js
11
- register
12
- recompile
13
- end
14
-
15
- private
16
- def copy_js
17
- copy_file 'public/frontend_js/contents/iframe.js', 'public/frontend_js/contents/iframe.js'
18
- end
19
-
20
- def register
21
- append_file 'public/frontend_js/content_types.js', "goog.require('concerto.frontend.Content.Iframe');\n"
22
- end
23
-
24
- def recompile
25
- inside 'public/frontend_js' do
26
- run('/bin/bash compile.sh', {:verbose => true})
27
- end
28
- end
29
- end
30
- end
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :concerto_iframe do
3
- # # Task goes here
4
- # end
@@ -1,77 +0,0 @@
1
- goog.provide('concerto.frontend.Content.Iframe');
2
-
3
- goog.require('concerto.frontend.Content');
4
- goog.require('concerto.frontend.ContentTypeRegistry');
5
- goog.require('goog.Uri');
6
- goog.require('goog.dom');
7
- goog.require('goog.events');
8
- goog.require('goog.events.EventType');
9
- goog.require('goog.style');
10
-
11
-
12
-
13
- /**
14
- * Iframe.
15
- *
16
- * @param {Object} data Properties for this piece of content.
17
- * @constructor
18
- * @extends {concerto.frontend.Content}
19
- */
20
- concerto.frontend.Content.Iframe = function(data) {
21
- concerto.frontend.Content.call(this, data);
22
-
23
- /**
24
- * The height of the field the image is being shown in.
25
- * @type {number}
26
- * @private
27
- */
28
- this.field_height_ = parseFloat(data['field']['size']['height']);
29
-
30
- /**
31
- * The width of the field the image is being shown in.
32
- * @type {number}
33
- * @private
34
- */
35
- this.field_width_ = parseFloat(data['field']['size']['width']);
36
-
37
- /**
38
- * The iframe being displayed.
39
- * @type {Object}
40
- */
41
- this.iframe = null;
42
-
43
- /**
44
- * The URL for the video / iframe.
45
- * @type {string}
46
- */
47
- this.url = data['render_details']['path'];
48
-
49
- /**
50
- * Bump the duration of this content by 1 second.
51
- * This attempts to account for 1 second of load time and should be
52
- * improved in the future.
53
- */
54
- this.duration = this.duration + 1;
55
- };
56
- goog.inherits(concerto.frontend.Content.Iframe, concerto.frontend.Content);
57
-
58
- // Register the content type.
59
- concerto.frontend.ContentTypeRegistry['Iframe'] =
60
- concerto.frontend.Content.Iframe;
61
-
62
-
63
- /**
64
- * Build the embed iframe and signal that we're ready to use it.
65
- * @private
66
- */
67
- concerto.frontend.Content.Iframe.prototype.load_ = function() {
68
- this.iframe = goog.dom.createElement('iframe');
69
- this.iframe.src = this.url;
70
- this.iframe.frameborder = 0;
71
- this.iframe.scrolling = 'no';
72
- goog.style.setSize(this.iframe, '100%', '100%');
73
- goog.style.setSize(this.div_, '100%', '100%');
74
- goog.style.setStyle(this.iframe, 'border', 0);
75
- goog.dom.appendChild(this.div_, this.iframe);
76
- this.finishLoad();
77
- };