Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rrennick committed May 6, 2020
2 parents 0e2e913 + 43ab840 commit 0f2fb4f
Show file tree
Hide file tree
Showing 169 changed files with 744 additions and 316 deletions.
26 changes: 0 additions & 26 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM wordpress:5.4.0
FROM wordpress:5.4.1
17 changes: 7 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* jshint node:true */
module.exports = function( grunt ) {
'use strict';
var sass = require( 'node-sass' );
Expand All @@ -14,12 +13,9 @@ module.exports = function( grunt ) {
php: 'includes'
},

// JavaScript linting with JSHint.
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
// JavaScript linting with ESLint.
eslint: {
src: [
'<%= dirs.js %>/admin/*.js',
'!<%= dirs.js %>/admin/*.min.js',
'<%= dirs.js %>/frontend/*.js',
Expand Down Expand Up @@ -192,12 +188,13 @@ module.exports = function( grunt ) {
},
js: {
files: [
'GruntFile.js',
'<%= dirs.js %>/admin/*js',
'<%= dirs.js %>/frontend/*js',
'!<%= dirs.js %>/admin/*.min.js',
'!<%= dirs.js %>/frontend/*.min.js'
],
tasks: ['jshint', 'uglify']
tasks: ['eslint','uglify']
}
},

Expand Down Expand Up @@ -291,7 +288,7 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( 'grunt-rtlcss' );
grunt.loadNpmTasks( 'grunt-postcss' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'gruntify-eslint' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
Expand All @@ -307,7 +304,7 @@ module.exports = function( grunt ) {
]);

grunt.registerTask( 'js', [
'jshint',
'eslint',
'uglify:admin',
'uglify:frontend'
]);
Expand Down
4 changes: 3 additions & 1 deletion assets/js/admin/api-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@
$( '#key_permissions', self.el ).val( data.permissions );
}
} else {
$( 'h2, h3', self.el ).first().append( '<div class="wc-api-message error"><p>' + response.data.message + '</p></div>' );
$( 'h2, h3', self.el )
.first()
.append( '<div class="wc-api-message error"><p>' + response.data.message + '</p></div>' );
}

self.unblock();
Expand Down
5 changes: 4 additions & 1 deletion assets/js/admin/backbone-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@
var button = e.keyCode || e.which;

// Enter key
if ( 13 === button && ! ( e.target.tagName && ( e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea' ) ) ) {
if (
13 === button &&
! ( e.target.tagName && ( e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea' ) )
) {
this.addButton( e );
}

Expand Down
54 changes: 44 additions & 10 deletions assets/js/admin/meta-boxes-order.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line max-len
/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order, wcSetClipboard, wcClearClipboard */
jQuery( function ( $ ) {

Expand All @@ -11,7 +12,12 @@ jQuery( function ( $ ) {
var wc_meta_boxes_order = {
states: null,
init: function() {
if ( ! ( typeof woocommerce_admin_meta_boxes_order === 'undefined' || typeof woocommerce_admin_meta_boxes_order.countries === 'undefined' ) ) {
if (
! (
typeof woocommerce_admin_meta_boxes_order === 'undefined' ||
typeof woocommerce_admin_meta_boxes_order.countries === 'undefined'
)
) {
/* State/Country select boxes */
this.states = $.parseJSON( woocommerce_admin_meta_boxes_order.countries.replace( /&quot;/g, '"' ) );
}
Expand Down Expand Up @@ -380,11 +386,19 @@ jQuery( function ( $ ) {
$( 'input.line_tax', $row ).each( function() {
var $line_total_tax = $( this );
var tax_id = $line_total_tax.data( 'tax_id' );
var unit_total_tax = accounting.unformat( $line_total_tax.attr( 'data-total_tax' ), woocommerce_admin.mon_decimal_point ) / o_qty;
var unit_total_tax = accounting.unformat(
$line_total_tax.attr( 'data-total_tax' ),
woocommerce_admin.mon_decimal_point
) / o_qty;
var $line_subtotal_tax = $( 'input.line_subtotal_tax[data-tax_id="' + tax_id + '"]', $row );
var unit_subtotal_tax = accounting.unformat( $line_subtotal_tax.attr( 'data-subtotal_tax' ), woocommerce_admin.mon_decimal_point ) / o_qty;
var unit_subtotal_tax = accounting.unformat(
$line_subtotal_tax.attr( 'data-subtotal_tax' ),
woocommerce_admin.mon_decimal_point
) / o_qty;
var round_at_subtotal = 'yes' === woocommerce_admin_meta_boxes.round_at_subtotal;
var precision = woocommerce_admin_meta_boxes[ round_at_subtotal ? 'rounding_precision' : 'currency_format_num_decimals' ];
var precision = woocommerce_admin_meta_boxes[
round_at_subtotal ? 'rounding_precision' : 'currency_format_num_decimals'
];

if ( 0 < unit_total_tax ) {
$line_total_tax.val(
Expand Down Expand Up @@ -877,7 +891,10 @@ jQuery( function ( $ ) {

$( '.refund input.refund_line_total' ).each(function( index, item ) {
if ( $( item ).closest( 'tr' ).data( 'order_item_id' ) ) {
line_item_totals[ $( item ).closest( 'tr' ).data( 'order_item_id' ) ] = accounting.unformat( item.value, woocommerce_admin.mon_decimal_point );
line_item_totals[ $( item ).closest( 'tr' ).data( 'order_item_id' ) ] = accounting.unformat(
item.value,
woocommerce_admin.mon_decimal_point
);
}
});

Expand All @@ -889,7 +906,10 @@ jQuery( function ( $ ) {
line_item_tax_totals[ $( item ).closest( 'tr' ).data( 'order_item_id' ) ] = {};
}

line_item_tax_totals[ $( item ).closest( 'tr' ).data( 'order_item_id' ) ][ tax_id ] = accounting.unformat( item.value, woocommerce_admin.mon_decimal_point );
line_item_tax_totals[ $( item ).closest( 'tr' ).data( 'order_item_id' ) ][ tax_id ] = accounting.unformat(
item.value,
woocommerce_admin.mon_decimal_point
);
}
});

Expand Down Expand Up @@ -1018,11 +1038,16 @@ jQuery( function ( $ ) {
var $refund_line_total_tax = $( this );
var tax_id = $refund_line_total_tax.data( 'tax_id' );
var line_total_tax = $( 'input.line_tax[data-tax_id="' + tax_id + '"]', $row );
var unit_total_tax = accounting.unformat( line_total_tax.data( 'total_tax' ), woocommerce_admin.mon_decimal_point ) / qty;
var unit_total_tax = accounting.unformat(
line_total_tax.data( 'total_tax' ),
woocommerce_admin.mon_decimal_point
) / qty;

if ( 0 < unit_total_tax ) {
var round_at_subtotal = 'yes' === woocommerce_admin_meta_boxes.round_at_subtotal;
var precision = woocommerce_admin_meta_boxes[ round_at_subtotal ? 'rounding_precision' : 'currency_format_num_decimals' ];
var precision = woocommerce_admin_meta_boxes[
round_at_subtotal ? 'rounding_precision' : 'currency_format_num_decimals'
];

$refund_line_total_tax.val(
parseFloat( accounting.formatNumber( unit_total_tax * refund_qty, precision, '' ) )
Expand Down Expand Up @@ -1059,8 +1084,17 @@ jQuery( function ( $ ) {
var index = $items.find('tr').length + 1;
var $row = '<tr data-meta_id="0">' +
'<td>' +
'<input type="text" maxlength="255" placeholder="' + woocommerce_admin_meta_boxes_order.placeholder_name + '" name="meta_key[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']" />' +
'<textarea placeholder="' + woocommerce_admin_meta_boxes_order.placeholder_value + '" name="meta_value[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']"></textarea>' +
'<input type="text" maxlength="255" placeholder="' +
woocommerce_admin_meta_boxes_order.placeholder_name +
'" name="meta_key[' + $item.attr( 'data-order_item_id' ) +
'][new-' + index + ']" />' +
'<textarea placeholder="' +
woocommerce_admin_meta_boxes_order.placeholder_value +
'" name="meta_value[' +
$item.attr( 'data-order_item_id' ) +
'][new-' +
index +
']"></textarea>' +
'</td>' +
'<td width="1%"><button class="remove_order_item_meta button">&times;</button></td>' +
'</tr>';
Expand Down
4 changes: 3 additions & 1 deletion assets/js/admin/meta-boxes-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ jQuery( function( $ ) {

$( '.product_attributes .woocommerce_attribute' ).each( function( index, el ) {
if ( $( el ).css( 'display' ) !== 'none' && $( el ).is( '.taxonomy' ) ) {
$( 'select.attribute_taxonomy' ).find( 'option[value="' + $( el ).data( 'taxonomy' ) + '"]' ).prop( 'disabled', true );
$( 'select.attribute_taxonomy' )
.find( 'option[value="' + $( el ).data( 'taxonomy' ) + '"]' )
.prop( 'disabled', true );
}
});

Expand Down
25 changes: 16 additions & 9 deletions assets/js/admin/product-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,24 @@ jQuery( function( $ ) {
var nextpostid = ui.item.next().find( '.check-column input' ).val();

// Show Spinner
ui.item.find( '.check-column input' ).hide().after( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );
ui.item
.find( '.check-column input' )
.hide()
.after( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );

// Go do the sorting stuff via ajax
$.post( ajaxurl, { action: 'woocommerce_product_ordering', id: postid, previd: prevpostid, nextid: nextpostid }, function( response ) {
$.each( response, function( key, value ) {
$( '#inline_' + key + ' .menu_order' ).html( value );
});
ui.item.find( '.check-column input' ).show().siblings( 'img' ).remove();
$( 'table.widefat tbody th, table.widefat tbody td' ).css( 'cursor', 'move' );
$( 'table.widefat tbody' ).sortable( 'enable' );
});
$.post(
ajaxurl,
{ action: 'woocommerce_product_ordering', id: postid, previd: prevpostid, nextid: nextpostid },
function( response ) {
$.each( response, function( key, value ) {
$( '#inline_' + key + ' .menu_order' ).html( value );
});
ui.item.find( '.check-column input' ).show().siblings( 'img' ).remove();
$( 'table.widefat tbody th, table.widefat tbody td' ).css( 'cursor', 'move' );
$( 'table.widefat tbody' ).sortable( 'enable' );
}
);

// fix cell colors
$( 'table.widefat tbody tr' ).each( function() {
Expand Down
1 change: 1 addition & 0 deletions assets/js/admin/quick-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jQuery(function( $ ) {
$( 'input[name="_stock"]', '.inline-edit-row' ).val( stock );
$( 'input[name="menu_order"]', '.inline-edit-row' ).val( menu_order );

// eslint-disable-next-line max-len
$( 'select[name="_tax_status"] option, select[name="_tax_class"] option, select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option' ).removeAttr( 'selected' );

$( 'select[name="_tax_status"] option[value="' + tax_status + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
Expand Down
8 changes: 7 additions & 1 deletion assets/js/admin/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ jQuery(function( $ ) {
csv_data += '"' + index + '",';
} else {
if ( groupby === 'day' ) {
csv_data += '"' + date.getUTCFullYear() + '-' + parseInt( date.getUTCMonth() + 1, 10 ) + '-' + date.getUTCDate() + '",';
csv_data += '"' +
date.getUTCFullYear() +
'-' +
parseInt( date.getUTCMonth() + 1, 10 ) +
'-' +
date.getUTCDate() +
'",';
} else {
csv_data += '"' + date.getUTCFullYear() + '-' + parseInt( date.getUTCMonth() + 1, 10 ) + '",';
}
Expand Down
7 changes: 5 additions & 2 deletions assets/js/admin/settings-views-html-settings-tax.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
minLength: 3
});

// Postcode and city don't have `name` values by default. They're only created if the contents changes, to save on database queries (I think)
// Postcode and city don't have `name` values by default.
// They're only created if the contents changes, to save on database queries (I think)
this.$el.find( 'td.postcode input, td.city input' ).change( function() {
$( this ).attr( 'name', $( this ).data( 'name' ) );
});
Expand Down Expand Up @@ -232,7 +233,9 @@

reordered_rates = _.map( rates_to_reorder, function( rate ) {
rate.tax_rate_order++;
changes[ rate.tax_rate_id ] = _.extend( changes[ rate.tax_rate_id ] || {}, { tax_rate_order : rate.tax_rate_order } );
changes[ rate.tax_rate_id ] = _.extend(
changes[ rate.tax_rate_id ] || {}, { tax_rate_order : rate.tax_rate_order }
);
return rate;
} );
} else {
Expand Down
48 changes: 35 additions & 13 deletions assets/js/admin/term-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ jQuery( function( $ ) {
};

$( document ).ajaxComplete( function( event, request, options ) {
if ( request && 4 === request.readyState && 200 === request.status && options.data && ( 0 <= options.data.indexOf( '_inline_edit' ) || 0 <= options.data.indexOf( 'add-tag' ) ) ) {
if (
request &&
4 === request.readyState &&
200 === request.status &&
options.data &&
( 0 <= options.data.indexOf( '_inline_edit' ) || 0 <= options.data.indexOf( 'add-tag' ) )
) {
$.wc_add_missing_sort_handles();
$( document.body ).trigger( 'init_tooltips' );
}
Expand Down Expand Up @@ -80,25 +86,41 @@ jQuery( function( $ ) {
}
}

// If previous and next not at same tree level, or next not at same tree level and the previous is the parent of the next, or just moved item beneath its own children
if ( ( prevtermid === undefined && nexttermid === undefined ) || ( nexttermid === undefined && nexttermparent === prevtermid ) || ( nexttermid !== undefined && prevtermparent === termid ) ) {
// If previous and next not at same tree level, or next not at same tree level and
// the previous is the parent of the next, or just moved item beneath its own children.
if (
( prevtermid === undefined && nexttermid === undefined ) ||
( nexttermid === undefined && nexttermparent === prevtermid ) ||
( nexttermid !== undefined && prevtermparent === termid )
) {
$( table_selector ).sortable( 'cancel' );
return;
}

// Show Spinner
ui.item.find( '.check-column input' ).hide();
ui.item.find( '.check-column' ).append( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );

// Go do the sorting stuff via ajax
$.post( ajaxurl, { action: 'woocommerce_term_ordering', id: termid, nextid: nexttermid, thetaxonomy: woocommerce_term_ordering_params.taxonomy }, function(response){
if ( response === 'children' ) {
window.location.reload();
} else {
ui.item.find( '.check-column input' ).show();
ui.item.find( '.check-column' ).find( 'img' ).remove();
ui.item
.find( '.check-column' )
.append( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );

// Go do the sorting stuff via ajax.
$.post(
ajaxurl,
{
action: 'woocommerce_term_ordering',
id: termid,
nextid: nexttermid,
thetaxonomy: woocommerce_term_ordering_params.taxonomy
},
function(response) {
if ( response === 'children' ) {
window.location.reload();
} else {
ui.item.find( '.check-column input' ).show();
ui.item.find( '.check-column' ).find( 'img' ).remove();
}
}
});
);

// Fix cell colors
$( 'table.widefat tbody tr' ).each( function() {
Expand Down
10 changes: 9 additions & 1 deletion assets/js/admin/wc-product-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@
$this.$form.find('.woocommerce-importer-progress').val( response.data.percentage );

if ( 'done' === response.data.position ) {
window.location = response.data.url + '&products-imported=' + parseInt( $this.imported, 10 ) + '&products-failed=' + parseInt( $this.failed, 10 ) + '&products-updated=' + parseInt( $this.updated, 10 ) + '&products-skipped=' + parseInt( $this.skipped, 10 );
window.location = response.data.url +
'&products-imported=' +
parseInt( $this.imported, 10 ) +
'&products-failed=' +
parseInt( $this.failed, 10 ) +
'&products-updated=' +
parseInt( $this.updated, 10 ) +
'&products-skipped=' +
parseInt( $this.skipped, 10 );
} else {
$this.run_import();
}
Expand Down
Loading

0 comments on commit 0f2fb4f

Please sign in to comment.