scrivito_facebook_widget 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +4 -0
- data/README.md +23 -0
- data/Rakefile +24 -0
- data/app/assets/javascripts/scrivito_facebook_widget.js +14 -0
- data/app/models/facebook_widget.rb +23 -0
- data/app/views/facebook_widget/_page.html.erb +1 -0
- data/app/views/facebook_widget/_post.html.erb +1 -0
- data/app/views/facebook_widget/_video.html.erb +1 -0
- data/app/views/facebook_widget/details.html.erb +26 -0
- data/app/views/facebook_widget/show.html.erb +1 -0
- data/app/views/facebook_widget/thumbnail.html.erb +3 -0
- data/lib/scrivito_facebook_widget.rb +4 -0
- data/lib/scrivito_facebook_widget/engine.rb +5 -0
- data/lib/scrivito_facebook_widget/version.rb +3 -0
- data/lib/tasks/scrivito_facebook_widget_tasks.rake +4 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c086729834353c67beced6753e07e4e9e2d79779
|
4
|
+
data.tar.gz: 87b22fe51cce2b905fccb7805e525764449b5fea
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b276a61ea755177965c7c9731c0947a02fae9697d23d0c93dfd048aa5d8cc56872c704d2683673c3b5fb4e9907c2a233c00c58e7e40bc8e04d27de1a05371a48
|
7
|
+
data.tar.gz: d57c15f4d4f9796cfb4716f9487dedfc8e93b99d41f17632d305917478983dcef391ebd17c3b92812973efe02cd4fb25ad4b3019e52e7a7b9f1b51b7e59fda3c
|
data/LICENSE
ADDED
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# ScrivitoFacebookWidget
|
2
|
+
|
3
|
+
A Widget for scrivito to insert a Facebok stream. You can add a page by its url, a video or a single post.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add to your gemfile
|
8
|
+
|
9
|
+
gem 'scrivito_facebook_widget'
|
10
|
+
|
11
|
+
Add to your Javascript mainfest
|
12
|
+
|
13
|
+
//= require scrivito_facebook_widget
|
14
|
+
|
15
|
+
## Facebook App id
|
16
|
+
|
17
|
+
Normaly you will see a warning, that no app id is set. This is no problem as long as you do not want to use private content on you webpage.
|
18
|
+
|
19
|
+
Iy you want to remove this warning, you have to set a global variable in javascript at the beginning of you document.
|
20
|
+
|
21
|
+
```javascript
|
22
|
+
var fbAppId = yourAppId
|
23
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ScrivitoFacebookWidget'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
load 'rails/tasks/statistics.rake'
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
Bundler::GemHelper.install_tasks
|
24
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$(function() {
|
2
|
+
$('body').prepend('<div id="fb-root"></div>');
|
3
|
+
|
4
|
+
$.getScript('//connect.facebook.net/en_US/sdk.js', function(){
|
5
|
+
FB.init({
|
6
|
+
appId: ("fbAppId" in window) ? window.fbAppId : '',
|
7
|
+
version: 'v2.3'
|
8
|
+
});
|
9
|
+
|
10
|
+
scrivito.on('content', function() {
|
11
|
+
FB.XFBML.parse();
|
12
|
+
});
|
13
|
+
});
|
14
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class FacebookWidget < Widget
|
2
|
+
attribute :type, :enum, values: ['page','post','video'], default: 'page'
|
3
|
+
attribute :url, :string
|
4
|
+
attribute :allowfullscreen, :enum, values: ['Yes', 'No'], default: 'Yes'
|
5
|
+
attribute :width, :string, default: '500'
|
6
|
+
attribute :height, :string, default: '700'
|
7
|
+
attribute :hide_cover, :enum, values: ['Yes', 'No'], default: 'No'
|
8
|
+
attribute :show_facepile, :enum, values: ['Yes', 'No'], default: 'Yes'
|
9
|
+
attribute :show_posts, :enum, values: ['Yes', 'No'], default: 'Yes'
|
10
|
+
attribute :hide_cta, :enum, values: ['Yes', 'No'], default: 'No'
|
11
|
+
|
12
|
+
def facebook_data
|
13
|
+
{
|
14
|
+
href: url,
|
15
|
+
width: width,
|
16
|
+
height: height,
|
17
|
+
hide_cover: hide_cover == "Yes" ? 'true' : 'false',
|
18
|
+
show_facepile: show_facepile == "Yes" ? 'true' : 'false',
|
19
|
+
show_posts: show_posts == "Yes" ? 'true' : 'false',
|
20
|
+
hide_cta: hide_cta == "Yes" ? 'true' : 'false'
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= content_tag :div, '', class: 'fb-page', data: widget.facebook_data %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div class="fb-post" data-href="<%= widget.url %>"></div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div class="fb-video" data-allowfullscreen="<%= widget.allowfullscreen == "Yes" %>" data-href="<%= widget.url %>" data-width="100%"></div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= scrivito_details_for 'Type' do %>
|
2
|
+
<%= scrivito_toggle_button_editor widget, :type %>
|
3
|
+
<% end %>
|
4
|
+
<%= scrivito_details_for 'Url' do %>
|
5
|
+
<%= scrivito_tag :div, widget, :url %>
|
6
|
+
<% end %>
|
7
|
+
<%= scrivito_details_for 'More Options for type page' do %>
|
8
|
+
<%= scrivito_details_for 'Max Width (max: 500; min: 180)' do %>
|
9
|
+
<%= scrivito_tag :div, widget, :width %>
|
10
|
+
<% end %>
|
11
|
+
<%= scrivito_details_for 'Height (min: 70)' do %>
|
12
|
+
<%= scrivito_tag :div, widget, :height %>
|
13
|
+
<% end %>
|
14
|
+
<%= scrivito_details_for 'Hide cover' do %>
|
15
|
+
<%= scrivito_toggle_button_editor widget, :hide_cover %>
|
16
|
+
<% end %>
|
17
|
+
<%= scrivito_details_for 'Show faces' do %>
|
18
|
+
<%= scrivito_toggle_button_editor widget, :hide_cover %>
|
19
|
+
<% end %>
|
20
|
+
<%= scrivito_details_for 'Show latest posts' do %>
|
21
|
+
<%= scrivito_toggle_button_editor widget, :show_posts %>
|
22
|
+
<% end %>
|
23
|
+
<%= scrivito_details_for 'Hide cta' do %>
|
24
|
+
<%= scrivito_toggle_button_editor widget, :hide_cta %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render "facebook_widget/#{widget.type}", widget: widget %>
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scrivito_facebook_widget
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scrivito
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: scrivito
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A widget for scrivito to create a facebook stream.
|
56
|
+
email:
|
57
|
+
- support@scrivito.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- LICENSE
|
63
|
+
- README.md
|
64
|
+
- Rakefile
|
65
|
+
- app/assets/javascripts/scrivito_facebook_widget.js
|
66
|
+
- app/models/facebook_widget.rb
|
67
|
+
- app/views/facebook_widget/_page.html.erb
|
68
|
+
- app/views/facebook_widget/_post.html.erb
|
69
|
+
- app/views/facebook_widget/_video.html.erb
|
70
|
+
- app/views/facebook_widget/details.html.erb
|
71
|
+
- app/views/facebook_widget/show.html.erb
|
72
|
+
- app/views/facebook_widget/thumbnail.html.erb
|
73
|
+
- lib/scrivito_facebook_widget.rb
|
74
|
+
- lib/scrivito_facebook_widget/engine.rb
|
75
|
+
- lib/scrivito_facebook_widget/version.rb
|
76
|
+
- lib/tasks/scrivito_facebook_widget_tasks.rake
|
77
|
+
homepage: https://www.scrivito.com
|
78
|
+
licenses:
|
79
|
+
- LGPL-3.0
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.4.5
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: A widget for scrivito to create a facebook stream.
|
101
|
+
test_files: []
|