1/** 2 * This file is part of OXID eShop Community Edition. 3 * 4 * OXID eShop Community Edition is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * OXID eShop Community Edition is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>. 16 * 17 * @link http://www.oxid-esales.com 18 * @copyright (C) OXID eSales AG 2003-2016 19 * @version OXID eShop CE 20 */ 21( function( $ ) { 22 23 var oxMiniBasket = { 24 25 _create: function(){ 26 27 var self = this, 28 options = self.options, 29 el = self.element; 30 31 var timeout; 32 33 $( "form.js-oxWidgetReload-miniBasket" ).submit( formSubmit ); 34 35 // show on hover after some time 36 $("#minibasketIcon", el).hover(function(){ 37 timeout = setTimeout(function(){ 38 self.showMiniBasket(); 39 }, 400); 40 }, function(){ 41 clearTimeout(timeout); 42 }); 43 44 // show on click 45 $("#minibasketIcon", el).click(function(){ 46 //self.showMiniBasket(); 47 if ($("#basketFlyout").is(':visible')) { 48 return false; 49 } else { 50 clearTimeout(timeout); 51 $(".basketFlyout").hide(); 52 } 53 }); 54 55 // close basket 56 $(".closePop").click(function(){ 57 $(".basketFlyout").hide(); 58 clearTimeout(timeout); 59 return false; 60 }); 61 62 $(document).click( function( e ){ 63 if( ! $(e.target).parents("div").hasClass("basketFlyout") ){ 64 $(".basketFlyout").hide(); 65 } 66 }); 67 68 // close basket on ESC key 69 $(document).keydown( function( e ) { 70 if( e.which == 27) { 71 $(".basketFlyout").hide(); 72 clearTimeout(timeout); 73 } 74 }); 75 76 // show / hide added article message 77 if($("#newItemMsg").length > 0){ 78 $("#countValue").hide(); 79 $("#newItemMsg").delay(3000).fadeTo("fast", 0, function(){ 80 $("#countValue").fadeTo("fast", 1); 81 $("#newItemMsg").remove() 82 }); 83 } 84 85 $("#countdown").countdown( 86 function(count, element, container) { 87 if (count <= 1) { 88 //closing and emptying the basket 89 $(element).parents("#basketFlyout").hide(); 90 $("#countValue").parent('span').remove(); 91 $("#basketFlyout").remove(); 92 $("#miniBasket #minibasketIcon").unbind('mouseenter mouseleave'); 93 // refresh mini basket widget 94 $( "form.js-oxWidgetReload-miniBasket" ).submit(); 95 return container.not(element); 96 } 97 return null; 98 } 99 ); 100 101 }, 102 103 showMiniBasket : function(){ 104 $("#basketFlyout").show(); 105 $(".flyoutBox").hide(); 106 $("#loginBox").hide(); 107 if ($(".scrollable .scrollbarBox").length > 0) { 108 $('.scrollable .scrollbarBox').jScrollPane({ 109 showArrows: true, 110 verticalArrowPositions: 'split' 111 }); 112 } 113 }, 114 115 /** 116 * Reloads block 117 * 118 * @param activator 119 * @param contentTarget 120 * @returns {boolean} 121 */ 122 reload: function ( activator, contentTarget ) { 123 oxAjax.ajax( 124 activator, {//onSuccess 125 'onSuccess': function ( r ) { 126 $( contentTarget ).html( r ); 127 if ( typeof WidgetsHandler !== 'undefined' ) { 128 WidgetsHandler.reloadWidget( 'oxwMiniBasket' ); 129 } else { 130 oxAjax.evalScripts( contentTarget ); 131 } 132 } 133 } 134 ); 135 return false;
136 } 137 } 138 139 /** 140 * Handles form submit 141 * 142 * @returns {*} 143 */ 144 function formSubmit() { 145 var target = $( this ); 146 return oxMiniBasket.reload( $( target ), $( "#minibasket_container" )[0] ); 147 } 148 149 $.widget( "ui.oxMiniBasket", oxMiniBasket ); 150 151} )( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.