pageflow-embedded-video 1.0.0 → 1.1.0

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
- SHA1:
3
- metadata.gz: 2ac513b7feab52d0e36e97b076366c580b957d0a
4
- data.tar.gz: 30c926704d7624f0ff290ab96f27068a97b9d1ec
2
+ SHA256:
3
+ metadata.gz: 58172568a795561cfa5c9b15beb1cf146bbed9185df06fd7a8778aabd290e145
4
+ data.tar.gz: 1bff248bfe9bcbf1559a18cfea8a667f8a272f198aa44e3157c1dfa8bc114a0f
5
5
  SHA512:
6
- metadata.gz: 07560a301494f18d7abbb540a176c9f19c773b1b5cbbfa1f7949d0d68287d432ad51698487e7c5941fcbc4af81dc53f4ee8c83d72e8b9dec0a3e57871b7ffebe
7
- data.tar.gz: 140ea15d8a11c9a6d6a1b15bfc9427a058d7eacb4b6d4ee17555a18af96e38b36a983e539ad771cd6a0bf714dd5a6309e272f0ae927edbd62e1445803e0d64ab
6
+ metadata.gz: 2a83250311ebce3c4f9984d0b6269cf513d539dfd49ac50534de021aca627f644fa25121a6389975a44ea456a358f3e066c93735df10bbe7b543ec9fd5d06e53
7
+ data.tar.gz: cf04b9da398197d01c2a40dc2ccac71932af70022a7e6aac2ea8c015edf64bc5427e47b1c5a65325108f6e1e7b2b3bb00347f031b4ecd297c55307aea1d69605
data/CHANGELOG.md CHANGED
@@ -1,18 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 1.0.0
3
+ ### Version 1.1.0
4
4
 
5
- 2017-08-11
5
+ 2017-11-08
6
6
 
7
- [Compare changes](https://github.com/codevise/pageflow-embedded-video/compare/0-3-stable...v1.0.0)
7
+ [Compare changes](https://github.com/codevise/pageflow-embedded-video/compare/1-0-stable...v1.1.0)
8
8
 
9
- - Do not declare bin stubs as executables in gemspec
10
- ([#17](https://github.com/codevise/pageflow-embedded-video/pull/17))
11
- - Allow to use background video
12
- ([#16](https://github.com/codevise/pageflow-embedded-video/pull/16))
13
- - Rename .css.scss to just .scss
14
- ([#15](https://github.com/codevise/pageflow-embedded-video/pull/15))
9
+ - Require Pageflow 12.1 and make split layout compatible with
10
+ adjustable title max-widths
11
+ ([#20](https://github.com/codevise/pageflow-embedded-video/pull/20),
12
+ [#21](https://github.com/codevise/pageflow-embedded-video/pull/21))
15
13
 
16
14
  See
17
- [0-3-stable branch](https://github.com/codevise/pageflow-embedded-video/blob/0-3-stable/CHANGELOG.md)
15
+ [1-0-stable branch](https://github.com/codevise/pageflow-embedded-video/blob/1-0-stable/CHANGELOG.md)
18
16
  for previous changes.
@@ -26,24 +26,25 @@ pageflow.react.registerPageTypeWithDefaultBackground('embedded_video', {
26
26
  },
27
27
 
28
28
  resize: function(pageElement, configuration) {
29
- var iframeWrapper = pageElement.find('.iframe_wrapper'),
30
- pageHeader = pageElement.find('.page_header'),
31
- scroller = pageElement.find('.scroller'),
32
- container = pageElement.find('.iframe_container'),
33
- iframeOverlay = pageElement.find('.iframe_overlay'),
34
- videoCaption = pageElement.find('.video_caption'),
35
- widescreened = pageElement.width() > 1430,
36
- fullWidth = configuration.full_width,
37
- mobile = pageflow.features.has('mobile platform');
38
-
39
- if (fullWidth && !this.fullscreen) {
40
- widescreened = false;
41
- }
29
+ var iframeWrapper = pageElement.find('.iframe_wrapper');
30
+ var pageHeader = pageElement.find('.page_header');
31
+ var pageTitle = pageHeader.find('.title');
32
+ var scroller = pageElement.find('.scroller');
33
+ var container = pageElement.find('.iframe_container');
34
+ var iframeOverlay = pageElement.find('.iframe_overlay');
35
+ var videoCaption = pageElement.find('.video_caption');
36
+
37
+ var mobile = pageflow.features.has('mobile platform');
38
+ var allowSplitLayout = !configuration.full_width || this.fullscreen;
39
+
40
+ pageElement.toggleClass('page-with_split_layout', allowSplitLayout);
42
41
 
43
- iframeWrapper.add(scroller).toggleClass('widescreened', widescreened);
42
+ var splitLayout = this.wideEnoughForSplitLayout(pageElement) && allowSplitLayout;
43
+
44
+ iframeWrapper.add(scroller).toggleClass('widescreened', splitLayout);
44
45
 
45
46
  if (!this.fullscreen) {
46
- if (widescreened || mobile) {
47
+ if (splitLayout || mobile) {
47
48
  if (!container.find('iframe').length) {
48
49
  container.append(iframeWrapper);
49
50
  }
@@ -55,7 +56,7 @@ pageflow.react.registerPageTypeWithDefaultBackground('embedded_video', {
55
56
  }
56
57
  }
57
58
 
58
- if (widescreened) {
59
+ if (splitLayout) {
59
60
  iframeWrapper.append(videoCaption);
60
61
  }
61
62
  else if (mobile) {
@@ -68,6 +69,21 @@ pageflow.react.registerPageTypeWithDefaultBackground('embedded_video', {
68
69
  scroller.scroller('refresh');
69
70
  },
70
71
 
72
+ wideEnoughForSplitLayout: function(pageElement) {
73
+ var pageTitle = pageElement.find('.page_header .title');
74
+
75
+ var pageTitleClientRect = pageTitle[0].getBoundingClientRect();
76
+ var pageClientRect = pageElement[0].getBoundingClientRect();
77
+
78
+ var spaceRightFromTitle = pageClientRect.right - pageTitleClientRect.right;
79
+ var spaceLeftFromTitle = pageTitleClientRect.left - pageClientRect.left;
80
+ var leftPositionedEmbedWidth = pageClientRect.width * 0.51;
81
+ var rightPositionedEmbedWidth = pageClientRect.width * 0.55;
82
+
83
+ return (spaceLeftFromTitle >= leftPositionedEmbedWidth ||
84
+ spaceRightFromTitle >= rightPositionedEmbedWidth);
85
+ },
86
+
71
87
  prepare: function(pageElement, configuration) {},
72
88
 
73
89
  activating: function(pageElement, configuration) {
@@ -5,10 +5,6 @@
5
5
  margin-top: 40px;
6
6
  }
7
7
 
8
- .page_header h2 .title {
9
- max-width: 500px;
10
- }
11
-
12
8
  .widescreened .contentText {
13
9
  margin-top: 0;
14
10
  }
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
2
  module EmbeddedVideo
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.1.0'.freeze
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.required_ruby_version = '~> 2.1'
20
20
 
21
- spec.add_runtime_dependency 'pageflow', '~> 12.x'
21
+ spec.add_runtime_dependency 'pageflow', '~> 12.1'
22
22
  spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow-embedded-video
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pageflow
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 12.x
19
+ version: '12.1'
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
- version: 12.x
26
+ version: '12.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pageflow-public-i18n
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.6.8
151
+ rubygems_version: 2.7.0
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Pagetype for embedded youtube/vimeo videos