Eabi_Zoom - Version 0.1.1

Version Notes

Added force Zoombox offsettop option, if offsettop autocalculation does not work

Download this release

Release Info

Developer Matis Matis
Extension Eabi_Zoom
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/community/Eabi/Zoom/etc/system.xml CHANGED
@@ -176,6 +176,15 @@
176
  <show_in_website>1</show_in_website>
177
  <show_in_store>1</show_in_store>
178
  </zoomTitleMarginTop>
 
 
 
 
 
 
 
 
 
179
 
180
  </fields>
181
 
176
  <show_in_website>1</show_in_website>
177
  <show_in_store>1</show_in_store>
178
  </zoomTitleMarginTop>
179
+ <zoomForceTop translate="label comment">
180
+ <label>Force top position for Zoom window</label>
181
+ <comment>in pixels, use only when browser detection does not work</comment>
182
+ <frontend_type>text</frontend_type>
183
+ <sort_order>56</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>1</show_in_store>
187
+ </zoomForceTop>
188
 
189
  </fields>
190
 
app/design/frontend/default/default/template/eabi_zoom/media.phtml CHANGED
@@ -30,6 +30,13 @@ $_product = $this->getProduct();
30
  $_zoomConfig = Mage::getStoreConfig('eabi_zoom/eabi_zoom');
31
 
32
  $zoomHideTitle = (isset($_zoomConfig['zoomHideTitle']) && $_zoomConfig['zoomHideTitle'] == '1') ? 'true' : 'false';
 
 
 
 
 
 
 
33
 
34
  $zoomTitleSize = (isset($_zoomConfig['zoomTitleSize'])) ? $_zoomConfig['zoomTitleSize'] : '0.8 em';
35
 
@@ -117,8 +124,8 @@ if (strstr($_zoomConfig['zoomImageSize'], '_')) {
117
  <script type="text/javascript">
118
 
119
  var eabi_bezoom_options = {
120
- height: <?php echo (int)$zoomImageSize[0]; ?>,
121
- width: <?php echo (int)$zoomImageSize[1]; ?>,
122
  marginLeft: <?php echo $zoomTitleMarginLeft; ?>,
123
  marginTop: <?php echo $zoomTitleMarginTop; ?>,
124
  bgColor: '<?php echo $zoomTitleBackground; ?>',
@@ -126,7 +133,8 @@ if (strstr($_zoomConfig['zoomImageSize'], '_')) {
126
  imgBorder: '<?php echo $zoomImageBorder; ?>',
127
  color: '<?php echo $zoomTitleColor; ?>',
128
  size: '<?php echo $zoomTitleSize; ?>',
129
- hideTitle: <?php echo $zoomHideTitle; ?>
 
130
  };
131
 
132
  var eabi_bezoom_change_image = function(node) {
30
  $_zoomConfig = Mage::getStoreConfig('eabi_zoom/eabi_zoom');
31
 
32
  $zoomHideTitle = (isset($_zoomConfig['zoomHideTitle']) && $_zoomConfig['zoomHideTitle'] == '1') ? 'true' : 'false';
33
+ $zoomForceTop = (isset($_zoomConfig['zoomForceTop'])) ? $_zoomConfig['zoomForceTop'] : false;
34
+
35
+ if ($zoomForceTop !== false && trim($zoomForceTop) !== '') {
36
+ $zoomForceTop = (int)$zoomForceTop;
37
+ } else {
38
+ $zoomForceTop = 'false';
39
+ }
40
 
41
  $zoomTitleSize = (isset($_zoomConfig['zoomTitleSize'])) ? $_zoomConfig['zoomTitleSize'] : '0.8 em';
42
 
124
  <script type="text/javascript">
125
 
126
  var eabi_bezoom_options = {
127
+ height: <?php echo (int)$zoomImageSize[1]; ?>,
128
+ width: <?php echo (int)$zoomImageSize[0]; ?>,
129
  marginLeft: <?php echo $zoomTitleMarginLeft; ?>,
130
  marginTop: <?php echo $zoomTitleMarginTop; ?>,
131
  bgColor: '<?php echo $zoomTitleBackground; ?>',
133
  imgBorder: '<?php echo $zoomImageBorder; ?>',
134
  color: '<?php echo $zoomTitleColor; ?>',
135
  size: '<?php echo $zoomTitleSize; ?>',
136
+ hideTitle: <?php echo $zoomHideTitle; ?>,
137
+ forceTop: <?php echo $zoomForceTop; ?>
138
  };
139
 
140
  var eabi_bezoom_change_image = function(node) {
app/locale/en_US/Eabi_Zoom.csv CHANGED
@@ -18,3 +18,5 @@
18
  "Left Margin for the Zoombox","Left Margin for the Zoombox"
19
  "Top Margin for the Zoombox","Top Margin for the Zoombox"
20
  "in pixels","in pixels"
 
 
18
  "Left Margin for the Zoombox","Left Margin for the Zoombox"
19
  "Top Margin for the Zoombox","Top Margin for the Zoombox"
20
  "in pixels","in pixels"
21
+ "Force top position for Zoom window","Force top position for Zoom window"
22
+ "in pixels, use only when browser detection does not work","in pixels, use only when browser detection does not work"
app/locale/et_EE/Eabi_Zoom.csv CHANGED
@@ -18,3 +18,5 @@
18
  "Left Margin for the Zoombox","Vasakpoolne suurendatud pildi lisavahe"
19
  "Top Margin for the Zoombox","Ülemine suurendatud pildi lisavahe"
20
  "in pixels","pikslites"
 
 
18
  "Left Margin for the Zoombox","Vasakpoolne suurendatud pildi lisavahe"
19
  "Top Margin for the Zoombox","Ülemine suurendatud pildi lisavahe"
20
  "in pixels","pikslites"
21
+ "Force top position for Zoom window","Kirjuta üle suurnedusklaasi positsioon ülemisest äärest"
22
+ "in pixels, use only when browser detection does not work","Pikslites, kasuta siis, kui automaatne positsioni arvutus eri brauserites ei toimi"
js/eabi_js/eabi_bezoom.js CHANGED
@@ -33,18 +33,20 @@ Eabi_Bezoom = Class.create(Abstract, {
33
  size: '0.8em',
34
  hideTitle: false,
35
  imgBorder: '#000000',
36
- imgBgColor: '#ffffff'
 
 
37
  }, options || {});
38
  var settings = this.options;
39
 
40
 
41
  this.selection.each(function(i, index) {
 
 
 
 
42
 
43
- var title = i.readAttribute(settings.titleSource);
44
- var imgBig = i.readAttribute(settings.imgSource);
45
- var titleAttribute = i.readAttribute('title');
46
-
47
- var img = i.select('img').first();
48
 
49
  //TODO: convert to mouseenter
50
  i.observe('click', function(e) {
@@ -60,19 +62,27 @@ Eabi_Bezoom = Class.create(Abstract, {
60
  var imgSmallDimensions = i.select('img').first().getDimensions();
61
 
62
  var pos = i.cumulativeOffset();
 
 
 
 
 
63
  var y = Math.ceil(pos.top - 0) + settings.marginTop; // - imgSmallDimensions.height;
64
- if (Prototype.Browser.IE) {
 
 
 
65
  y -= imgSmallDimensions.height;
66
  }
67
  var x = Math.ceil(pos.left - 0) + imgSmallDimensions.width + settings.marginLeft;
68
- var titleDiv = '<div style="background-color:'+settings.bgColor+';color:'+settings.color+';font-size:'+settings.size+';">'+title+'</div>';
69
 
70
  if (settings.hideTitle) {
71
  titleDiv = '';
72
  }
73
 
74
 
75
- $$('body').first().insert('<div id="'+settings.identifier+'" style="border:1px solid ' + settings.imgBorder + '; background: ' + settings.imgBgColor + '; position:absolute; top:'+y+'px;left:'+x+'px;width:'+settings.width+'px;">' + titleDiv + '<div style="width:'+settings.width+'px;height:'+settings.height+'px;overflow:hidden;position:relative;"><img id="'+settings.identifier+'_img" src="'+imgBig+'" style="position:relative;"></div></div>');
76
  return e.stop();
77
 
78
  });
33
  size: '0.8em',
34
  hideTitle: false,
35
  imgBorder: '#000000',
36
+ imgBgColor: '#ffffff',
37
+ forceTop: false
38
+
39
  }, options || {});
40
  var settings = this.options;
41
 
42
 
43
  this.selection.each(function(i, index) {
44
+ var title = i.readAttribute(settings.titleSource),
45
+ imgBig = i.readAttribute(settings.imgSource),
46
+ titleAttribute = i.readAttribute('title'),
47
+ img = i.select('img').first();
48
 
49
+
 
 
 
 
50
 
51
  //TODO: convert to mouseenter
52
  i.observe('click', function(e) {
62
  var imgSmallDimensions = i.select('img').first().getDimensions();
63
 
64
  var pos = i.cumulativeOffset();
65
+
66
+ if (settings.forceTop !== false) {
67
+ pos.top = settings.forceTop;
68
+ }
69
+
70
  var y = Math.ceil(pos.top - 0) + settings.marginTop; // - imgSmallDimensions.height;
71
+ if (y < 0) {
72
+ y -= settings.marginTop;
73
+ }
74
+ if (y < 0) {
75
  y -= imgSmallDimensions.height;
76
  }
77
  var x = Math.ceil(pos.left - 0) + imgSmallDimensions.width + settings.marginLeft;
78
+ var titleDiv = '<div style="text-align: center; background-color:'+settings.bgColor+';color:'+settings.color+';font-size:'+settings.size+';">'+title+'</div>';
79
 
80
  if (settings.hideTitle) {
81
  titleDiv = '';
82
  }
83
 
84
 
85
+ $$('body').first().insert('<div id="'+settings.identifier+'" style="border:1px solid ' + settings.imgBorder + '; background: ' + settings.imgBgColor + '; position:absolute; top:'+y+'px;left:'+x+'px;width:'+settings.width+'px;">' + titleDiv + '<div style="width:'+settings.width+'px;height:'+settings.height+'px;overflow:hidden;position:relative; text-align: center;"><img id="'+settings.identifier+'_img" src="'+imgBig+'" style="position:relative;"></div></div>');
86
  return e.stop();
87
 
88
  });
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eabi_Zoom</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
@@ -10,11 +10,12 @@
10
  <description>&lt;p&gt;Clicking on product's main image activates the zoombox and moving a mouse changes the part of image being zoomed&lt;/p&gt;&#xD;
11
  &lt;p&gt;Clicking on any of the products additional images changes the main image to the one clicked&lt;/p&gt;&#xD;
12
  &lt;p&gt;Configurable from the administration panel&lt;/p&gt;</description>
13
- <notes>Initial release</notes>
 
14
  <authors><author><name>Matis Matis</name><user>mhalmann</user><email>info@e-abi.ee</email></author></authors>
15
- <date>2012-07-20</date>
16
- <time>21:55:55</time>
17
- <contents><target name="magecommunity"><dir name="Eabi"><dir name="Zoom"><file name="CHANGELOG.txt" hash="f8ffcc9b07719e670426d06a78f7cf7e"/><dir name="Helper"><file name="Data.php" hash="97ef94244209f5a13deee59e5691677d"/></dir><file name="LICENCE.txt" hash="0191312e121c0b3e1165619b96efcf9f"/><dir name="etc"><file name="config.xml" hash="6327af8da94d29039bf969b8d1d13e0d"/><file name="system.xml" hash="fee4b99e3dc156051a0f994bb2e549db"/></dir><dir name="sql"><dir name="eabi_zoom_setup"><file name="mysql4-install-0.1.0.php" hash="1609ddb62f3980672f6b977af6974f53"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="et_EE"><file name="Eabi_Zoom.csv" hash="f683b961275321c188b16d98c4cd2a88"/></dir><dir name="en_US"><file name="Eabi_Zoom.csv" hash="5d17af6f3ff3c4c25c3d238c47c7ae0e"/></dir></target><target name="mageetc"><dir name="modules"><file name="Eabi_Zoom.xml" hash="e1ce2d901972130ceaba89a60c82e29b"/></dir></target><target name="mageweb"><dir name="js"><dir name="eabi_js"><file name="eabi_bezoom.js" hash="47fb6eaa447e65cfb42b949c6f72a0bb"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_zoom.xml" hash="8bb781df7f166da385d8b35af64ac724"/></dir><dir name="template"><dir name="eabi_zoom"><file name="media.phtml" hash="9b9c0536a5a8b0b30b133ee3ebe1b818"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>5.4.10</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eabi_Zoom</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
10
  <description>&lt;p&gt;Clicking on product's main image activates the zoombox and moving a mouse changes the part of image being zoomed&lt;/p&gt;&#xD;
11
  &lt;p&gt;Clicking on any of the products additional images changes the main image to the one clicked&lt;/p&gt;&#xD;
12
  &lt;p&gt;Configurable from the administration panel&lt;/p&gt;</description>
13
+ <notes>Added force Zoombox offsettop option, if offsettop autocalculation does not work&#xD;
14
+ </notes>
15
  <authors><author><name>Matis Matis</name><user>mhalmann</user><email>info@e-abi.ee</email></author></authors>
16
+ <date>2012-07-22</date>
17
+ <time>13:35:05</time>
18
+ <contents><target name="magecommunity"><dir name="Eabi"><dir name="Zoom"><file name="CHANGELOG.txt" hash="f8ffcc9b07719e670426d06a78f7cf7e"/><dir name="Helper"><file name="Data.php" hash="97ef94244209f5a13deee59e5691677d"/></dir><file name="LICENCE.txt" hash="0191312e121c0b3e1165619b96efcf9f"/><dir name="etc"><file name="config.xml" hash="6327af8da94d29039bf969b8d1d13e0d"/><file name="system.xml" hash="753558132ce97430134e91768238fd3e"/></dir><dir name="sql"><dir name="eabi_zoom_setup"><file name="mysql4-install-0.1.0.php" hash="1609ddb62f3980672f6b977af6974f53"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="et_EE"><file name="Eabi_Zoom.csv" hash="f4ef21fd6b5b6648cfa4a86932375907"/></dir><dir name="en_US"><file name="Eabi_Zoom.csv" hash="97e3d2e3846146d2f6662031b1ec5476"/></dir></target><target name="mageetc"><dir name="modules"><file name="Eabi_Zoom.xml" hash="e1ce2d901972130ceaba89a60c82e29b"/></dir></target><target name="mageweb"><dir name="js"><dir name="eabi_js"><file name="eabi_bezoom.js" hash="05db6e82dffa55bce257bab126f59617"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_zoom.xml" hash="8bb781df7f166da385d8b35af64ac724"/></dir><dir name="template"><dir name="eabi_zoom"><file name="media.phtml" hash="993d509009803b7ea36417863bb58892"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>5.4.10</max></php></required></dependencies>
21
  </package>