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:
@@ -0,0 +1,329 @@
|
||||
<?php
|
||||
/**
|
||||
* Dimension Field
|
||||
*
|
||||
* @package ReduxFramework
|
||||
* @subpackage Field_Dimensions
|
||||
* @author Kevin Provance (kprovance)
|
||||
* @version 4.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'Redux_Dimensions', false ) ) {
|
||||
|
||||
/**
|
||||
* Class Redux_Dimensions
|
||||
*/
|
||||
class Redux_Dimensions extends Redux_Field {
|
||||
|
||||
/**
|
||||
* Set field and value defaults.
|
||||
*/
|
||||
public function set_defaults() {
|
||||
// No errors, please.
|
||||
$defaults = array(
|
||||
'width' => true,
|
||||
'height' => true,
|
||||
'units_extended' => false,
|
||||
'units' => 'px',
|
||||
'mode' => array(
|
||||
'width' => false,
|
||||
'height' => false,
|
||||
),
|
||||
);
|
||||
|
||||
$this->field = wp_parse_args( $this->field, $defaults );
|
||||
|
||||
$defaults = array(
|
||||
'width' => '',
|
||||
'height' => '',
|
||||
'units' => 'px',
|
||||
);
|
||||
|
||||
$this->value = wp_parse_args( $this->value, $defaults );
|
||||
|
||||
if ( isset( $this->value['unit'] ) ) {
|
||||
$this->value['units'] = $this->value['unit'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
$arr_units = Redux_Helpers::$array_units;
|
||||
|
||||
$unit_check = $arr_units;
|
||||
$unit_check[] = false;
|
||||
|
||||
// If units field has a value but is not an acceptable value, unset the variable.
|
||||
if ( isset( $this->field['units'] ) && ! Redux_Helpers::array_in_array( $this->field['units'], $unit_check ) ) {
|
||||
unset( $this->field['units'] );
|
||||
}
|
||||
|
||||
// If there is a default unit value but is not an accepted value, unset the variable.
|
||||
if ( isset( $this->value['units'] ) && ! Redux_Helpers::array_in_array( $this->value['units'], $unit_check ) ) {
|
||||
unset( $this->value['units'] );
|
||||
}
|
||||
|
||||
/*
|
||||
* Since the unit field could be an array, string value or bool (to hide the unit field)
|
||||
* we need to separate our functions to avoid those nasty PHP index notices!
|
||||
*/
|
||||
|
||||
// if field units have a value and ARE an array, then evaluate as needed.
|
||||
if ( isset( $this->field['units'] ) && ! is_array( $this->field['units'] ) ) {
|
||||
|
||||
// If units fields has a value but units value does not then make units value the field value.
|
||||
if ( isset( $this->field['units'] ) && ! isset( $this->value['units'] ) || false === $this->field['units'] ) {
|
||||
$this->value['units'] = $this->field['units'];
|
||||
|
||||
// If unit field does NOT have a value and units value does NOT have a value, set both to blank (default?).
|
||||
} elseif ( ! isset( $this->field['units'] ) && ! isset( $this->value['units'] ) ) {
|
||||
$this->field['units'] = 'px';
|
||||
$this->value['units'] = 'px';
|
||||
|
||||
// If unit field has NO value but units value does, then set unit field to value field.
|
||||
} elseif ( ! isset( $this->field['units'] ) && isset( $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 ( isset( $this->value['units'] ) && $this->value['units'] !== $this->field['units'] ) {
|
||||
$this->value['units'] = $this->field['units'];
|
||||
}
|
||||
|
||||
// do stuff based on unit field NOT set as an array.
|
||||
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement
|
||||
} elseif ( isset( $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.
|
||||
}
|
||||
|
||||
echo '<fieldset id="' . esc_attr( $this->field['id'] ) . '-fieldset" class="redux-dimensions-container" data-id="' . esc_attr( $this->field['id'] ) . '">';
|
||||
|
||||
$this->select2_config['allowClear'] = false;
|
||||
|
||||
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'] );
|
||||
|
||||
// This used to be unit field, but was giving the PHP index error when it was an array,
|
||||
// so I changed it.
|
||||
echo '<input type="hidden" class="field-units" value="' . esc_attr( $this->value['units'] ) . '">';
|
||||
|
||||
/**
|
||||
* Width
|
||||
* */
|
||||
if ( true === $this->field['width'] ) {
|
||||
if ( ! empty( $this->value['width'] ) && false !== $this->value['units'] && strpos( $this->value['width'], strval( $this->value['units'] ) ) === false ) {
|
||||
$this->value['width'] = filter_var( $this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
||||
if ( false !== $this->field['units'] ) {
|
||||
$this->value['width'] .= $this->value['units'];
|
||||
}
|
||||
}
|
||||
echo '<div class="field-dimensions-input input-prepend">';
|
||||
echo '<span class="add-on"><i class="el el-resize-horizontal icon-large"></i></span>';
|
||||
echo '<input
|
||||
type="text"
|
||||
class="redux-dimensions-input redux-dimensions-width mini ' . esc_attr( $this->field['class'] ) . '"
|
||||
placeholder="' . esc_html__( 'Width', 'redux-framework' ) . '"
|
||||
rel="' . esc_attr( $this->field['id'] ) . '-width"
|
||||
value="' . esc_attr( filter_var( $this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) ) . '">';
|
||||
|
||||
echo '<input
|
||||
data-id="' . esc_attr( $this->field['id'] ) . '"
|
||||
type="hidden"
|
||||
id="' . esc_attr( $this->field['id'] ) . '-width"
|
||||
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[width]"
|
||||
value="' . esc_attr( $this->value['width'] ) . '">';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Height
|
||||
* */
|
||||
if ( true === $this->field['height'] ) {
|
||||
if ( ! empty( $this->value['height'] ) && false !== $this->value['units'] && strpos( $this->value['height'], strval( $this->value['units'] ) ) === false ) {
|
||||
$this->value['height'] = filter_var( $this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
||||
if ( false !== $this->field['units'] ) {
|
||||
$this->value['height'] .= $this->value['units'];
|
||||
}
|
||||
}
|
||||
echo '<div class="field-dimensions-input input-prepend">';
|
||||
echo '<span class="add-on"><i class="el el-resize-vertical icon-large"></i></span>';
|
||||
echo '<input
|
||||
type="text"
|
||||
class="redux-dimensions-input redux-dimensions-height mini ' . esc_attr( $this->field['class'] ) . '"
|
||||
placeholder="' . esc_html__( 'Height', 'redux-framework' ) . '"
|
||||
rel="' . esc_attr( $this->field['id'] ) . '-height"
|
||||
value="' . esc_attr( filter_var( $this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) ) . '">';
|
||||
|
||||
echo '<input
|
||||
data-id="' . esc_attr( $this->field['id'] ) . '"
|
||||
type="hidden"
|
||||
id="' . esc_attr( $this->field['id'] ) . '-height"
|
||||
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[height]"
|
||||
value="' . esc_attr( $this->value['height'] ) . '">';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Units
|
||||
* */
|
||||
// If units field is set and units field NOT false then fill out the options object and show it, otherwise it's hidden
|
||||
// and the default units value will apply.
|
||||
if ( isset( $this->field['units'] ) && false !== $this->field['units'] ) {
|
||||
echo '<div
|
||||
class="select_wrapper dimensions-units"
|
||||
original-title="' . esc_html__( 'Units', 'redux-framework' ) . '">';
|
||||
|
||||
echo '<select
|
||||
data-id="' . esc_attr( $this->field['id'] ) . '"
|
||||
data-placeholder="' . esc_html__( 'Units', 'redux-framework' ) . '"
|
||||
class="redux-dimensions redux-dimensions-units select ' . esc_attr( $this->field['class'] ) . '"
|
||||
original-title="' . esc_html__( 'Units', 'redux-framework' ) . '"
|
||||
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[units]"' . esc_attr( $select2_data ) . '>';
|
||||
|
||||
// Extended units, show 'em all.
|
||||
if ( $this->field['units_extended'] ) {
|
||||
$test_units = $arr_units;
|
||||
} else {
|
||||
$test_units = array( 'px', 'em', 'rem', '%' );
|
||||
}
|
||||
|
||||
if ( '' !== $this->field['units'] && is_array( $this->field['units'] ) ) {
|
||||
$test_units = $this->field['units'];
|
||||
}
|
||||
|
||||
if ( in_array( $this->field['units'], $test_units, true ) ) {
|
||||
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_attr( $a_unit ) . '</option>';
|
||||
}
|
||||
}
|
||||
echo '</select></div>';
|
||||
}
|
||||
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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-dimensions',
|
||||
Redux_Core::$url . 'inc/fields/dimensions/redux-dimensions' . 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-dimensions',
|
||||
Redux_Core::$url . 'inc/fields/dimensions/redux-dimensions.css',
|
||||
array(),
|
||||
$this->timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile CSS styles for output.
|
||||
*
|
||||
* @param string $data CSS data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function css_style( $data ): string {
|
||||
$style = '';
|
||||
|
||||
// If field units has a value and IS an array, then evaluate as needed.
|
||||
if ( isset( $this->field['units'] ) && ! is_array( $this->field['units'] ) ) {
|
||||
|
||||
// If units fields has a value but units value does not then make units value the field value.
|
||||
if ( isset( $this->field['units'] ) && ! isset( $this->value['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 ( ! isset( $this->field['units'] ) && ! isset( $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 ( ! isset( $this->field['units'] ) && isset( $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 ( isset( $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 ( isset( $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.
|
||||
}
|
||||
|
||||
$units = $this->value['units'] ?? '';
|
||||
|
||||
if ( ! is_array( $this->field['mode'] ) ) {
|
||||
$height = isset( $this->field['mode'] ) && ! empty( $this->field['mode'] ) ? $this->field['mode'] : 'height';
|
||||
$width = isset( $this->field['mode'] ) && ! empty( $this->field['mode'] ) ? $this->field['mode'] : 'width';
|
||||
} else {
|
||||
$height = false !== $this->field['mode']['height'] ? $this->field['mode']['height'] : 'height';
|
||||
$width = false !== $this->field['mode']['width'] ? $this->field['mode']['width'] : 'width';
|
||||
}
|
||||
|
||||
$clean_value = array(
|
||||
$height => isset( $this->value['height'] ) ? filter_var( $this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : '',
|
||||
$width => isset( $this->value['width'] ) ? filter_var( $this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : '',
|
||||
);
|
||||
|
||||
foreach ( $clean_value as $key => $value ) {
|
||||
// Output if it's a numeric entry.
|
||||
if ( isset( $value ) && is_numeric( $value ) ) {
|
||||
$style .= $key . ':' . $value . $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_Dimensions', 'ReduxFramework_Dimensions' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
_deprecated_file( 'field_dimensions.php', '4.3', 'class-redux-dimensions.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.' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
||||
@@ -0,0 +1,11 @@
|
||||
.redux-dimensions-container select, .redux-dimensions-container .select_wrapper { width: 80px !important; float: left; }
|
||||
|
||||
.redux-dimensions-container .field-dimensions-input { margin-right: 10px; margin-bottom: 7px; }
|
||||
|
||||
@media screen and (max-width: 782px) { .redux-dimensions-container .field-dimensions-input input { display: inline-block !important; width: 100px !important; }
|
||||
.redux-dimensions-container .field-dimensions-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }
|
||||
.redux-dimensions-container .select_wrapper { margin-top: 6px; } }
|
||||
|
||||
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtZGltZW5zaW9ucy5jc3MiLCJzb3VyY2VzIjpbInJlZHV4LWRpbWVuc2lvbnMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxBQUNJLDJCQUR1QixDQUN2QixNQUFNLEVBRFYsMkJBQTJCLENBRXZCLGVBQWUsQ0FBQyxFQUNaLEtBQUssRUFBRSxlQUFlLEVBQ3RCLEtBQUssRUFBRSxJQUFJLEdBQ2Q7O0FBTEwsQUFPSSwyQkFQdUIsQ0FPdkIsdUJBQXVCLENBQUMsRUFDcEIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLDJCQUZtQixDQUN2Qix1QkFBdUIsQ0FDbkIsS0FBSyxDQUFDLEVBQ0YsT0FBTyxFQUFFLHVCQUF1QixFQUNoQyxLQUFLLEVBQUUsZ0JBQWdCLEdBQzFCO0NBTFQsQUFPUSwyQkFQbUIsQ0FDdkIsdUJBQXVCLENBTW5CLE9BQU8sQ0FBQyxFQUNKLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLFNBQVMsRUFBRSxJQUFJLEVBQ2YsV0FBVyxFQUFFLEdBQUcsR0FDbkI7Q0FYVCxBQWNJLDJCQWR1QixDQWN2QixlQUFlLENBQUMsRUFDWixVQUFVLEVBQUUsR0FBRyxHQUNsQiJ9 */
|
||||
|
||||
/*# sourceMappingURL=redux-dimensions.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["redux-dimensions.scss","redux-dimensions.css"],"names":[],"mappings":"AAAA,kFCGQ,sBAAsB,EDUvB,WAAY,EAAA;;AAbnB,sDCQQ,kBAAkB,EAClB,kBAAkB,EAAA;;AAI1B,uCACI,4DAGY,gCAAgC,EAChC,uBAAuB,EAAA;CAJnC,8DAQY,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAAA;CAV5B,8CAeQ,eAAe,EAAA,EAClB;;AAtBT,i2BAAi2B","file":"redux-dimensions.css","sourcesContent":[".redux-dimensions-container {\r\n select,\r\n .select_wrapper {\r\n width: 80px !important;\r\n float: left;\r\n }\r\n\r\n .field-dimensions-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-dimensions-container {\r\n .field-dimensions-input {\r\n input {\r\n display: inline-block !important;\r\n width: 100px !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\r\n",".redux-dimensions-container select, .redux-dimensions-container .select_wrapper { width: 80px !important; float: left; }\n\n.redux-dimensions-container .field-dimensions-input { margin-right: 10px; margin-bottom: 7px; }\n\n@media screen and (max-width: 782px) { .redux-dimensions-container .field-dimensions-input input { display: inline-block !important; width: 100px !important; }\n\t.redux-dimensions-container .field-dimensions-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }\n\t.redux-dimensions-container .select_wrapper { margin-top: 6px; } }\n\n/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtZGltZW5zaW9ucy5jc3MiLCJzb3VyY2VzIjpbInJlZHV4LWRpbWVuc2lvbnMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxBQUNJLDJCQUR1QixDQUN2QixNQUFNLEVBRFYsMkJBQTJCLENBRXZCLGVBQWUsQ0FBQyxFQUNaLEtBQUssRUFBRSxlQUFlLEVBQ3RCLEtBQUssRUFBRSxJQUFJLEdBQ2Q7O0FBTEwsQUFPSSwyQkFQdUIsQ0FPdkIsdUJBQXVCLENBQUMsRUFDcEIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLDJCQUZtQixDQUN2Qix1QkFBdUIsQ0FDbkIsS0FBSyxDQUFDLEVBQ0YsT0FBTyxFQUFFLHVCQUF1QixFQUNoQyxLQUFLLEVBQUUsZ0JBQWdCLEdBQzFCO0NBTFQsQUFPUSwyQkFQbUIsQ0FDdkIsdUJBQXVCLENBTW5CLE9BQU8sQ0FBQyxFQUNKLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLFNBQVMsRUFBRSxJQUFJLEVBQ2YsV0FBVyxFQUFFLEdBQUcsR0FDbkI7Q0FYVCxBQWNJLDJCQWR1QixDQWN2QixlQUFlLENBQUMsRUFDWixVQUFVLEVBQUUsR0FBRyxHQUNsQiJ9 */\n\n/*# sourceMappingURL=redux-dimensions.css.map */\n"]}
|
||||
@@ -0,0 +1,57 @@
|
||||
/* global jQuery, redux */
|
||||
|
||||
(function( $ ) {
|
||||
'use strict';
|
||||
|
||||
redux.field_objects = redux.field_objects || {};
|
||||
redux.field_objects.dimensions = redux.field_objects.dimensions || {};
|
||||
|
||||
redux.field_objects.dimensions.init = function( selector ) {
|
||||
selector = $.redux.getSelector( selector, 'dimensions' );
|
||||
|
||||
$( 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-dimensions-units' ).select2();
|
||||
|
||||
el.find( '.redux-dimensions-input' ).on(
|
||||
'change',
|
||||
function() {
|
||||
var units = $( this ).parents( '.redux-field:first' ).find( '.field-units' ).val();
|
||||
if ( 0 !== $( this ).parents( '.redux-field:first' ).find( '.redux-dimensions-units' ).length ) {
|
||||
units = $( this ).parents( '.redux-field:first' ).find( '.redux-dimensions-units option:selected' ).val();
|
||||
}
|
||||
if ( 'undefined' !== typeof units ) {
|
||||
el.find( '#' + $( this ).attr( 'rel' ) ).val( $( this ).val() + units );
|
||||
} else {
|
||||
el.find( '#' + $( this ).attr( 'rel' ) ).val( $( this ).val() );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
el.find( '.redux-dimensions-units' ).on(
|
||||
'change',
|
||||
function() {
|
||||
$( this ).parents( '.redux-field:first' ).find( '.redux-dimensions-input' ).change();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
})( jQuery );
|
||||
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/dimensions/redux-dimensions.min.js
vendored
Normal file
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/dimensions/redux-dimensions.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(n){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.dimensions=redux.field_objects.dimensions||{},redux.field_objects.dimensions.init=function(i){i=n.redux.getSelector(i,"dimensions"),n(i).each(function(){var e=n(this),i=e;(i=e.hasClass("redux-field-container")?i:e.parents(".redux-field-container:first")).is(":hidden")||i.hasClass("redux-field-init")&&(i.removeClass("redux-field-init"),e.find(".redux-dimensions-units").select2(),e.find(".redux-dimensions-input").on("change",function(){var i=n(this).parents(".redux-field:first").find(".field-units").val();void 0!==(i=0!==n(this).parents(".redux-field:first").find(".redux-dimensions-units").length?n(this).parents(".redux-field:first").find(".redux-dimensions-units option:selected").val():i)?e.find("#"+n(this).attr("rel")).val(n(this).val()+i):e.find("#"+n(this).attr("rel")).val(n(this).val())}),e.find(".redux-dimensions-units").on("change",function(){n(this).parents(".redux-field:first").find(".redux-dimensions-input").change()}))})}}(jQuery);
|
||||
@@ -0,0 +1,34 @@
|
||||
.redux-dimensions-container {
|
||||
select,
|
||||
.select_wrapper {
|
||||
width: 80px !important;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.field-dimensions-input {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.redux-dimensions-container {
|
||||
.field-dimensions-input {
|
||||
input {
|
||||
display: inline-block !important;
|
||||
width: 100px !important;
|
||||
}
|
||||
|
||||
.add-on {
|
||||
padding: 7px 4px;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.select_wrapper {
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user