scrivito_twitter_widget 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aa40d0716edfc6bb3ce9b07f8cbf8a112cc0aa39
4
+ data.tar.gz: 96a111abafb70094e0b83c1c7a6267548445e136
5
+ SHA512:
6
+ metadata.gz: f89ac36c9c675e794a2b537a7f8568b675feb6ea3f2383fbce333a6a9c9d0f33ac7fde0195cdf18a60a0c3e3192fce64fadcb7fe28846b202f4c9f16bf81d9e1
7
+ data.tar.gz: 95c96954b2d4d2e1a8737e1d95c56806d64e8ef629d96b365bdc4022cffdc7c0992fb6e045f996fb22f4edb836fe25cf742ca22353a0e56c6f717b8a5013055f
data/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ Copyright (c) 2009 - 2015 Infopark AG (http://www.infopark.com)
2
+
3
+ This software can be used and modified under the LGPL-3.0. Please refer to
4
+ http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
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 = 'ScrivitoTwitterWidget'
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,34 @@
1
+ window.twttr = (function(d, s, id) {
2
+ var js, fjs = d.getElementsByTagName(s)[0],
3
+ t = window.twttr || {};
4
+ if (d.getElementById(id)) return t;
5
+ js = d.createElement(s);
6
+ js.id = id;
7
+ js.src = "https://platform.twitter.com/widgets.js";
8
+ fjs.parentNode.insertBefore(js, fjs);
9
+
10
+ t._e = [];
11
+ t.ready = function(f) {
12
+ t._e.push(f);
13
+ };
14
+
15
+ return t;
16
+ }(document, "script", "twitter-wjs"));
17
+
18
+ twttr.ready(function(twttr) {
19
+ scrivito.on('content', function(content) {
20
+ $.each($('.tweet_by_id'), function(index, elem) {
21
+ var id = $(elem).data('id');
22
+ var type = $(elem).data('type');
23
+
24
+ $(elem).html('');
25
+ if(type == "video") {
26
+ twttr.widgets.createVideo(id, elem)
27
+ } else if(type == "timeline") {
28
+ twttr.widgets.createTimeline(id, elem)
29
+ } else {
30
+ twttr.widgets.createTweet(id, elem)
31
+ }
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,4 @@
1
+ class TwitterWidget < Widget
2
+ attribute :tweet_id, :string
3
+ attribute :type, :enum, values: ['tweet', 'timeline', 'video'], default: 'tweet'
4
+ end
@@ -0,0 +1,13 @@
1
+ <%= scrivito_details_for 'Type Id' do %>
2
+ <%= scrivito_toggle_button_editor widget, :type %>
3
+ <% end %>
4
+ <%= scrivito_details_for 'Id' do %>
5
+ <%= scrivito_tag :div, widget, :tweet_id %>
6
+ <% end %>
7
+ <div class="alert alert-info">
8
+ If you select timline, you have to
9
+ <a href="https://twitter.com/settings/widgets/new" target="_blank">
10
+ create a new timeline
11
+ </a>
12
+ on twitter and use the ID of it.
13
+ </div>
@@ -0,0 +1,7 @@
1
+ <% if widget.tweet_id.present? %>
2
+ <div class="tweet_by_id" data-id="<%= widget.tweet_id %>" data-type="<%= widget.type %>"></div>
3
+ <% else %>
4
+ <div class="alert alert-info">
5
+ No id ist present. Select it on details view.
6
+ </div>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= scrivito_thumbnail 'Twitter widget' do %>
2
+ Add tweets to the Page.
3
+ <% end %>
@@ -0,0 +1,4 @@
1
+ require "scrivito_twitter_widget/engine"
2
+
3
+ module ScrivitoTwitterWidget
4
+ end
@@ -0,0 +1,5 @@
1
+ module ScrivitoTwitterWidget
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace ScrivitoTwitterWidget
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module ScrivitoTwitterWidget
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :scrivito_twitter_widget do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scrivito_twitter_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 twitter stream.
56
+ email:
57
+ - support@scrivito.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE
63
+ - Rakefile
64
+ - app/assets/javascripts/scrivito_twitter_widget.js
65
+ - app/models/twitter_widget.rb
66
+ - app/views/twitter_widget/details.html.erb
67
+ - app/views/twitter_widget/show.html.erb
68
+ - app/views/twitter_widget/thumbnail.html.erb
69
+ - lib/scrivito_twitter_widget.rb
70
+ - lib/scrivito_twitter_widget/engine.rb
71
+ - lib/scrivito_twitter_widget/version.rb
72
+ - lib/tasks/scrivito_twitter_widget_tasks.rake
73
+ homepage: https://www.scrivito.com
74
+ licenses:
75
+ - LGPL-3.0
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.4.5
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: A widget for scrivito to create a twitter stream.
97
+ test_files: []