Cubet_Productlocator - Version 2.1.0

Version Notes

This is a stable version.

Download this release

Release Info

Developer Lovegin John
Extension Cubet_Productlocator
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.0 to 2.1.0

app/code/community/Cubet/Productlocator/Adminhtml/Model/Customoptions.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cubet_Productlocator_Adminhtml_Model_Customoptions
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Left')),
10
+ array('value' => 0, 'label'=>Mage::helper('adminhtml')->__('Right')),
11
+ );
12
+ }
13
+
14
+ }
app/code/community/Cubet/Productlocator/Model/Observer.php CHANGED
@@ -3,7 +3,24 @@
3
  class Cubet_Productlocator_Model_Observer {
4
 
5
  public function save_location(Varien_Event_Observer $observer) {
6
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
8
 
9
  }
3
  class Cubet_Productlocator_Model_Observer {
4
 
5
  public function save_location(Varien_Event_Observer $observer) {
6
+
7
+ }
8
+
9
+ public function set_block($observer) {
10
+
11
+ $action = $observer->getEvent()->getAction();
12
+ $fullActionName = $action->getFullActionName();
13
+ $layout_position = Mage::getStoreConfig('productlocator/map/side');
14
+ $position = ($layout_position == 1) ? 'left' : 'right';
15
+ $myXml = '<reference name="' . $position . '">';
16
+ $myXml .= '<block type="productlocator/map" name="locator" template="productlocator/locator.phtml" />';
17
+ $myXml .= '</reference>';
18
+
19
+ $layout = $observer->getEvent()->getLayout();
20
+ if ($fullActionName == 'catalog_product_view') { //set any action name here
21
+ $layout->getUpdate()->addUpdate($myXml);
22
+ $layout->generateXml();
23
+ }
24
  }
25
 
26
  }
app/code/community/Cubet/Productlocator/cubet_productlocator.sql~ DELETED
@@ -1,8 +0,0 @@
1
- CREATE TABLE IF NOT EXISTS `cubet_productlocator` (
2
- `id` int(11) NOT NULL AUTO_INCREMENT,
3
- `pid` int(11) NOT NULL,
4
- `latitude` varchar(50) DEFAULT NULL,
5
- `longitude` varchar(50) DEFAULT NULL,
6
- PRIMARY KEY (`id`)
7
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
8
-
 
 
 
 
 
 
 
 
app/code/community/Cubet/Productlocator/etc/config.xml CHANGED
@@ -16,7 +16,7 @@
16
  <config>
17
  <modules>
18
  <Cubet_Productlocator>
19
- <version>1.0.2</version>
20
  </Cubet_Productlocator>
21
  </modules>
22
  <frontend>
@@ -39,6 +39,9 @@
39
  </frontend>
40
  <global>
41
  <models>
 
 
 
42
  <productlocator>
43
  <class>Cubet_Productlocator_Model</class>
44
  <resourceModel>productlocator_mysql4</resourceModel>
@@ -83,15 +86,26 @@
83
  <class>Cubet_Productlocator_Block</class>
84
  </productlocator>
85
  </blocks>
 
 
 
 
 
 
 
 
 
 
 
86
  </global>
87
  <adminhtml>
88
  <layout>
89
- <updates>
90
- <productlocator>
91
- <file>productlocator.xml</file>
92
- </productlocator>
93
- </updates>
94
- </layout>
95
  <acl>
96
  <resources>
97
  <all>
16
  <config>
17
  <modules>
18
  <Cubet_Productlocator>
19
+ <version>2.1.0</version>
20
  </Cubet_Productlocator>
21
  </modules>
22
  <frontend>
39
  </frontend>
40
  <global>
41
  <models>
42
+ <productlocator_adminhtml>
43
+ <class>Cubet_Productlocator_Adminhtml_Model</class>
44
+ </productlocator_adminhtml>
45
  <productlocator>
46
  <class>Cubet_Productlocator_Model</class>
47
  <resourceModel>productlocator_mysql4</resourceModel>
86
  <class>Cubet_Productlocator_Block</class>
87
  </productlocator>
88
  </blocks>
89
+ <events>
90
+ <controller_action_layout_generate_blocks_before>
91
+ <observers>
92
+ <Cubet_Productlocator_Model_Observer>
93
+ <type>singleton</type>
94
+ <class>Cubet_Productlocator_Model_Observer</class>
95
+ <method>set_block</method>
96
+ </Cubet_Productlocator_Model_Observer>
97
+ </observers>
98
+ </controller_action_layout_generate_blocks_before>
99
+ </events>
100
  </global>
101
  <adminhtml>
102
  <layout>
103
+ <updates>
104
+ <productlocator>
105
+ <file>productlocator.xml</file>
106
+ </productlocator>
107
+ </updates>
108
+ </layout>
109
  <acl>
110
  <resources>
111
  <all>
app/code/community/Cubet/Productlocator/etc/config.xml~ CHANGED
@@ -16,7 +16,7 @@
16
  <config>
17
  <modules>
18
  <Cubet_Productlocator>
19
- <version>1.0.0</version>
20
  </Cubet_Productlocator>
21
  </modules>
22
  <frontend>
@@ -39,6 +39,9 @@
39
  </frontend>
40
  <global>
41
  <models>
 
 
 
42
  <productlocator>
43
  <class>Cubet_Productlocator_Model</class>
44
  <resourceModel>productlocator_mysql4</resourceModel>
@@ -83,15 +86,26 @@
83
  <class>Cubet_Productlocator_Block</class>
84
  </productlocator>
85
  </blocks>
 
 
 
 
 
 
 
 
 
 
 
86
  </global>
87
  <adminhtml>
88
  <layout>
89
- <updates>
90
- <productlocator>
91
- <file>productlocator.xml</file>
92
- </productlocator>
93
- </updates>
94
- </layout>
95
  <acl>
96
  <resources>
97
  <all>
16
  <config>
17
  <modules>
18
  <Cubet_Productlocator>
19
+ <version>1.0.2</version>
20
  </Cubet_Productlocator>
21
  </modules>
22
  <frontend>
39
  </frontend>
40
  <global>
41
  <models>
42
+ <productlocator_adminhtml>
43
+ <class>Cubet_Productlocator_Adminhtml_Model</class>
44
+ </productlocator_adminhtml>
45
  <productlocator>
46
  <class>Cubet_Productlocator_Model</class>
47
  <resourceModel>productlocator_mysql4</resourceModel>
86
  <class>Cubet_Productlocator_Block</class>
87
  </productlocator>
88
  </blocks>
89
+ <events>
90
+ <controller_action_layout_generate_blocks_before>
91
+ <observers>
92
+ <Cubet_Productlocator_Model_Observer>
93
+ <type>singleton</type>
94
+ <class>Cubet_Productlocator_Model_Observer</class>
95
+ <method>set_block</method>
96
+ </Cubet_Productlocator_Model_Observer>
97
+ </observers>
98
+ </controller_action_layout_generate_blocks_before>
99
+ </events>
100
  </global>
101
  <adminhtml>
102
  <layout>
103
+ <updates>
104
+ <productlocator>
105
+ <file>productlocator.xml</file>
106
+ </productlocator>
107
+ </updates>
108
+ </layout>
109
  <acl>
110
  <resources>
111
  <all>
app/code/community/Cubet/Productlocator/etc/system.xml CHANGED
@@ -42,6 +42,15 @@
42
  <show_in_website>1</show_in_website>
43
  <show_in_store>1</show_in_store>
44
  </key>
 
 
 
 
 
 
 
 
 
45
  <zoom translate="label comment">
46
  <label>Zoom rate</label>
47
  <comment>rate to be zoomed</comment>
42
  <show_in_website>1</show_in_website>
43
  <show_in_store>1</show_in_store>
44
  </key>
45
+ <side translate="label">
46
+ <label>Please select your side</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>productlocator_adminhtml/customoptions</source_model>
49
+ <sort_order>15</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </side>
54
  <zoom translate="label comment">
55
  <label>Zoom rate</label>
56
  <comment>rate to be zoomed</comment>
app/design/frontend/base/default/layout/productlocator.xml CHANGED
@@ -13,10 +13,7 @@
13
  <action method="addCss"><script>css/productlocator/jquery.fancybox.css</script></action>
14
  <action method="addItem"><type>skin_css</type><name>css/productlocator/productlocator.css</name><params/></action>
15
  </reference>
16
- <reference name="left">
17
- <block type="productlocator/map" name="locator" as="locator" template="productlocator/locator.phtml" />
18
- </reference>
19
- </catalog_product_view>
20
  <productlocator_index_index translate="label">
21
  <remove name="head" />
22
  <remove name="header" />
13
  <action method="addCss"><script>css/productlocator/jquery.fancybox.css</script></action>
14
  <action method="addItem"><type>skin_css</type><name>css/productlocator/productlocator.css</name><params/></action>
15
  </reference>
16
+ </catalog_product_view>
 
 
 
17
  <productlocator_index_index translate="label">
18
  <remove name="head" />
19
  <remove name="header" />
js/productlocator/jquery.fancybox.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
3
+ width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
4
+ keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
5
+ (I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
6
+ openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
7
+ isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
8
+ c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
9
+ k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
10
+ b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
11
+ setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
12
+ d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
13
+ a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
14
+ b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
15
+ y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
16
+ if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
+ (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
18
+ {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
19
+ mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
20
+ !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
21
+ "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
22
+ this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
23
+ f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
24
+ e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
25
+ outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
26
+ g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
27
+ "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
28
+ h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
29
+ h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
30
+ "iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
31
+ y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
32
+ !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
33
+ b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
34
+ a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
35
+ (c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
36
+ f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
37
+ {duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
38
+ b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
39
+ f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
40
+ b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
41
+ p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
42
+ f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
43
+ b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
44
+ e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
45
+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
46
+ d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
js/productlocator/jquery.ui.map.js ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery FN Google Map 3.0-rc
3
+ * http://code.google.com/p/jquery-ui-map/
4
+ * Copyright (c) 2010 - 2012 Johan Säll Larsson
5
+ * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+ ( function($) {
8
+
9
+ /**
10
+ * @param name:string
11
+ * @param prototype:object
12
+ */
13
+ $.a = function(name, prototype) {
14
+
15
+ var namespace = name.split('.')[0];
16
+ name = name.split('.')[1];
17
+
18
+ $[namespace] = $[namespace] || {};
19
+ $[namespace][name] = function(options, element) {
20
+ if ( arguments.length ) {
21
+ this._setup(options, element);
22
+ }
23
+ };
24
+
25
+ $[namespace][name].prototype = $.extend({
26
+ 'namespace': namespace,
27
+ 'pluginName': name
28
+ }, prototype);
29
+
30
+ $.fn[name] = function(options) {
31
+
32
+ var isMethodCall = typeof options === "string",
33
+ args = Array.prototype.slice.call(arguments, 1),
34
+ returnValue = this;
35
+
36
+ if ( isMethodCall && options.substring(0, 1) === '_' ) {
37
+ return returnValue;
38
+ }
39
+
40
+ this.each(function() {
41
+ var instance = $.data(this, name);
42
+ if (!instance) {
43
+ instance = $.data(this, name, new $[namespace][name](options, this));
44
+ }
45
+ if (isMethodCall) {
46
+ returnValue = instance[options].apply(instance, args);
47
+ }
48
+ });
49
+
50
+ return returnValue;
51
+
52
+ };
53
+
54
+ };
55
+
56
+ $.a('ui.gmap', {
57
+
58
+ /**
59
+ * Map options
60
+ * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MapOptions
61
+ */
62
+ options: {
63
+ mapTypeId: 'roadmap',
64
+ zoom: 5
65
+ },
66
+
67
+ /**
68
+ * Get or set options
69
+ * @param key:string
70
+ * @param options:object
71
+ * @return object
72
+ */
73
+ option: function(key, options) {
74
+ if (options) {
75
+ this.options[key] = options;
76
+ this.get('map').set(key, options);
77
+ return this;
78
+ }
79
+ return this.options[key];
80
+ },
81
+
82
+ /**
83
+ * Setup plugin basics,
84
+ * @param options:object
85
+ * @param element:node
86
+ */
87
+ _setup: function(options, element) {
88
+ this.el = element;
89
+ options = options || {};
90
+ jQuery.extend(this.options, options, { 'center': this._latLng(options.center) });
91
+ this._create();
92
+ if ( this._init ) { this._init(); }
93
+ },
94
+
95
+ /**
96
+ * Instanciate the Google Maps object
97
+ */
98
+ _create: function() {
99
+ var self = this;
100
+ this.instance = { 'map': new google.maps.Map(self.el, self.options), 'markers': [], 'overlays': [], 'services': [] };
101
+ google.maps.event.addListenerOnce(self.instance.map, 'bounds_changed', function() { $(self.el).trigger('init', self.instance.map); });
102
+ self._call(self.options.callback, self.instance.map);
103
+ },
104
+
105
+ /**
106
+ * Adds a latitude longitude pair to the bounds.
107
+ * @param position:google.maps.LatLng/string
108
+ */
109
+ addBounds: function(position) {
110
+ var bounds = this.get('bounds', new google.maps.LatLngBounds());
111
+ bounds.extend(this._latLng(position));
112
+ this.get('map').fitBounds(bounds);
113
+ return this;
114
+ },
115
+
116
+ /**
117
+ * Helper function to check if a LatLng is within the viewport
118
+ * @param marker:google.maps.Marker
119
+ */
120
+ inViewport: function(marker) {
121
+ var bounds = this.get('map').getBounds();
122
+ return (bounds) ? bounds.contains(marker.getPosition()) : false;
123
+ },
124
+
125
+ /**
126
+ * Adds a custom control to the map
127
+ * @param panel:jquery/node/string
128
+ * @param position:google.maps.ControlPosition
129
+ * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#ControlPosition
130
+ */
131
+ addControl: function(panel, position) {
132
+ this.get('map').controls[position].push(this._unwrap(panel));
133
+ return this;
134
+ },
135
+
136
+ /**
137
+ * Adds a Marker to the map
138
+ * @param markerOptions:google.maps.MarkerOptions
139
+ * @param callback:function(map:google.maps.Map, marker:google.maps.Marker) (optional)
140
+ * @return $(google.maps.Marker)
141
+ * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MarkerOptions
142
+ */
143
+ addMarker: function(markerOptions, callback) {
144
+ markerOptions.map = this.get('map');
145
+ markerOptions.position = this._latLng(markerOptions.position);
146
+ var marker = new (markerOptions.marker || google.maps.Marker)(markerOptions);
147
+ var markers = this.get('markers');
148
+ if ( marker.id ) {
149
+ markers[marker.id] = marker;
150
+ } else {
151
+ markers.push(marker);
152
+ }
153
+ if ( marker.bounds ) {
154
+ this.addBounds(marker.getPosition());
155
+ }
156
+ this._call(callback, markerOptions.map, marker);
157
+ return $(marker);
158
+ },
159
+
160
+ /**
161
+ * Clears by type
162
+ * @param ctx:string e.g. 'markers', 'overlays', 'services'
163
+ */
164
+ clear: function(ctx) {
165
+ this._c(this.get(ctx));
166
+ this.set(ctx, []);
167
+ return this;
168
+ },
169
+
170
+ _c: function(obj) {
171
+ for ( var property in obj ) {
172
+ if ( obj.hasOwnProperty(property) ) {
173
+ if ( obj[property] instanceof google.maps.MVCObject ) {
174
+ google.maps.event.clearInstanceListeners(obj[property]);
175
+ if ( obj[property].setMap ) {
176
+ obj[property].setMap(null);
177
+ }
178
+ } else if ( obj[property] instanceof Array ) {
179
+ this._c(obj[property]);
180
+ }
181
+ obj[property] = null;
182
+ }
183
+ }
184
+ },
185
+
186
+ /**
187
+ * Returns the objects with a specific property and value, e.g. 'category', 'tags'
188
+ * @param ctx:string in what context, e.g. 'markers'
189
+ * @param options:object property:string the property to search within, value:string, operator:string (optional) (AND/OR)
190
+ * @param callback:function(marker:google.maps.Marker, isFound:boolean)
191
+ */
192
+ find: function(ctx, options, callback) {
193
+ var obj = this.get(ctx);
194
+ options.value = $.isArray(options.value) ? options.value : [options.value];
195
+ for ( var property in obj ) {
196
+ if ( obj.hasOwnProperty(property) ) {
197
+ var isFound = false;
198
+ for ( var value in options.value ) {
199
+ if ( $.inArray(options.value[value], obj[property][options.property]) > -1 ) {
200
+ isFound = true;
201
+ } else {
202
+ if ( options.operator && options.operator === 'AND' ) {
203
+ isFound = false;
204
+ break;
205
+ }
206
+ }
207
+ }
208
+ callback(obj[property], isFound);
209
+ }
210
+ }
211
+ return this;
212
+ },
213
+
214
+ /**
215
+ * Returns an instance property by key. Has the ability to set an object if the property does not exist
216
+ * @param key:string
217
+ * @param value:object(optional)
218
+ */
219
+ get: function(key, value) {
220
+ var instance = this.instance;
221
+ if ( !instance[key] ) {
222
+ if ( key.indexOf('>') > -1 ) {
223
+ var e = key.replace(/ /g, '').split('>');
224
+ for ( var i = 0; i < e.length; i++ ) {
225
+ if ( !instance[e[i]] ) {
226
+ if (value) {
227
+ instance[e[i]] = ( (i + 1) < e.length ) ? [] : value;
228
+ } else {
229
+ return null;
230
+ }
231
+ }
232
+ instance = instance[e[i]];
233
+ }
234
+ return instance;
235
+ } else if ( value && !instance[key] ) {
236
+ this.set(key, value);
237
+ }
238
+ }
239
+ return instance[key];
240
+ },
241
+
242
+ /**
243
+ * Triggers an InfoWindow to open
244
+ * @param infoWindowOptions:google.maps.InfoWindowOptions
245
+ * @param marker:google.maps.Marker (optional)
246
+ * @param callback:function (optional)
247
+ * @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#InfoWindowOptions
248
+ */
249
+ openInfoWindow: function(infoWindowOptions, marker, callback) {
250
+ var iw = this.get('iw', infoWindowOptions.infoWindow || new google.maps.InfoWindow);
251
+ iw.setOptions(infoWindowOptions);
252
+ iw.open(this.get('map'), this._unwrap(marker));
253
+ this._call(callback, iw);
254
+ return this;
255
+ },
256
+
257
+ /**
258
+ * Triggers an InfoWindow to close
259
+ */
260
+ closeInfoWindow: function() {
261
+ if ( this.get('iw') != null ) {
262
+ this.get('iw').close();
263
+ }
264
+ return this;
265
+ },
266
+
267
+ /**
268
+ * Sets an instance property
269
+ * @param key:string
270
+ * @param value:object
271
+ */
272
+ set: function(key, value) {
273
+ this.instance[key] = value;
274
+ return this;
275
+ },
276
+
277
+ /**
278
+ * Refreshes the map
279
+ */
280
+ refresh: function() {
281
+ var map = this.get('map');
282
+ var latLng = map.getCenter();
283
+ $(map).triggerEvent('resize');
284
+ map.setCenter(latLng);
285
+ return this;
286
+ },
287
+
288
+ /**
289
+ * Destroys the plugin.
290
+ */
291
+ destroy: function() {
292
+ this.clear('markers').clear('services').clear('overlays')._c(this.instance);
293
+ jQuery.removeData(this.el, this.name);
294
+ },
295
+
296
+ /**
297
+ * Helper method for calling a function
298
+ * @param callback
299
+ */
300
+ _call: function(callback) {
301
+ if ( callback && $.isFunction(callback) ) {
302
+ callback.apply(this, Array.prototype.slice.call(arguments, 1));
303
+ }
304
+ },
305
+
306
+ /**
307
+ * Helper method for google.maps.Latlng
308
+ * @param latLng:string/google.maps.LatLng
309
+ */
310
+ _latLng: function(latLng) {
311
+ if ( !latLng ) {
312
+ return new google.maps.LatLng(0.0, 0.0);
313
+ }
314
+ if ( latLng instanceof google.maps.LatLng ) {
315
+ return latLng;
316
+ } else {
317
+ latLng = latLng.replace(/ /g,'').split(',');
318
+ return new google.maps.LatLng(latLng[0], latLng[1]);
319
+ }
320
+ },
321
+
322
+ /**
323
+ * Helper method for unwrapping jQuery/DOM/string elements
324
+ * @param obj:string/node/jQuery
325
+ */
326
+ _unwrap: function(obj) {
327
+ return (!obj) ? null : ( (obj instanceof jQuery) ? obj[0] : ((obj instanceof Object) ? obj : $('#'+obj)[0]) )
328
+ }
329
+
330
+ });
331
+
332
+ jQuery.fn.extend( {
333
+
334
+ triggerEvent: function(eventType) {
335
+ google.maps.event.trigger(this[0], eventType);
336
+ return this;
337
+ },
338
+
339
+ addEventListener: function(eventType, eventDataOrCallback, eventCallback) {
340
+ if ( google.maps && this[0] instanceof google.maps.MVCObject ) {
341
+ google.maps.event.addListener(this[0], eventType, eventDataOrCallback);
342
+ } else {
343
+ if (eventCallback) {
344
+ this.bind(eventType, eventDataOrCallback, eventCallback);
345
+ } else {
346
+ this.bind(eventType, eventDataOrCallback);
347
+ }
348
+ }
349
+ return this;
350
+ }
351
+
352
+ /*removeEventListener: function(eventType) {
353
+ if ( google.maps && this[0] instanceof google.maps.MVCObject ) {
354
+ if (eventType) {
355
+ google.maps.event.clearListeners(this[0], eventType);
356
+ } else {
357
+ google.maps.event.clearInstanceListeners(this[0]);
358
+ }
359
+ } else {
360
+ this.unbind(eventType);
361
+ }
362
+ return this;
363
+ }*/
364
+
365
+ });
366
+
367
+ jQuery.each(('click rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) {
368
+ jQuery.fn[name] = function(a, b) {
369
+ return this.addEventListener(name, a, b);
370
+ }
371
+ });
372
+
373
+ } (jQuery) );
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cubet_Productlocator</name>
4
- <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>This module enables to add location for each product and to show those location on a map in the product detail page.</description>
11
  <notes>This is a stable version.</notes>
12
  <authors><author><name>Lovegin John</name><user>webcubes</user><email>info@cubettech.com</email></author></authors>
13
- <date>2014-05-20</date>
14
- <time>10:02:21</time>
15
- <contents><target name="magecommunity"><dir name="Cubet"><dir name="Productlocator"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Productlocator.php" hash="21af7fb2b5b35b8c6499c7acd92d048e"/></dir></dir></dir></dir></dir><file name="Map.php" hash="681668bf8ab5f15256505704d474774a"/></dir><dir name="Helper"><file name="Data.php" hash="5c90deb38e39d10eaf393a1e04ff17a6"/></dir><dir name="Model"><file name="Locator.php" hash="261465f086a4f450e3d00a66758a4816"/><dir name="Mysql4"><dir name="Locator"><file name="Collection.php" hash="f7b4bdc482ba23023902a43e8234da5b"/></dir><file name="Locator.php" hash="7215441ca8de663d178897f4fe2fbd4b"/></dir><file name="Observer.php" hash="ba9faf9735c9fdbe512b177cdc40d321"/><dir name="Resource"><file name="Setup.php" hash="64debf8d16bf6a5b61d028fb648e0376"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="48edfa44e685442bfd5ad01a46aba60c"/></dir><file name="cubet_productlocator.sql" hash="1a2fc626bc71f5320e2eab5e96b899aa"/><file name="cubet_productlocator.sql~" hash="a5a4d142531b6574ef251a415f32c70f"/><dir name="etc"><file name="config.xml" hash="600199d77003e527795399be5a5bd4c4"/><file name="config.xml~" hash="ea44611e3e7f32613abc5ae1138ba038"/><file name="system.xml" hash="555c4c5a2ad6e9e691db04106d8e56c6"/><file name="system.xml~" hash="091a8a7505b01c6e6a1f8986833c15e5"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cubet_Productlocator.xml" hash="bbb6b6eabe1f343404e36fd158be8390"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="productlocator.xml" hash="5b4f2e269964ac35bcee517a01d112fe"/></dir><dir name="template"><dir name="productlocator"><dir name="catalog"><dir name="product"><dir name="edit"><file name="tab.phtml" hash="9a4c324fcd9336254322d3e9f45fb8be"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="productlocator"><file name="locator.phtml" hash="eba5758c0ea7e0f7b5537d897b3eb790"/></dir></dir><dir name="layout"><file name="productlocator.xml" hash="61fe9aa2db3e0f2e68e01b3104806b79"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="productlocator"><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="jquery.fancybox.css" hash="6c55951ce1e3115711f63f99b7501f3a"/><file name="productlocator.css" hash="67cb69ad2832e20bd7764b482a7cedde"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="productlocator"><file name="jquery-2.1.1.min.js" hash="e40ec2161fe7993196f23c8a07346306"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cubet_Productlocator</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
10
  <description>This module enables to add location for each product and to show those location on a map in the product detail page.</description>
11
  <notes>This is a stable version.</notes>
12
  <authors><author><name>Lovegin John</name><user>webcubes</user><email>info@cubettech.com</email></author></authors>
13
+ <date>2014-05-21</date>
14
+ <time>12:53:21</time>
15
+ <contents><target name="magecommunity"><dir name="Cubet"><dir name="Productlocator"><dir name="Adminhtml"><dir name="Model"><file name="Customoptions.php" hash="3088a560e407e5aca9c4f611d6508fc8"/></dir></dir><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Productlocator.php" hash="21af7fb2b5b35b8c6499c7acd92d048e"/></dir></dir></dir></dir></dir><file name="Map.php" hash="681668bf8ab5f15256505704d474774a"/></dir><dir name="Helper"><file name="Data.php" hash="5c90deb38e39d10eaf393a1e04ff17a6"/></dir><dir name="Model"><file name="Locator.php" hash="261465f086a4f450e3d00a66758a4816"/><dir name="Mysql4"><dir name="Locator"><file name="Collection.php" hash="f7b4bdc482ba23023902a43e8234da5b"/></dir><file name="Locator.php" hash="7215441ca8de663d178897f4fe2fbd4b"/></dir><file name="Observer.php" hash="f3aac991ebd5dfa575485f687c4d7be0"/><dir name="Resource"><file name="Setup.php" hash="64debf8d16bf6a5b61d028fb648e0376"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="48edfa44e685442bfd5ad01a46aba60c"/></dir><file name="cubet_productlocator.sql" hash="1a2fc626bc71f5320e2eab5e96b899aa"/><dir name="etc"><file name="config.xml" hash="ad2734b4a2a8d69ff11a0d480775a458"/><file name="config.xml~" hash="9265ddb1b35068290372b7842b2924c3"/><file name="system.xml" hash="2366f56336cd9bd51ef85635d5b83c32"/><file name="system.xml~" hash="091a8a7505b01c6e6a1f8986833c15e5"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cubet_Productlocator.xml" hash="bbb6b6eabe1f343404e36fd158be8390"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="productlocator.xml" hash="5b4f2e269964ac35bcee517a01d112fe"/></dir><dir name="template"><dir name="productlocator"><dir name="catalog"><dir name="product"><dir name="edit"><file name="tab.phtml" hash="9a4c324fcd9336254322d3e9f45fb8be"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="productlocator"><file name="locator.phtml" hash="eba5758c0ea7e0f7b5537d897b3eb790"/></dir></dir><dir name="layout"><file name="productlocator.xml" hash="3b3dc50c0eee0f2f95e61a384457e406"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="productlocator"><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="jquery.fancybox.css" hash="6c55951ce1e3115711f63f99b7501f3a"/><file name="productlocator.css" hash="67cb69ad2832e20bd7764b482a7cedde"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="productlocator"><file name="jquery-2.1.1.min.js" hash="e40ec2161fe7993196f23c8a07346306"/><file name="jquery.fancybox.pack.js" hash="cc9e759f24ba773aeef8a131889d3728"/><file name="jquery.ui.map.js" hash="66a82a959067906f14dfd25b231537a6"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>