Mediastrategi_Shadowmedia - Version 0.5.1

Version Notes

Bug fixes

Download this release

Release Info

Developer Mediastrategi
Extension Mediastrategi_Shadowmedia
Version 0.5.1
Comparing to
See all releases


Code changes from version 0.5.0 to 0.5.1

app/code/local/Mediastrategi/Shadowmedia/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mediastrategi_Shadowmedia>
5
- <version>0.5.0</version>
6
  </Mediastrategi_Shadowmedia>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Mediastrategi_Shadowmedia>
5
+ <version>0.5.1</version>
6
  </Mediastrategi_Shadowmedia>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mediastrategi_Shadowmedia</name>
4
- <version>0.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.mediastrategi.se/license/">Mediastrategi EULA</license>
7
  <channel>community</channel>
@@ -18,11 +18,11 @@ Features - Lite version:&#xD;
18
  - Possible to show, text, images and movies - using the Magento text editor&#xD;
19
  - Add links and set destination url (used for banners, text etc)&#xD;
20
  - Set interval parameters for the lightbox to control when it will appear again for returning visitors</description>
21
- <notes>New design and more features also bug fixes</notes>
22
  <authors><author><name>Mediastrategi</name><user>mediastrategi</user><email>support@mediastrategi.se</email></author></authors>
23
  <date>2015-02-12</date>
24
- <time>08:45:27</time>
25
- <contents><target name="magelocal"><dir name="Mediastrategi"><dir name="Shadowmedia"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Editor.php" hash="7bcbaaa0d041f2d83b7da33e0a5cfe90"/></dir></dir></dir><file name="Shadowmedia.php" hash="0793b18520511a4cf1a21c30b5061682"/></dir><dir name="Model"><dir name="Source"><file name="Effects.php" hash="ddaed5d721806280230a83d4a541562a"/><file name="Units.php" hash="927b4c0ed8fdfaca32526e860a6f0537"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="06ce8a89fff0363f612c1f61ff172cd7"/><file name="config.xml" hash="56bd104a2828fba5390299a2329a9c60"/><file name="system.xml" hash="938b01da21afac4628c46a12e2c72069"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mediastrategi_Shadowmedia.xml" hash="13b51e1e41f4456e4de03147c28849f1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mediastrategi_shadowmedia.xml" hash="9483ee317d8ccdec6b6b77869aabbfa4"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mediastrategi_shadowmedia.xml" hash="55e74af26a614922237ef2ff12382e5f"/></dir><dir name="template"><dir name="mediastrategi_shadowmedia"><file name="shadowmedia.phtml" hash="d804fb32ff2f52d2d30bb7c08d2564de"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="mediastrategi_shadowmedia.css" hash="55144813e2e70d9354698fa452a5e44a"/></dir><dir name="js"><file name="mediastrategi_shadowmedia.js" hash="47dd158ce0edaa3d1b45dee761e5834d"/><file name="jquery.fitvids.js" hash="3f9f554c9070bbcf1f12e8e746ab2b47"/></dir><dir name="images"><dir name="mediastrategi_shadowmedia"><file name="close.png" hash="8539b3d9600fd90dbcf4b6138292593a"/></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mediastrategi_Shadowmedia</name>
4
+ <version>0.5.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.mediastrategi.se/license/">Mediastrategi EULA</license>
7
  <channel>community</channel>
18
  - Possible to show, text, images and movies - using the Magento text editor&#xD;
19
  - Add links and set destination url (used for banners, text etc)&#xD;
20
  - Set interval parameters for the lightbox to control when it will appear again for returning visitors</description>
21
+ <notes>Bug fixes</notes>
22
  <authors><author><name>Mediastrategi</name><user>mediastrategi</user><email>support@mediastrategi.se</email></author></authors>
23
  <date>2015-02-12</date>
24
+ <time>12:01:56</time>
25
+ <contents><target name="magelocal"><dir name="Mediastrategi"><dir name="Shadowmedia"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Editor.php" hash="7bcbaaa0d041f2d83b7da33e0a5cfe90"/></dir></dir></dir><file name="Shadowmedia.php" hash="0793b18520511a4cf1a21c30b5061682"/></dir><dir name="Model"><dir name="Source"><file name="Effects.php" hash="ddaed5d721806280230a83d4a541562a"/><file name="Units.php" hash="927b4c0ed8fdfaca32526e860a6f0537"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="06ce8a89fff0363f612c1f61ff172cd7"/><file name="config.xml" hash="542aa018d89877f03a4397dadfda5fcb"/><file name="system.xml" hash="938b01da21afac4628c46a12e2c72069"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mediastrategi_Shadowmedia.xml" hash="13b51e1e41f4456e4de03147c28849f1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mediastrategi_shadowmedia.xml" hash="9483ee317d8ccdec6b6b77869aabbfa4"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mediastrategi_shadowmedia.xml" hash="55e74af26a614922237ef2ff12382e5f"/></dir><dir name="template"><dir name="mediastrategi_shadowmedia"><file name="shadowmedia.phtml" hash="d804fb32ff2f52d2d30bb7c08d2564de"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="mediastrategi_shadowmedia.css" hash="3c72d5f1d084e60f4b2f4a30088a7a74"/></dir><dir name="js"><file name="mediastrategi_shadowmedia.js" hash="dae9ed6ff1befa655ce7f65ff5bd1c98"/><file name="jquery.fitvids.js" hash="8d641f726c1938c3fc006484939efc1e"/></dir><dir name="images"><dir name="mediastrategi_shadowmedia"><file name="close.png" hash="8539b3d9600fd90dbcf4b6138292593a"/></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>
skin/frontend/base/default/css/mediastrategi_shadowmedia.css CHANGED
@@ -40,6 +40,10 @@
40
  background: #fff;
41
  }
42
 
 
 
 
 
43
  .shadowmedia-modal.shadowmedia-open.shadowmedia-anchored {
44
  top: 20px;
45
  -webkit-transform: translate(-50%, 0);
40
  background: #fff;
41
  }
42
 
43
+ .shadowmedia-content img {
44
+ max-width: 100%;
45
+ }
46
+
47
  .shadowmedia-modal.shadowmedia-open.shadowmedia-anchored {
48
  top: 20px;
49
  -webkit-transform: translate(-50%, 0);
skin/frontend/base/default/js/jquery.fitvids.js CHANGED
@@ -9,75 +9,81 @@
9
  *
10
  */
11
 
12
- (function( $ ){
 
13
 
14
- "use strict";
15
 
16
- $.fn.fitVids = function( options ) {
17
- var settings = {
18
- customSelector: null,
19
- ignore: null,
20
- };
21
-
22
- if(!document.getElementById('fit-vids-style')) {
23
- // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
24
- var head = document.head || document.getElementsByTagName('head')[0];
25
- var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
26
- var div = document.createElement('div');
27
- div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
28
- head.appendChild(div.childNodes[1]);
29
- }
30
-
31
- if ( options ) {
32
- $.extend( settings, options );
33
- }
34
 
35
- return this.each(function(){
36
- var selectors = [
37
- "iframe[src*='player.vimeo.com']",
38
- "iframe[src*='youtube.com']",
39
- "iframe[src*='youtube-nocookie.com']",
40
- "iframe[src*='kickstarter.com'][src*='video.html']",
41
- "object",
42
- "embed"
43
- ];
44
 
45
- if (settings.customSelector) {
46
- selectors.push(settings.customSelector);
 
 
 
 
 
47
  }
48
 
49
- var ignoreList = '.fitvidsignore';
50
-
51
- if(settings.ignore) {
52
- ignoreList = ignoreList + ', ' + settings.ignore;
53
  }
54
 
55
- var $allVideos = $(this).find(selectors.join(','));
56
- $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
57
- $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
 
 
 
 
 
 
58
 
59
- $allVideos.each(function(){
60
- var $this = $(this);
61
- if($this.parents(ignoreList).length > 0) {
62
- return; // Disable FitVids on this video.
63
- }
64
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
65
- if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
66
- {
67
- $this.attr('height', 9);
68
- $this.attr('width', 16);
69
  }
70
- var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
71
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
72
- aspectRatio = height / width;
73
- if(!$this.attr('id')){
74
- var videoID = 'fitvid' + Math.floor(Math.random()*999999);
75
- $this.attr('id', videoID);
76
  }
77
- $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
78
- $this.removeAttr('height').removeAttr('width');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  });
80
- });
81
- };
82
  // Works with either jQuery or Zepto
83
- })( window.jQuery || window.Zepto );
 
 
9
  *
10
  */
11
 
12
+ // Only run if jQuery Library is found
13
+ if (typeof jQuery != 'undefined') {
14
 
15
+ (function( $ ){
16
 
17
+ "use strict";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
+ $.fn.fitVids = function (options) {
20
+ var settings = {
21
+ customSelector: null,
22
+ ignore: null,
23
+ };
 
 
 
 
24
 
25
+ if (!document.getElementById('fit-vids-style')) {
26
+ // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
27
+ var head = document.head || document.getElementsByTagName('head')[0];
28
+ var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
29
+ var div = document.createElement('div');
30
+ div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
31
+ head.appendChild(div.childNodes[1]);
32
  }
33
 
34
+ if (options) {
35
+ $.extend(settings, options);
 
 
36
  }
37
 
38
+ return this.each(function () {
39
+ var selectors = [
40
+ "iframe[src*='player.vimeo.com']",
41
+ "iframe[src*='youtube.com']",
42
+ "iframe[src*='youtube-nocookie.com']",
43
+ "iframe[src*='kickstarter.com'][src*='video.html']",
44
+ "object",
45
+ "embed"
46
+ ];
47
 
48
+ if (settings.customSelector) {
49
+ selectors.push(settings.customSelector);
 
 
 
 
 
 
 
 
50
  }
51
+
52
+ var ignoreList = '.fitvidsignore';
53
+
54
+ if (settings.ignore) {
55
+ ignoreList = ignoreList + ', ' + settings.ignore;
 
56
  }
57
+
58
+ var $allVideos = $(this).find(selectors.join(','));
59
+ $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
60
+ $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
61
+
62
+ $allVideos.each(function () {
63
+ var $this = $(this);
64
+ if ($this.parents(ignoreList).length > 0) {
65
+ return; // Disable FitVids on this video.
66
+ }
67
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) {
68
+ return;
69
+ }
70
+ if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) {
71
+ $this.attr('height', 9);
72
+ $this.attr('width', 16);
73
+ }
74
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
75
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
76
+ aspectRatio = height / width;
77
+ if (!$this.attr('id')) {
78
+ var videoID = 'fitvid' + Math.floor(Math.random() * 999999);
79
+ $this.attr('id', videoID);
80
+ }
81
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100) + "%");
82
+ $this.removeAttr('height').removeAttr('width');
83
+ });
84
  });
85
+ };
 
86
  // Works with either jQuery or Zepto
87
+ })( window.jQuery || window.Zepto );
88
+
89
+ }
skin/frontend/base/default/js/mediastrategi_shadowmedia.js CHANGED
@@ -56,7 +56,9 @@
56
  (this.modal.offsetHeight > window.innerHeight ?
57
  " shadowmedia-open shadowmedia-anchored" : " shadowmedia-open");
58
  this.overlay.className = this.overlay.className + " shadowmedia-open";
59
- jQuery('.shadowmedia-content').fitVids();
 
 
60
  };
61
 
62
  // Private Methods
@@ -145,4 +147,5 @@
145
  return 'transitionend';
146
  }
147
 
148
- }());
 
56
  (this.modal.offsetHeight > window.innerHeight ?
57
  " shadowmedia-open shadowmedia-anchored" : " shadowmedia-open");
58
  this.overlay.className = this.overlay.className + " shadowmedia-open";
59
+ if (typeof jQuery != 'undefined') {
60
+ jQuery('.shadowmedia-content').fitVids();
61
+ }
62
  };
63
 
64
  // Private Methods
147
  return 'transitionend';
148
  }
149
 
150
+ }());
151
+