Skip to content

Commit

Permalink
Merge branch 'master' into performance/slow-term-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Feb 7, 2019
2 parents 0d41625 + 9ef6ea0 commit b2c33b8
Show file tree
Hide file tree
Showing 138 changed files with 6,068 additions and 6,816 deletions.
1 change: 0 additions & 1 deletion .codeclimate.yml
Expand Up @@ -24,7 +24,6 @@ exclude_paths:
- "includes/api/legacy/"
- "includes/libraries/"
- "includes/updates/"
- "includes/gateways/simplify-commerce/"
- "includes/shipping/legacy-*"
- "includes/wc-deprecated-functions.php"
- "assets/js/accounting/"
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc
Expand Up @@ -7,12 +7,16 @@
"globals": {
"wp": true,
"wpApiSettings": true,
"wcSettings": true
"wcSettings": true,
"es6": true
},
"rules": {
"camelcase": 0,
"indent": 0,
"max-len": [ 2, { "code": 140 } ],
"no-console": 1
},
"parserOptions": {
"ecmaVersion": 6
}
}
1 change: 0 additions & 1 deletion .scrutinizer.yml
Expand Up @@ -27,7 +27,6 @@ filter:
- sample-data/
- i18n/
- includes/api/legacy/
- includes/gateways/simplify-commerce/includes/
- includes/legacy/
- includes/libraries/
- includes/shipping/legacy-*
Expand Down
38 changes: 22 additions & 16 deletions Gruntfile.js
@@ -1,6 +1,7 @@
/* jshint node:true */
module.exports = function( grunt ) {
'use strict';
const sass = require( 'node-sass' );

grunt.initConfig({

Expand All @@ -22,9 +23,7 @@ module.exports = function( grunt ) {
'<%= dirs.js %>/admin/*.js',
'!<%= dirs.js %>/admin/*.min.js',
'<%= dirs.js %>/frontend/*.js',
'!<%= dirs.js %>/frontend/*.min.js',
'includes/gateways/simplify-commerce/assets/js/*.js',
'!includes/gateways/simplify-commerce/assets/js/*.min.js'
'!<%= dirs.js %>/frontend/*.min.js'
]
},

Expand Down Expand Up @@ -75,9 +74,13 @@ module.exports = function( grunt ) {
'<%= dirs.js %>/jquery-flot/jquery.flot.time.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.time.js'],
'<%= dirs.js %>/jquery-payment/jquery.payment.min.js': ['<%= dirs.js %>/jquery-payment/jquery.payment.js'],
'<%= dirs.js %>/jquery-qrcode/jquery.qrcode.min.js': ['<%= dirs.js %>/jquery-qrcode/jquery.qrcode.js'],
'<%= dirs.js %>/jquery-serializejson/jquery.serializejson.min.js': ['<%= dirs.js %>/jquery-serializejson/jquery.serializejson.js'],
'<%= dirs.js %>/jquery-serializejson/jquery.serializejson.min.js': [
'<%= dirs.js %>/jquery-serializejson/jquery.serializejson.js'
],
'<%= dirs.js %>/jquery-tiptip/jquery.tipTip.min.js': ['<%= dirs.js %>/jquery-tiptip/jquery.tipTip.js'],
'<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js': ['<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.js'],
'<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js': [
'<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.js'
],
'<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.init.min.js': ['<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.init.js'],
'<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.min.js': ['<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.js'],
'<%= dirs.js %>/flexslider/jquery.flexslider.min.js': ['<%= dirs.js %>/flexslider/jquery.flexslider.js'],
Expand Down Expand Up @@ -112,6 +115,7 @@ module.exports = function( grunt ) {
sass: {
compile: {
options: {
implementation: sass,
sourceMap: 'none'
},
files: [{
Expand Down Expand Up @@ -260,7 +264,9 @@ module.exports = function( grunt ) {
contributors: {
command: [
'echo "Generating contributor list since <%= fromDate %>"',
'./node_modules/.bin/githubcontrib --owner woocommerce --repo woocommerce --fromDate <%= fromDate %> --authToken <%= authToken %> --cols 6 --sortBy contributions --format md --sortOrder desc --showlogin true > contributors.md'
'./node_modules/.bin/githubcontrib --owner woocommerce --repo woocommerce --fromDate <%= fromDate %>' +
' --authToken <%= authToken %> --cols 6 --sortBy contributions --format md --sortOrder desc' +
' --showlogin true > contributors.md'
].join( '&&' )
}
},
Expand All @@ -277,7 +283,8 @@ module.exports = function( grunt ) {
{
config: 'authToken',
type: 'input',
message: '(optional) Provide a personal access token. This will allow 5000 requests per hour rather than 60 - use if nothing is generated.'
message: '(optional) Provide a personal access token.' +
' This will allow 5000 requests per hour rather than 60 - use if nothing is generated.'
}
]
}
Expand All @@ -298,15 +305,14 @@ module.exports = function( grunt ) {
},
dist: {
src: [
'**/*.php', // Include all files
'!apigen/**', // Exclude apigen/
'!includes/api/legacy/**', // Exclude legacy REST API
'!includes/gateways/simplify-commerce/includes/Simplify/**', // Exclude simplify commerce SDK
'!includes/libraries/**', // Exclude libraries/
'!node_modules/**', // Exclude node_modules/
'!tests/cli/**', // Exclude tests/cli/
'!tmp/**', // Exclude tmp/
'!vendor/**' // Exclude vendor/
'**/*.php', // Include all php files.
'!apigen/**',
'!includes/api/legacy/**',
'!includes/libraries/**',
'!node_modules/**',
'!tests/cli/**',
'!tmp/**',
'!vendor/**'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions assets/css/admin.scss
Expand Up @@ -583,17 +583,6 @@
color: inherit;
}

.simplify-commerce-banner {
overflow: hidden;

img {
float: right;
padding: 15px 0;
margin-left: 1em;
width: 200px;
}
}

/**
* Help Tip
*/
Expand Down Expand Up @@ -3686,15 +3675,15 @@
padding: 0 15px 10px 0;
}
}

.wc-shipping-zone-settings {

td.forminp {
input, textarea {
width: 448px;
padding: 6px 11px;
}

.select2-search input {
padding: 6px;
}
Expand Down Expand Up @@ -4797,8 +4786,20 @@
float: right;
}

input[type=text],
input[type=number],
input[type="text"],
input[type="number"],
input[type="password"],
input[type="color"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="search"],
input[type="tel"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/twenty-nineteen-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/twenty-nineteen.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions assets/css/twenty-seventeen.scss
Expand Up @@ -80,6 +80,17 @@
visibility: visible;
}
}

.woocommerce-form-login {
.woocommerce-form-login__submit {
float: left;
margin-right: 1em;
}
.woocommerce-form-login__rememberme {
display: inline-block;
line-height: 3em;
}
}
}

.woocommerce-breadcrumb {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/wc-setup-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/wc-setup.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions assets/css/woocommerce.scss
Expand Up @@ -1670,6 +1670,16 @@ p.demo_store,
color: $red;
}
}

.woocommerce-form-login {
.woocommerce-form-login__submit {
float: left;
margin-right: 1em;
}
.woocommerce-form-login__rememberme {
display: inline-block;
}
}
}

.woocommerce-no-js {
Expand Down
Binary file added assets/images/placeholder-attachment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion assets/js/admin/wc-setup.js
Expand Up @@ -95,6 +95,7 @@ jQuery( function( $ ) {
description.find( '.shipping-method-description' ).addClass( 'hide' );
description.find( '.' + selectedMethod ).removeClass( 'hide' );

var $checkbox = zone.parent().find( 'input[type="checkbox"]' );
var settings = zone.find( '.shipping-method-settings' );
settings
.find( '.shipping-method-setting' )
Expand All @@ -105,7 +106,7 @@ jQuery( function( $ ) {
.find( '.' + selectedMethod )
.removeClass( 'hide' )
.find( '.shipping-method-required-field' )
.prop( 'required', true );
.prop( 'required', $checkbox.prop( 'checked' ) );
} ).find( '.wc-wizard-shipping-method-select .method' ).change();

$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-enable', function() {
Expand Down
35 changes: 27 additions & 8 deletions assets/js/frontend/add-to-cart-variation.js
Expand Up @@ -111,8 +111,8 @@
VariationForm.prototype.onResetDisplayedVariation = function( event ) {
var form = event.data.variationForm;
form.$product.find( '.product_meta' ).find( '.sku' ).wc_reset_content();
form.$product.find( '.product_weight' ).wc_reset_content();
form.$product.find( '.product_dimensions' ).wc_reset_content();
form.$product.find( '.product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value' ).wc_reset_content();
form.$product.find( '.product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value' ).wc_reset_content();
form.$form.trigger( 'reset_image' );
form.$singleVariation.slideUp( 200 ).trigger( 'hide_variation' );
};
Expand Down Expand Up @@ -194,8 +194,8 @@
VariationForm.prototype.onFoundVariation = function( event, variation ) {
var form = event.data.variationForm,
$sku = form.$product.find( '.product_meta' ).find( '.sku' ),
$weight = form.$product.find( '.product_weight' ),
$dimensions = form.$product.find( '.product_dimensions' ),
$weight = form.$product.find( '.product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value' ),
$dimensions = form.$product.find( '.product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value' ),
$qty = form.$singleVariationWrap.find( '.quantity' ),
purchasable = true,
variation_id = '',
Expand Down Expand Up @@ -352,11 +352,19 @@
}

if ( attr_val ) {
// Decode entities and add slashes.
// Decode entities.
attr_val = $( '<div/>' ).html( attr_val ).text();

// Attach.
new_attr_select.find( 'option[value="' + form.addSlashes( attr_val ) + '"]' ).addClass( 'attached ' + variation_active );
// Attach to matching options by value. This is done to compare
// TEXT values rather than any HTML entities.
new_attr_select.find( 'option' ).each( function( index, el ) {
var option_value = $( this ).val();

if ( attr_val === option_value ) {
$( this ).addClass( 'attached ' + variation_active );
return false; // break.
}
});
} else {
// Attach all apart from placeholder.
new_attr_select.find( 'option:gt(0)' ).addClass( 'attached ' + variation_active );
Expand All @@ -371,8 +379,19 @@
attached_options_count = new_attr_select.find( 'option.attached' ).length;

// Check if current selection is in attached options.
if ( selected_attr_val && ( attached_options_count === 0 || new_attr_select.find( 'option.attached.enabled[value="' + form.addSlashes( selected_attr_val ) + '"]' ).length === 0 ) ) {
if ( selected_attr_val ) {
selected_attr_val_valid = false;

if ( 0 !== attached_options_count ) {
new_attr_select.find( 'option.attached.enabled' ).each( function( index, el ) {
var option_value = $( this ).val();

if ( selected_attr_val === option_value ) {
selected_attr_val_valid = true;
return false; // break.
}
});
}
}

// Detach the placeholder if:
Expand Down
12 changes: 5 additions & 7 deletions assets/js/frontend/add-to-cart.js
Expand Up @@ -119,15 +119,13 @@ jQuery( function( $ ) {
AddToCartHandler.prototype.updateCartPage = function() {
var page = window.location.toString().replace( 'add-to-cart', 'added-to-cart' );

$( '.shop_table.cart' ).load( page + ' .shop_table.cart:eq(0) > *', function() {
$( '.shop_table.cart' ).stop( true ).css( 'opacity', '1' ).unblock();
$.get( page, function( data ) {
$( '.shop_table.cart:eq(0)' ).replaceWith( $( data ).find( '.shop_table.cart:eq(0)' ) );
$( '.cart_totals:eq(0)' ).replaceWith( $( data ).find( '.cart_totals:eq(0)' ) );
$( '.cart_totals, .shop_table.cart' ).stop( true ).css( 'opacity', '1' ).unblock();
$( document.body ).trigger( 'cart_page_refreshed' );
});

$( '.cart_totals' ).load( page + ' .cart_totals:eq(0) > *', function() {
$( '.cart_totals' ).stop( true ).css( 'opacity', '1' ).unblock();
$( document.body ).trigger( 'cart_totals_refreshed' );
});
} );
};

/**
Expand Down
14 changes: 14 additions & 0 deletions assets/js/frontend/cart-fragments.js
Expand Up @@ -165,4 +165,18 @@ jQuery( function( $ ) {
$( document.body ).on( 'adding_to_cart', function() {
$( '.hide_cart_widget_if_empty' ).closest( '.widget_shopping_cart' ).show();
});

// Customiser support.
var hasSelectiveRefresh = (
'undefined' !== typeof wp &&
wp.customize &&
wp.customize.selectiveRefresh &&
wp.customize.widgetsPreview &&
wp.customize.widgetsPreview.WidgetPartial
);
if ( hasSelectiveRefresh ) {
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
refresh_cart_fragment();
} );
}
});
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -12,7 +12,7 @@
"require-dev": {
"apigen/apigen": "4.1.2",
"nette/utils": "2.5.3",
"phpunit/phpunit": "6.5.13",
"phpunit/phpunit": "6.5.14",
"woocommerce/woocommerce-sniffs": "0.0.5"
},
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2c33b8

Please sign in to comment.