Changeset 2263082
- Timestamp:
- 03/18/2020 10:51:37 AM (6 years ago)
- Location:
- easyreservations/trunk
- Files:
-
- 10 edited
-
assets/js/admin/meta-boxes-resource.js (modified) (9 diffs)
-
assets/js/admin/settings-views-html-availability.js (modified) (2 diffs)
-
assets/js/admin/settings-views-html-status.js (modified) (5 diffs)
-
assets/js/admin/settings-views-html-tax.js (modified) (18 diffs)
-
assets/js/admin/settings.js (modified) (4 diffs)
-
assets/js/er-datepicker.js (modified) (1 diff)
-
assets/js/er-datepicker.min.js (modified) (1 diff)
-
easyReservations.php (modified) (1 diff)
-
includes/class-easyreservations.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easyreservations/trunk/assets/js/admin/meta-boxes-resource.js
r2262833 r2263082 2 2 3 3 jQuery( function( $ ) { 4 5 4 // Catalog Visibility. 6 5 $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).click( function() { … … 13 12 $( '#catalog-visibility-select' ).slideUp( 'fast' ); 14 13 15 varlabel = $( 'input[name=_visibility]:checked' ).attr( 'data-label' );14 let label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' ); 16 15 17 16 if ( $( 'input[name=_featured]' ).is( ':checked' ) ) { … … 31 30 $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show(); 32 31 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' ); 35 34 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' ); 38 36 39 var label = $( 'input[name=_visibility]:checked' ).attr( 'data-label' ); 40 41 if ( 'yes' === current_featured ) { 37 if ( 'yes' === $( '#current_featured' ).val() ) { 42 38 //label = label + ', ' + woocommerce_admin_meta_boxes.featured_label; 43 39 $( 'input[name=_featured]' ).attr( 'checked', 'checked' ); … … 51 47 52 48 // 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' ); 56 52 57 53 $( '.add_resource_images' ).on( 'click', 'a', function( event ) { 58 var $el = $( this );59 60 54 event.preventDefault(); 61 55 62 56 // If the media frame already exists, reopen it. 63 if ( resource _gallery_frame ) {64 resource _gallery_frame.open();57 if ( resourceGalleryFrame ) { 58 resourceGalleryFrame.open(); 65 59 return; 66 60 } 67 61 62 const $el = $( this ); 63 68 64 // Create the media frame. 69 resource _gallery_frame = wp.media.frames.resource_gallery = wp.media( {65 resourceGalleryFrame = wp.media.frames.resource_gallery = wp.media( { 70 66 // Set the title of the modal. 71 67 title: $el.data( 'choose' ), 72 68 button: { 73 text: $el.data( 'update' ) 69 text: $el.data( 'update' ), 74 70 }, 75 71 states: [ … … 77 73 title: $el.data( 'choose' ), 78 74 filterable: 'all', 79 multiple: true 80 } ) 81 ] 75 multiple: true, 76 } ), 77 ], 82 78 } ); 83 79 84 80 // 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(); 88 84 89 85 selection.map( function( attachment ) { … … 91 87 92 88 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; 95 90 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 ) + 98 93 '" /><ul class="actions"><li><a href="#" class="delete" title="' + $el.data( 'delete' ) + '">' + 99 94 $el.data( 'text' ) + '</a></li></ul></li>' 100 95 ); 101 96 } 97 98 return true; 102 99 } ); 103 100 104 $image_gallery_ids.val( attachment_ids );101 imageGalleryIds.val( attachmentIds ); 105 102 } ); 106 103 107 104 // Finally, open the modal. 108 resource _gallery_frame.open();105 resourceGalleryFrame.open(); 109 106 } ); 110 107 111 108 // Image ordering. 112 $resource_images.sortable( {109 resourceImages.sortable( { 113 110 items: 'li.image', 114 111 cursor: 'move', … … 126 123 }, 127 124 update: function() { 128 var attachment_ids = '';125 let attachmentIds = ''; 129 126 130 127 $( '#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' ) + ','; 133 129 } ); 134 130 135 $image_gallery_ids.val( attachment_ids );136 } 131 imageGalleryIds.val( attachmentIds ); 132 }, 137 133 } ); 138 134 … … 141 137 $( this ).closest( 'li.image' ).remove(); 142 138 143 var attachment_ids = '';139 let attachmentIds = ''; 144 140 145 141 $( '#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' ) + ','; 148 143 } ); 149 144 150 $image_gallery_ids.val( attachment_ids );145 imageGalleryIds.val( attachmentIds ); 151 146 152 147 // Remove any lingering tooltips. … … 158 153 159 154 $( document ).ready( function() { 160 let blockLoaded = false; 161 let blockLoadedInterval = setInterval( function() { 155 const blockLoadedInterval = setInterval( function() { 162 156 if ( $( '.edit-post-post-visibility' ).length > 0 ) { 163 157 //Actual functions goes here 164 158 $( '#catalog-visibility' ).children().insertAfter( $( '.edit-post-post-visibility' ) ); 165 blockLoaded = true;166 }167 if ( blockLoaded ) {168 159 clearInterval( blockLoadedInterval ); 169 160 } 170 161 }, 500 ); 171 172 162 } ); 173 163 -
easyreservations/trunk/assets/js/admin/settings-views-html-availability.js
r2262833 r2263082 1 /* global htmlSettingsTaxLocalizeScript*/1 /* global display_availability_filter, er_admin_availability_params */ 2 2 3 3 /** … … 12 12 display_availability_filter(); 13 13 } ); 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 */ 2 2 jQuery( function( $ ) { 3 4 3 /** 5 4 * Users country and state fields 6 5 */ 7 varerSystemStatus = {6 const erSystemStatus = { 8 7 init: function() { 9 8 $( document.body ) … … 18 17 * Prevent anchor behavior when click on TipTip. 19 18 * 20 * @return bool19 * @return {boolean} bool 21 20 */ 22 21 preventTipTipClick: function() { … … 27 26 * Generate system status report. 28 27 * 29 * @return { Bool}28 * @return {boolean} bool 30 29 */ 31 30 generateReport: function() { 32 varreport = '';31 let report = ''; 33 32 34 33 $( '.er_status_table thead, .er_status_table tbody' ).each( function() { 35 34 if ( $( this ).is( 'thead' ) ) { 36 varlabel = $( this ).find( 'th:eq(0)' ).data( 'export-label' ) || $( this ).text();35 const label = $( this ).find( 'th:eq(0)' ).data( 'export-label' ) || $( this ).text(); 37 36 report = report + '\n### ' + $.trim( label ) + ' ###\n\n'; 38 37 } else { 39 38 $( 'tr', $( this ) ).each( function() { 40 varlabel = $( 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. 42 41 43 42 // 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( '✔' );47 $value_html.find( '.dashicons-no-alt, .dashicons-warning' ).replaceWith( '❌' );43 const valueHTML = $( this ).find( 'td:eq(2)' ).clone(); 44 valueHTML.find( '.private' ).remove(); 45 valueHTML.find( '.dashicons-yes' ).replaceWith( '✔' ); 46 valueHTML.find( '.dashicons-no-alt, .dashicons-warning' ).replaceWith( '❌' ); 48 47 49 48 // 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( ', ' ); 52 51 53 if ( value _array.length > 1 ) {52 if ( valueArray.length > 1 ) { 54 53 // If value have a list of plugins ','. 55 54 // 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'; 59 58 } ); 60 59 61 the _value = temp_line;60 theValue = tempLine; 62 61 } 63 62 64 report = report + '' + the _name + ': ' + the_value + '\n';63 report = report + '' + theName + ': ' + theValue + '\n'; 65 64 } ); 66 65 } … … 100 99 'fadeIn': 50, 101 100 'fadeOut': 50, 102 'delay': 0 101 'delay': 0, 103 102 } ).focus(); 104 103 }, … … 110 109 $( '.copy-error' ).removeClass( 'hidden' ); 111 110 $( '#debug-report' ).find( 'textarea' ).focus().select(); 112 } 111 }, 113 112 }; 114 113 -
easyreservations/trunk/assets/js/admin/settings-views-html-tax.js
r2262833 r2263082 1 /* global htmlSettingsTaxLocalizeScript */1 /* global Backbone, htmlSettingsTaxLocalizeScript */ 2 2 3 3 /** … … 6 6 ( function( $, data, wp ) { 7 7 $( function() { 8 9 8 if ( ! String.prototype.trim ) { 10 9 String.prototype.trim = function() { … … 13 12 } 14 13 15 varrowTemplate = wp.template( 'er-tax-table-row' ),14 const rowTemplate = wp.template( 'er-tax-table-row' ), 16 15 rowTemplateEmpty = wp.template( 'er-tax-table-row-empty' ), 17 16 paginationTemplate = wp.template( 'er-tax-table-pagination' ), … … 19 18 $tbody = $( '#rates' ), 20 19 $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 ); 58 43 } ); 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 } ), 82 80 ERTaxTableViewConstructor = Backbone.View.extend( { 83 81 rowTemplate: rowTemplate, … … 85 83 page: data.page, 86 84 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; 90 88 this.page = this.sanitizePage( data.page ); 91 89 … … 93 91 this.listenTo( this.model, 'saved:rates', this.clearUnloadConfirmation ); 94 92 $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 ); 96 94 $pagination.on( 'click', 'a', { view: this }, this.onPageChange ); 97 95 $pagination.on( 'change', 'input', { view: this }, this.onPageChange ); … … 105 103 }, 106 104 render: function() { 107 varrates = 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 ), 113 111 view = this; 114 112 … … 116 114 this.$el.empty(); 117 115 118 if ( paged _rates.length ) {116 if ( pagedRates.length ) { 119 117 // Populate $tbody with the current page of results. 120 $.each( paged _rates, function( id, rowData ) {118 $.each( pagedRates, function( id, rowData ) { 121 119 view.$el.append( view.rowTemplate( rowData ) ); 122 120 } ); … … 125 123 } 126 124 127 if ( qty _pages > 1 ) {125 if ( qtyPages > 1 ) { 128 126 // We've now displayed our initial page, time to render the pagination box. 129 127 $pagination.html( paginationTemplate( { 130 qty_rates: qty _rates,128 qty_rates: qtyRates, 131 129 current_page: this.page, 132 qty_pages: qty _pages130 qty_pages: qtyPages, 133 131 } ) ); 134 132 } else { … … 142 140 } 143 141 144 var url = data.base_url,145 search = $search_field.val();142 const search = $searchField.val(); 143 let url = data.base_url; 146 144 147 145 if ( 1 < this.page ) { … … 159 157 }, 160 158 onAddNewRow: function( event ) { 161 varview = event.data.view,159 const view = event.data.view, 162 160 model = view.model, 163 161 rates = _.indexBy( model.get( 'rates' ), 'id' ), … … 166 164 newRow = _.extend( {}, data.default_rate, { 167 165 id: 'new-' + size + '-' + Date.now(), 168 newRow: true 166 newRow: true, 169 167 } ), 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' ); 177 169 178 170 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 ) { 191 180 rate.order++; 192 181 changes[ rate.id ] = _.extend( changes[ rate.id ] || {}, { order: rate.order } ); … … 214 203 }, 215 204 onDeleteRow: function( event ) { 216 varview = event.data.view,205 const view = event.data.view, 217 206 model = view.model, 218 207 rates = _.indexBy( model.get( 'rates' ), 'id' ), 219 208 changes = {}, 220 $current, 221 current_id; 209 $current = $tbody.children( '.current' ); 222 210 223 211 event.preventDefault(); 224 212 225 if ( $current = $tbody.children( '.current' )) {213 if ( $current ) { 226 214 $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' } ); 232 220 } ); 233 221 … … 245 233 }, 246 234 onPageChange: function( event ) { 247 var$target = $( event.currentTarget );235 const $target = $( event.currentTarget ); 248 236 249 237 event.preventDefault(); … … 253 241 }, 254 242 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'; 256 244 257 245 $.each( event.data.view.model.getFilteredRates(), function( id, rowData ) { 258 var row = ''; 259 260 row += rowData.country + ','; 246 let row = rowData.country + ','; 261 247 row += rowData.state + ','; 262 248 row += ( rowData.postcode ? rowData.postcode.join( '; ' ) : '' ) + ','; … … 268 254 row += data.current_class; 269 255 270 csv _data += row + '\n';256 csvData += row + '\n'; 271 257 } ); 272 258 273 $( this ).attr( 'href', encodeURI( csv _data ) );259 $( this ).attr( 'href', encodeURI( csvData ) ); 274 260 275 261 return true; … … 289 275 }, 290 276 updateModelOnChange: function( event ) { 291 varmodel = event.data.view.model,277 const model = event.data.view.model, 292 278 $target = $( event.target ), 293 279 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(); 296 283 297 284 if ( 'compound' === attribute || 'flat' === attribute ) { … … 305 292 model.setRateAttribute( id, attribute, val ); 306 293 }, 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 }, 316 303 } ), 317 304 ERTaxTableModelInstance = new ERTaxTableModelConstructor( { 318 rates: data.rates 305 rates: data.rates, 319 306 } ), 320 307 ERTaxTableInstance = new ERTaxTableViewConstructor( { 321 308 model: ERTaxTableModelInstance, 322 el: '#rates' 309 el: '#rates', 323 310 } ); 324 311 325 312 ERTaxTableInstance.render(); 326 327 313 } ); 328 } )( jQuery, htmlSettingsTaxLocalizeScript, wp);314 }( jQuery, htmlSettingsTaxLocalizeScript, wp ) ); -
easyreservations/trunk/assets/js/admin/settings.js
r2262833 r2263082 1 /* global wp*/1 /* global */ 2 2 ( function( $, wp ) { 3 4 3 // Color picker 5 4 $( '.colorpick' ) … … 9 8 }, 10 9 hide: true, 11 border: true 10 border: true, 12 11 } ) 13 12 … … 21 20 .on( 'change', function() { 22 21 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})$/ ) ) { 26 23 $( this ).val( $( this ).data( 'original-value' ) ).change(); 27 24 } else { … … 55 52 ui.item.removeAttr( 'style' ); 56 53 ui.item.trigger( 'updateMoveButtons' ); 57 } 54 }, 58 55 } ); 59 56 60 57 $( 'code[data-tag]' ).on( 'click', function() { 61 var$txt = $( '#' + $( this ).data( 'target' ) );62 varcaretPos = $txt[ 0 ].selectionStart;63 vartextAreaTxt = $txt.val();64 vartxtToAdd = '[' + $( 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' ) + ']'; 65 62 $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 19 19 showAnim: 'slideDown', 20 20 beforeShow: function( _, inst ) { 21 console.log( 13 );22 23 21 inst.dpDiv.removeClass( 'ui-datepicker' ).addClass( 'easy-datepicker' ).addClass( 'easy-ui' ); 24 22 }, -
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};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){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 4 4 Plugin URI: http://www.easyreservations.org 5 5 Description: This powerful property and reservation management plugin allows you to receive, schedule and handle your bookings easily! 6 Version: 6.0-alpha. 76 Version: 6.0-alpha.8 7 7 Author: Feryaz Beer 8 8 Author URI: http://www.feryaz.de -
easyreservations/trunk/includes/class-easyreservations.php
r2262833 r2263082 18 18 * @var string 19 19 */ 20 public $version = '6.0-alpha. 7';20 public $version = '6.0-alpha.8'; 21 21 /** 22 22 * Session instance. -
easyreservations/trunk/readme.txt
r2262833 r2263082 55 55 == Changelog == 56 56 57 = 6.0-alpha.8 - 2020-03-18 = 58 * Fix - Tax settings js 59 57 60 = 6.0-alpha.7 - 2020-03-18 = 58 61 * Feature - Reservation timeline
Note: See TracChangeset
for help on using the changeset viewer.