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,412 @@
<?php
/**
* Slides 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_Slides', false ) ) {
/**
* Main Redux_slides class
*
* @since 1.0.0
*/
class Redux_Slides extends Redux_Field {
/**
* Set field and value defaults.
*/
public function set_defaults() {
$defaults = array(
'show' => array(
'title' => true,
'description' => true,
'url' => true,
),
'content_title' => esc_html__( 'Slide', 'redux-framework' ),
);
$this->field = wp_parse_args( $this->field, $defaults );
}
/**
* Field Render Function.
* Takes the vars and outputs the HTML for the field in the settings
*
* @since 1.0.0
* @access public
* @return void
*/
public function render() {
// translators: New accordion title.
echo '<div class="redux-slides-accordion" data-new-content-title="' . esc_attr( sprintf( __( 'New %s', 'redux-framework' ), $this->field['content_title'] ) ) . '">';
$x = 0;
if ( is_array( $this->value ) && ! empty( $this->value ) ) {
$slides = $this->value;
foreach ( $slides as $slide ) {
if ( empty( $slide ) ) {
continue;
}
$defaults = array(
'title' => '',
'description' => '',
'sort' => '',
'url' => '',
'image' => '',
'thumb' => '',
'attachment_id' => '',
'height' => '',
'width' => '',
'select' => array(),
);
$slide = wp_parse_args( $slide, $defaults );
if ( empty( $slide['thumb'] ) && ! empty( $slide['attachment_id'] ) ) {
$img = wp_get_attachment_image_src( $slide['attachment_id'], 'full' );
$slide['image'] = $img[0];
$slide['width'] = $img[1];
$slide['height'] = $img[2];
}
echo '<div class="redux-slides-accordion-group"><fieldset class="redux-field" data-id="' . esc_attr( $this->field['id'] ) . '"><h3><span class="redux-slides-header">' . esc_html( $slide['title'] ) . '</span></h3><div>';
$hide = '';
if ( empty( $slide['image'] ) ) {
$hide = ' hide';
}
$alt = wp_prepare_attachment_for_js( $slide['attachment_id'] );
$alt = $alt['alt'] ?? '';
echo '<div class="screenshot' . esc_attr( $hide ) . '">';
echo '<a class="of-uploaded-image" href="' . esc_url( $slide['image'] ) . '">';
echo '<img
class="redux-slides-image"
id="image_image_id_' . esc_attr( $x ) . '" src="' . esc_url( $slide['thumb'] ) . '"
alt="' . esc_attr( $alt ) . '"
target="_blank" rel="external" />';
echo '</a>';
echo '</div>';
echo '<div class="redux_slides_add_remove">';
echo '<span class="button media_upload_button" id="add_' . esc_attr( $x ) . '">' . esc_html__( 'Upload', 'redux-framework' ) . '</span>';
$hide = '';
if ( empty( $slide['image'] ) ) {
$hide = ' hide';
}
echo '<span
class="button remove-image' . esc_attr( $hide ) . '"
id="reset_' . esc_attr( $x ) . '"
rel="' . esc_attr( $slide['attachment_id'] ) . '">' .
esc_html__( 'Remove', 'redux-framework' ) . '</span>';
echo '</div>' . "\n";
echo '<ul id="' . esc_attr( $this->field['id'] ) . '-ul" class="redux-slides-list">';
if ( $this->field['show']['title'] ) {
$title_type = 'text';
} else {
$title_type = 'hidden';
}
$placeholder = ( isset( $this->field['placeholder']['title'] ) ) ? esc_attr( $this->field['placeholder']['title'] ) : __( 'Title', 'redux-framework' );
echo '<li>';
echo '<input
type="' . esc_attr( $title_type ) . '"
id="' . esc_attr( $this->field['id'] ) . '-title_' . esc_attr( $x ) . '"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][title]' . $this->field['name_suffix'] ) . '"
value="' . esc_attr( $slide['title'] ) . '"
placeholder="' . esc_attr( $placeholder ) . '" class="full-text slide-title" />';
echo '</li>';
if ( $this->field['show']['description'] ) {
$placeholder = ( isset( $this->field['placeholder']['description'] ) ) ? esc_attr( $this->field['placeholder']['description'] ) : __( 'Description', 'redux-framework' );
echo '<li>';
echo '<textarea
name="' . esc_attr( $this->field['name'] . '[' . $x . '][description]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-description_' . esc_attr( $x ) . '"
placeholder="' . esc_attr( $placeholder ) . '"
class="large-text"
rows="6">' . esc_textarea( $slide['description'] ) . '</textarea>';
echo '</li>';
}
$placeholder = ( isset( $this->field['placeholder']['url'] ) ) ? esc_attr( $this->field['placeholder']['url'] ) : __( 'URL', 'redux-framework' );
if ( $this->field['show']['url'] ) {
$url_type = 'text';
} else {
$url_type = 'hidden';
}
echo '<li>';
echo '<input
type="' . esc_attr( $url_type ) . '"
id="' . esc_attr( $this->field['id'] . '-url_' ) . esc_attr( $x ) . '"
name="' . esc_attr( $this->field['name'] . '[' . esc_attr( $x ) . '][url]' . $this->field['name_suffix'] ) . '"
value="' . esc_attr( $slide['url'] ) . '"
class="full-text" placeholder="' . esc_attr( $placeholder ) . '" />';
echo '</li>';
echo '<li>';
echo '<input
type="hidden"
class="slide-sort"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][sort]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-sort_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['sort'] ) . '" />';
echo '<li>';
echo '<input
type="hidden"
class="upload-id"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][attachment_id]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-image_id_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['attachment_id'] ) . '" />';
echo '<input
type="hidden"
class="upload" name="' . esc_attr( $this->field['name'] . '[' . $x . '][image]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-image_url_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['image'] ) . '" readonly="readonly" />';
echo '<input
type="hidden"
class="upload-height"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][height]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-image_height_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['height'] ) . '" />';
echo '<input
type="hidden"
class="upload-width"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][width]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-image_width_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['width'] ) . '" />';
echo '</li>';
echo '<input
type="hidden"
class="upload-thumbnail"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][thumb]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] ) . '-thumb_url_' . esc_attr( $x ) . '"
value="' . esc_attr( $slide['thumb'] ) . '" readonly="readonly" />';
echo '</li>';
echo '<li>';
echo '<a href="javascript:void(0);" class="button deletion redux-slides-remove">' . esc_html__( 'Delete', 'redux-framework' ) . '</a>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</fieldset>';
echo '</div>';
++$x;
}
}
if ( 0 === $x ) {
echo '<div class="redux-slides-accordion-group">';
echo '<fieldset class="redux-field" data-id="' . esc_attr( $this->field['id'] ) . '">';
echo '<h3>';
// translators: Content title for new accordion.
echo '<span class="redux-slides-header">' . esc_html( sprintf( __( 'New %s', 'redux-framework' ), esc_attr( $this->field['content_title'] ) ) ) . '</span>';
echo '</h3>';
echo '<div>';
$hide = ' hide';
echo '<div class="screenshot' . esc_attr( $hide ) . '">';
echo '<a class="of-uploaded-image" href="">';
echo '<img class="redux-slides-image" id="image_image_id_' . esc_attr( $x ) . '" src="" alt="placeholder" target="_blank" rel="external" />';
echo '</a>';
echo '</div>';
// Upload controls DIV.
echo '<div class="upload_button_div">';
// If the user has WP3.5+ show upload/remove button.
echo '<span class="button media_upload_button" id="add_' . esc_attr( $x ) . '">' . esc_html__( 'Upload', 'redux-framework' ) . '</span>';
echo '<span class="button remove-image' . esc_attr( $hide ) . '" id="reset_' . esc_attr( $x ) . '" rel="' . esc_attr( $this->parent->args['opt_name'] . '[' . $this->field['id'] ) . '][attachment_id]">' . esc_html__( 'Remove', 'redux-framework' ) . '</span>';
echo '</div>' . "\n";
echo '<ul id="' . esc_attr( $this->field['id'] ) . '-ul" class="redux-slides-list">';
if ( $this->field['show']['title'] ) {
$title_type = 'text';
} else {
$title_type = 'hidden';
}
$placeholder = ( isset( $this->field['placeholder']['title'] ) ) ? esc_attr( $this->field['placeholder']['title'] ) : __( 'Title', 'redux-framework' );
echo '<li>';
echo '<input
type="' . esc_attr( $title_type ) . '"
id="' . esc_attr( $this->field['id'] . '-title_' . $x ) . '"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][title]' . $this->field['name_suffix'] ) . '"
value=""
placeholder="' . esc_attr( $placeholder ) . '"
class="full-text slide-title" />';
echo '</li>';
if ( $this->field['show']['description'] ) {
$placeholder = ( isset( $this->field['placeholder']['description'] ) ) ? esc_attr( $this->field['placeholder']['description'] ) : __( 'Description', 'redux-framework' );
echo '<li>';
echo '<textarea
name="' . esc_attr( $this->field['name'] . '[' . $x . '][description]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-description_' . $x ) . '"
placeholder="' . esc_attr( $placeholder ) . '"
class="large-text"
rows="6"></textarea>';
echo '</li>';
}
$placeholder = ( isset( $this->field['placeholder']['url'] ) ) ? esc_attr( $this->field['placeholder']['url'] ) : __( 'URL', 'redux-framework' );
if ( $this->field['show']['url'] ) {
$url_type = 'text';
} else {
$url_type = 'hidden';
}
echo '<li>';
echo '<input
type="' . esc_attr( $url_type ) . '"
id="' . esc_attr( $this->field['id'] . '-url_' . $x ) . '"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][url]' . $this->field['name_suffix'] ) . '"
value="" class="full-text" placeholder="' . esc_attr( $placeholder ) . '" />';
echo '</li>';
echo '<li>';
echo '<input
type="hidden"
class="slide-sort"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][sort]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-sort_' . $x ) . '"
value="' . esc_attr( $x ) . '" />';
echo '<li>';
echo '<input
type="hidden"
class="upload-id"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][attachment_id]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-image_id_' . $x ) . '"
value="" />';
echo '<input
type="hidden"
class="upload"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][image]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-image_url_' . $x ) . '"
value="" readonly="readonly" />';
echo '<input
type="hidden"
class="upload-height"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][height]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-image_height_' . $x ) . '"
value="" />';
echo '<input
type="hidden"
class="upload-width"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][width]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-image_width_' . $x ) . '"
value="" />';
echo '</li>';
echo '<input
type="hidden"
class="upload-thumbnail"
name="' . esc_attr( $this->field['name'] . '[' . $x . '][thumb]' . $this->field['name_suffix'] ) . '"
id="' . esc_attr( $this->field['id'] . '-thumb_url_' . $x ) . '"
value="" />';
echo '</li>';
echo '<li>';
echo '<a href="javascript:void(0);" class="button deletion redux-slides-remove">' . esc_html__( 'Delete', 'redux-framework' ) . '</a>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</fieldset>';
echo '</div>';
}
echo '</div>';
// translators: Content title for accordion.
echo '<a href="javascript:void(0);" class="button redux-slides-add button-primary" rel-id="' . esc_attr( $this->field['id'] ) . '-ul" rel-name="' . esc_attr( $this->field['name'] . '[title][]' . $this->field['name_suffix'] ) . '">' . esc_html( sprintf( __( 'Add %s', 'redux-framework' ), esc_html( $this->field['content_title'] ) ) ) . '</a>';
echo '<br/>';
}
/**
* Enqueue Function.
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
*
* @since 1.0.0
* @access public
* @return void
*/
public function enqueue() {
if ( function_exists( 'wp_enqueue_media' ) ) {
wp_enqueue_media();
} else {
wp_enqueue_script( 'media-upload' );
}
if ( $this->parent->args['dev_mode'] ) {
wp_enqueue_style( 'redux-field-media' );
wp_enqueue_style(
'redux-field-slides',
Redux_Core::$url . 'inc/fields/slides/redux-slides.css',
array(),
$this->timestamp
);
}
wp_enqueue_script(
'redux-field-media',
Redux_Core::$url . 'assets/js/media/media' . Redux_Functions::is_min() . '.js',
array( 'jquery', 'redux-js' ),
$this->timestamp,
true
);
wp_enqueue_script(
'redux-field-slides',
Redux_Core::$url . 'inc/fields/slides/redux-slides' . Redux_Functions::is_min() . '.js',
array( 'jquery', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-sortable', 'redux-field-media' ),
$this->timestamp,
true
);
}
}
}
class_alias( 'Redux_Slides', 'ReduxFramework_Slides' );

View File

@@ -0,0 +1,8 @@
<?php
/**
* Silence is golden.
*
* @package Redux Framework
*/
_deprecated_file( 'field_slides.php', '4.3', 'class-redux-slides.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,27 @@
.redux-container-slides .redux-slides-list .select2-container { margin-bottom: 10px; width: 100%; }
.redux-container-slides .ui-accordion-header { margin-bottom: 0; }
.redux-container-slides .full-text, .redux-container-slides .large-text { width: 100%; }
.redux-container-slides .redux-slides-accordion-group { border: 1px solid #dfdfdf !important; border-radius: 3px !important; margin-top: 0 !important; margin-bottom: 10px; background: #f9f9f9; padding: 5px; }
.redux-container-slides .redux-slides-accordion-group h3 { border: 1px solid #dfdfdf; cursor: move !important; font-weight: bold; padding: 0 10px !important; height: 40px; line-height: 40px !important; background-color: #f1f1f1; background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#ececec)); background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec); background-image: linear-gradient(to bottom, #f9f9f9, #ececec); overflow: hidden; border-radius: 3px; -webkit-box-shadow: inset 0 1px 0 #fff; box-shadow: inset 0 1px 0 #fff; text-align: center; }
.redux-container-slides #redux-slides-accordion .redux-slides-image { height: 250px; padding: 5px; margin-top: 10px; margin-bottom: 10px; border: 1px solid #e3e3e3; background: #f7f7f7; border-radius: 3px; }
.redux-container-slides .redux-slides-add { float: right; margin-right: 10%; display: block; margin-bottom: 10px; }
.redux-container-slides .redux-slides-remove { color: #ef521d !important; float: right; margin-top: 5px; }
.redux-container-slides .redux-slides-header { font-weight: bold; }
.redux-container-slides .redux_slides_add_remove { margin-bottom: 10px; }
.redux-container-slides input { width: 100% !important; }
.wp-customizer .redux-container-slides .ui-accordion .ui-accordion-content { padding: 10px; }
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtc2xpZGVzLmNzcyIsInNvdXJjZXMiOlsicmVkdXgtc2xpZGVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFDSSx1QkFEb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UFnRkksdUJBaEZtQixDQWdGbkIsS0FBSyxDQUFDLEVBQ0YsS0FBSyxFQUFFLGVBQWUsR0FDekI7O0FBSUwsQUFDSSxjQURVLENBQ1YsdUJBQXVCLENBQUMsYUFBYSxDQUFDLHFCQUFxQixDQUFDLEVBQ3hELE9BQU8sRUFBRSxJQUFJLEdBQ2hCIn0= */
/*# sourceMappingURL=redux-slides.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,150 @@
/*global redux_change, redux, jQuery */
(function( $ ) {
'use strict';
redux.field_objects = redux.field_objects || {};
redux.field_objects.slides = redux.field_objects.slides || {};
redux.field_objects.slides.init = function( selector ) {
selector = $.redux.getSelector( selector, 'slides' );
$( selector ).each(
function() {
var el = $( this );
var parent = el;
redux.field_objects.media.init( el );
if ( ! el.hasClass( 'redux-field-container' ) ) {
parent = el.parents( '.redux-field-container:first' );
}
if ( parent.is( ':hidden' ) ) {
return;
}
if ( parent.hasClass( 'redux-container-slides' ) ) {
parent.addClass( 'redux-field-init' );
}
if ( parent.hasClass( 'redux-field-init' ) ) {
parent.removeClass( 'redux-field-init' );
} else {
return;
}
el.find( '.redux-slides-remove' ).on(
'click',
function() {
var slideCount;
var contentNewTitle;
redux_change( $( this ) );
$( this ).parent().siblings().find( 'input[type="text"]' ).val( '' );
$( this ).parent().siblings().find( 'textarea' ).val( '' );
$( this ).parent().siblings().find( 'input[type="hidden"]' ).val( '' );
slideCount = $( this ).parents( '.redux-container-slides:first' ).find( '.redux-slides-accordion-group' ).length;
if ( slideCount > 1 ) {
$( this ).parents( '.redux-slides-accordion-group:first' ).slideUp(
'medium',
function() {
$( this ).remove();
}
);
} else {
contentNewTitle = $( this ).parent( '.redux-slides-accordion' ).data( 'new-content-title' );
$( this ).parents( '.redux-slides-accordion-group:first' ).find( '.remove-image' ).trigger( 'click' );
$( this ).parents( '.redux-container-slides:first' ).find( '.redux-slides-accordion-group:last' ).find( '.redux-slides-header' ).text( contentNewTitle );
}
}
);
el.find( '.redux-slides-add' ).off( 'click' ).on(
'click',
function() {
var contentNewTitle;
var newSlide = $( this ).prev().find( '.redux-slides-accordion-group:last' ).clone( true );
var slideCount = $( newSlide ).find( '.slide-title' ).attr( 'name' ).match( /[0-9]+(?!.*[0-9])/ );
var slideCount1 = slideCount * 1 + 1;
$( newSlide ).find( 'input[type="text"], input[type="hidden"], textarea' ).each(
function() {
$( this ).attr( 'name', $( this ).attr( 'name' ).replace( /[0-9]+(?!.*[0-9])/, slideCount1 ) ).attr( 'id', $( this ).attr( 'id' ).replace( /[0-9]+(?!.*[0-9])/, slideCount1 ) );
$( this ).val( '' );
if ( $( this ).hasClass( 'slide-sort' ) ) {
$( this ).val( slideCount1 );
}
}
);
contentNewTitle = $( this ).prev().data( 'new-content-title' );
$( newSlide ).find( '.screenshot' ).removeAttr( 'style' );
$( newSlide ).find( '.screenshot' ).addClass( 'hide' );
$( newSlide ).find( '.screenshot a' ).attr( 'href', '' );
$( newSlide ).find( '.remove-image' ).addClass( 'hide' );
$( newSlide ).find( '.redux-slides-image' ).attr( 'src', '' ).removeAttr( 'id' );
$( newSlide ).find( 'h3' ).text( '' ).append( '<span class="redux-slides-header">' + contentNewTitle + '</span><span class="ui-accordion-header-icon ui-icon ui-icon-plus"></span>' );
$( this ).prev().append( newSlide );
}
);
el.find( '.slide-title' ).on(
'keyup',
function( event ) {
var newTitle = event.target.value;
$( this ).parents().eq( 3 ).find( '.redux-slides-header' ).text( newTitle );
}
);
el.find( '.redux-slides-accordion' ).accordion(
{
header: '> div > fieldset > h3',
collapsible: true,
active: false,
heightStyle: 'content',
icons: {
'header': 'ui-icon-plus',
'activeHeader': 'ui-icon-minus'
}
}
).sortable(
{
axis: 'y',
handle: 'h3',
connectWith: '.redux-slides-accordion',
start: function( e, ui ) {
e = null;
ui.placeholder.height( ui.item.height() );
ui.placeholder.width( ui.item.width() );
},
placeholder: 'ui-state-highlight',
stop: function( event, ui ) {
var inputs;
event = null;
// IE doesn't register the blur when sorting
// so trigger focusout handlers to remove .ui-state-focus.
ui.item.children( 'h3' ).triggerHandler( 'focusout' );
inputs = $( 'input.slide-sort' );
inputs.each(
function( idx ) {
$( this ).val( idx );
}
);
}
}
);
}
);
};
})( jQuery );

View File

@@ -0,0 +1 @@
!function(s){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.slides=redux.field_objects.slides||{},redux.field_objects.slides.init=function(e){e=s.redux.getSelector(e,"slides"),s(e).each(function(){var e=s(this),i=e;redux.field_objects.media.init(e),(i=e.hasClass("redux-field-container")?i:e.parents(".redux-field-container:first")).is(":hidden")||(i.hasClass("redux-container-slides")&&i.addClass("redux-field-init"),i.hasClass("redux-field-init")&&(i.removeClass("redux-field-init"),e.find(".redux-slides-remove").on("click",function(){var e;redux_change(s(this)),s(this).parent().siblings().find('input[type="text"]').val(""),s(this).parent().siblings().find("textarea").val(""),s(this).parent().siblings().find('input[type="hidden"]').val(""),1<s(this).parents(".redux-container-slides:first").find(".redux-slides-accordion-group").length?s(this).parents(".redux-slides-accordion-group:first").slideUp("medium",function(){s(this).remove()}):(e=s(this).parent(".redux-slides-accordion").data("new-content-title"),s(this).parents(".redux-slides-accordion-group:first").find(".remove-image").trigger("click"),s(this).parents(".redux-container-slides:first").find(".redux-slides-accordion-group:last").find(".redux-slides-header").text(e))}),e.find(".redux-slides-add").off("click").on("click",function(){var e,i=s(this).prev().find(".redux-slides-accordion-group:last").clone(!0),t=+s(i).find(".slide-title").attr("name").match(/[0-9]+(?!.*[0-9])/)+1;s(i).find('input[type="text"], input[type="hidden"], textarea').each(function(){s(this).attr("name",s(this).attr("name").replace(/[0-9]+(?!.*[0-9])/,t)).attr("id",s(this).attr("id").replace(/[0-9]+(?!.*[0-9])/,t)),s(this).val(""),s(this).hasClass("slide-sort")&&s(this).val(t)}),e=s(this).prev().data("new-content-title"),s(i).find(".screenshot").removeAttr("style"),s(i).find(".screenshot").addClass("hide"),s(i).find(".screenshot a").attr("href",""),s(i).find(".remove-image").addClass("hide"),s(i).find(".redux-slides-image").attr("src","").removeAttr("id"),s(i).find("h3").text("").append('<span class="redux-slides-header">'+e+'</span><span class="ui-accordion-header-icon ui-icon ui-icon-plus"></span>'),s(this).prev().append(i)}),e.find(".slide-title").on("keyup",function(e){e=e.target.value;s(this).parents().eq(3).find(".redux-slides-header").text(e)}),e.find(".redux-slides-accordion").accordion({header:"> div > fieldset > h3",collapsible:!0,active:!1,heightStyle:"content",icons:{header:"ui-icon-plus",activeHeader:"ui-icon-minus"}}).sortable({axis:"y",handle:"h3",connectWith:".redux-slides-accordion",start:function(e,i){i.placeholder.height(i.item.height()),i.placeholder.width(i.item.width())},placeholder:"ui-state-highlight",stop:function(e,i){i.item.children("h3").triggerHandler("focusout"),s("input.slide-sort").each(function(e){s(this).val(e)})}})))})}}(jQuery);

View File

@@ -0,0 +1,91 @@
.redux-container-slides {
.redux-slides-list .select2-container {
margin-bottom: 10px;
width: 100%;
}
.ui-accordion-header {
margin-bottom: 0;
}
.full-text,
.large-text {
width: 100%;
}
.redux-slides-accordion-group {
border: 1px solid #dfdfdf !important;
border-radius: 3px !important;
margin-top: 0 !important;
margin-bottom: 10px;
background: #f9f9f9;
padding: 5px;
h3 {
border: 1px solid #dfdfdf;
cursor: move !important;
font-weight: bold;
padding: 0 10px !important;
height: 40px;
line-height: 40px !important;
background-color: #f1f1f1;
background-image: -ms-linear-gradient(top, #f9f9f9, #ececec);
background-image: -moz-linear-gradient(top, #f9f9f9, #ececec);
background-image: -o-linear-gradient(top, #f9f9f9, #ececec);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#ececec));
background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
background-image: linear-gradient(to bottom, #f9f9f9, #ececec);
overflow: hidden;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: inset 0 1px 0 #fff;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
text-align: center;
}
}
#redux-slides-accordion .redux-slides-image {
height: 250px;
padding: 5px;
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #e3e3e3;
background: #f7f7f7;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.redux-slides-add {
float: right;
margin-right: 10%;
display: block;
margin-bottom: 10px;
}
.redux-slides-remove {
color: #ef521d !important;
float: right;
margin-top: 5px;
}
.redux-slides-header {
font-weight: bold;
}
.redux_slides_add_remove {
margin-bottom: 10px;
}
input {
width: 100% !important;
}
}
.wp-customizer {
.redux-container-slides .ui-accordion .ui-accordion-content {
padding: 10px;
}
}