pageflow-chart 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +13 -0
- data/Gemfile +1 -5
- data/app/assets/javascripts/pageflow/chart/editor/views/embedded/iframe_embedded_view.js +7 -1
- data/app/assets/stylesheets/pageflow/chart/transparent_background.css.erb +4 -0
- data/app/helpers/pageflow/chart/scraped_sites_helper.rb +5 -2
- data/config/locales/de.yml +11 -10
- data/config/locales/en.yml +9 -1
- data/lib/pageflow/chart/scraper.rb +8 -7
- data/lib/pageflow/chart/version.rb +1 -1
- data/spec/pageflow/chart/scraper_spec.rb +9 -3
- metadata +3 -7
- data/config/locales/new/datawrapper_ad.de.yml +0 -10
- data/config/locales/new/datawrapper_ad.en.yml +0 -10
- data/config/locales/new/full_width.de.yml +0 -7
- data/config/locales/new/full_width.en.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11c6001c705a34c2d17a065441d9686e344d7599
|
4
|
+
data.tar.gz: 46f602eb70655ddd464c18eda8de6d609361d6b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd30df75eb0b9604b04f4d7a7a4aabd713b622a171453f58107318acb2dc4fe1a86421c6ccabe958f4d9b04531c262e0a3839975934d43a98823ac4d904aba6
|
7
|
+
data.tar.gz: ae52e80fa81f6cbd3e94102874c6902a151b6c77b4b55bd0422db8c0b7595e91b993ad18b5164c467e3c5b455d2c3d722c27635c113535bd5db1d03a18ff6b1e
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
### Version 0.2.1
|
4
|
+
|
5
|
+
2017-07-12
|
6
|
+
|
7
|
+
[Compare changes](https://github.com/codevise/pageflow-chart/compare/v0.2.0...v0.2.1)
|
8
|
+
|
9
|
+
- Update datawrapper scraping
|
10
|
+
([#36](https://github.com/codevise/pageflow-chart/pull/36))
|
11
|
+
- Ensure custom theme attribute is evaluated correctly
|
12
|
+
([#28](https://github.com/codevise/pageflow-chart/pull/28))
|
13
|
+
- Fix test suite
|
14
|
+
([#27](https://github.com/codevise/pageflow-chart/pull/27))
|
15
|
+
|
3
16
|
### Version 0.2.0
|
4
17
|
|
5
18
|
2016-06-09
|
data/Gemfile
CHANGED
@@ -3,10 +3,6 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in chart.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'activeadmin', :git => 'https://github.com/codevise/active_admin.git', :branch => 'rails4'
|
7
|
-
gem 'ransack'
|
8
|
-
gem 'inherited_resources', '1.4.1'
|
9
|
-
gem 'formtastic', '2.3.0.rc2'
|
10
6
|
gem 'state_machine', git: 'https://github.com/codevise/state_machine.git'
|
11
7
|
|
12
|
-
gem 'pageflow', git: 'https://github.com/codevise/pageflow'
|
8
|
+
gem 'pageflow', git: 'https://github.com/codevise/pageflow', branch: '0-11-stable'
|
@@ -39,7 +39,13 @@ pageflow.chart.IframeEmbeddedView = Backbone.Marionette.View.extend({
|
|
39
39
|
|
40
40
|
if (scrapedSite && scrapedSite.isProcessed()) {
|
41
41
|
this.$el.attr('src', scrapedSite.get('html_file_url'));
|
42
|
-
|
42
|
+
|
43
|
+
if (scrapedSite.get('use_custom_theme')) {
|
44
|
+
this.$el.attr('data-use-custom-theme', 'true');
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
this.$el.removeAttr('data-use-custom-theme');
|
48
|
+
}
|
43
49
|
}
|
44
50
|
else {
|
45
51
|
this.$el.attr('src', '');
|
@@ -17,9 +17,12 @@ module Pageflow
|
|
17
17
|
|
18
18
|
if scraped_site
|
19
19
|
data_attributes = {
|
20
|
-
src: scraped_site.html_file_url
|
21
|
-
use_custom_theme: scraped_site.use_custom_theme
|
20
|
+
src: scraped_site.html_file_url
|
22
21
|
}
|
22
|
+
|
23
|
+
if scraped_site.use_custom_theme
|
24
|
+
data_attributes[:use_custom_theme] = true
|
25
|
+
end
|
23
26
|
end
|
24
27
|
|
25
28
|
content_tag(:iframe, '', IFRAME_ATTRIBUTES.merge(data: data_attributes))
|
data/config/locales/de.yml
CHANGED
@@ -7,34 +7,35 @@ de:
|
|
7
7
|
chart:
|
8
8
|
editor:
|
9
9
|
templates:
|
10
|
+
datawrapper_ad:
|
11
|
+
create_chart: Neues Datawrapper Diagramm erstellen
|
10
12
|
scraped_site_status:
|
11
13
|
failed: Beim Herunterladen des Diagramms ist ein Fehler aufgetreten.
|
12
14
|
pending: Diagramm wird heruntergeladen...
|
13
15
|
help_entries:
|
14
16
|
page_type:
|
15
17
|
menu_item: Diagramm
|
16
|
-
text:
|
17
|
-
|
18
|
+
text: |-
|
19
|
+
# Diagramm
|
18
20
|
|
19
21
|
Einbindung von Datawrapper-Diagrammen
|
20
22
|
|
21
|
-
|
22
23
|
Hier kannst Du Deinen Pageflow um animierte Infografiken ergänzen. Eingebettet ist das
|
23
|
-
|
24
24
|
Diagramm in ein Hintergrund-Bild und Text. Die Infografik lässt sich durch Klicken
|
25
|
-
|
26
25
|
vergrössern.
|
27
26
|
|
28
|
-
|
29
27
|
Dein Diagramm musst Du allerdings zuvor extern erstellen und einen entsprechenden Link generieren. Unter www.datawrapper.de findest Du Beispiele und die Konditionen, um
|
30
|
-
|
31
28
|
diesen Dienst in Anspruch zu nehmen.
|
32
29
|
|
33
|
-
|
34
30
|
Beachte, dass Datawrapper ein spezielles Design für Diagramme bietet, die in Pageflow eingebettet werden sollen. Klicke dazu im "Visualisieren" Schritt des Diagramm Assistenten auf das Tab "Design" und wähle "Pageflow" aus. Das Farbschema des Diagramms ist dann für die Verwendung in Pageflow optimiert.
|
35
31
|
|
36
|
-
|
37
|
-
|
32
|
+
Typische Anwendungsbeispiele: Statistiken, Diagramme, Zahlen&Fakten
|
33
|
+
page_attributes:
|
34
|
+
full_width:
|
35
|
+
inline_help: Verbreitert das Diagramm, so dass es die maximal verfügbare Breite nutzt.
|
36
|
+
label: Gesamte Breite nutzen
|
37
|
+
scraped_site_id:
|
38
|
+
inline_help: 'URL zu einem bei Datawrapper publiziertem Diagramm. Datawrapper bietet in den Diagramm Optionen ein spezielles ''Pageflow'' Design für eine optimale Darstellung innerhalb des Beitrags. '
|
38
39
|
page_type_category_name: Daten und Diagramme
|
39
40
|
page_type_description: Einbindung von Diagrammen, die mit Datawrapper erstellt wurden
|
40
41
|
page_type_name: Diagramm
|
data/config/locales/en.yml
CHANGED
@@ -7,13 +7,21 @@ en:
|
|
7
7
|
chart:
|
8
8
|
editor:
|
9
9
|
templates:
|
10
|
+
datawrapper_ad:
|
11
|
+
create_chart: Create new Datawrapper chart
|
10
12
|
scraped_site_status:
|
11
13
|
failed: Chart download failed.
|
12
14
|
pending: Downloading chart...
|
13
15
|
help_entries:
|
14
16
|
page_type:
|
15
17
|
menu_item: Chart
|
16
|
-
text:
|
18
|
+
text: "# Chart\n\nIntegration of a Datawrapper-Diagram\n\nHere you can add animated infographics to your Pageflow. The diagram is embedded into a background-picture and text. To enlarge the graphic you simply have to click on it. \n\nBut first of all you have to create your graphic externally and generate a link. You can find examples and requirements for this under www.datawrapper.de.\n\nNote that Datawrapper offers a special layout option for charts that shall be embedded into a Pageflow: In the \"Visualize\" step of the chart creation wizard, click the \"Design\" tab and select the \"Pageflow\" layout. That way a color scheme is used which complements Pageflow's look.\n\nExamples of application: statistics, diagrams, numbers & facts"
|
19
|
+
page_attributes:
|
20
|
+
full_width:
|
21
|
+
inline_help: Extends the chart to use the maximum width available.
|
22
|
+
label: Use full width
|
23
|
+
scraped_site_id:
|
24
|
+
inline_help: URL of a chart published via Datawrapper. Datawrapper offers a special 'Pageflow' layout selectable on the 'Design' tab for optimal display inside Pageflow.
|
17
25
|
page_type_category_name: Data and Charts
|
18
26
|
page_type_description: Embedded Datawrapper chart
|
19
27
|
page_type_name: Chart
|
@@ -67,12 +67,13 @@ module Pageflow
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def combine_script_tags_in_head
|
70
|
-
|
70
|
+
script_src_tags_in_head.each(&:remove)
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
document.at_css('head')
|
72
|
+
all_script_src_tag = Nokogiri::XML::Node.new('script', document)
|
73
|
+
all_script_src_tag[:src] = 'all.js'
|
74
|
+
all_script_src_tag[:type] = 'text/javascript'
|
75
|
+
document.at_css('head').children.first
|
76
|
+
.add_previous_sibling(all_script_src_tag)
|
76
77
|
end
|
77
78
|
|
78
79
|
def combine_css_link_tags
|
@@ -86,14 +87,14 @@ module Pageflow
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def filtered_script_tags_in_head
|
89
|
-
|
90
|
+
script_src_tags_in_head.reject do |tag|
|
90
91
|
options.fetch(:head_script_blacklist, []).any? do |regexp|
|
91
92
|
tag[:src] =~ regexp
|
92
93
|
end
|
93
94
|
end
|
94
95
|
end
|
95
96
|
|
96
|
-
def
|
97
|
+
def script_src_tags_in_head
|
97
98
|
document.css('head script[src]')
|
98
99
|
end
|
99
100
|
|
@@ -8,7 +8,9 @@ module Pageflow
|
|
8
8
|
html = <<-HTML
|
9
9
|
<!DOCTYPE html>
|
10
10
|
<html>
|
11
|
-
<head
|
11
|
+
<head>
|
12
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
13
|
+
</head>
|
12
14
|
<body>contents</body>
|
13
15
|
</html>
|
14
16
|
HTML
|
@@ -57,7 +59,9 @@ module Pageflow
|
|
57
59
|
html = <<-HTML
|
58
60
|
<!DOCTYPE html>
|
59
61
|
<html>
|
60
|
-
<head
|
62
|
+
<head>
|
63
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
64
|
+
</head>
|
61
65
|
<body>
|
62
66
|
<script id="good">window.ok = true;</script>
|
63
67
|
<script id="bad">alert();</script>
|
@@ -74,7 +78,9 @@ module Pageflow
|
|
74
78
|
html = <<-HTML
|
75
79
|
<!DOCTYPE html>
|
76
80
|
<html>
|
77
|
-
<head
|
81
|
+
<head>
|
82
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
83
|
+
</head>
|
78
84
|
<body>
|
79
85
|
<div id="bad" class="noscript"></div>
|
80
86
|
<div id="good"></div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageflow-chart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Fischbach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pageflow
|
@@ -260,10 +260,6 @@ files:
|
|
260
260
|
- chart.gemspec
|
261
261
|
- config/locales/de.yml
|
262
262
|
- config/locales/en.yml
|
263
|
-
- config/locales/new/datawrapper_ad.de.yml
|
264
|
-
- config/locales/new/datawrapper_ad.en.yml
|
265
|
-
- config/locales/new/full_width.de.yml
|
266
|
-
- config/locales/new/full_width.en.yml
|
267
263
|
- config/routes.rb
|
268
264
|
- db/migrate/20140417112724_create_pageflow_chart_scraped_sites.rb
|
269
265
|
- db/migrate/20160211085234_add_use_custom_theme_to_scraped_sites.rb
|
@@ -348,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
344
|
version: '0'
|
349
345
|
requirements: []
|
350
346
|
rubyforge_project:
|
351
|
-
rubygems_version: 2.
|
347
|
+
rubygems_version: 2.6.8
|
352
348
|
signing_key:
|
353
349
|
specification_version: 4
|
354
350
|
summary: Pagetype for Embedded Datawrapper Charts
|
@@ -1,10 +0,0 @@
|
|
1
|
-
de:
|
2
|
-
pageflow:
|
3
|
-
chart:
|
4
|
-
editor:
|
5
|
-
templates:
|
6
|
-
datawrapper_ad:
|
7
|
-
create_chart: "Neues Datawrapper Diagramm erstellen"
|
8
|
-
page_attributes:
|
9
|
-
scraped_site_id:
|
10
|
-
inline_help: "URL zu einem bei Datawrapper publiziertem Diagramm. Datawrapper bietet in den Diagramm Optionen ein spezielles 'Pageflow' Design für eine optimale Darstellung innerhalb des Beitrags. "
|
@@ -1,10 +0,0 @@
|
|
1
|
-
en:
|
2
|
-
pageflow:
|
3
|
-
chart:
|
4
|
-
editor:
|
5
|
-
templates:
|
6
|
-
datawrapper_ad:
|
7
|
-
create_chart: "Create new Datawrapper chart"
|
8
|
-
page_attributes:
|
9
|
-
scraped_site_id:
|
10
|
-
inline_help: "URL of a chart published via Datawrapper. Datawrapper offers a special 'Pageflow' layout selectable on the 'Design' tab for optimal display inside Pageflow."
|