//** // * NOTICE OF LICENSE // * // * You may not sell, sub-license, rent or lease // * any portion of the Software or Documentation to anyone. // * // * DISCLAIMER // * // * Do not edit or add to this file if you wish to upgrade to newer // * versions in the future. // * // * @category ET // * @package ET_AdvancedCompare // * @copyright Copyright (c) 2012 ET Web Solutions (http://etwebsolutions.com) // * @contacts support@etwebsolutions.com // * @license http://shop.etwebsolutions.com/etws-license-free-v1/ ETWS Free License (EFL1) // */ var CompareNoReload = { compareAnimationCount: 0, compareRemoveFromListSilent: function(removeUrl) { new Ajax.Request(removeUrl, { onSuccess: function(response) { CompareNoReload.compareUpdateSidebarHtml(response.responseText); CompareNoReload.rescanForNewCompare(); } }); }, compareClearList: function (clearUrl,textAlert) { new Ajax.Request(clearUrl, { onSuccess: function(response) { CompareNoReload.compareUpdateSidebarHtml(response.responseText); CompareNoReload.rescanForNewCompare(); } }); }, compareAddToList: function (addUrl,id2Animate) { this.startAnimation(id2Animate); new Ajax.Request(addUrl, { onSuccess: function(response) { CompareNoReload.compareUpdateSidebarHtml(response.responseText); CompareNoReload.rescanForNewCompare(); } }); return false; }, /* compareUpdateSidebar: function () { if(typeof($("compareUpdateUrl")) !== 'undefined') new Ajax.Request($("compareUpdateUrl").value, { method: 'post', parameters: $('shipping-type').serialize(true), onSuccess: function(response) { this.getCompareSideBlock().update(response.responseText); this.rescanForNewCompare(); } }); }, */ compareUpdateSidebarHtml: function (updateText) { if(typeof(this.getCompareSideBlock()) != 'undefined'){ //compareAnimationText=eval(updateText); this.getCompareSideBlock().replace(eval(updateText)); } }, startAnimation: function (id2Animate) { if(typeof(id2Animate)!= 'undefined') { if((typeof(this.getCompareSideBlock()) != 'undefined')&($(id2Animate) != null)) { var xy=this.getCompareSideBlock().cumulativeOffset(); var dmnsns = this.getCompareSideBlock().getDimensions(); var endPosition={ top :xy[1]+dmnsns.height-5-22, left :xy[0]+dmnsns.width-5-79, width :79, height :22 }; var animatedSteps=10; var animatedTime=0.75; var xy=$(id2Animate).cumulativeOffset(); var dmnsns = $(id2Animate).getDimensions(); var startPosition={ top :xy[1], left :xy[0], width :dmnsns.width, height :dmnsns.height }; var accelerationX=(endPosition.left-startPosition.left)*2/animatedSteps/animatedSteps; var accelerationY=(endPosition.top-startPosition.top)*2/animatedSteps/animatedSteps; if($('animated_div')==null) { $$('div.wrapper')[0].insert({bottom:'
'}); } $('animated_div').setStyle({ "position" :"absolute", "left" :startPosition.left+"px", "top" :startPosition.top+'px', "width" :startPosition.width+'px', "height" :startPosition.height+'px', "display" :"" }); $('animated_div').setOpacity(0.7); for(var i=0;i0) { return $$("div.mini-compare-products")[0]; } //1.4+ return $$("div.block-compare")[0]; } } Event.observe(window, 'load', function() { //redefining click CompareNoReload.rescanForNewCompare(); if(CompareNoReload.getCompareSideBlock() == null) { if($$('div.col-left').length>0)$$('div.col-left')[0].insert({bottom:'
'}); else if($$('div.col-right').length>0)$$('div.col-right')[0].insert({bottom:'
'}); } });