Hotel Raxa - Advanced Booking System Implementation

🏨 Hotel Booking Enhancements:
- Implemented Eagle Booking Advanced Pricing add-on
- Added Booking.com-style rate management system
- Created professional calendar interface for pricing
- Integrated deals and discounts functionality

💰 Advanced Pricing Features:
- Dynamic pricing models (per room, per person, per adult)
- Base rates, adult rates, and child rates management
- Length of stay discounts and early bird deals
- Mobile rates and secret deals implementation
- Seasonal promotions and flash sales

📅 Availability Management:
- Real-time availability tracking
- Stop sell and restriction controls
- Closed to arrival/departure functionality
- Minimum/maximum stay requirements
- Automatic sold-out management

💳 Payment Integration:
- Maintained Redsys payment gateway integration
- Seamless integration with existing Eagle Booking
- No modifications to core Eagle Booking plugin

🛠️ Technical Implementation:
- Custom database tables for advanced pricing
- WordPress hooks and filters integration
- AJAX-powered admin interface
- Data migration from existing Eagle Booking
- Professional calendar view for revenue management

📊 Admin Interface:
- Booking.com-style management dashboard
- Visual rate and availability calendar
- Bulk operations for date ranges
- Statistics and analytics dashboard
- Modal dialogs for quick editing

🔧 Code Quality:
- WordPress coding standards compliance
- Secure database operations with prepared statements
- Proper input validation and sanitization
- Error handling and logging
- Responsive admin interface

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hotel Raxa Dev
2025-07-11 07:43:22 +02:00
commit 5b1e2453c7
9816 changed files with 2784509 additions and 0 deletions

View File

@@ -0,0 +1,391 @@
<?php
/**
* Spacing Field
*
* @package Redux Framework/Fields
* @author Dovy Paukstys & Kevin Provance (kprovance)
* @version 4.0.0
*/
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'Redux_Spacing', false ) ) {
/**
* Class Redux_Spacing
*/
class Redux_Spacing extends Redux_Field {
/**
* Set field a value defaults.
*/
public function set_defaults() {
$defaults = array(
'units' => 'px',
'mode' => 'padding',
'top' => true,
'bottom' => true,
'all' => false,
'left' => true,
'right' => true,
'units_extended' => false,
'display_units' => true,
);
$this->field = wp_parse_args( $this->field, $defaults );
// Set default values.
$defaults = array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
'units' => 'px',
);
$this->value = wp_parse_args( $this->value, $defaults );
}
/**
* Field Render Function.
* Takes the vars and outputs the HTML for the field in the settings
*
* @since ReduxFramework 1.0.0
*/
public function render() {
/*
* Acceptable values checks. If the passed variable doesn't pass muster, we unset them
* and reset them with default values to avoid errors.
*/
$unit_arr = Redux_Helpers::$array_units;
$unit_check = $unit_arr;
$unit_check[] = false;
// If units field has a value but is not an acceptable value, unset the variable.
if ( ! Redux_Helpers::array_in_array( $this->field['units'], $unit_check ) ) {
$this->field['units'] = 'px';
}
// If there is a default unit value but is not an accepted value, unset the variable.
if ( ! Redux_Helpers::array_in_array( $this->value['units'], $unit_check ) ) {
$this->value['units'] = 'px';
}
if ( false === $this->field['units'] ) {
$this->value['units'] = '';
}
if ( ! in_array( $this->field['mode'], array( 'margin', 'padding' ), true ) ) {
if ( 'absolute' === $this->field['mode'] ) {
$this->field['mode'] = '';
} else {
$this->field['mode'] = 'padding';
}
}
$value = array(
'top' => isset( $this->value[ $this->field['mode'] . '-top' ] ) ? filter_var( $this->value[ $this->field['mode'] . '-top' ], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : filter_var( $this->value['top'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ),
'right' => isset( $this->value[ $this->field['mode'] . '-right' ] ) ? filter_var( $this->value[ $this->field['mode'] . '-right' ], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : filter_var( $this->value['right'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ),
'bottom' => isset( $this->value[ $this->field['mode'] . '-bottom' ] ) ? filter_var( $this->value[ $this->field['mode'] . '-bottom' ], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : filter_var( $this->value['bottom'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ),
'left' => isset( $this->value[ $this->field['mode'] . '-left' ] ) ? filter_var( $this->value[ $this->field['mode'] . '-left' ], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : filter_var( $this->value['left'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ),
);
// if field units has a value and is NOT an array, then evaluate as needed.
if ( ! is_array( $this->field['units'] ) ) {
// If units fields has a value and is not empty but units value does not then make units value the field value.
if ( '' === $this->value['units'] && ( '' !== $this->field['units'] || false === $this->field['units'] ) ) {
$this->value['units'] = $this->field['units'];
// If units field does NOT have a value and units value does NOT have a value, set both to blank (default?).
} elseif ( '' === $this->field['units'] && '' === $this->value['units'] ) {
$this->field['units'] = 'px';
$this->value['units'] = 'px';
// If units field has NO value but units value does, then set unit field to value field.
} elseif ( '' === $this->field['units'] && '' !== $this->value['units'] ) {
$this->field['units'] = $this->value['units'];
// if unit value is set and unit value doesn't equal unit field (coz who knows why)
// then set unit value to unit field.
} elseif ( '' !== $this->value['units'] && $this->field['units'] !== $this->value['units'] ) {
$this->value['units'] = $this->field['units'];
}
// do stuff based on unit field NOT set as an array.
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement
} elseif ( ! empty( $this->field['units'] ) && is_array( $this->field['units'] ) ) {
// nothing to do here, but I'm leaving the construct just in case I have to debug this again.
}
if ( '' !== $this->field['units'] ) {
$value['units'] = $this->value['units'];
}
$this->value = $value;
if ( '' !== $this->field['mode'] ) {
$this->field['mode'] = $this->field['mode'] . '-';
}
if ( isset( $this->field['select2'] ) ) {
$this->field['select2'] = wp_parse_args( $this->field['select2'], $this->select2_config );
} else {
$this->field['select2'] = $this->select2_config;
}
$this->field['select2'] = Redux_Functions::sanitize_camel_case_array_keys( $this->field['select2'] );
$select2_data = Redux_Functions::create_data_string( $this->field['select2'] );
echo '<input
type="hidden"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[units]"
class="field-units" value="' . esc_attr( $this->value['units'] ) . '">';
if ( true === $this->field['all'] ) {
$this->field['top'] = true;
$this->field['right'] = true;
$this->field['bottom'] = true;
$this->field['left'] = true;
$this->value['bottom'] = $this->value['top'];
$this->value['left'] = $this->value['top'];
$this->value['right'] = $this->value['top'];
echo '<div class="field-spacing-input input-prepend">
<span class="add-on">
<i class="el el-fullscreen icon-large"></i>
</span>
<input
type="text"
class="redux-spacing-all redux-spacing-input mini ' . esc_attr( $this->field['class'] ) . '"
placeholder="' . esc_html__( 'All', 'redux-framework' ) . '"
rel="' . esc_attr( $this->field['id'] ) . '-all"
value="' . esc_attr( $this->value['top'] ) . '"
>
</div>';
}
if ( true === $this->field['top'] ) {
echo '<input
type="hidden"
class="redux-spacing-value"
id="' . esc_attr( $this->field['id'] ) . '-top"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] ) . 'top]"
value="' . esc_attr( $this->value['top'] ) . ( ! empty( $this->value['top'] ) ? esc_attr( $this->value['units'] ) : '' ) . '"
>';
}
if ( true === $this->field['right'] ) {
echo '<input
type="hidden"
class="redux-spacing-value"
id="' . esc_attr( $this->field['id'] ) . '-right"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] ) . 'right]"
value="' . esc_attr( $this->value['right'] ) . ( ! empty( $this->value['right'] ) ? esc_attr( $this->value['units'] ) : '' ) . '"
>';
}
if ( true === $this->field['bottom'] ) {
echo '<input
type="hidden"
class="redux-spacing-value"
id="' . esc_attr( $this->field['id'] ) . '-bottom"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] ) . 'bottom]"
value="' . esc_attr( $this->value['bottom'] ) . ( ! empty( $this->value['bottom'] ) ? esc_attr( $this->value['units'] ) : '' ) . '"
>';
}
if ( true === $this->field['left'] ) {
echo '<input
type="hidden"
class="redux-spacing-value"
id="' . esc_attr( $this->field['id'] ) . '-left"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] ) . 'left]"
value="' . esc_attr( $this->value['left'] ) . ( ! empty( $this->value['left'] ) ? esc_attr( $this->value['units'] ) : '' ) . '"
>';
}
if ( false === $this->field['all'] ) {
/**
* Top
* */
if ( true === $this->field['top'] ) {
echo '<div class="field-spacing-input input-prepend">
<span class="add-on">
<i class="el el-arrow-up icon-large"></i>
</span>
<input type="text"
class="redux-spacing-top redux-spacing-input mini ' . esc_attr( $this->field['class'] ) . '"
placeholder="' . esc_html__( 'Top', 'redux-framework' ) . '"
rel="' . esc_attr( $this->field['id'] ) . '-top"
value="' . esc_attr( $this->value['top'] ) . '"/>
</div>';
}
/**
* Right
* */
if ( true === $this->field['right'] ) {
echo '<div class="field-spacing-input input-prepend">
<span class="add-on">
<i class="el el-arrow-right icon-large"></i>
</span>
<input type="text"
class="redux-spacing-right redux-spacing-input mini ' . esc_attr( $this->field['class'] ) . '"
placeholder="' . esc_html__( 'Right', 'redux-framework' ) . '"
rel="' . esc_attr( $this->field['id'] ) . '-right"
value="' . esc_attr( $this->value['right'] ) . '"/>
</div>';
}
/**
* Bottom
* */
if ( true === $this->field['bottom'] ) {
echo '<div class="field-spacing-input input-prepend">
<span class="add-on">
<i class="el el-arrow-down icon-large"></i>
</span>
<input type="text"
class="redux-spacing-bottom redux-spacing-input mini ' . esc_attr( $this->field['class'] ) . '"
placeholder="' . esc_html__( 'Bottom', 'redux-framework' ) . '"
rel="' . esc_attr( $this->field['id'] ) . '-bottom"
value="' . esc_attr( $this->value['bottom'] ) . '">
</div>';
}
/**
* Left
* */
if ( true === $this->field['left'] ) {
echo '<div class="field-spacing-input input-prepend">
<span class="add-on">
<i class="el el-arrow-left icon-large"></i>
</span>
<input type="text"
class="redux-spacing-left redux-spacing-input mini ' . esc_attr( $this->field['class'] ) . '"
placeholder="' . esc_html__( 'Left', 'redux-framework' ) . '"
rel="' . esc_attr( $this->field['id'] ) . '-left"
value="' . esc_attr( $this->value['left'] ) . '"/>
</div>';
}
}
/**
* Units
* */
if ( false !== $this->field['units'] && true === $this->field['display_units'] ) {
echo '<div class="select_wrapper spacing-units" original-title="' . esc_html__( 'Units', 'redux-framework' ) . '">';
echo '<select data-placeholder="' . esc_html__( 'Units', 'redux-framework' ) . '" class="redux-spacing redux-spacing-units select ' . esc_attr( $this->field['class'] ) . '" original-title="' . esc_html__( 'Units', 'redux-framework' ) . '" id="' . esc_attr( $this->field['id'] ) . '_units"' . esc_attr( $select2_data ) . '>';
if ( $this->field['units_extended'] ) {
$test_units = $unit_arr;
} else {
$test_units = array( 'px', 'em', 'pt', 'rem', '%' );
}
if ( '' !== $this->field['units'] || is_array( $this->field['units'] ) ) {
$test_units = $this->field['units'];
}
echo '<option></option>';
if ( ! is_array( $this->field['units'] ) ) {
echo '<option value="' . esc_attr( $this->field['units'] ) . '" selected="selected">' . esc_attr( $this->field['units'] ) . '</option>';
} else {
foreach ( $test_units as $a_unit ) {
echo '<option value="' . esc_attr( $a_unit ) . '" ' . selected( $this->value['units'], $a_unit, false ) . '>' . esc_html( $a_unit ) . '</option>';
}
}
echo '</select></div>';
}
}
/**
* Enqueue Function.
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
*
* @since ReduxFramework 1.0.0
*/
public function enqueue() {
wp_enqueue_style( 'select2-css' );
wp_enqueue_script(
'redux-field-spacing',
Redux_Core::$url . 'inc/fields/spacing/redux-spacing' . Redux_Functions::is_min() . '.js',
array( 'jquery', 'select2-js', 'redux-js' ),
$this->timestamp,
true
);
if ( $this->parent->args['dev_mode'] ) {
wp_enqueue_style(
'redux-field-spacing',
Redux_Core::$url . 'inc/fields/spacing/redux-spacing.css',
array(),
$this->timestamp
);
}
}
/**
* Compile CSS data for output.
*
* @param string $data CSS data.
*
* @return string|void
*/
public function css_style( $data ) {
$style = '';
$data = (array) $data;
if ( ! isset( $this->field ) ) {
return;
}
if ( ! in_array( $this->field['mode'], array( 'padding', 'absolute', 'margin' ), true ) ) {
$this->field['mode'] = 'padding';
}
$units = $data['units'] ?? '';
foreach ( $data as $key => $value ) {
if ( 'units' === $key ) {
continue;
}
$the_units = $units;
// Strip off any alpha for is_numeric test - kp.
$num_no_alpha = preg_replace( '/[^\d.-]/', '', $value );
if ( empty( $the_units ) ) {
$the_units = str_replace( $num_no_alpha, '', $value );
}
// Output if it's a numeric entry.
if ( isset( $value ) && is_numeric( $num_no_alpha ) ) {
$style .= $key . ':' . $num_no_alpha . $the_units . ';';
}
}
return $style;
}
/**
* Enable output_variables to be generated.
*
* @since 4.0.3
* @return void
*/
public function output_variables() {
// No code needed, just defining the method is enough.
}
}
}
class_alias( 'Redux_Spacing', 'ReduxFramework_Spacing' );

View File

@@ -0,0 +1,8 @@
<?php
/**
* Silence is golden.
*
* @package Redux Framework
*/
_deprecated_file( 'field_spacing.php', '4.3', 'class-redux-spacing.php', 'This file has been renamed and is no longer used in Redux 4. Please change any references to it as it will be removed in future versions of Redux.' );

View File

@@ -0,0 +1,8 @@
<?php
/**
* Silence is golden.
*
* @package Redux Framework
*/
echo null;

View File

@@ -0,0 +1,11 @@
.redux-container-spacing select, .redux-container-spacing .select_wrapper { width: 80px !important; float: left; }
.redux-container-spacing .field-spacing-input { margin-right: 10px; margin-bottom: 7px; }
@media screen and (max-width: 782px) { .redux-container-spacing .field-spacing-input input { display: inline-block !important; width: 70px !important; }
.redux-container-spacing .field-spacing-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }
.redux-container-spacing .select_wrapper { margin-top: 6px; } }
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtc3BhY2luZy5jc3MiLCJzb3VyY2VzIjpbInJlZHV4LXNwYWNpbmcuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxBQUNJLHdCQURvQixDQUNwQixNQUFNLEVBRFYsd0JBQXdCLENBRXBCLGVBQWUsQ0FBQyxFQUNaLEtBQUssRUFBRSxlQUFlLEVBQ3RCLEtBQUssRUFBRSxJQUFJLEdBQ2Q7O0FBTEwsQUFPSSx3QkFQb0IsQ0FPcEIsb0JBQW9CLENBQUMsRUFDakIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLHdCQUZnQixDQUNwQixvQkFBb0IsQ0FDaEIsS0FBSyxDQUFDLEVBQ0YsT0FBTyxFQUFFLHVCQUF1QixFQUNoQyxLQUFLLEVBQUUsZUFBZSxHQUN6QjtDQUxULEFBT1Esd0JBUGdCLENBQ3BCLG9CQUFvQixDQU1oQixPQUFPLENBQUMsRUFDSixPQUFPLEVBQUUsT0FBTyxFQUNoQixTQUFTLEVBQUUsSUFBSSxFQUNmLFdBQVcsRUFBRSxHQUFHLEdBQ25CO0NBWFQsQUFjSSx3QkFkb0IsQ0FjcEIsZUFBZSxDQUFDLEVBQ1osVUFBVSxFQUFFLEdBQUcsR0FDbEIifQ== */
/*# sourceMappingURL=redux-spacing.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["redux-spacing.scss","redux-spacing.css"],"names":[],"mappings":"AAAA,4ECGQ,sBAAsB,EDUvB,WAAY,EAAA;;AAbnB,gDCQQ,kBAAkB,EAClB,kBAAkB,EAAA;;AAI1B,uCACI,sDAGY,gCAAgC,EAChC,sBAAsB,EAAA;CAJlC,wDAQY,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAAA;CAV5B,2CAeQ,eAAe,EAAA,EAClB;;AAtBT,y1BAAy1B","file":"redux-spacing.css","sourcesContent":[".redux-container-spacing {\r\n select,\r\n .select_wrapper {\r\n width: 80px !important;\r\n float: left;\r\n }\r\n\r\n .field-spacing-input {\r\n margin-right: 10px;\r\n margin-bottom: 7px;\r\n }\r\n}\r\n\r\n@media screen and (max-width: 782px) {\r\n .redux-container-spacing {\r\n .field-spacing-input {\r\n input {\r\n display: inline-block !important;\r\n width: 70px !important;\r\n }\r\n\r\n .add-on {\r\n padding: 7px 4px;\r\n font-size: 16px;\r\n line-height: 1.5;\r\n }\r\n }\r\n\r\n .select_wrapper {\r\n margin-top: 6px;\r\n }\r\n }\r\n}\r\n",".redux-container-spacing select, .redux-container-spacing .select_wrapper { width: 80px !important; float: left; }\n\n.redux-container-spacing .field-spacing-input { margin-right: 10px; margin-bottom: 7px; }\n\n@media screen and (max-width: 782px) { .redux-container-spacing .field-spacing-input input { display: inline-block !important; width: 70px !important; }\n\t.redux-container-spacing .field-spacing-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }\n\t.redux-container-spacing .select_wrapper { margin-top: 6px; } }\n\n/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtc3BhY2luZy5jc3MiLCJzb3VyY2VzIjpbInJlZHV4LXNwYWNpbmcuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxBQUNJLHdCQURvQixDQUNwQixNQUFNLEVBRFYsd0JBQXdCLENBRXBCLGVBQWUsQ0FBQyxFQUNaLEtBQUssRUFBRSxlQUFlLEVBQ3RCLEtBQUssRUFBRSxJQUFJLEdBQ2Q7O0FBTEwsQUFPSSx3QkFQb0IsQ0FPcEIsb0JBQW9CLENBQUMsRUFDakIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLHdCQUZnQixDQUNwQixvQkFBb0IsQ0FDaEIsS0FBSyxDQUFDLEVBQ0YsT0FBTyxFQUFFLHVCQUF1QixFQUNoQyxLQUFLLEVBQUUsZUFBZSxHQUN6QjtDQUxULEFBT1Esd0JBUGdCLENBQ3BCLG9CQUFvQixDQU1oQixPQUFPLENBQUMsRUFDSixPQUFPLEVBQUUsT0FBTyxFQUNoQixTQUFTLEVBQUUsSUFBSSxFQUNmLFdBQVcsRUFBRSxHQUFHLEdBQ25CO0NBWFQsQUFjSSx3QkFkb0IsQ0FjcEIsZUFBZSxDQUFDLEVBQ1osVUFBVSxFQUFFLEdBQUcsR0FDbEIifQ== */\n\n/*# sourceMappingURL=redux-spacing.css.map */\n"]}

View File

@@ -0,0 +1,73 @@
/*global redux*/
(function( $ ) {
'use strict';
redux.field_objects = redux.field_objects || {};
redux.field_objects.spacing = redux.field_objects.spacing || {};
redux.field_objects.spacing.init = function( selector ) {
selector = $.redux.getSelector( selector, 'spacing' );
$( selector ).each(
function() {
var el = $( this );
var parent = el;
if ( ! el.hasClass( 'redux-field-container' ) ) {
parent = el.parents( '.redux-field-container:first' );
}
if ( parent.is( ':hidden' ) ) {
return;
}
if ( parent.hasClass( 'redux-field-init' ) ) {
parent.removeClass( 'redux-field-init' );
} else {
return;
}
el.find( '.redux-spacing-units' ).select2();
el.find( '.redux-spacing-input' ).on(
'change',
function() {
var value;
var units = $( this ).parents( '.redux-field:first' ).find( '.field-units' ).val();
if ( 0 !== $( this ).parents( '.redux-field:first' ).find( '.redux-spacing-units' ).length ) {
units = $( this ).parents( '.redux-field:first' ).find( '.redux-spacing-units option:selected' ).val();
}
value = $( this ).val();
if ( 'undefined' !== typeof units && value ) {
value += units;
}
if ( $( this ).hasClass( 'redux-spacing-all' ) ) {
$( this ).parents( '.redux-field:first' ).find( '.redux-spacing-value' ).each(
function() {
$( this ).val( value );
}
);
} else {
$( '#' + $( this ).attr( 'rel' ) ).val( value );
}
}
);
el.find( '.redux-spacing-units' ).on(
'change',
function() {
$( this ).parents( '.redux-field:first' ).find( '.redux-spacing-input' ).change();
el.find( '.field-units' ).val( $( this ).val() );
}
);
}
);
};
})( jQuery );

View File

@@ -0,0 +1 @@
!function(n){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.spacing=redux.field_objects.spacing||{},redux.field_objects.spacing.init=function(i){i=n.redux.getSelector(i,"spacing"),n(i).each(function(){var i=n(this),e=i;(e=i.hasClass("redux-field-container")?e:i.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),i.find(".redux-spacing-units").select2(),i.find(".redux-spacing-input").on("change",function(){var i,e=n(this).parents(".redux-field:first").find(".field-units").val();0!==n(this).parents(".redux-field:first").find(".redux-spacing-units").length&&(e=n(this).parents(".redux-field:first").find(".redux-spacing-units option:selected").val()),i=n(this).val(),void 0!==e&&i&&(i+=e),n(this).hasClass("redux-spacing-all")?n(this).parents(".redux-field:first").find(".redux-spacing-value").each(function(){n(this).val(i)}):n("#"+n(this).attr("rel")).val(i)}),i.find(".redux-spacing-units").on("change",function(){n(this).parents(".redux-field:first").find(".redux-spacing-input").change(),i.find(".field-units").val(n(this).val())}))})}}(jQuery);

View File

@@ -0,0 +1,33 @@
.redux-container-spacing {
select,
.select_wrapper {
width: 80px !important;
float: left;
}
.field-spacing-input {
margin-right: 10px;
margin-bottom: 7px;
}
}
@media screen and (max-width: 782px) {
.redux-container-spacing {
.field-spacing-input {
input {
display: inline-block !important;
width: 70px !important;
}
.add-on {
padding: 7px 4px;
font-size: 16px;
line-height: 1.5;
}
}
.select_wrapper {
margin-top: 6px;
}
}
}