From c7534fd58ffe167680842473e84ce1f78288e005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Vracovsk=C3=BD?= Date: Tue, 2 Feb 2021 07:09:48 +0100 Subject: [PATCH] Refactored checkout for 3rd generation templates --- 00/css/modules/components/forms.less | 13 - 00/css/modules/components/order-step-one.less | 34 +- 00/css/modules/components/price-wrapper.less | 4 - 00/css/modules/shared-declarations.less | 10 +- 00/js/jqueryui/autocomplete.js | 1215 +++++++++-------- 00/js/libs/cart.js | 22 +- 00/js/libs/checkout.js | 797 +---------- 00/js/libs/checkoutShared.js | 876 ++++++++++++ 00/js/libs/config.js | 16 - 00/js/libs/externalShippingOne.js | 92 ++ 00/js/libs/externalShippingTwo.js | 92 ++ 00/js/libs/helpers.js | 9 +- 00/js/libs/modal.js | 28 +- 00/js/libs/scripts.js | 31 +- 00/js/modules/globalFunctions.js | 28 +- 09/css/modules/cart.less | 4 - 16 files changed, 1785 insertions(+), 1486 deletions(-) create mode 100644 00/js/libs/checkoutShared.js create mode 100644 00/js/libs/externalShippingOne.js create mode 100644 00/js/libs/externalShippingTwo.js diff --git a/00/css/modules/components/forms.less b/00/css/modules/components/forms.less index ab03966..7293fdd 100644 --- a/00/css/modules/components/forms.less +++ b/00/css/modules/components/forms.less @@ -154,9 +154,6 @@ input[type="radio"] { cursor: not-allowed; } } - .table-payu & { - display: inline; - } &.error-field, &.js-error-field { & + label { @@ -218,16 +215,6 @@ input { &[type="search"] { .appearance(none); } - &[type="radio"] { - .table-payu & { - .appearance(radio); - } - } - &[type="checkbox"] { - .table-payu & { - .appearance(checkbox); - } - } } .required-asterisk:after { diff --git a/00/css/modules/components/order-step-one.less b/00/css/modules/components/order-step-one.less index 6d6064d..e80d75e 100644 --- a/00/css/modules/components/order-step-one.less +++ b/00/css/modules/components/order-step-one.less @@ -6,12 +6,6 @@ &:last-child { border-bottom-style: none; } - &.payu-billing-info { - padding-left: 0; - label { - padding-left: 20px; - } - } input[type="radio"] + label { display: flex; justify-content: space-between; @@ -58,16 +52,20 @@ } } -#payu-template { - .container { - width: auto; - padding-left: 0; - padding-right: 0; - padding: round(@line-height-computed / 2) 0; - } - table { - max-width: 100%; - width: 100% !important; - margin: 0 !important; - } +#payu_ .table-payu { + border: 0 !important; + width: 100% !important; + max-width: 100%; + padding: 0 !important; + margin: 0 !important; + background: none !important; +} + +input[type="radio"].payu + label::before, +input[type="radio"].payu + label::after { + visibility: hidden; +} +#payu_ input[type="radio"] { + display: inline; + .appearance(auto); } diff --git a/00/css/modules/components/price-wrapper.less b/00/css/modules/components/price-wrapper.less index cb938bf..3e1a33e 100644 --- a/00/css/modules/components/price-wrapper.less +++ b/00/css/modules/components/price-wrapper.less @@ -36,7 +36,3 @@ } } } - -.matrixprice { - display: none; -} diff --git a/00/css/modules/shared-declarations.less b/00/css/modules/shared-declarations.less index b9f7eed..1f4efe2 100644 --- a/00/css/modules/shared-declarations.less +++ b/00/css/modules/shared-declarations.less @@ -233,11 +233,6 @@ label.disabled { width: auto !important; padding: 0 !important; } - .table-payu { - width: 100% !important; - margin: 10px 0 !important; - padding: 0 !important; - } #checkoutContent & { display: block; } @@ -373,7 +368,6 @@ iframe[name="google_conversion_frame"] { #company-info { margin-bottom: @line-height-computed; } - /* social buttons popoup */ .at-share-dock-outer { position: relative; @@ -429,3 +423,7 @@ iframe[name="google_conversion_frame"] { margin-bottom: 0; } } + +.recapitulation-shipping-billing-label { + display: none; +} diff --git a/00/js/jqueryui/autocomplete.js b/00/js/jqueryui/autocomplete.js index 8c8ce2b..dceef0f 100644 --- a/00/js/jqueryui/autocomplete.js +++ b/00/js/jqueryui/autocomplete.js @@ -17,625 +17,626 @@ //>>css.theme: ../themes/base/theme.css ( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ - "jquery", - "./core", - "./widget", - "./position", - "./menu" - ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } + if ( typeof define === "function" && define.amd ) { + // AMD. Register as an anonymous module. + define( [ + "jquery", + "./core", + "./widget", + "./position", + "./menu" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } }( function( $ ) { $.widget( "ui.autocomplete", { - version: "@VERSION", - defaultElement: "", - options: { - appendTo: null, - autoFocus: false, - delay: 300, - minLength: 1, - position: { - my: "left top", - at: "left bottom", - collision: "none" - }, - source: null, - - // callbacks - change: null, - close: null, - focus: null, - open: null, - response: null, - search: null, - select: null - }, - - requestIndex: 0, - pending: 0, - - _create: function() { - // Some browsers only repeat keydown events, not keypress events, - // so we use the suppressKeyPress flag to determine if we've already - // handled the keydown event. #7269 - // Unfortunately the code for & in keypress is the same as the up arrow, - // so we use the suppressKeyPressRepeat flag to avoid handling keypress - // events when we know the keydown event was used to modify the - // search term. #7799 - var suppressKeyPress, suppressKeyPressRepeat, suppressInput, - nodeName = this.element[ 0 ].nodeName.toLowerCase(), - isTextarea = nodeName === "textarea", - isInput = nodeName === "input"; - - // Textareas are always multi-line - // Inputs are always single-line, even if inside a contentEditable element - // IE also treats inputs as contentEditable - // All other element types are determined by whether or not they're contentEditable - this.isMultiLine = isTextarea || !isInput && this.element.prop( "isContentEditable" ); - - this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; - this.isNewMenu = true; - - this._addClass( "ui-autocomplete-input" ); - this.element.attr( "autocomplete", "off" ); - - this._on( this.element, { - keydown: function( event ) { - if ( this.element.prop( "readOnly" ) ) { - suppressKeyPress = true; - suppressInput = true; - suppressKeyPressRepeat = true; - return; - } - - suppressKeyPress = false; - suppressInput = false; - suppressKeyPressRepeat = false; - var keyCode = $.ui.keyCode; - switch ( event.keyCode ) { - case keyCode.PAGE_UP: - suppressKeyPress = true; - this._move( "previousPage", event ); - break; - case keyCode.PAGE_DOWN: - suppressKeyPress = true; - this._move( "nextPage", event ); - break; - case keyCode.UP: - suppressKeyPress = true; - this._keyEvent( "previous", event ); - break; - case keyCode.DOWN: - suppressKeyPress = true; - this._keyEvent( "next", event ); - break; - case keyCode.ENTER: - // when menu is open and has focus - if ( this.menu.active ) { - // #6055 - Opera still allows the keypress to occur - // which causes forms to submit - suppressKeyPress = true; - event.preventDefault(); - this.menu.select( event ); - } - break; - case keyCode.TAB: - if ( this.menu.active ) { - this.menu.select( event ); - } - break; - case keyCode.ESCAPE: - if ( this.menu.element.is( ":visible" ) ) { - if ( !this.isMultiLine ) { - this._value( this.term ); - } - this.close( event ); - // Different browsers have different default behavior for escape - // Single press can mean undo or clear - // Double press in IE means clear the whole form - event.preventDefault(); - } - break; - default: - suppressKeyPressRepeat = true; - // search timeout should be triggered before the input value is changed - this._searchTimeout( event ); - break; - } - }, - keypress: function( event ) { - if ( suppressKeyPress ) { - suppressKeyPress = false; - if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { - event.preventDefault(); - } - return; - } - if ( suppressKeyPressRepeat ) { - return; - } - - // replicate some key handlers to allow them to repeat in Firefox and Opera - var keyCode = $.ui.keyCode; - switch ( event.keyCode ) { - case keyCode.PAGE_UP: - this._move( "previousPage", event ); - break; - case keyCode.PAGE_DOWN: - this._move( "nextPage", event ); - break; - case keyCode.UP: - this._keyEvent( "previous", event ); - break; - case keyCode.DOWN: - this._keyEvent( "next", event ); - break; - } - }, - input: function( event ) { - if ( suppressInput ) { - suppressInput = false; - event.preventDefault(); - return; - } - this._searchTimeout( event ); - }, - focus: function() { - this.selectedItem = null; - this.previous = this._value(); - }, - blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - - clearTimeout( this.searching ); - this.close( event ); - this._change( event ); - } - } ); - - this._initSource(); - this.menu = $( "