Plugin Directory

Changeset 2263082


Ignore:
Timestamp:
03/18/2020 10:51:37 AM (6 years ago)
Author:
feryaz
Message:

Update to 6.0-alpha.8

Location:
easyreservations/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • easyreservations/trunk/assets/js/admin/meta-boxes-resource.js

    r2262833 r2263082  
    22
    33jQuery( function( $ ) {
    4 
    54    // Catalog Visibility.
    65    $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).click( function() {
     
    1312        $( '#catalog-visibility-select' ).slideUp( 'fast' );
    1413
    15         var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
     14        let label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
    1615
    1716        if ( $( 'input[name=_featured]' ).is( ':checked' ) ) {
     
    3130        $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show();
    3231
    33         var current_visibility = $( '#current_visibility' ).val();
    34         var current_featured = $( '#current_featured' ).val();
     32        $( 'input[name=_visibility]' ).removeAttr( 'checked' );
     33        $( 'input[name=_visibility][value=' + $( '#current_visibility' ).val() + ']' ).attr( 'checked', 'checked' );
    3534
    36         $( 'input[name=_visibility]' ).removeAttr( 'checked' );
    37         $( 'input[name=_visibility][value=' + current_visibility + ']' ).attr( 'checked', 'checked' );
     35        let label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
    3836
    39         var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );
    40 
    41         if ( 'yes' === current_featured ) {
     37        if ( 'yes' === $( '#current_featured' ).val() ) {
    4238            //label = label + ', ' + woocommerce_admin_meta_boxes.featured_label;
    4339            $( 'input[name=_featured]' ).attr( 'checked', 'checked' );
     
    5147
    5248    // resource gallery file uploads.
    53     var resource_gallery_frame;
    54     var $image_gallery_ids = $( '#resource_image_gallery' );
    55     var $resource_images = $( '#resource_images_container' ).find( 'ul.resource_images' );
     49    let resourceGalleryFrame;
     50    const imageGalleryIds = $( '#resource_image_gallery' );
     51    const resourceImages = $( '#resource_images_container' ).find( 'ul.resource_images' );
    5652
    5753    $( '.add_resource_images' ).on( 'click', 'a', function( event ) {
    58         var $el = $( this );
    59 
    6054        event.preventDefault();
    6155
    6256        // If the media frame already exists, reopen it.
    63         if ( resource_gallery_frame ) {
    64             resource_gallery_frame.open();
     57        if ( resourceGalleryFrame ) {
     58            resourceGalleryFrame.open();
    6559            return;
    6660        }
    6761
     62        const $el = $( this );
     63
    6864        // Create the media frame.
    69         resource_gallery_frame = wp.media.frames.resource_gallery = wp.media( {
     65        resourceGalleryFrame = wp.media.frames.resource_gallery = wp.media( {
    7066            // Set the title of the modal.
    7167            title: $el.data( 'choose' ),
    7268            button: {
    73                 text: $el.data( 'update' )
     69                text: $el.data( 'update' ),
    7470            },
    7571            states: [
     
    7773                    title: $el.data( 'choose' ),
    7874                    filterable: 'all',
    79                     multiple: true
    80                 } )
    81             ]
     75                    multiple: true,
     76                } ),
     77            ],
    8278        } );
    8379
    8480        // When an image is selected, run a callback.
    85         resource_gallery_frame.on( 'select', function() {
    86             var selection = resource_gallery_frame.state().get( 'selection' );
    87             var attachment_ids = $image_gallery_ids.val();
     81        resourceGalleryFrame.on( 'select', function() {
     82            const selection = resourceGalleryFrame.state().get( 'selection' );
     83            let attachmentIds = imageGalleryIds.val();
    8884
    8985            selection.map( function( attachment ) {
     
    9187
    9288                if ( attachment.id ) {
    93                     attachment_ids = attachment_ids ? attachment_ids + ',' + attachment.id : attachment.id;
    94                     var attachment_image = attachment.sizes && attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;
     89                    attachmentIds = attachmentIds ? attachmentIds + ',' + attachment.id : attachment.id;
    9590
    96                     $resource_images.append(
    97                         '<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment_image +
     91                    resourceImages.append(
     92                        '<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + ( attachment.sizes && attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url ) +
    9893                        '" /><ul class="actions"><li><a href="#" class="delete" title="' + $el.data( 'delete' ) + '">' +
    9994                        $el.data( 'text' ) + '</a></li></ul></li>'
    10095                    );
    10196                }
     97
     98                return true;
    10299            } );
    103100
    104             $image_gallery_ids.val( attachment_ids );
     101            imageGalleryIds.val( attachmentIds );
    105102        } );
    106103
    107104        // Finally, open the modal.
    108         resource_gallery_frame.open();
     105        resourceGalleryFrame.open();
    109106    } );
    110107
    111108    // Image ordering.
    112     $resource_images.sortable( {
     109    resourceImages.sortable( {
    113110        items: 'li.image',
    114111        cursor: 'move',
     
    126123        },
    127124        update: function() {
    128             var attachment_ids = '';
     125            let attachmentIds = '';
    129126
    130127            $( '#resource_images_container' ).find( 'ul li.image' ).css( 'cursor', 'default' ).each( function() {
    131                 var attachment_id = $( this ).attr( 'data-attachment_id' );
    132                 attachment_ids = attachment_ids + attachment_id + ',';
     128                attachmentIds = attachmentIds + $( this ).attr( 'data-attachment_id' ) + ',';
    133129            } );
    134130
    135             $image_gallery_ids.val( attachment_ids );
    136         }
     131            imageGalleryIds.val( attachmentIds );
     132        },
    137133    } );
    138134
     
    141137        $( this ).closest( 'li.image' ).remove();
    142138
    143         var attachment_ids = '';
     139        let attachmentIds = '';
    144140
    145141        $( '#resource_images_container' ).find( 'ul li.image' ).css( 'cursor', 'default' ).each( function() {
    146             var attachment_id = $( this ).attr( 'data-attachment_id' );
    147             attachment_ids = attachment_ids + attachment_id + ',';
     142            attachmentIds = attachmentIds + $( this ).attr( 'data-attachment_id' ) + ',';
    148143        } );
    149144
    150         $image_gallery_ids.val( attachment_ids );
     145        imageGalleryIds.val( attachmentIds );
    151146
    152147        // Remove any lingering tooltips.
     
    158153
    159154    $( document ).ready( function() {
    160         let blockLoaded = false;
    161         let blockLoadedInterval = setInterval( function() {
     155        const blockLoadedInterval = setInterval( function() {
    162156            if ( $( '.edit-post-post-visibility' ).length > 0 ) {
    163157                //Actual functions goes here
    164158                $( '#catalog-visibility' ).children().insertAfter( $( '.edit-post-post-visibility' ) );
    165                 blockLoaded = true;
    166             }
    167             if ( blockLoaded ) {
    168159                clearInterval( blockLoadedInterval );
    169160            }
    170161        }, 500 );
    171 
    172162    } );
    173163
  • easyreservations/trunk/assets/js/admin/settings-views-html-availability.js

    r2262833 r2263082  
    1 /* global htmlSettingsTaxLocalizeScript */
     1/* global display_availability_filter, er_admin_availability_params */
    22
    33/**
     
    1212        display_availability_filter();
    1313    } );
    14 } )( jQuery, er_admin_availability_params );
     14}( jQuery, er_admin_availability_params ) );
  • easyreservations/trunk/assets/js/admin/settings-views-html-status.js

    r2262833 r2263082  
    1 /* global jQuery, easyreservations_admin_system_status, erSetClipboard, erClearClipboard */
     1/* global easyreservations_admin_system_status, erSetClipboard, erClearClipboard */
    22jQuery( function( $ ) {
    3 
    43    /**
    54     * Users country and state fields
    65     */
    7     var erSystemStatus = {
     6    const erSystemStatus = {
    87        init: function() {
    98            $( document.body )
     
    1817         * Prevent anchor behavior when click on TipTip.
    1918         *
    20          * @return bool
     19         * @return {boolean} bool
    2120         */
    2221        preventTipTipClick: function() {
     
    2726         * Generate system status report.
    2827         *
    29          * @return {Bool}
     28         * @return {boolean} bool
    3029         */
    3130        generateReport: function() {
    32             var report = '';
     31            let report = '';
    3332
    3433            $( '.er_status_table thead, .er_status_table tbody' ).each( function() {
    3534                if ( $( this ).is( 'thead' ) ) {
    36                     var label = $( this ).find( 'th:eq(0)' ).data( 'export-label' ) || $( this ).text();
     35                    const label = $( this ).find( 'th:eq(0)' ).data( 'export-label' ) || $( this ).text();
    3736                    report = report + '\n### ' + $.trim( label ) + ' ###\n\n';
    3837                } else {
    3938                    $( 'tr', $( this ) ).each( function() {
    40                         var label = $( this ).find( 'td:eq(0)' ).data( 'export-label' ) || $( this ).find( 'td:eq(0)' ).text();
    41                         var the_name = $.trim( label ).replace( /(<([^>]+)>)/ig, '' ); // Remove HTML.
     39                        const label = $( this ).find( 'td:eq(0)' ).data( 'export-label' ) || $( this ).find( 'td:eq(0)' ).text();
     40                        const theName = $.trim( label ).replace( /(<([^>]+)>)/ig, '' ); // Remove HTML.
    4241
    4342                        // Find value
    44                         var $value_html = $( this ).find( 'td:eq(2)' ).clone();
    45                         $value_html.find( '.private' ).remove();
    46                         $value_html.find( '.dashicons-yes' ).replaceWith( '&#10004;' );
    47                         $value_html.find( '.dashicons-no-alt, .dashicons-warning' ).replaceWith( '&#10060;' );
     43                        const valueHTML = $( this ).find( 'td:eq(2)' ).clone();
     44                        valueHTML.find( '.private' ).remove();
     45                        valueHTML.find( '.dashicons-yes' ).replaceWith( '&#10004;' );
     46                        valueHTML.find( '.dashicons-no-alt, .dashicons-warning' ).replaceWith( '&#10060;' );
    4847
    4948                        // Format value
    50                         var the_value = $.trim( $value_html.text() );
    51                         var value_array = the_value.split( ', ' );
     49                        let theValue = $.trim( valueHTML.text() );
     50                        const valueArray = theValue.split( ', ' );
    5251
    53                         if ( value_array.length > 1 ) {
     52                        if ( valueArray.length > 1 ) {
    5453                            // If value have a list of plugins ','.
    5554                            // Split to add new line.
    56                             var temp_line = '';
    57                             $.each( value_array, function( key, line ) {
    58                                 temp_line = temp_line + line + '\n';
     55                            let tempLine = '';
     56                            $.each( valueArray, function( key, line ) {
     57                                tempLine = tempLine + line + '\n';
    5958                            } );
    6059
    61                             the_value = temp_line;
     60                            theValue = tempLine;
    6261                        }
    6362
    64                         report = report + '' + the_name + ': ' + the_value + '\n';
     63                        report = report + '' + theName + ': ' + theValue + '\n';
    6564                    } );
    6665                }
     
    10099                'fadeIn': 50,
    101100                'fadeOut': 50,
    102                 'delay': 0
     101                'delay': 0,
    103102            } ).focus();
    104103        },
     
    110109            $( '.copy-error' ).removeClass( 'hidden' );
    111110            $( '#debug-report' ).find( 'textarea' ).focus().select();
    112         }
     111        },
    113112    };
    114113
  • easyreservations/trunk/assets/js/admin/settings-views-html-tax.js

    r2262833 r2263082  
    1 /* global htmlSettingsTaxLocalizeScript */
     1/* global Backbone, htmlSettingsTaxLocalizeScript */
    22
    33/**
     
    66( function( $, data, wp ) {
    77    $( function() {
    8 
    98        if ( ! String.prototype.trim ) {
    109            String.prototype.trim = function() {
     
    1312        }
    1413
    15         var rowTemplate = wp.template( 'er-tax-table-row' ),
     14        const rowTemplate = wp.template( 'er-tax-table-row' ),
    1615            rowTemplateEmpty = wp.template( 'er-tax-table-row-empty' ),
    1716            paginationTemplate = wp.template( 'er-tax-table-pagination' ),
     
    1918            $tbody = $( '#rates' ),
    2019            $pagination = $( '#rates-pagination' ),
    21             $search_field = $( '#rates-search .er-tax-rates-search-field' ),
    22             $submit = $( '.button-primary[name=save]' );
    23 
    24         ERTaxTableModelConstructor = Backbone.Model.extend( {
    25             changes: {},
    26             setRateAttribute: function( rateID, attribute, value ) {
    27                 var rates = _.indexBy( this.get( 'rates' ), 'id' ),
    28                     changes = {};
    29 
    30                 if ( rates[ rateID ][ attribute ] !== value ) {
    31                     changes[ rateID ] = {};
    32                     changes[ rateID ][ attribute ] = value;
    33                     rates[ rateID ][ attribute ] = value;
    34                 }
    35 
    36                 this.logChanges( changes );
    37             },
    38             logChanges: function( changedRows ) {
    39                 var changes = this.changes || {};
    40 
    41                 _.each( changedRows, function( row, id ) {
    42                     changes[ id ] = _.extend( changes[ id ] || {
    43                         id: id
    44                     }, row );
    45                 } );
    46 
    47                 this.changes = changes;
    48                 this.trigger( 'change:rates' );
    49             },
    50             getFilteredRates: function() {
    51                 var rates = this.get( 'rates' ),
    52                     search = $search_field.val().toLowerCase();
    53 
    54                 if ( search.length ) {
    55                     rates = _.filter( rates, function( rate ) {
    56                         var search_text = _.toArray( rate ).join( ' ' ).toLowerCase();
    57                         return ( -1 !== search_text.indexOf( search ) );
     20            $searchField = $( '#rates-search .er-tax-rates-search-field' ),
     21            $submit = $( '.button-primary[name=save]' ),
     22            ERTaxTableModelConstructor = Backbone.Model.extend( {
     23                changes: {},
     24                setRateAttribute: function( rateID, attribute, value ) {
     25                    const rates = _.indexBy( this.get( 'rates' ), 'id' ),
     26                        changes = {};
     27
     28                    if ( rates[ rateID ][ attribute ] !== value ) {
     29                        changes[ rateID ] = {};
     30                        changes[ rateID ][ attribute ] = value;
     31                        rates[ rateID ][ attribute ] = value;
     32                    }
     33
     34                    this.logChanges( changes );
     35                },
     36                logChanges: function( changedRows ) {
     37                    const changes = this.changes || {};
     38
     39                    _.each( changedRows, function( row, id ) {
     40                        changes[ id ] = _.extend( changes[ id ] || {
     41                            id: id,
     42                        }, row );
    5843                    } );
    59                 }
    60 
    61                 rates = _.sortBy( rates, function( rate ) {
    62                     return parseInt( rate.order, 10 );
    63                 } );
    64 
    65                 return rates;
    66             },
    67             block: function() {
    68                 $table.block( {
    69                     message: null,
    70                     overlayCSS: {
    71                         background: '#fff',
    72                         opacity: 0.6
    73                     }
    74                 } );
    75             },
    76             unblock: function() {
    77                 $table.unblock();
    78             },
    79             save: function() {
    80             }
    81         } ),
     44
     45                    this.changes = changes;
     46                    this.trigger( 'change:rates' );
     47                },
     48                getFilteredRates: function() {
     49                    const search = $searchField.val().toLowerCase();
     50                    let rates = this.get( 'rates' );
     51
     52                    if ( search.length ) {
     53                        rates = _.filter( rates, function( rate ) {
     54                            const searchText = _.toArray( rate ).join( ' ' ).toLowerCase();
     55                            return ( -1 !== searchText.indexOf( search ) );
     56                        } );
     57                    }
     58
     59                    rates = _.sortBy( rates, function( rate ) {
     60                        return parseInt( rate.order, 10 );
     61                    } );
     62
     63                    return rates;
     64                },
     65                block: function() {
     66                    $table.block( {
     67                        message: null,
     68                        overlayCSS: {
     69                            background: '#fff',
     70                            opacity: 0.6,
     71                        },
     72                    } );
     73                },
     74                unblock: function() {
     75                    $table.unblock();
     76                },
     77                save: function() {
     78                },
     79            } ),
    8280            ERTaxTableViewConstructor = Backbone.View.extend( {
    8381                rowTemplate: rowTemplate,
     
    8583                page: data.page,
    8684                initialize: function() {
    87                     var qty_pages = Math.ceil( _.toArray( this.model.get( 'rates' ) ).length / this.per_page );
    88 
    89                     this.qty_pages = 0 === qty_pages ? 1 : qty_pages;
     85                    const qtyPages = Math.ceil( _.toArray( this.model.get( 'rates' ) ).length / this.per_page );
     86
     87                    this.qty_pages = 0 === qtyPages ? 1 : qtyPages;
    9088                    this.page = this.sanitizePage( data.page );
    9189
     
    9391                    this.listenTo( this.model, 'saved:rates', this.clearUnloadConfirmation );
    9492                    $tbody.on( 'change autocompletechange', ':input', { view: this }, this.updateModelOnChange );
    95                     $search_field.on( 'keyup search', { view: this }, this.onSearchField );
     93                    $searchField.on( 'keyup search', { view: this }, this.onSearchField );
    9694                    $pagination.on( 'click', 'a', { view: this }, this.onPageChange );
    9795                    $pagination.on( 'change', 'input', { view: this }, this.onPageChange );
     
    105103                },
    106104                render: function() {
    107                     var rates = this.model.getFilteredRates(),
    108                         qty_rates = _.size( rates ),
    109                         qty_pages = Math.ceil( qty_rates / this.per_page ),
    110                         first_index = 0 === qty_rates ? 0 : this.per_page * ( this.page - 1 ),
    111                         last_index = this.per_page * this.page,
    112                         paged_rates = _.toArray( rates ).slice( first_index, last_index ),
     105                    const rates = this.model.getFilteredRates(),
     106                        qtyRates = _.size( rates ),
     107                        qtyPages = Math.ceil( qtyRates / this.per_page ),
     108                        firstIndex = 0 === qtyRates ? 0 : this.per_page * ( this.page - 1 ),
     109                        lastIndex = this.per_page * this.page,
     110                        pagedRates = _.toArray( rates ).slice( firstIndex, lastIndex ),
    113111                        view = this;
    114112
     
    116114                    this.$el.empty();
    117115
    118                     if ( paged_rates.length ) {
     116                    if ( pagedRates.length ) {
    119117                        // Populate $tbody with the current page of results.
    120                         $.each( paged_rates, function( id, rowData ) {
     118                        $.each( pagedRates, function( id, rowData ) {
    121119                            view.$el.append( view.rowTemplate( rowData ) );
    122120                        } );
     
    125123                    }
    126124
    127                     if ( qty_pages > 1 ) {
     125                    if ( qtyPages > 1 ) {
    128126                        // We've now displayed our initial page, time to render the pagination box.
    129127                        $pagination.html( paginationTemplate( {
    130                             qty_rates: qty_rates,
     128                            qty_rates: qtyRates,
    131129                            current_page: this.page,
    132                             qty_pages: qty_pages
     130                            qty_pages: qtyPages,
    133131                        } ) );
    134132                    } else {
     
    142140                    }
    143141
    144                     var url = data.base_url,
    145                         search = $search_field.val();
     142                    const search = $searchField.val();
     143                    let url = data.base_url;
    146144
    147145                    if ( 1 < this.page ) {
     
    159157                },
    160158                onAddNewRow: function( event ) {
    161                     var view = event.data.view,
     159                    const view = event.data.view,
    162160                        model = view.model,
    163161                        rates = _.indexBy( model.get( 'rates' ), 'id' ),
     
    166164                        newRow = _.extend( {}, data.default_rate, {
    167165                            id: 'new-' + size + '-' + Date.now(),
    168                             newRow: true
     166                            newRow: true,
    169167                        } ),
    170                         $current,
    171                         current_id,
    172                         current_order,
    173                         rates_to_reorder,
    174                         reordered_rates;
    175 
    176                     $current = $tbody.children( '.current' );
     168                        $current = $tbody.children( '.current' );
    177169
    178170                    if ( $current.length ) {
    179                         current_id = $current.last().data( 'id' );
    180                         current_order = parseInt( rates[ current_id ].order, 10 );
    181                         newRow.order = 1 + current_order;
    182 
    183                         rates_to_reorder = _.filter( rates, function( rate ) {
    184                             if ( parseInt( rate.order, 10 ) > current_order ) {
    185                                 return true;
    186                             }
    187                             return false;
    188                         } );
    189 
    190                         reordered_rates = _.map( rates_to_reorder, function( rate ) {
     171                        const currentId = $current.last().data( 'id' );
     172                        const currentOrder = parseInt( rates[ currentId ].order, 10 );
     173                        newRow.order = 1 + currentOrder;
     174
     175                        const ratesToReorder = _.filter( rates, function( rate ) {
     176                            return parseInt( rate.order, 10 ) > currentOrder;
     177                        } );
     178
     179                        _.map( ratesToReorder, function( rate ) {
    191180                            rate.order++;
    192181                            changes[ rate.id ] = _.extend( changes[ rate.id ] || {}, { order: rate.order } );
     
    214203                },
    215204                onDeleteRow: function( event ) {
    216                     var view = event.data.view,
     205                    const view = event.data.view,
    217206                        model = view.model,
    218207                        rates = _.indexBy( model.get( 'rates' ), 'id' ),
    219208                        changes = {},
    220                         $current,
    221                         current_id;
     209                        $current = $tbody.children( '.current' );
    222210
    223211                    event.preventDefault();
    224212
    225                     if ( $current = $tbody.children( '.current' ) ) {
     213                    if ( $current ) {
    226214                        $current.each( function() {
    227                             current_id = $( this ).data( 'id' );
    228 
    229                             delete rates[ current_id ];
    230 
    231                             changes[ current_id ] = _.extend( changes[ current_id ] || {}, { deleted: 'deleted' } );
     215                            let currentId = $( this ).data( 'id' );
     216
     217                            delete rates[ currentId ];
     218
     219                            changes[ currentId ] = _.extend( changes[ currentId ] || {}, { deleted: 'deleted' } );
    232220                        } );
    233221
     
    245233                },
    246234                onPageChange: function( event ) {
    247                     var $target = $( event.currentTarget );
     235                    const $target = $( event.currentTarget );
    248236
    249237                    event.preventDefault();
     
    253241                },
    254242                onExport: function( event ) {
    255                     var csv_data = 'data:application/csv;charset=utf-8,' + data.strings.csv_data_cols.join( ',' ) + '\n';
     243                    let csvData = 'data:application/csv;charset=utf-8,' + data.strings.csv_data_cols.join( ',' ) + '\n';
    256244
    257245                    $.each( event.data.view.model.getFilteredRates(), function( id, rowData ) {
    258                         var row = '';
    259 
    260                         row += rowData.country + ',';
     246                        let row = rowData.country + ',';
    261247                        row += rowData.state + ',';
    262248                        row += ( rowData.postcode ? rowData.postcode.join( '; ' ) : '' ) + ',';
     
    268254                        row += data.current_class;
    269255
    270                         csv_data += row + '\n';
     256                        csvData += row + '\n';
    271257                    } );
    272258
    273                     $( this ).attr( 'href', encodeURI( csv_data ) );
     259                    $( this ).attr( 'href', encodeURI( csvData ) );
    274260
    275261                    return true;
     
    289275                },
    290276                updateModelOnChange: function( event ) {
    291                     var model = event.data.view.model,
     277                    const model = event.data.view.model,
    292278                        $target = $( event.target ),
    293279                        id = $target.closest( 'tr' ).data( 'id' ),
    294                         attribute = $target.data( 'attribute' ),
    295                         val = $target.val();
     280                        attribute = $target.data( 'attribute' );
     281
     282                    let val = $target.val();
    296283
    297284                    if ( 'compound' === attribute || 'flat' === attribute ) {
     
    305292                    model.setRateAttribute( id, attribute, val );
    306293                },
    307                 sanitizePage: function( page_num ) {
    308                     page_num = parseInt( page_num, 10 );
    309                     if ( page_num < 1 ) {
    310                         page_num = 1;
    311                     } else if ( page_num > this.qty_pages ) {
    312                         page_num = this.qty_pages;
    313                     }
    314                     return page_num;
    315                 }
     294                sanitizePage: function( pageNum ) {
     295                    pageNum = parseInt( pageNum, 10 );
     296                    if ( pageNum < 1 ) {
     297                        pageNum = 1;
     298                    } else if ( pageNum > this.qty_pages ) {
     299                        pageNum = this.qty_pages;
     300                    }
     301                    return pageNum;
     302                },
    316303            } ),
    317304            ERTaxTableModelInstance = new ERTaxTableModelConstructor( {
    318                 rates: data.rates
     305                rates: data.rates,
    319306            } ),
    320307            ERTaxTableInstance = new ERTaxTableViewConstructor( {
    321308                model: ERTaxTableModelInstance,
    322                 el: '#rates'
     309                el: '#rates',
    323310            } );
    324311
    325312        ERTaxTableInstance.render();
    326 
    327313    } );
    328 } )( jQuery, htmlSettingsTaxLocalizeScript, wp );
     314}( jQuery, htmlSettingsTaxLocalizeScript, wp ) );
  • easyreservations/trunk/assets/js/admin/settings.js

    r2262833 r2263082  
    1 /* global wp */
     1/* global */
    22( function( $, wp ) {
    3 
    43    // Color picker
    54    $( '.colorpick' )
     
    98            },
    109            hide: true,
    11             border: true
     10            border: true,
    1211        } )
    1312
     
    2120        .on( 'change', function() {
    2221            if ( $( this ).is( '.iris-error' ) ) {
    23                 var original_value = $( this ).data( 'original-value' );
    24 
    25                 if ( original_value.match( /^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ ) ) {
     22                if ( $( this ).data( 'original-value' ).match( /^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ ) ) {
    2623                    $( this ).val( $( this ).data( 'original-value' ) ).change();
    2724                } else {
     
    5552            ui.item.removeAttr( 'style' );
    5653            ui.item.trigger( 'updateMoveButtons' );
    57         }
     54        },
    5855    } );
    5956
    6057    $( 'code[data-tag]' ).on( 'click', function() {
    61         var $txt = $( '#' + $( this ).data( 'target' ) );
    62         var caretPos = $txt[ 0 ].selectionStart;
    63         var textAreaTxt = $txt.val();
    64         var txtToAdd = '[' + $( this ).data( 'tag' ) + ']';
     58        const $txt = $( '#' + $( this ).data( 'target' ) );
     59        const caretPos = $txt[ 0 ].selectionStart;
     60        const textAreaTxt = $txt.val();
     61        const txtToAdd = '[' + $( this ).data( 'tag' ) + ']';
    6562        $txt.val( textAreaTxt.substring( 0, caretPos ) + txtToAdd + textAreaTxt.substring( caretPos ) );
    66     } )
    67 
    68 } )( jQuery, wp );
     63    } );
     64}( jQuery, wp ) );
  • easyreservations/trunk/assets/js/er-datepicker.js

    r2262833 r2263082  
    1919                    showAnim: 'slideDown',
    2020                    beforeShow: function( _, inst ) {
    21                         console.log( 13 );
    22 
    2321                        inst.dpDiv.removeClass( 'ui-datepicker' ).addClass( 'easy-datepicker' ).addClass( 'easy-ui' );
    2422                    },
  • easyreservations/trunk/assets/js/er-datepicker.min.js

    r2262833 r2263082  
    1 jQuery(function(b){if(typeof er_date_picker_params==="undefined"){return false}var a=er_datepicker_get_args();function c(){b(".er-datepicker").each(function(){b(this).attr("autocomplete","off");var e=b(this).attr("data-target"),d=b(this).attr("data-format"),f=b.extend({changeMonth:true,changeYear:true,showAnim:"slideDown",beforeShow:function(g,h){console.log(13);h.dpDiv.removeClass("ui-datepicker").addClass("easy-datepicker").addClass("easy-ui")}},a);if(b(this).is("div")){b(this).removeClass("ui-datepicker").addClass("easy-datepicker").addClass("easy-ui")}if(d&&typeof d!=="undefined"){f.dateFormat=d}if(e&&typeof e!=="undefined"){f.onSelect=function(i){var g=b(this).data("datepicker");var h=b.datepicker.parseDate(g.settings.dateFormat||b.datepicker._defaults.dateFormat,i,g.settings);b("#"+e).datepicker("option","minDate",h)}}b(this).datepicker(f)})}c();b(document).on("er-init-datepicker",function(){c()})});function er_datepicker_get_args(){var f=er_date_picker_params.date_format;switch(f){case"Y/m/d":f="yy/mm/dd";break;case"m/d/Y":f="mm/dd/yy";break;case"d-m-Y":f="dd-mm-yy";break;case"Y-m-d":f="yy-mm-dd";break;default:f="dd.mm.yy";break}var d=er_date_picker_params.day_names.slice();d.unshift(d[6]);d.length=7;var b=er_date_picker_params.day_names_short.slice();b.unshift(b[6]);b.length=7;var a=er_date_picker_params.day_names_min.slice();a.unshift(a[6]);a.length=7;var c={dateFormat:f,dayNames:d,dayNamesShort:b,dayNamesMin:a,monthNames:er_date_picker_params.month_names,monthNamesShort:er_date_picker_params.month_names_short,prevText:"",nextText:""};if(er_date_picker_params.is_frontend_request==="yes"){var e=parseInt(er_date_picker_params.earliest_possible,10)/86400;if(e>=1){c.minDate=e}}c.firstDay=parseInt(er_date_picker_params.start_of_week,10);return c};
     1jQuery(function(b){if(typeof er_date_picker_params==="undefined"){return false}var a=er_datepicker_get_args();function c(){b(".er-datepicker").each(function(){b(this).attr("autocomplete","off");var e=b(this).attr("data-target"),d=b(this).attr("data-format"),f=b.extend({changeMonth:true,changeYear:true,showAnim:"slideDown",beforeShow:function(g,h){h.dpDiv.removeClass("ui-datepicker").addClass("easy-datepicker").addClass("easy-ui")}},a);if(b(this).is("div")){b(this).removeClass("ui-datepicker").addClass("easy-datepicker").addClass("easy-ui")}if(d&&typeof d!=="undefined"){f.dateFormat=d}if(e&&typeof e!=="undefined"){f.onSelect=function(i){var g=b(this).data("datepicker");var h=b.datepicker.parseDate(g.settings.dateFormat||b.datepicker._defaults.dateFormat,i,g.settings);b("#"+e).datepicker("option","minDate",h)}}b(this).datepicker(f)})}c();b(document).on("er-init-datepicker",function(){c()})});function er_datepicker_get_args(){var f=er_date_picker_params.date_format;switch(f){case"Y/m/d":f="yy/mm/dd";break;case"m/d/Y":f="mm/dd/yy";break;case"d-m-Y":f="dd-mm-yy";break;case"Y-m-d":f="yy-mm-dd";break;default:f="dd.mm.yy";break}var d=er_date_picker_params.day_names.slice();d.unshift(d[6]);d.length=7;var b=er_date_picker_params.day_names_short.slice();b.unshift(b[6]);b.length=7;var a=er_date_picker_params.day_names_min.slice();a.unshift(a[6]);a.length=7;var c={dateFormat:f,dayNames:d,dayNamesShort:b,dayNamesMin:a,monthNames:er_date_picker_params.month_names,monthNamesShort:er_date_picker_params.month_names_short,prevText:"",nextText:""};if(er_date_picker_params.is_frontend_request==="yes"){var e=parseInt(er_date_picker_params.earliest_possible,10)/86400;if(e>=1){c.minDate=e}}c.firstDay=parseInt(er_date_picker_params.start_of_week,10);return c};
  • easyreservations/trunk/easyReservations.php

    r2262833 r2263082  
    44Plugin URI: http://www.easyreservations.org
    55Description: This powerful property and reservation management plugin allows you to receive, schedule and handle your bookings easily!
    6 Version: 6.0-alpha.7
     6Version: 6.0-alpha.8
    77Author: Feryaz Beer
    88Author URI: http://www.feryaz.de
  • easyreservations/trunk/includes/class-easyreservations.php

    r2262833 r2263082  
    1818     * @var string
    1919     */
    20     public $version = '6.0-alpha.7';
     20    public $version = '6.0-alpha.8';
    2121    /**
    2222     * Session instance.
  • easyreservations/trunk/readme.txt

    r2262833 r2263082  
    5555== Changelog ==
    5656
     57= 6.0-alpha.8 - 2020-03-18 =
     58* Fix - Tax settings js
     59
    5760= 6.0-alpha.7 - 2020-03-18 =
    5861* Feature - Reservation timeline
Note: See TracChangeset for help on using the changeset viewer.