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,381 @@
|
||||
<?php
|
||||
/**
|
||||
* Border Field.
|
||||
*
|
||||
* @package ReduxFramework/Fields
|
||||
* @author Dovy Paukstys & Kevin Provance (kprovance)
|
||||
* @version 4.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Don't duplicate me!
|
||||
if ( ! class_exists( 'Redux_Border', false ) ) {
|
||||
|
||||
/**
|
||||
* Class Redux_Border
|
||||
*/
|
||||
class Redux_Border extends Redux_Field {
|
||||
|
||||
/**
|
||||
* Set field and value defaults.
|
||||
*/
|
||||
public function set_defaults() {
|
||||
// No errors, please.
|
||||
$defaults = array(
|
||||
'top' => true,
|
||||
'bottom' => true,
|
||||
'all' => true,
|
||||
'style' => true,
|
||||
'color' => true,
|
||||
'left' => true,
|
||||
'right' => true,
|
||||
);
|
||||
|
||||
$this->field = wp_parse_args( $this->field, $defaults );
|
||||
|
||||
$defaults = array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
'color' => '',
|
||||
'style' => '',
|
||||
);
|
||||
|
||||
$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() {
|
||||
$value = array(
|
||||
'top' => isset( $this->value['border-top'] ) ? filter_var( $this->value['border-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['border-right'] ) ? filter_var( $this->value['border-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['border-bottom'] ) ? filter_var( $this->value['border-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['border-left'] ) ? filter_var( $this->value['border-left'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : filter_var( $this->value['left'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ),
|
||||
'color' => $this->value['border-color'] ?? $this->value['color'],
|
||||
'style' => $this->value['border-style'] ?? $this->value['style'],
|
||||
);
|
||||
|
||||
if ( ( isset( $this->value['width'] ) || isset( $this->value['border-width'] ) ) ) {
|
||||
if ( isset( $this->value['border-width'] ) && ! empty( $this->value['border-width'] ) ) {
|
||||
$this->value['width'] = $this->value['border-width'];
|
||||
}
|
||||
|
||||
$this->value['width'] = $this->strip_alphas( $this->value['width'] );
|
||||
|
||||
$value['top'] = $this->value['width'];
|
||||
$value['right'] = $this->value['width'];
|
||||
$value['bottom'] = $this->value['width'];
|
||||
$value['left'] = $this->value['width'];
|
||||
}
|
||||
|
||||
$this->value = $value;
|
||||
|
||||
$defaults = array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
);
|
||||
|
||||
$this->check_for_all();
|
||||
|
||||
$this->value = wp_parse_args( $this->value, $defaults );
|
||||
|
||||
$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'] );
|
||||
|
||||
echo '<input type="hidden" class="field-units" value="px">';
|
||||
|
||||
if ( isset( $this->field['all'] ) && true === $this->field['all'] ) {
|
||||
echo '<div class="field-border-input input-prepend"><span class="add-on"><i class="el el-fullscreen icon-large"></i></span><input type="text" class="redux-border-all redux-border-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>';
|
||||
}
|
||||
|
||||
echo '<input type="hidden" class="redux-border-value" id="' . esc_attr( $this->field['id'] ) . '-top" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-top]" value="' . ( isset( $this->value['top'] ) && '' !== $this->value['top'] ? esc_attr( $this->value['top'] ) . 'px' : '' ) . '">';
|
||||
echo '<input type="hidden" class="redux-border-value" id="' . esc_attr( $this->field['id'] ) . '-right" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-right]" value="' . ( isset( $this->value['right'] ) && '' !== $this->value['right'] ? esc_attr( $this->value['right'] ) . 'px' : '' ) . '">';
|
||||
echo '<input type="hidden" class="redux-border-value" id="' . esc_attr( $this->field['id'] ) . '-bottom" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-bottom]" value="' . ( isset( $this->value['bottom'] ) && '' !== $this->value['bottom'] ? esc_attr( $this->value['bottom'] ) . 'px' : '' ) . '">';
|
||||
echo '<input type="hidden" class="redux-border-value" id="' . esc_attr( $this->field['id'] ) . '-left" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-left]" value="' . ( isset( $this->value['left'] ) && '' !== $this->value['left'] ? esc_attr( $this->value['left'] ) . 'px' : '' ) . '">';
|
||||
|
||||
if ( ! isset( $this->field['all'] ) || true !== $this->field['all'] ) {
|
||||
/**
|
||||
* Top
|
||||
* */
|
||||
if ( true === $this->field['top'] ) {
|
||||
echo '<div class="field-border-input input-prepend">
|
||||
<span class="add-on">
|
||||
<i class="el el-arrow-up icon-large"></i>
|
||||
</span>
|
||||
<input type="text" class="redux-border-top redux-border-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-border-input input-prepend">
|
||||
<span class="add-on">
|
||||
<i class="el el-arrow-right icon-large"></i>
|
||||
</span>
|
||||
<input type="text" class="redux-border-right redux-border-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-border-input input-prepend">
|
||||
<span class="add-on">
|
||||
<i class="el el-arrow-down icon-large"></i>
|
||||
</span>
|
||||
<input type="text" class="redux-border-bottom redux-border-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-border-input input-prepend">
|
||||
<span class="add-on">
|
||||
<i class="el el-arrow-left icon-large"></i>
|
||||
</span>
|
||||
<input type="text" class="redux-border-left redux-border-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>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Border-style
|
||||
* */
|
||||
if ( false !== $this->field['style'] ) {
|
||||
$options = array(
|
||||
'solid' => esc_html__( 'Solid', 'redux-framework' ),
|
||||
'dashed' => esc_html__( 'Dashed', 'redux-framework' ),
|
||||
'dotted' => esc_html__( 'Dotted', 'redux-framework' ),
|
||||
'double' => esc_html__( 'Double', 'redux-framework' ),
|
||||
'none' => esc_html__( 'None', 'redux-framework' ),
|
||||
);
|
||||
|
||||
echo '<select data-placeholder="' . esc_html__( 'Border style', 'redux-framework' ) . '" id="' . esc_attr( $this->field['id'] ) . '[border-style]" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-style]" class="tips redux-border-style ' . esc_attr( $this->field['class'] ) . '" rows="6" data-id="' . esc_attr( $this->field['id'] ) . '"' . esc_attr( $select2_data ) . '>';
|
||||
|
||||
foreach ( $options as $k => $v ) {
|
||||
echo '<option value="' . esc_attr( $k ) . '" ' . selected( $value['style'], $k, false ) . '>' . esc_html( $v ) . '</option>';
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
} else {
|
||||
echo '<input type="hidden" id="' . esc_attr( $this->field['id'] ) . '[border-style]" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-style]" value="' . esc_attr( $this->value['style'] ) . '" data-id="' . esc_attr( $this->field['id'] ) . '">';
|
||||
}
|
||||
|
||||
/**
|
||||
* Color
|
||||
* */
|
||||
if ( false !== $this->field['color'] ) {
|
||||
$default = $this->field['default']['border-color'] ?? '';
|
||||
|
||||
if ( empty( $default ) ) {
|
||||
$default = ( isset( $this->field['default']['color'] ) ) ? $this->field['default']['color'] : '#ffffff';
|
||||
}
|
||||
|
||||
echo '<input ';
|
||||
echo 'name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-color]"';
|
||||
echo 'id="' . esc_attr( $this->field['id'] ) . '-border"';
|
||||
echo 'class="color-picker redux-border-color redux-color redux-color-init ' . esc_attr( $this->field['class'] ) . '"';
|
||||
echo 'type="text"';
|
||||
echo 'value="' . esc_attr( $this->value['color'] ) . '"';
|
||||
echo 'data-default-color="' . esc_attr( $default ) . '"';
|
||||
echo 'data-id="' . esc_attr( $this->field['id'] ) . '"';
|
||||
|
||||
$data = array(
|
||||
'field' => $this->field,
|
||||
'index' => '',
|
||||
);
|
||||
|
||||
echo Redux_Functions_Ex::output_alpha_data( $data ); // phpcs:ignore WordPress.Security.EscapeOutput
|
||||
|
||||
echo '>';
|
||||
} else {
|
||||
echo '<input type="hidden" id="' . esc_attr( $this->field['id'] ) . '[border-color]" name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '[border-color]" value="' . esc_attr( $this->value['color'] ) . '" data-id="' . esc_attr( $this->field['id'] ) . '">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Do enqueue for each field instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function always_enqueue() {
|
||||
if ( isset( $this->field['color_alpha'] ) && $this->field['color_alpha'] ) {
|
||||
if ( ! wp_script_is( 'redux-wp-color-picker-alpha' ) ) {
|
||||
wp_enqueue_script( 'redux-wp-color-picker-alpha' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
$min = Redux_Functions::is_min();
|
||||
|
||||
if ( ! wp_style_is( 'select2-css' ) ) {
|
||||
wp_enqueue_style( 'select2-css' );
|
||||
}
|
||||
|
||||
if ( ! wp_style_is( 'wp-color-picker' ) ) {
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
}
|
||||
|
||||
$dep_array = array( 'jquery', 'select2-js', 'wp-color-picker', 'redux-js' );
|
||||
|
||||
wp_enqueue_script(
|
||||
'redux-field-border',
|
||||
Redux_Core::$url . 'inc/fields/border/redux-border' . $min . '.js',
|
||||
$dep_array,
|
||||
$this->timestamp,
|
||||
true
|
||||
);
|
||||
|
||||
if ( $this->parent->args['dev_mode'] ) {
|
||||
if ( ! wp_style_is( 'redux-color-picker' ) ) {
|
||||
wp_enqueue_style( 'redux-color-picker' );
|
||||
}
|
||||
|
||||
wp_enqueue_style(
|
||||
'redux-field-border',
|
||||
Redux_Core::$url . 'inc/fields/border/redux-border.css',
|
||||
array(),
|
||||
$this->timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to make sure all is properly set.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function check_for_all() {
|
||||
if ( true === $this->field['all'] ) {
|
||||
if ( 1 !== $this->field['top'] || 1 !== $this->field['bottom'] || 1 !== $this->field['left'] || 1 !== $this->field['right'] ) {
|
||||
$this->field['all'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output CSS styling.
|
||||
*
|
||||
* @param mixed $data Value array.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function css_style( $data ): string {
|
||||
$style = '';
|
||||
|
||||
$this->check_for_all();
|
||||
|
||||
if ( isset( $this->field['all'] ) && true === $this->field['all'] ) {
|
||||
$border_width = $data['border-width'] ?? '0px';
|
||||
$val = $data['border-top'] ?? $border_width;
|
||||
|
||||
$data['border-top'] = $val;
|
||||
$data['border-bottom'] = $val;
|
||||
$data['border-left'] = $val;
|
||||
$data['border-right'] = $val;
|
||||
}
|
||||
|
||||
$clean_value = array(
|
||||
'color' => ! empty( $data['border-color'] ) ? $data['border-color'] : '',
|
||||
'style' => ! empty( $data['border-style'] ) ? $data['border-style'] : '',
|
||||
);
|
||||
|
||||
$border_width = '';
|
||||
if ( isset( $data['border-width'] ) ) {
|
||||
$border_width = $data['border-width'];
|
||||
}
|
||||
|
||||
$this->field['top'] = $this->field['top'] ?? true;
|
||||
$this->field['bottom'] = $this->field['bottom'] ?? true;
|
||||
$this->field['left'] = $this->field['left'] ?? true;
|
||||
$this->field['right'] = $this->field['right'] ?? true;
|
||||
|
||||
if ( true === $this->field['top'] ) {
|
||||
$clean_value['top'] = ! empty( $data['border-top'] ) ? $data['border-top'] : $border_width;
|
||||
}
|
||||
|
||||
if ( true === $this->field['bottom'] ) {
|
||||
$clean_value['bottom'] = ! empty( $data['border-bottom'] ) ? $data['border-bottom'] : $border_width;
|
||||
}
|
||||
|
||||
if ( true === $this->field['left'] ) {
|
||||
$clean_value['left'] = ! empty( $data['border-left'] ) ? $data['border-left'] : $border_width;
|
||||
}
|
||||
|
||||
if ( true === $this->field['right'] ) {
|
||||
$clean_value['right'] = ! empty( $data['border-right'] ) ? $data['border-right'] : $border_width;
|
||||
}
|
||||
|
||||
// absolute, padding, margin.
|
||||
if ( ! isset( $this->field['all'] ) || true !== $this->field['all'] ) {
|
||||
foreach ( $clean_value as $key => $value ) {
|
||||
if ( 'color' === $key || 'style' === $key ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! empty( $value ) ) {
|
||||
$style .= 'border-' . $key . ':' . $value . ' ' . $clean_value['style'] . ' ' . $clean_value['color'] . ';';
|
||||
}
|
||||
}
|
||||
} elseif ( ! empty( $clean_value['top'] ) ) {
|
||||
$style .= 'border:' . $clean_value['top'] . ' ' . $clean_value['style'] . ' ' . $clean_value['color'] . ';';
|
||||
}
|
||||
|
||||
return $style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip alpha chars.
|
||||
*
|
||||
* @param string $s Criteria.
|
||||
*
|
||||
* @return null|string|string[]
|
||||
*/
|
||||
private function strip_alphas( string $s ) {
|
||||
// Regex is our friend. THERE ARE FOUR LIGHTS!!
|
||||
return preg_replace( '/[^\d.-]/', '', $s );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_Border', 'ReduxFramework_Border' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
_deprecated_file( 'field_border.php', '4.3', 'class-redux-border.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,15 @@
|
||||
.redux-container-border .select2-container { float: left; display: block; margin-right: 10px; }
|
||||
|
||||
.redux-container-border .select_wrapper { float: left; width: inherit; }
|
||||
|
||||
.redux-container-border .select_wrapper select { width: 80px; float: left; }
|
||||
|
||||
.redux-container-border .field-border-input { margin-right: 10px; margin-bottom: 7px; }
|
||||
|
||||
@media screen and (max-width: 782px) { .redux-container-border .field-border-input input { display: inline-block !important; width: 100px !important; }
|
||||
.redux-container-border .field-border-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }
|
||||
.redux-container-border .select_wrapper { margin-top: 6px; } }
|
||||
|
||||
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtYm9yZGVyLmNzcyIsInNvdXJjZXMiOlsicmVkdXgtYm9yZGVyLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFDSSx1QkFEbUIsQ0FDbkIsa0JBQWtCLENBQUMsRUFDZixLQUFLLEVBQUUsSUFBSSxFQUNYLE9BQU8sRUFBRSxLQUFLLEVBQ2QsWUFBWSxFQUFFLElBQUksR0FDckI7O0FBTEwsQUFPSSx1QkFQbUIsQ0FPbkIsZUFBZSxDQUFDLEVBQ1osS0FBSyxFQUFFLElBQUksRUFNWCxLQUFLLEVBQUUsT0FBTyxHQUNqQjs7QUFmTCxBQVNRLHVCQVRlLENBT25CLGVBQWUsQ0FFWCxNQUFNLENBQUMsRUFDSCxLQUFLLEVBQUUsSUFBSSxFQUNYLEtBQUssRUFBRSxJQUFJLEdBRWQ7O0FBYlQsQUFpQkksdUJBakJtQixDQWlCbkIsbUJBQW1CLENBQUMsRUFDaEIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLHVCQUZlLENBQ25CLG1CQUFtQixDQUNmLEtBQUssQ0FBQyxFQUNGLE9BQU8sRUFBRSx1QkFBdUIsRUFDaEMsS0FBSyxFQUFFLGdCQUFnQixHQUMxQjtDQUxULEFBT1EsdUJBUGUsQ0FDbkIsbUJBQW1CLENBTWYsT0FBTyxDQUFDLEVBQ0osT0FBTyxFQUFFLE9BQU8sRUFDaEIsU0FBUyxFQUFFLElBQUksRUFDZixXQUFXLEVBQUUsR0FBRyxHQUNuQjtDQVhULEFBY0ksdUJBZG1CLENBY25CLGVBQWUsQ0FBQyxFQUNaLFVBQVUsRUFBRSxHQUFHLEdBQ2xCIn0= */
|
||||
|
||||
/*# sourceMappingURL=redux-border.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["redux-border.scss","redux-border.css"],"names":[],"mappings":"AAAA,6CAAA,WAAA,ECGQ,cAAc,EDHtB,kBAOI,EAAA;;AAPJ,0CAuBO,WAAY,ECTX,cAAc,EAAA;;ADdtB,iDAwBI,WAAA,ECbQ,WAAW,EAAA;;ADXvB,8CCkBQ,kBAAkB,EAClB,kBAAkB,EAAA;;AAI1B,uCACI,oDAGY,gCAAgC,EAChC,uBAAuB,EAAA;CAJnC,sDAQY,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAAA;CAV5B,0CAeQ,eAAe,EAAA,EAClB;;AA5BT,qjCAAqjC","file":"redux-border.css","sourcesContent":[".redux-container-border {\r\n .select2-container {\r\n float: left;\r\n display: block;\r\n margin-right: 10px;\r\n }\r\n\r\n .select_wrapper {\r\n float: left;\r\n select {\r\n width: 80px;\r\n float: left;\r\n\r\n }\r\n width: inherit;\r\n }\r\n\r\n .field-border-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-border {\r\n .field-border-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",".redux-container-border .select2-container { float: left; display: block; margin-right: 10px; }\n\n.redux-container-border .select_wrapper { float: left; width: inherit; }\n\n.redux-container-border .select_wrapper select { width: 80px; float: left; }\n\n.redux-container-border .field-border-input { margin-right: 10px; margin-bottom: 7px; }\n\n@media screen and (max-width: 782px) { .redux-container-border .field-border-input input { display: inline-block !important; width: 100px !important; }\n\t.redux-container-border .field-border-input .add-on { padding: 7px 4px; font-size: 16px; line-height: 1.5; }\n\t.redux-container-border .select_wrapper { margin-top: 6px; } }\n\n/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtYm9yZGVyLmNzcyIsInNvdXJjZXMiOlsicmVkdXgtYm9yZGVyLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFDSSx1QkFEbUIsQ0FDbkIsa0JBQWtCLENBQUMsRUFDZixLQUFLLEVBQUUsSUFBSSxFQUNYLE9BQU8sRUFBRSxLQUFLLEVBQ2QsWUFBWSxFQUFFLElBQUksR0FDckI7O0FBTEwsQUFPSSx1QkFQbUIsQ0FPbkIsZUFBZSxDQUFDLEVBQ1osS0FBSyxFQUFFLElBQUksRUFNWCxLQUFLLEVBQUUsT0FBTyxHQUNqQjs7QUFmTCxBQVNRLHVCQVRlLENBT25CLGVBQWUsQ0FFWCxNQUFNLENBQUMsRUFDSCxLQUFLLEVBQUUsSUFBSSxFQUNYLEtBQUssRUFBRSxJQUFJLEdBRWQ7O0FBYlQsQUFpQkksdUJBakJtQixDQWlCbkIsbUJBQW1CLENBQUMsRUFDaEIsWUFBWSxFQUFFLElBQUksRUFDbEIsYUFBYSxFQUFFLEdBQUcsR0FDckI7O0FBR0wsTUFBTSxDQUFDLE1BQU0sTUFBTSxTQUFTLEVBQUUsS0FBSyxJQUMvQixBQUVRLHVCQUZlLENBQ25CLG1CQUFtQixDQUNmLEtBQUssQ0FBQyxFQUNGLE9BQU8sRUFBRSx1QkFBdUIsRUFDaEMsS0FBSyxFQUFFLGdCQUFnQixHQUMxQjtDQUxULEFBT1EsdUJBUGUsQ0FDbkIsbUJBQW1CLENBTWYsT0FBTyxDQUFDLEVBQ0osT0FBTyxFQUFFLE9BQU8sRUFDaEIsU0FBUyxFQUFFLElBQUksRUFDZixXQUFXLEVBQUUsR0FBRyxHQUNuQjtDQVhULEFBY0ksdUJBZG1CLENBY25CLGVBQWUsQ0FBQyxFQUNaLFVBQVUsRUFBRSxHQUFHLEdBQ2xCIn0= */\n\n/*# sourceMappingURL=redux-border.css.map */\n"]}
|
||||
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
* Field Border (border)
|
||||
*/
|
||||
|
||||
/*global redux_change, redux, colorValidate */
|
||||
|
||||
(function( $ ) {
|
||||
'use strict';
|
||||
|
||||
redux.field_objects = redux.field_objects || {};
|
||||
redux.field_objects.border = redux.field_objects.border || {};
|
||||
|
||||
redux.field_objects.border.init = function( selector ) {
|
||||
selector = $.redux.getSelector( selector, 'border' );
|
||||
|
||||
$( 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-border-top, .redux-border-right, .redux-border-bottom, .redux-border-left, .redux-border-all' ).numeric( { allowMinus: false } );
|
||||
el.find( '.redux-border-style' ).select2();
|
||||
|
||||
el.find( '.redux-border-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-border-units' ).length ) {
|
||||
units = $( this ).parents( '.redux-field:first' ).find( '.redux-border-units option:selected' ).val();
|
||||
}
|
||||
|
||||
value = $( this ).val();
|
||||
|
||||
if ( 'undefined' !== typeof units && value ) {
|
||||
value += units;
|
||||
}
|
||||
|
||||
if ( $( this ).hasClass( 'redux-border-all' ) ) {
|
||||
$( this ).parents( '.redux-field:first' ).find( '.redux-border-value' ).each(
|
||||
function() {
|
||||
$( this ).val( value );
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$( '#' + $( this ).attr( 'rel' ) ).val( value );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
el.find( '.redux-border-units' ).on(
|
||||
'change',
|
||||
function() {
|
||||
$( this ).parents( '.redux-field:first' ).find( '.redux-border-input' ).change();
|
||||
}
|
||||
);
|
||||
|
||||
el.find( '.redux-color-init' ).wpColorPicker(
|
||||
{
|
||||
change: function( e, ui ) {
|
||||
$( this ).val( ui.color.toString() );
|
||||
redux_change( $( this ) );
|
||||
el.find( '#' + e.target.getAttribute( 'data-id' ) + '-transparency' ).prop( 'checked', false );
|
||||
},
|
||||
clear: function( e, ui ) {
|
||||
e = null;
|
||||
$( this ).val( ui.color.toString() );
|
||||
redux_change( $( this ).parent().find( '.redux-color-init' ) );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
el.find( '.redux-color' ).on(
|
||||
'keyup',
|
||||
function() {
|
||||
var color = colorValidate( this );
|
||||
|
||||
if ( color && color !== $( this ).val() ) {
|
||||
$( this ).val( color );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Replace and validate field on blur.
|
||||
el.find( '.redux-color' ).on(
|
||||
'blur',
|
||||
function() {
|
||||
var value = $( this ).val();
|
||||
|
||||
if ( colorValidate( this ) === value ) {
|
||||
if ( 0 !== value.indexOf( '#' ) ) {
|
||||
$( this ).val( $( this ).data( 'oldcolor' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Store the old valid color on keydown.
|
||||
el.find( '.redux-color' ).on(
|
||||
'keydown',
|
||||
function() {
|
||||
$( this ).data( 'oldkeypress', $( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
);
|
||||
};
|
||||
})( jQuery );
|
||||
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/border/redux-border.min.js
vendored
Normal file
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/border/redux-border.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(d){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.border=redux.field_objects.border||{},redux.field_objects.border.init=function(e){e=d.redux.getSelector(e,"border"),d(e).each(function(){var i=d(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-border-top, .redux-border-right, .redux-border-bottom, .redux-border-left, .redux-border-all").numeric({allowMinus:!1}),i.find(".redux-border-style").select2(),i.find(".redux-border-input").on("change",function(){var e,r=d(this).parents(".redux-field:first").find(".field-units").val();0!==d(this).parents(".redux-field:first").find(".redux-border-units").length&&(r=d(this).parents(".redux-field:first").find(".redux-border-units option:selected").val()),e=d(this).val(),void 0!==r&&e&&(e+=r),d(this).hasClass("redux-border-all")?d(this).parents(".redux-field:first").find(".redux-border-value").each(function(){d(this).val(e)}):d("#"+d(this).attr("rel")).val(e)}),i.find(".redux-border-units").on("change",function(){d(this).parents(".redux-field:first").find(".redux-border-input").change()}),i.find(".redux-color-init").wpColorPicker({change:function(e,r){d(this).val(r.color.toString()),redux_change(d(this)),i.find("#"+e.target.getAttribute("data-id")+"-transparency").prop("checked",!1)},clear:function(e,r){d(this).val(r.color.toString()),redux_change(d(this).parent().find(".redux-color-init"))}}),i.find(".redux-color").on("keyup",function(){var e=colorValidate(this);e&&e!==d(this).val()&&d(this).val(e)}),i.find(".redux-color").on("blur",function(){var e=d(this).val();colorValidate(this)===e&&0!==e.indexOf("#")&&d(this).val(d(this).data("oldcolor"))}),i.find(".redux-color").on("keydown",function(){d(this).data("oldkeypress",d(this).val())}))})}}(jQuery);
|
||||
@@ -0,0 +1,43 @@
|
||||
.redux-container-border {
|
||||
.select2-container {
|
||||
float: left;
|
||||
display: block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.select_wrapper {
|
||||
float: left;
|
||||
select {
|
||||
width: 80px;
|
||||
float: left;
|
||||
|
||||
}
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.field-border-input {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.redux-container-border {
|
||||
.field-border-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