pageflow 13.0.0 → 13.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pageflow might be problematic. Click here for more details.

Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -267
  3. data/admins/pageflow/accounts.rb +5 -3
  4. data/app/assets/javascripts/pageflow/base.js +1 -0
  5. data/app/assets/javascripts/pageflow/browser/video.js +6 -1
  6. data/app/assets/javascripts/pageflow/delayed_start.js +50 -0
  7. data/app/assets/javascripts/pageflow/dist/react.js +1733 -989
  8. data/app/assets/javascripts/pageflow/editor/models/widget.js +2 -1
  9. data/app/assets/javascripts/pageflow/editor/models/widget_configuration_file_selection_handler.js +16 -0
  10. data/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +2 -0
  11. data/app/assets/javascripts/pageflow/editor/views/widget_types/classic_loading_spinner.js +11 -0
  12. data/app/assets/javascripts/pageflow/editor/views/widget_types/title_loading_spinner.js +20 -0
  13. data/app/assets/javascripts/pageflow/jquery_utils.js +10 -0
  14. data/app/assets/javascripts/pageflow/manual_start.js +2 -20
  15. data/app/assets/javascripts/pageflow/ready.js +3 -1
  16. data/app/assets/javascripts/pageflow/slideshow.js +1 -1
  17. data/app/assets/javascripts/pageflow/slideshow/page_widget.js +1 -1
  18. data/app/assets/javascripts/pageflow/slideshow/scroll_indicator_widget.js +1 -1
  19. data/app/assets/javascripts/pageflow/video_player/filter_sources.js +16 -2
  20. data/app/assets/javascripts/pageflow/widgets.js +1 -0
  21. data/app/assets/javascripts/pageflow/widgets/navigation.js +1 -0
  22. data/app/assets/javascripts/pageflow/widgets/navigation_mobile.js +1 -0
  23. data/app/assets/javascripts/pageflow/widgets/overview.js +3 -1
  24. data/app/assets/stylesheets/pageflow/navigation_bar.scss +0 -4
  25. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner.scss +2 -0
  26. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner/title.scss +158 -0
  27. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +35 -30
  28. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +25 -10
  29. data/app/helpers/pageflow/common_entry_seed_helper.rb +0 -1
  30. data/app/helpers/pageflow/entry_json_seed_helper.rb +7 -0
  31. data/app/models/pageflow/theming.rb +2 -1
  32. data/app/views/admin/accounts/_form.html.erb +7 -0
  33. data/app/views/admin/accounts/_theming_details.html.arb +3 -0
  34. data/app/views/pageflow/entries/_mobile_navigation.html.erb +2 -3
  35. data/app/views/pageflow/entries/mobile_navigation/_page.html.erb +5 -0
  36. data/app/views/pageflow/entries/navigation/_page.html.erb +3 -1
  37. data/app/views/pageflow/entries/overview/_page.html.erb +1 -1
  38. data/app/views/pageflow/entries/show.html.erb +0 -1
  39. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -0
  40. data/app/views/pageflow/react/_widget.html.erb +8 -1
  41. data/config/locales/de.yml +27 -0
  42. data/config/locales/en.yml +27 -0
  43. data/db/migrate/20190109085744_add_default_locale_to_themings.rb +6 -0
  44. data/lib/pageflow/built_in_widget_type.rb +14 -0
  45. data/lib/pageflow/built_in_widget_types_plugin.rb +12 -1
  46. data/lib/pageflow/react.rb +2 -2
  47. data/lib/pageflow/react/widget_type.rb +5 -2
  48. data/lib/pageflow/version.rb +1 -1
  49. metadata +10 -5
  50. data/app/assets/javascripts/pageflow/widgets/loading_spinner.js +0 -23
  51. data/app/views/pageflow/entries/_loading_spinner.html.erb +0 -5
@@ -8,6 +8,7 @@ pageflow.Widget = Backbone.Model.extend({
8
8
  this.configuration = new pageflow.WidgetConfiguration(
9
9
  this.get('configuration') || {}
10
10
  );
11
+ this.configuration.parent = this;
11
12
 
12
13
  this.listenTo(this.configuration, 'change', function() {
13
14
  this.trigger('change:configuration', this);
@@ -37,4 +38,4 @@ pageflow.Widget = Backbone.Model.extend({
37
38
  configuration: this.configuration.toJSON()
38
39
  };
39
40
  },
40
- });
41
+ });
@@ -0,0 +1,16 @@
1
+ pageflow.WidgetConfigurationFileSelectionHandler = function(options) {
2
+ var widget = pageflow.entry.widgets.get(options.id);
3
+
4
+ this.call = function(file) {
5
+ widget.configuration.setReference(options.attributeName, file);
6
+ };
7
+
8
+ this.getReferer = function() {
9
+ return '/widgets/' + widget.id;
10
+ };
11
+ };
12
+
13
+ pageflow.editor.registerFileSelectionHandler(
14
+ 'widgetConfiguration',
15
+ pageflow.WidgetConfigurationFileSelectionHandler
16
+ );
@@ -68,6 +68,8 @@ pageflow.EntryPreviewView = Backbone.Marionette.ItemView.extend({
68
68
  simulateHistory: true
69
69
  });
70
70
 
71
+ pageflow.delayedStart.perform();
72
+
71
73
  this.listenTo(this.pages, 'add', function() {
72
74
  slideshow.update();
73
75
  });
@@ -0,0 +1,11 @@
1
+ pageflow.editor.widgetTypes.register('classic_loading_spinner', {
2
+ configurationEditorView: pageflow.ConfigurationEditorView.extend({
3
+ configure: function() {
4
+ this.tab('loading_spinner', function() {
5
+ this.view(pageflow.InfoBoxView, {
6
+ text: I18n.t('pageflow.editor.classic_loading_spinner.widget_type_info_box_text')
7
+ });
8
+ });
9
+ }
10
+ })
11
+ });
@@ -0,0 +1,20 @@
1
+ pageflow.editor.widgetTypes.register('title_loading_spinner', {
2
+ configurationEditorView: pageflow.ConfigurationEditorView.extend({
3
+ configure: function() {
4
+ this.tab('loading_spinner', function() {
5
+ this.view(pageflow.InfoBoxView, {
6
+ text: I18n.t('pageflow.editor.title_loading_spinner.widget_type_info_box_text')
7
+ });
8
+ this.input('title', pageflow.TextInputView, {
9
+ placeholder: pageflow.entry.configuration.get('title') ||
10
+ pageflow.entry.get('entry_title'),
11
+ });
12
+ this.input('subtitle', pageflow.TextInputView);
13
+ this.input('custom_background_image_id', pageflow.FileInputView, {
14
+ collection: 'image_files',
15
+ fileSelectionHandler: 'widgetConfiguration'
16
+ });
17
+ });
18
+ }
19
+ })
20
+ });
@@ -10,3 +10,13 @@ $.fn.updateTitle = function () {
10
10
  this.attr('title', this.data('title'));
11
11
  }
12
12
  };
13
+
14
+ $.fn.loadLazyImages = function() {
15
+ this.find('img[data-src]').each(function() {
16
+ var img = $(this);
17
+
18
+ if (!img.attr('src')) {
19
+ img.attr('src', img.data('src'));
20
+ }
21
+ });
22
+ };
@@ -4,32 +4,14 @@ pageflow.manualStart = (function($) {
4
4
 
5
5
  $(function() {
6
6
  if (pageflow.manualStart.enabled) {
7
+ pageflow.delayedStart.waitFor(waitDeferred);
7
8
  requiredDeferred.resolve(waitDeferred.resolve);
8
9
  }
9
- else {
10
- waitDeferred.resolve();
11
- }
12
10
  });
13
11
 
14
12
  return {
15
- wait: function(callback) {
16
- var cancelled = false;
17
-
18
- waitDeferred.then(function() {
19
- if (!cancelled) {
20
- callback();
21
- }
22
- });
23
-
24
- return {
25
- cancel: function() {
26
- cancelled = true;
27
- }
28
- };
29
- },
30
-
31
13
  required: function() {
32
14
  return requiredDeferred.promise();
33
15
  }
34
16
  };
35
- }(jQuery));
17
+ }(jQuery));
@@ -6,6 +6,7 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
6
6
 
7
7
  body.one('pagepreloaded', function() {
8
8
  readyDeferred.resolve();
9
+ pageflow.events.trigger('ready');
9
10
  });
10
11
 
11
12
  pageflow.Visited.setup();
@@ -32,6 +33,7 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
32
33
  $('.multimedia_alert').multimediaAlert();
33
34
 
34
35
  pageflow.widgetTypes.enhance(body);
36
+ pageflow.delayedStart.perform();
35
37
  pageflow.phoneLandscapeFullscreen();
36
38
  }
37
39
  });
@@ -42,4 +44,4 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
42
44
  pageflow.nativeScrolling.preventScrollingOnEmbed(slideshow);
43
45
  });
44
46
  };
45
- }).promise();
47
+ }).promise();
@@ -194,7 +194,7 @@ pageflow.Slideshow = function($el, configurations) {
194
194
  }
195
195
 
196
196
  function getPageByPermaId(permaId) {
197
- return $el.find('#' + permaId);
197
+ return $el.find('#' + parseInt(permaId, 10));
198
198
  }
199
199
 
200
200
  this.on = function() {
@@ -175,7 +175,7 @@
175
175
 
176
176
  _triggerDelayedPageTypeHook: function(name) {
177
177
  var that = this;
178
- var handle = pageflow.manualStart.wait(function() {
178
+ var handle = pageflow.delayedStart.wait(function() {
179
179
  that._triggerPageTypeHook(name);
180
180
  });
181
181
 
@@ -104,7 +104,7 @@
104
104
  that.element.removeClass('visible');
105
105
  });
106
106
 
107
- $.when(pageflow.ready, pageflow.manualStart).done(function() {
107
+ $.when(pageflow.ready, pageflow.delayedStart.promise()).done(function() {
108
108
  setTimeout(function() {
109
109
  that.element.addClass('attract');
110
110
  setTimeout(function() {
@@ -1,8 +1,22 @@
1
1
  pageflow.VideoPlayer.filterSources = function(playerElement) {
2
- if ($(playerElement).is('video') && pageflow.browser.has('mp4 support only')) {
2
+ if (!$(playerElement).is('video')) {
3
+ return playerElement;
4
+ }
5
+
6
+ var changed = false;
7
+
8
+ if (pageflow.browser.has('mp4 support only')) {
3
9
  // keep only mp4 source
4
10
  $(playerElement).find('source').not('source[type="video/mp4"]').remove();
11
+ changed = true;
12
+ }
13
+ else if (pageflow.browser.has('mse and native hls support')) {
14
+ // remove dash source to ensure hls is used
15
+ $(playerElement).find('source[type="application/dash+xml"]').remove();
16
+ changed = true;
17
+ }
5
18
 
19
+ if (changed) {
6
20
  // the video tags initially in the dom are broken since they "saw"
7
21
  // the other sources. replace with clones
8
22
  var clone = $(playerElement).clone(true);
@@ -13,4 +27,4 @@ pageflow.VideoPlayer.filterSources = function(playerElement) {
13
27
  else {
14
28
  return playerElement;
15
29
  }
16
- };
30
+ };
@@ -35,6 +35,7 @@ pageflow.widgets = (function() {
35
35
  .addClass(replacement);
36
36
 
37
37
  pageflow.events.trigger('widgets:update');
38
+ pageflow.slides.triggerResizeHooks();
38
39
  }
39
40
 
40
41
  function className(name, state) {
@@ -87,6 +87,7 @@
87
87
  var handlerIn = function() {
88
88
  if (!('ontouchstart' in document.documentElement)) {
89
89
  $(overlays[index]).css("top", $(this).offset().top).addClass('visible').removeClass('hidden');
90
+ overlays.loadLazyImages();
90
91
  }
91
92
  };
92
93
 
@@ -19,6 +19,7 @@
19
19
  $('.menu.index', element).click(function() {
20
20
  if(!$(element).hasClass('sharing') && !$(element).hasClass('imprint')) {
21
21
  $(element).toggleClass('active');
22
+ element.loadLazyImages();
22
23
  }
23
24
  $(element).removeClass('imprint sharing');
24
25
  });
@@ -18,6 +18,8 @@ jQuery(function($) {
18
18
  var scrollIndicator = $('.slideshow .scroll_indicator');
19
19
 
20
20
  overview.toggleClass('active', state);
21
+ overview.loadLazyImages();
22
+
21
23
  indexButton
22
24
  .toggleClass('active', state)
23
25
  .updateTitle();
@@ -126,4 +128,4 @@ jQuery(function($) {
126
128
  }
127
129
  }
128
130
  });
129
- });
131
+ });
@@ -158,10 +158,6 @@
158
158
 
159
159
  .navigation_site_detail {
160
160
  @include box(-40px);
161
-
162
- img {
163
- margin-top: 12px;
164
- }
165
161
  }
166
162
 
167
163
  .navigation_bg, .navigation_bullet .button {
@@ -46,6 +46,8 @@ $loading-spinner-glow-size: 140px !default;
46
46
  /// File extension of background and logo
47
47
  $loading-spinner-image-file-extension: "png" !default;
48
48
 
49
+ @import "./loading_spinner/title";
50
+
49
51
  @if not $custom-loading-spinner {
50
52
  .loading_spinner {
51
53
  // scss-lint:disable ImportantRule
@@ -0,0 +1,158 @@
1
+ $title-loading-spinner-typography: () !default;
2
+
3
+ $title-loading-spinner-title-typography: () !default;
4
+
5
+ $title-loading-spinner-phone-title-typography: () !default;
6
+
7
+ $title-loading-spinner-subtitle-typography: () !default;
8
+
9
+ $title-loading-spinner-phone-subtitle-typography: () !default;
10
+
11
+ .title_loading_spinner {
12
+ $duration: 7s;
13
+
14
+ &:before {
15
+ content: "";
16
+ display: block;
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0;
20
+ bottom: 0;
21
+ right: 0;
22
+ z-index: 1;
23
+ background-color: rgba(0, 0, 0, 0.15);
24
+ }
25
+
26
+ &-image {
27
+ background-size: cover;
28
+ filter: blur(50px);
29
+ height: 100%;
30
+ }
31
+
32
+ &-titles {
33
+ @include standard-typography(
34
+ $title-loading-spinner-typography,
35
+ (
36
+ text-align: center
37
+ )
38
+ );
39
+ position: absolute;
40
+ top: 40%;
41
+ left: 50%;
42
+ width: 100%;
43
+ padding: 1em;
44
+ box-sizing: border-box;
45
+ transform: translate(-50%, -50%);
46
+ z-index: 1;
47
+ color: #fff;
48
+ opacity: 0;
49
+ }
50
+
51
+ &-title {
52
+ &:after {
53
+ content: "";
54
+ display: block;
55
+ width: 100px;
56
+ border-bottom: solid 2px #fff;
57
+ margin: 20px auto;
58
+ }
59
+
60
+ @include typography(
61
+ $title-loading-spinner-title-typography,
62
+ (
63
+ font-weight: bold,
64
+ font-size: 5.3em
65
+ )
66
+ );
67
+
68
+ @include phone {
69
+ &:after {
70
+ border-bottom-width: 1px;
71
+ }
72
+
73
+ @include typography(
74
+ $title-loading-spinner-phone-title-typography,
75
+ (
76
+ font-size: 2em
77
+ )
78
+ );
79
+ }
80
+ }
81
+
82
+ &-subtitle {
83
+ @include typography(
84
+ $title-loading-spinner-subtitle-typography,
85
+ (
86
+ font-size: 1.5em,
87
+ )
88
+ );
89
+
90
+ @include phone {
91
+ @include typography(
92
+ $title-loading-spinner-phone-subtitle-typography,
93
+ (
94
+ font-size: 1em
95
+ )
96
+ );
97
+ }
98
+ }
99
+
100
+ &-logo {
101
+ @extend %pageflow_widget_margin_right !optional;
102
+ position: relative;
103
+
104
+ &:after {
105
+ @extend %background_logo;
106
+ content: "";
107
+ display: block;
108
+ z-index: 1;
109
+ opacity: 0;
110
+ }
111
+ }
112
+
113
+ &-fade {
114
+ @include animation(fade_out 1s ease 1);
115
+ @include animation-delay($duration + 0.5s);
116
+ @include animation-fill-mode(forwards);
117
+
118
+ .title_loading_spinner-titles {
119
+ @include animation(title_fade $duration ease-out 1);
120
+ @include animation-fill-mode(forwards);
121
+ }
122
+
123
+ .title_loading_spinner-logo:after {
124
+ @include animation(fade_in 1s ease-out 1);
125
+ @include animation-fill-mode(forwards);
126
+ }
127
+ }
128
+
129
+ @include keyframes(title_fade) {
130
+ 0% {
131
+ @include transform(translate(-50%, -30%));
132
+ opacity: 0;
133
+ }
134
+
135
+ 20% {
136
+ @include transform(translate(-50%, -30%));
137
+ opacity: 0;
138
+ }
139
+
140
+ 50% {
141
+ opacity: 1;
142
+ }
143
+
144
+ 60% {
145
+ @include transform(translate(-50%, -50%));
146
+ }
147
+
148
+ 70% {
149
+ @include transform(translate(-50%, -50%));
150
+ opacity: 1;
151
+ }
152
+
153
+ 100% {
154
+ @include transform(translate(-50%, -50%));
155
+ opacity: 0;
156
+ }
157
+ }
158
+ }
@@ -32,40 +32,45 @@ $logo-background-image-variant-banner-phone-height: null !default;
32
32
  ) {
33
33
  $page-selector: if($first-page-only, ":first-child", "");
34
34
 
35
- .page#{$page-selector} {
36
- .content_and_background .scroller > div:after {
37
- content: "";
38
- position: absolute;
39
- top: $top;
40
- z-index: 200;
41
- min-width: $min-width;
42
- max-width: $max-width;
43
- width: $width;
44
- height: $height;
45
- background-image: image-url("pageflow/themes/#{$theme-name}/logo_header.#{$logo-image-file-extension}");
46
- background-repeat: no-repeat;
47
- background-size: contain;
48
-
49
- @include dir-ltr {
50
- background-position: #{$logo-alignment} top;
51
- }
35
+ %background_logo {
36
+ top: $top;
37
+ position: absolute;
38
+ min-width: $min-width;
39
+ max-width: $max-width;
40
+ width: $width;
41
+ height: $height;
42
+ background-image: image-url("pageflow/themes/#{$theme-name}/logo_header.#{$logo-image-file-extension}");
43
+ background-repeat: no-repeat;
44
+ background-size: contain;
45
+
46
+ @include dir-ltr {
47
+ background-position: #{$logo-alignment} top;
48
+ }
52
49
 
53
- @include dir-rtl {
54
- background-position: #{if($logo-alignment == "left", "right", "left")} top;
55
- }
50
+ @include dir-rtl {
51
+ background-position: #{if($logo-alignment == "left", "right", "left")} top;
52
+ }
56
53
 
57
- @include mobile {
58
- background-position: left top;
59
- padding-top: $logo-background-image-variant-mobile-padding-top;
60
- height: $mobile-height;
61
- }
54
+ @include mobile {
55
+ background-position: left top;
56
+ padding-top: $logo-background-image-variant-mobile-padding-top;
57
+ height: $mobile-height;
58
+ }
62
59
 
63
- @include phone {
64
- height: $phone-height;
65
- top: $phone-top;
66
- }
60
+ @include phone {
61
+ height: $phone-height;
62
+ top: $phone-top;
63
+ }
67
64
 
68
- @include logo-alignment;
65
+ @include logo-alignment;
66
+ }
67
+
68
+ .page#{$page-selector} {
69
+ .content_and_background .scroller > div:after {
70
+ @extend %background_logo;
71
+
72
+ content: "";
73
+ z-index: 200;
69
74
  }
70
75
 
71
76
  &.invert .content_and_background .scroller > div:after {