From b2c35a5ded12b7b9a2bb7f6ab866cc90e07c4ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A0=20Mestieri?= Date: Mon, 17 Aug 2020 10:57:09 +0200 Subject: [PATCH 001/144] Added cache and filters for wc-customer get operations. --- .../reports/class-wc-report-customer-list.php | 1 + includes/class-wc-post-data.php | 3 +- .../class-wc-customer-data-store.php | 43 ++++++++++++------- includes/wc-order-functions.php | 1 + includes/wc-update-functions.php | 1 + 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/includes/admin/reports/class-wc-report-customer-list.php b/includes/admin/reports/class-wc-report-customer-list.php index e223570b7b9..4beeb951df9 100644 --- a/includes/admin/reports/class-wc-report-customer-list.php +++ b/includes/admin/reports/class-wc-report-customer-list.php @@ -62,6 +62,7 @@ class WC_Report_Customer_List extends WP_List_Table { delete_user_meta( $user_id, '_money_spent' ); delete_user_meta( $user_id, '_order_count' ); + delete_user_meta( $user_id, '_last_order' ); /* translators: User display name */ echo '

' . sprintf( esc_html__( 'Refreshed stats for %s', 'woocommerce' ), esc_html( $user->display_name ) ) . '

'; } diff --git a/includes/class-wc-post-data.php b/includes/class-wc-post-data.php index 39b89ba29b9..e09d8597190 100644 --- a/includes/class-wc-post-data.php +++ b/includes/class-wc-post-data.php @@ -406,8 +406,9 @@ class WC_Post_Data { $customer->save(); } - // Delete order count meta. + // Delete order count and last order meta. delete_user_meta( $customer_id, '_order_count' ); + delete_user_meta( $customer_id, '_last_order' ); } // Clean up items. diff --git a/includes/data-stores/class-wc-customer-data-store.php b/includes/data-stores/class-wc-customer-data-store.php index a772e45fe76..81137e995da 100644 --- a/includes/data-stores/class-wc-customer-data-store.php +++ b/includes/data-stores/class-wc-customer-data-store.php @@ -324,22 +324,31 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat * @return WC_Order|false */ public function get_last_order( &$customer ) { - global $wpdb; - - $last_order = $wpdb->get_var( - // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared - "SELECT posts.ID - FROM $wpdb->posts AS posts - LEFT JOIN {$wpdb->postmeta} AS meta on posts.ID = meta.post_id - WHERE meta.meta_key = '_customer_user' - AND meta.meta_value = '" . esc_sql( $customer->get_id() ) . "' - AND posts.post_type = 'shop_order' - AND posts.post_status IN ( '" . implode( "','", array_map( 'esc_sql', array_keys( wc_get_order_statuses() ) ) ) . "' ) - ORDER BY posts.ID DESC" - // phpcs:enable + $last_order = apply_filters( + 'woocommerce_customer_get_last_order', + get_user_meta( $customer->get_id(), '_last_order', true ), + $customer ); - if ( ! $last_order ) { + if ( '' === $last_order ) { + global $wpdb; + + $last_order = $wpdb->get_var( + // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared + "SELECT posts.ID + FROM $wpdb->posts AS posts + LEFT JOIN {$wpdb->postmeta} AS meta on posts.ID = meta.post_id + WHERE meta.meta_key = '_customer_user' + AND meta.meta_value = '" . esc_sql( $customer->get_id() ) . "' + AND posts.post_type = 'shop_order' + AND posts.post_status IN ( '" . implode( "','", array_map( 'esc_sql', array_keys( wc_get_order_statuses() ) ) ) . "' ) + ORDER BY posts.ID DESC" + // phpcs:enable + ); + update_user_meta( $customer->get_id(), '_last_order', $last_order ); + } + + if ( ! $last_order || '' === $last_order ) { return false; } @@ -354,7 +363,11 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat * @return integer */ public function get_order_count( &$customer ) { - $count = get_user_meta( $customer->get_id(), '_order_count', true ); + $count = apply_filters( + 'woocommerce_customer_get_order_count', + get_user_meta( $customer->get_id(), '_order_count', true ), + $customer + ); if ( '' === $count ) { global $wpdb; diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index 99f55dd30f2..ffe993acb83 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -461,6 +461,7 @@ function wc_delete_shop_order_transients( $order = 0 ) { $order_id = $order->get_id(); delete_user_meta( $order->get_customer_id(), '_money_spent' ); delete_user_meta( $order->get_customer_id(), '_order_count' ); + delete_user_meta( $order->get_customer_id(), '_last_order' ); } else { $order_id = 0; } diff --git a/includes/wc-update-functions.php b/includes/wc-update-functions.php index 2ebb79abdac..264ea4fd020 100644 --- a/includes/wc-update-functions.php +++ b/includes/wc-update-functions.php @@ -701,6 +701,7 @@ function wc_update_230_options() { // _money_spent and _order_count may be out of sync - clear them delete_metadata( 'user', 0, '_money_spent', '', true ); delete_metadata( 'user', 0, '_order_count', '', true ); + delete_metadata( 'user', 0, '_last_order', '', true ); // To prevent taxes being hidden when using a default 'no address' in a store with tax inc prices, set the woocommerce_default_customer_address to use the store base address by default. if ( '' === get_option( 'woocommerce_default_customer_address', false ) && wc_prices_include_tax() ) { From 83434deb420f477290ab294cd84cff539235ef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A0=20Mestieri?= Date: Wed, 26 Aug 2020 16:12:06 +0200 Subject: [PATCH 002/144] Added PR feedback. --- includes/data-stores/class-wc-customer-data-store.php | 1 + includes/wc-order-functions.php | 2 +- includes/wc-user-functions.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-customer-data-store.php b/includes/data-stores/class-wc-customer-data-store.php index 81137e995da..7ee2a5a9100 100644 --- a/includes/data-stores/class-wc-customer-data-store.php +++ b/includes/data-stores/class-wc-customer-data-store.php @@ -64,6 +64,7 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat 'syntax_highlighting', '_order_count', '_money_spent', + '_last_order', '_woocommerce_tracks_anon_id', ); diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index ffe993acb83..3f73ccb3d8d 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -456,7 +456,7 @@ function wc_delete_shop_order_transients( $order = 0 ) { delete_transient( $transient ); } - // Clear money spent for user associated with order. + // Clear customer's order related caches. if ( is_a( $order, 'WC_Order' ) ) { $order_id = $order->get_id(); delete_user_meta( $order->get_customer_id(), '_money_spent' ); diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 282582cf624..20c8e8d59aa 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -272,6 +272,7 @@ function wc_update_new_customer_past_orders( $customer_id ) { update_user_meta( $customer_id, 'paying_customer', 1 ); update_user_meta( $customer_id, '_order_count', '' ); update_user_meta( $customer_id, '_money_spent', '' ); + delete_user_meta( $customer_id, '_last_order' ); } return $linked; From 12be6f3c969d53e8e9c85613d2d5ffc8120d5769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A0=20Mestieri?= Date: Thu, 27 Aug 2020 09:33:56 +0200 Subject: [PATCH 003/144] Fixed code standard error. --- includes/wc-user-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 20c8e8d59aa..2aaf43ea6a2 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -898,7 +898,7 @@ function wc_update_user_last_active( $user_id ) { if ( ! $user_id ) { return; } - update_user_meta( $user_id, 'wc_last_active', (string) strtotime( date( 'Y-m-d', time() ) ) ); + update_user_meta( $user_id, 'wc_last_active', (string) strtotime( gmdate( 'Y-m-d', time() ) ) ); } /** From b209b2bec33fce057317143b3f7c8276bed1672a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A0=20Mestieri?= Date: Mon, 31 Aug 2020 08:28:30 +0200 Subject: [PATCH 004/144] fixup! Added PR feedback. --- includes/data-stores/class-wc-customer-data-store.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-customer-data-store.php b/includes/data-stores/class-wc-customer-data-store.php index 7ee2a5a9100..63fa5425443 100644 --- a/includes/data-stores/class-wc-customer-data-store.php +++ b/includes/data-stores/class-wc-customer-data-store.php @@ -349,7 +349,7 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat update_user_meta( $customer->get_id(), '_last_order', $last_order ); } - if ( ! $last_order || '' === $last_order ) { + if ( ! $last_order ) { return false; } From 4ecb468690fc627a22bb6af3cda7dd5febf13982 Mon Sep 17 00:00:00 2001 From: Omkar Bhagat Date: Mon, 27 Jul 2020 19:38:07 +0530 Subject: [PATCH 005/144] Modify the logic for deleting variations Implements the following expected behaviour: 1. Switch from variable subscription to non-variable one will delete variations. 2. Switch from variable subscription to variable product and vice-versa will NOT delete any variations. This shall have no side-effects in WooCommerce Core. --- includes/class-wc-post-data.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-post-data.php b/includes/class-wc-post-data.php index 39b89ba29b9..125f5657c03 100644 --- a/includes/class-wc-post-data.php +++ b/includes/class-wc-post-data.php @@ -127,7 +127,10 @@ class WC_Post_Data { * @param string $to New type. */ public static function product_type_changed( $product, $from, $to ) { - if ( 'variable' === $from && 'variable' !== $to ) { + $from_variable_type = ( false !== strpos( $from, 'variable' ) ); + $to_variable_type = ( false !== strpos( $to, 'variable' ) ); + + if ( $from_variable_type && ! $to_variable_type ) { // If the product is no longer variable, we should ensure all variations are removed. $data_store = WC_Data_Store::load( 'product-variable' ); $data_store->delete_variations( $product->get_id(), true ); From 6bca55b6d67ba22b642cadb00e5fa501acd360e0 Mon Sep 17 00:00:00 2001 From: Omkar Bhagat Date: Wed, 9 Sep 2020 00:33:51 +0530 Subject: [PATCH 006/144] Introduce filters to filter $from and $to This will introduce two new filters: woocommerce_from_product_type_changed woocommerce_to_product_type_changed to filter the $from and $to variables respectively. This will be useful in WCS pr_3732! --- includes/class-wc-post-data.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-post-data.php b/includes/class-wc-post-data.php index 125f5657c03..06d0545a650 100644 --- a/includes/class-wc-post-data.php +++ b/includes/class-wc-post-data.php @@ -127,10 +127,10 @@ class WC_Post_Data { * @param string $to New type. */ public static function product_type_changed( $product, $from, $to ) { - $from_variable_type = ( false !== strpos( $from, 'variable' ) ); - $to_variable_type = ( false !== strpos( $to, 'variable' ) ); + apply_filters( 'woocommerce_from_product_type_changed', $from ); + apply_filters( 'woocommerce_to_product_type_changed', $to ); - if ( $from_variable_type && ! $to_variable_type ) { + if ( 'variable' === $from && 'variable' !== $to ) { // If the product is no longer variable, we should ensure all variations are removed. $data_store = WC_Data_Store::load( 'product-variable' ); $data_store->delete_variations( $product->get_id(), true ); From 87b2d574db365143dab94711b4f2af8bca0a4f3a Mon Sep 17 00:00:00 2001 From: Omkar Bhagat Date: Fri, 11 Sep 2020 01:29:17 +0530 Subject: [PATCH 007/144] Convert the two filters into a single filter Removing the two newly introduced filters and replacing it with one single filter: woocommerce_delete_variations_on_product_type_change. --- includes/class-wc-post-data.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/includes/class-wc-post-data.php b/includes/class-wc-post-data.php index 06d0545a650..30699d23e2e 100644 --- a/includes/class-wc-post-data.php +++ b/includes/class-wc-post-data.php @@ -127,10 +127,7 @@ class WC_Post_Data { * @param string $to New type. */ public static function product_type_changed( $product, $from, $to ) { - apply_filters( 'woocommerce_from_product_type_changed', $from ); - apply_filters( 'woocommerce_to_product_type_changed', $to ); - - if ( 'variable' === $from && 'variable' !== $to ) { + if ( apply_filters( 'woocommerce_delete_variations_on_product_type_change', 'variable' === $from && 'variable' !== $to, $product, $from, $to ) ) { // If the product is no longer variable, we should ensure all variations are removed. $data_store = WC_Data_Store::load( 'product-variable' ); $data_store->delete_variations( $product->get_id(), true ); From fc908a0befc97aa05b453255907d8afdac26bd9a Mon Sep 17 00:00:00 2001 From: And Finally Date: Tue, 15 Sep 2020 10:55:52 +0100 Subject: [PATCH 008/144] Change href of premium support link from `https://woocommerce.com/my-account/tickets/` to `https://woocommerce.com/my-account/create-a-ticket/`, as the original URL is deprecated. --- includes/class-wc-install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 95fc3ec85e1..5711ed891cc 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -1378,7 +1378,7 @@ CREATE TABLE {$wpdb->prefix}wc_reserved_stock ( ); if ( WCConnectionHelper::is_connected() ) { - $row_meta['premium_support'] = '' . esc_html__( 'Premium support', 'woocommerce' ) . ''; + $row_meta['premium_support'] = '' . esc_html__( 'Premium support', 'woocommerce' ) . ''; } return array_merge( $links, $row_meta ); From 269ca73aa8594f5fa8305517f169c2648fdd658b Mon Sep 17 00:00:00 2001 From: Jory Hogeveen Date: Tue, 20 Oct 2020 15:56:02 +0200 Subject: [PATCH 009/144] Allow re-init of price slider Use case for when the widget is reloaded using AJAX --- assets/js/frontend/price-slider.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/frontend/price-slider.js b/assets/js/frontend/price-slider.js index 3b89b117c8b..1e294b5f087 100644 --- a/assets/js/frontend/price-slider.js +++ b/assets/js/frontend/price-slider.js @@ -66,6 +66,7 @@ jQuery( function( $ ) { } init_price_filter(); + $( document.body ).on( 'init_price_filter', init_price_filter ); var hasSelectiveRefresh = ( 'undefined' !== typeof wp && From 34eb09dfa19d3085219159f4ce2144b178ecfd31 Mon Sep 17 00:00:00 2001 From: Jory Hogeveen Date: Tue, 20 Oct 2020 15:56:43 +0200 Subject: [PATCH 010/144] Use `on` instead of `bind` Bind will be deprecated --- assets/js/frontend/price-slider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/frontend/price-slider.js b/assets/js/frontend/price-slider.js index 1e294b5f087..1c456527d96 100644 --- a/assets/js/frontend/price-slider.js +++ b/assets/js/frontend/price-slider.js @@ -6,7 +6,7 @@ jQuery( function( $ ) { return false; } - $( document.body ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) { + $( document.body ).on( 'price_slider_create price_slider_slide', function( event, min, max ) { $( '.price_slider_amount span.from' ).html( accounting.formatMoney( min, { symbol: woocommerce_price_slider_params.currency_format_symbol, @@ -76,7 +76,7 @@ jQuery( function( $ ) { wp.customize.widgetsPreview.WidgetPartial ); if ( hasSelectiveRefresh ) { - wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() { + wp.customize.selectiveRefresh.on( 'partial-content-rendered', function() { init_price_filter(); } ); } From ebb8ced803dd3687be56a4a8d297ed5205a2d84f Mon Sep 17 00:00:00 2001 From: Matt Harrison Date: Fri, 2 Oct 2020 22:07:13 -0400 Subject: [PATCH 011/144] Make next webhook not return a date when the webhook is already running. A potential fix for #26851 This does change the get_next functionality slightly but if the hook is already running then the next state should trigger a new one anyway. --- includes/queue/class-wc-action-queue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/queue/class-wc-action-queue.php b/includes/queue/class-wc-action-queue.php index 702861f54d3..88bccaeceef 100644 --- a/includes/queue/class-wc-action-queue.php +++ b/includes/queue/class-wc-action-queue.php @@ -126,7 +126,7 @@ class WC_Action_Queue implements WC_Queue_Interface { $next_timestamp = as_next_scheduled_action( $hook, $args, $group ); - if ( $next_timestamp ) { + if ( is_numeric( $next_timestamp ) ) { return new WC_DateTime( "@{$next_timestamp}", new DateTimeZone( 'UTC' ) ); } From bdda54f6010536ff5c58b38b7b6921538b9393c8 Mon Sep 17 00:00:00 2001 From: Ramon Fincken Date: Fri, 13 Nov 2020 14:02:05 +0100 Subject: [PATCH 012/144] [TASK] documented introduction of wc_get_container function [TASK] documented introduction of wc_get_container function as it has a new syntax --- woocommerce.php | 1 + 1 file changed, 1 insertion(+) diff --git a/woocommerce.php b/woocommerce.php index 3e0bc877ce4..14d4c6f1a0b 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -51,6 +51,7 @@ function WC() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.Fu * Returns the WooCommerce PSR11-compatible object container. * Code in the `includes` directory should use the container to get instances of classes in the `src` directory. * + * @since 4.4.0 * @return \Psr\Container\ContainerInterface The WooCommerce PSR11 container. */ function wc_get_container() : \Psr\Container\ContainerInterface { From 8ebead165e5d29eb552505730b2492c94532f4ed Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 18 Nov 2020 14:56:30 -0300 Subject: [PATCH 013/144] Replace usages of depracted jQuery.fn.click() event shorthand This commit replaces all instances in WooCommerce codebase (except included third-party libraries) where jQuery.fn.click( handler ) event shorthand was used. This shorthand was deprecated in jQuery 3.3 (see https://github.com/jquery/jquery/issues/3214). The jQuery documentation was not updated yet (see https://github.com/jquery/jquery-migrate/issues/288 and https://github.com/jquery/api.jquery.com/issues/972). jQuery.click() was not deprecated and so it was not replaced. --- assets/js/admin/marketplace-suggestions.js | 2 +- assets/js/admin/meta-boxes-order.js | 2 +- assets/js/admin/meta-boxes-product.js | 6 +++--- assets/js/admin/meta-boxes.js | 2 +- assets/js/admin/reports.js | 2 +- assets/js/admin/settings.js | 2 +- assets/js/admin/woocommerce_admin.js | 2 +- assets/js/frontend/woocommerce.js | 2 +- includes/admin/class-wc-admin-attributes.php | 2 +- includes/admin/class-wc-admin.php | 2 +- includes/admin/views/html-admin-page-status-logs-db.php | 2 +- includes/emails/class-wc-email.php | 4 ++-- includes/tracks/events/class-wc-products-tracking.php | 2 +- includes/tracks/events/class-wc-status-tracking.php | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/assets/js/admin/marketplace-suggestions.js b/assets/js/admin/marketplace-suggestions.js index 3eee50b17b9..7493d3fedf6 100644 --- a/assets/js/admin/marketplace-suggestions.js +++ b/assets/js/admin/marketplace-suggestions.js @@ -405,7 +405,7 @@ } // Track when suggestions are displayed (and not already visible). - $( 'ul.product_data_tabs li.marketplace-suggestions_options a' ).click( function( e ) { + $( 'ul.product_data_tabs li.marketplace-suggestions_options a' ).on( 'click', function( e ) { e.preventDefault(); if ( '#marketplace_suggestions' === currentTab ) { diff --git a/assets/js/admin/meta-boxes-order.js b/assets/js/admin/meta-boxes-order.js index e4f108f1362..45dffce3884 100644 --- a/assets/js/admin/meta-boxes-order.js +++ b/assets/js/admin/meta-boxes-order.js @@ -28,7 +28,7 @@ jQuery( function ( $ ) { $( '#woocommerce-order-actions input, #woocommerce-order-actions a' ).click(function() { window.onbeforeunload = ''; }); - $( 'a.edit_address' ).click( this.edit_address ); + $( 'a.edit_address' ).on( 'click', this.edit_address ); $( 'a.billing-same-as-shipping' ).on( 'click', this.copy_billing_to_shipping ); $( 'a.load_customer_billing' ).on( 'click', this.load_billing ); $( 'a.load_customer_shipping' ).on( 'click', this.load_shipping ); diff --git a/assets/js/admin/meta-boxes-product.js b/assets/js/admin/meta-boxes-product.js index d54284dd766..d7d4dc5c3aa 100644 --- a/assets/js/admin/meta-boxes-product.js +++ b/assets/js/admin/meta-boxes-product.js @@ -49,14 +49,14 @@ jQuery( function( $ ) { }); // Catalog Visibility. - $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).click( function() { + $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).on( 'click', function() { if ( $( '#catalog-visibility-select' ).is( ':hidden' ) ) { $( '#catalog-visibility-select' ).slideDown( 'fast' ); $( this ).hide(); } return false; }); - $( '#catalog-visibility' ).find( '.save-post-visibility' ).click( function() { + $( '#catalog-visibility' ).find( '.save-post-visibility' ).on( 'click', function() { $( '#catalog-visibility-select' ).slideUp( 'fast' ); $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show(); @@ -70,7 +70,7 @@ jQuery( function( $ ) { $( '#catalog-visibility-display' ).text( label ); return false; }); - $( '#catalog-visibility' ).find( '.cancel-post-visibility' ).click( function() { + $( '#catalog-visibility' ).find( '.cancel-post-visibility' ).on( 'click', function() { $( '#catalog-visibility-select' ).slideUp( 'fast' ); $( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show(); diff --git a/assets/js/admin/meta-boxes.js b/assets/js/admin/meta-boxes.js index 13e2c4a56c4..f054ebaf9d4 100644 --- a/assets/js/admin/meta-boxes.js +++ b/assets/js/admin/meta-boxes.js @@ -35,7 +35,7 @@ jQuery( function ( $ ) { // Tabbed Panels $( document.body ).on( 'wc-init-tabbed-panels', function() { $( 'ul.wc-tabs' ).show(); - $( 'ul.wc-tabs a' ).click( function( e ) { + $( 'ul.wc-tabs a' ).on( 'click', function( e ) { e.preventDefault(); var panel_wrap = $( this ).closest( 'div.panel-wrap' ); $( 'ul.wc-tabs li', panel_wrap ).removeClass( 'active' ); diff --git a/assets/js/admin/reports.js b/assets/js/admin/reports.js index f419f16fc03..34ec4ff2be6 100644 --- a/assets/js/admin/reports.js +++ b/assets/js/admin/reports.js @@ -130,7 +130,7 @@ jQuery(function( $ ) { } // Export - $( '.export_csv' ).click( function() { + $( '.export_csv' ).on( 'click', function() { var exclude_series = $( this ).data( 'exclude_series' ) || ''; exclude_series = exclude_series.toString(); exclude_series = exclude_series.split( ',' ); diff --git a/assets/js/admin/settings.js b/assets/js/admin/settings.js index 5ad5e4e02c9..88a924b8384 100644 --- a/assets/js/admin/settings.js +++ b/assets/js/admin/settings.js @@ -80,7 +80,7 @@ } }); - $( '.submit :input' ).click( function() { + $( '.submit :input' ).on( 'click', function() { window.onbeforeunload = ''; }); }); diff --git a/assets/js/admin/woocommerce_admin.js b/assets/js/admin/woocommerce_admin.js index ecae72492e5..e023ab8ef08 100644 --- a/assets/js/admin/woocommerce_admin.js +++ b/assets/js/admin/woocommerce_admin.js @@ -235,7 +235,7 @@ $( this ).focus(); } ); - $( '.wc_input_table .remove_rows' ).click( function() { + $( '.wc_input_table .remove_rows' ).on( 'click', function() { var $tbody = $( this ).closest( '.wc_input_table' ).find( 'tbody' ); if ( $tbody.find( 'tr.current' ).length > 0 ) { var $current = $tbody.find( 'tr.current' ); diff --git a/assets/js/frontend/woocommerce.js b/assets/js/frontend/woocommerce.js index 8c0414fff1b..23ebef51c21 100644 --- a/assets/js/frontend/woocommerce.js +++ b/assets/js/frontend/woocommerce.js @@ -25,7 +25,7 @@ jQuery( function( $ ) { } // Set a cookie and hide the store notice when the dismiss button is clicked - $( '.woocommerce-store-notice__dismiss-link' ).click( function( event ) { + $( '.woocommerce-store-notice__dismiss-link' ).on( 'click', function( event ) { Cookies.set( cookieName, 'hidden', { path: '/' } ); $( '.woocommerce-store-notice' ).hide(); event.preventDefault(); diff --git a/includes/admin/class-wc-admin-attributes.php b/includes/admin/class-wc-admin-attributes.php index 9dc884fe9e9..bd772f1c34f 100644 --- a/includes/admin/class-wc-admin-attributes.php +++ b/includes/admin/class-wc-admin-attributes.php @@ -462,7 +462,7 @@ class WC_Admin_Attributes { Date: Sat, 5 Dec 2020 20:30:42 -0700 Subject: [PATCH 063/144] Code review feedback--moving statuses to config values --- tests/e2e/core-tests/specs/index.js | 6 +- .../wp-admin-order-status-filter.test.js | 108 ------------ .../wp-admin-order-status-filters.test.js | 160 ++++++++++++++++++ tests/e2e/env/config/default.json | 9 + .../wp-admin/test-order-status-filters.js | 6 + 5 files changed, 178 insertions(+), 111 deletions(-) delete mode 100644 tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filter.test.js create mode 100644 tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js create mode 100644 tests/e2e/specs/wp-admin/test-order-status-filters.js diff --git a/tests/e2e/core-tests/specs/index.js b/tests/e2e/core-tests/specs/index.js index 256c87a4dba..b404e8bf19d 100644 --- a/tests/e2e/core-tests/specs/index.js +++ b/tests/e2e/core-tests/specs/index.js @@ -21,7 +21,7 @@ const { runAddSimpleProductTest, runAddVariableProductTest } = require( './merch const runUpdateGeneralSettingsTest = require( './merchant/wp-admin-settings-general.test' ); const runProductSettingsTest = require( './merchant/wp-admin-settings-product.test' ); const runTaxSettingsTest = require( './merchant/wp-admin-settings-tax.test' ); -const runOrderStatusFilterTest = require( './merchant/wp-admin-order-status-filter.test' ); +const runOrderStatusFiltersTest = require( './merchant/wp-admin-order-status-filters.test' ); const runSetupOnboardingTests = () => { runActivationTest(); @@ -45,7 +45,7 @@ const runMerchantTests = () => { runUpdateGeneralSettingsTest(); runProductSettingsTest(); runTaxSettingsTest(); - runOrderStatusFilterTest(); + runOrderStatusFiltersTest(); } module.exports = { @@ -66,6 +66,6 @@ module.exports = { runUpdateGeneralSettingsTest, runProductSettingsTest, runTaxSettingsTest, - runOrderStatusFilterTest, + runOrderStatusFiltersTest, runMerchantTests, }; diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filter.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filter.test.js deleted file mode 100644 index 4f69df2a236..00000000000 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filter.test.js +++ /dev/null @@ -1,108 +0,0 @@ -/* eslint-disable jest/no-export, jest/no-disabled-tests */ -/** - * Internal dependencies - */ -const { - StoreOwnerFlow, - createSimpleOrder, - clickFilter, - moveAllItemsToTrash, -} = require( '@woocommerce/e2e-utils' ); - -let statusColumnTextSelector = 'mark.order-status > span'; - -const runOrderFiltersTest = () => { - describe('WooCommerce Orders > Filter Orders by Status', () => { - beforeAll(async () => { - // First, let's login - await StoreOwnerFlow.login(); - - // Next, let's create some orders we can filter against - await createSimpleOrder('Pending payment'); - await createSimpleOrder('Processing'); - await createSimpleOrder('Completed'); - await createSimpleOrder('Cancelled'); - await createSimpleOrder('Refunded'); - }); - - afterAll( async () => { - // Make sure we're on the all orders view and cleanup the orders we created - await StoreOwnerFlow.openAllOrdersView(); - await moveAllItemsToTrash(); - }); - - it('should filter by Pending payment', async () => { - await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-pending'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - - // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - }); - - it('should filter by Processing', async () => { - await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-processing'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - - // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - }); - - it('should filter by Completed', async () => { - await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-completed'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - - // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - }); - - it('should filter by Cancelled', async () => { - await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-cancelled'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - - // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - }); - - it('should filter by Refunded', async () => { - await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-refunded'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - - // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - await expect(page).not.toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - }); - - it('should filter by All', async () => { - await StoreOwnerFlow.openAllOrdersView(); - // Make sure all the order statuses that were created show in this list - await clickFilter('.all'); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Pending payment'}); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Processing'}); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Completed'}); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Cancelled'}); - await expect(page).toMatchElement(statusColumnTextSelector, {text: 'Refunded'}); - }); - - }); -}; - -module.exports = runOrderFiltersTest; diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js new file mode 100644 index 00000000000..80f0099a3d9 --- /dev/null +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js @@ -0,0 +1,160 @@ +/* eslint-disable jest/no-export, jest/no-disabled-tests */ +/** + * Internal dependencies + */ +const { + StoreOwnerFlow, + createSimpleOrder, + clickFilter, + moveAllItemsToTrash, +} = require( '@woocommerce/e2e-utils' ); + +const statusColumnTextSelector = 'mark.order-status > span'; + +// Order Statuses to filter against +const config = require( 'config' ); +const pendingPayment = config.get( 'orderstatuses.pendingpayment' ); +const processing = config.get( 'orderstatuses.processing' ); +const onHold = config.get( 'orderstatuses.onhold' ); +const completed = config.get( 'orderstatuses.completed' ); +const cancelled = config.get( 'orderstatuses.cancelled' ); +const refunded = config.get( 'orderstatuses.refunded' ); +const failed = config.get( 'orderstatuses.failed' ); + +const runOrderStatusFiltersTest = () => { + describe('WooCommerce Orders > Filter Orders by Status', () => { + beforeAll(async () => { + // First, let's login + await StoreOwnerFlow.login(); + + // Next, let's create some orders we can filter against + await createSimpleOrder(pendingPayment); + await createSimpleOrder(processing); + await createSimpleOrder(onHold); + await createSimpleOrder(completed); + await createSimpleOrder(cancelled); + await createSimpleOrder(refunded); + await createSimpleOrder(failed); + }, 40000); + + afterAll( async () => { + // Make sure we're on the all orders view and cleanup the orders we created + await StoreOwnerFlow.openAllOrdersView(); + await moveAllItemsToTrash(); + }); + + it('should filter by Pending payment', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-pending'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by Processing', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-processing'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: processing }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by On hold', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-on-hold'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: onHold }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by Completed', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-completed'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: completed }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by Cancelled', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-cancelled'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: cancelled }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by Refunded', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-refunded'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: refunded }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + it('should filter by Failed', async () => { + await StoreOwnerFlow.openAllOrdersView(); + await clickFilter('.wc-failed'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: failed }); + + // Verify other statuses don't show + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + }); + + it('should filter by All', async () => { + await StoreOwnerFlow.openAllOrdersView(); + // Make sure all the order statuses that were created show in this list + await clickFilter('.all'); + await expect(page).toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: processing }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: completed }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: cancelled }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: refunded }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).toMatchElement(statusColumnTextSelector, { text: failed }); + }); + + }); +}; + +module.exports = runOrderStatusFiltersTest; diff --git a/tests/e2e/env/config/default.json b/tests/e2e/env/config/default.json index 19693eece88..0f5fb666016 100644 --- a/tests/e2e/env/config/default.json +++ b/tests/e2e/env/config/default.json @@ -71,5 +71,14 @@ "zoneregions": "United States (US)", "shippingmethod": "Free shipping" } + }, + "orderstatuses": { + "pendingpayment": "Pending payment", + "processing": "Processing", + "onhold": "On hold", + "completed": "Completed", + "cancelled": "Cancelled", + "refunded": "Refunded", + "failed": "Failed" } } diff --git a/tests/e2e/specs/wp-admin/test-order-status-filters.js b/tests/e2e/specs/wp-admin/test-order-status-filters.js new file mode 100644 index 00000000000..5de9b3c2a50 --- /dev/null +++ b/tests/e2e/specs/wp-admin/test-order-status-filters.js @@ -0,0 +1,6 @@ +/* + * Internal dependencies + */ +const { runOrderStatusFiltersTest } = require( '@woocommerce/e2e-core-tests' ); + +runOrderStatusFiltersTest(); From 6208fc3d2707b53fad3d1141d6b44439ff752572 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 8 Dec 2020 15:18:54 +0000 Subject: [PATCH 064/144] Update WooCommerce Blocks package to 4.0.0 --- bin/composer/mozart/composer.lock | 33 +++++++- bin/composer/phpcs/composer.lock | 32 +++++++- bin/composer/phpunit/composer.lock | 118 ++++++++++++++++++++++++++++- bin/composer/wp/composer.lock | 52 +++++++++++-- composer.json | 2 +- composer.lock | 18 +++-- 6 files changed, 238 insertions(+), 17 deletions(-) diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index 40df149d2ef..620e50a2a59 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -32,6 +32,7 @@ "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, + "default-branch": true, "bin": [ "bin/mozart" ], @@ -52,6 +53,10 @@ } ], "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/master" + }, "funding": [ { "url": "https://github.com/coenjacobs", @@ -142,6 +147,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.0.70" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -197,6 +206,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -269,6 +282,9 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v4.4.17" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -327,6 +343,9 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v4.4.17" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -404,6 +423,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -480,6 +502,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -560,6 +585,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -636,6 +664,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -665,5 +696,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 9eee228d3be..363928fcb9a 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -71,6 +71,10 @@ "stylecheck", "tests" ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -129,6 +133,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -181,6 +189,10 @@ "polyfill", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, "time": "2019-11-04T15:17:54+00:00" }, { @@ -231,6 +243,10 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, "time": "2019-08-28T14:22:28+00:00" }, { @@ -282,6 +298,11 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2020-10-23T02:01:07+00:00" }, { @@ -322,6 +343,10 @@ "woocommerce", "wordpress" ], + "support": { + "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", + "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master" + }, "time": "2020-08-06T18:23:45+00:00" }, { @@ -368,6 +393,11 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -381,5 +411,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index fe2ac4e1b6d..0f86a7f43fe 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -59,6 +59,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/master" + }, "time": "2015-06-14T21:17:01+00:00" }, { @@ -104,6 +108,10 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + }, "time": "2017-10-19T19:58:43+00:00" }, { @@ -159,6 +167,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, "time": "2017-03-05T18:14:27+00:00" }, { @@ -206,6 +218,10 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, "time": "2017-03-05T17:38:23+00:00" }, { @@ -260,6 +276,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, "time": "2017-09-11T18:02:19+00:00" }, { @@ -312,6 +332,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -357,6 +381,10 @@ "email": "me@mikevanriel.com" } ], + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + }, "time": "2017-12-30T13:23:38+00:00" }, { @@ -420,6 +448,10 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -483,6 +515,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/5.3" + }, "time": "2018-04-06T15:36:58+00:00" }, { @@ -530,6 +566,11 @@ "filesystem", "iterator" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + }, "time": "2017-11-27T13:52:08+00:00" }, { @@ -571,6 +612,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -620,6 +665,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -669,6 +718,10 @@ "keywords": [ "tokenizer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, "abandoned": true, "time": "2017-11-27T05:48:46+00:00" }, @@ -754,6 +807,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/6.5.14" + }, "time": "2019-02-01T05:22:47+00:00" }, { @@ -813,6 +870,10 @@ "mock", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/5.0.10" + }, "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, @@ -859,6 +920,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -929,6 +994,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, "time": "2018-02-01T13:46:46+00:00" }, { @@ -981,6 +1050,10 @@ "keywords": [ "diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, "time": "2017-08-03T08:09:46+00:00" }, { @@ -1031,6 +1104,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/master" + }, "time": "2017-07-01T08:51:00+00:00" }, { @@ -1098,6 +1175,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1155,6 +1236,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1202,6 +1287,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1253,6 +1342,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1312,6 +1405,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1360,6 +1457,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + }, "time": "2015-07-28T20:34:47+00:00" }, { @@ -1403,6 +1504,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -1465,6 +1570,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1519,6 +1627,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -1568,6 +1680,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1581,5 +1697,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index f35d6aacefa..ed08b92c203 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -67,6 +67,11 @@ "po", "translation" ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Gettext/issues", + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.3" + }, "time": "2020-11-18T22:35:49+00:00" }, { @@ -128,6 +133,10 @@ "translations", "unicode" ], + "support": { + "issues": "https://github.com/php-gettext/Languages/issues", + "source": "https://github.com/php-gettext/Languages/tree/2.6.0" + }, "time": "2019-11-13T10:30:21+00:00" }, { @@ -173,6 +182,10 @@ } ], "description": "Peast is PHP library that generates AST for JavaScript code", + "support": { + "issues": "https://github.com/mck89/peast/issues", + "source": "https://github.com/mck89/peast/tree/v1.11.0" + }, "time": "2020-10-09T15:12:13+00:00" }, { @@ -219,6 +232,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/master" + }, "time": "2019-11-23T21:40:31+00:00" }, { @@ -268,6 +285,10 @@ "iri", "sockets" ], + "support": { + "issues": "https://github.com/rmccue/Requests/issues", + "source": "https://github.com/rmccue/Requests/tree/master" + }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -317,20 +338,23 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/3.3" + }, "time": "2017-06-01T21:01:25+00:00" }, { "name": "wp-cli/i18n-command", - "version": "v2.2.5", + "version": "v2.2.6", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "b02ecdc9a57f9633740c254d19749118b7411f0f" + "reference": "a66da3f09f6a728832381012848c3074bf1635c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/b02ecdc9a57f9633740c254d19749118b7411f0f", - "reference": "b02ecdc9a57f9633740c254d19749118b7411f0f", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/a66da3f09f6a728832381012848c3074bf1635c8", + "reference": "a66da3f09f6a728832381012848c3074bf1635c8", "shasum": "" }, "require": { @@ -374,7 +398,11 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", - "time": "2020-07-08T15:20:38+00:00" + "support": { + "issues": "https://github.com/wp-cli/i18n-command/issues", + "source": "https://github.com/wp-cli/i18n-command/tree/v2.2.6" + }, + "time": "2020-12-07T19:28:27+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -422,6 +450,9 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -472,6 +503,10 @@ "cli", "console" ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/master" + }, "time": "2018-09-04T13:28:00+00:00" }, { @@ -534,6 +569,11 @@ "cli", "wordpress" ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, "time": "2020-02-18T08:15:37+00:00" } ], @@ -547,5 +587,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/composer.json b/composer.json index fbe002c7e07..ba50c64da3b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", "woocommerce/woocommerce-admin": "1.7.3", - "woocommerce/woocommerce-blocks": "3.8.1" + "woocommerce/woocommerce-blocks": "4.0.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4" diff --git a/composer.lock b/composer.lock index 708fff2b4b7..d86fc5d8f7a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "77e54b85eedb5be94edbd73cf5436900", + "content-hash": "49f95ee6d40261f4e337506c1b86353c", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -531,16 +531,16 @@ }, { "name": "woocommerce/woocommerce-blocks", - "version": "v3.8.1", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git", - "reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c" + "reference": "f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/e5aef9eddd13c5511ba673eb70ed8cb3e80d828c", - "reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c", + "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e", + "reference": "f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e", "shasum": "" }, "require": { @@ -574,7 +574,11 @@ "gutenberg", "woocommerce" ], - "time": "2020-11-23T20:48:39+00:00" + "support": { + "issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues", + "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v4.0.0" + }, + "time": "2020-12-08T13:17:01+00:00" } ], "packages-dev": [ @@ -637,5 +641,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } From 03c612b4730010f58c3cfd62a4d5c52cb43b9af0 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 8 Dec 2020 09:58:37 -0800 Subject: [PATCH 065/144] Added 4.8.0 changelog and updated stable tag --- changelog.txt | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 2 +- 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 4d9eb5dce3c..39107c360d9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,118 @@ == Changelog == += 4.8.0 - 2020-12-08 = + +**WooCommerce** + +* Enhancement - Limited the system status report's "not tested with version" warning to major versions. #28114 +* Enhancement - Add shipping, tax, and fee lines to refund REST API response. #28241 +* Enhancement - Added support for Twenty Twenty-One theme. #28134 +* Tweak - Reduced the memory usage of AJAX product searches. #28177 +* Tweak - Replaced deprecated jQuery functionality. #28005, #28058 +* Tweak - Hid "Add to cart" button for out of stock grouped products. #28169 +* Tweak - Made product date deserialization more explicit. #28052 +* Fix - Stock adjustment when deleting a refunded order item. #28069 +* Fix - Avatar display for recent reviews widget in admin area. #28067 +* Fix - Incorrect product sorting user capability. #28062 +* Fix - PayPal response emptying uninitialized cart. #28027 +* Fix - Display of visual feedback after pressing "Place Order" in `Twenty Twenty` and `Twenty Nineteen` themes #27997 +* Fix - Category and tag bulk deletion message. #27856 +* Fix - Corrected Puerto Rico address validation. #28465 +* Dev - Filter: `woocommerce_product_has_options` to products. #27514 +* Dev - Added error message to `checkout_error` JS event. #28101 +* Dev - Replaced usage of deprecated `woocommerce_reset_loop()` in product category shortcodes. #28242 +* Dev - Set "Tested up to" header to WordPress 5.6. #28388 +* Localization - Jamaican currency, states, and address structure. #27723 +* Localization - Better display of inclusive taxes during checkout. #28064 +* Localization - Validation for Belgium postcodes. #28145 + +**WooCommerce Admin - 1.7.0 & 1.7.1 & 1.7.2 & 1.7.3** + +* Enhancement - Variations report. #5167 +* Enhancement - Add ability to toggle homescreen layouts. #5429 +* Enhancement - Accordion component #5474 +* Enhancement - Badge component #5520 +* Tweak - Remove customer analytics data upon order deletion #5171 +* Tweak - Updating Stripe key field validation to support test keys #5201 +* Tweak - Wrap search control selected items in list #5231 +* Tweak - Update store setup link to redirect to setup wizard #5200 +* Tweak - Removing breadcrumbs from wc-admin header #5232 +* Tweak - Use consistent markdown headers in navigation readme #5417 +* Tweak - Remove Store Setup Alert #5499 +* Tweak - Customers: Update column heading for date registered #5542 +* Tweak - alter homescreen layout. #5465 +* Fix - Added support for custom actionable statuses. #5550 +* Fix - wrong casing used on the PayPal brand name #5514 🎉 @rtpHarry +* Fix - Import @wordpress/base-styles/default-custom-properties #5491 +* Fix - downloads report #5441 +* Fix - missing custom autocompleter attribute in Search component of Advanced Filter #5448 +* Fix - empty no posts state on Marketing page. #5411 +* Fix - visual issues in the Search component. #5199 +* Fix - Inconsistent line endings in readme.txt. #5281 +* Fix - popover menu to expand menu item width to 100% #5519 +* Fix - Wrong class name for querying Categories Report #5522 🎉 @zzap +* Fix - Remove label printing mention for non us countries #5527 +* Fix - First product script navigation dependency #5584 +* Fix - Added support for custom actionable statuses #5550 +* Fix - Display the store management links last on the homescreen #5579 +* Fix - Ensure the "Set up additional payment providers" inbox notification is shown when relevant after completing the OBW. #5547 +* Fix - Load wc-tracks in the homepage notice admin script. #5638 +* Fix - Link component prop caused a React warning. #5653 +* Fix - Flickering of order panel while loading. #5655 +* Fix - Tax code duplicated when clicking the button to remove. #5638 +* Fix - Restore Autoloading of WooCommerce Classes in PHP Tests. #5650 +* Fix - Skip WC Payment plugin note if plugin not added through the onboarding process. #5619 +* Fix - Use error_log() to log the deprecated class calls instead of `_deprecated_function()`. #5802 +* Fix - Don't show the Orders panel on the homescreen with the Task List. #5552 +* Fix - Home Screen: Do not show store setup activity panel. #5801 +* Dev - Home Screen - migrate orders panel. #5455 +* Dev - Store Profiler - include Creative Mail as a free extension #5543 +* Dev - Add undefined check in intervals data util #5546 +* Dev - Fix wakeup visibility for PHP 8 compatibility #5211 +* Dev - Fix header height and positioning for wc nav #5173 +* Dev - Add remote inbox notification rule processors for country and state #5203 +* Dev - Rename admin notes classes and file names to fit conventions #514 +* Dev - remove checks of store registration that are no longer needed. #5170 +* Dev - Fix version update script for composer.json #5165 +* Dev - Remove getAdminLink from data package #5158 +* Dev - Bump @woocommerce/components dependencies. #5153 +* Dev - Add note status remote inbox notifications rule processor #5207 +* Dev - Make code chunk filenames more stable. #5229 +* Dev - Inbox Panel component moved #5252 +* Dev - Added animation to Inbox note deletion #5263 +* Dev - Update starter pack dependencies #5254 +* Dev - Ensure test zips have latest packages from npm and composer. #5313 +* Dev - Add remote inbox notifications rule allowing access to any option #5206 +* Dev - Add manage orders on the go admin note #5159 +* Dev - Add WooCommerceDependencyExtractionWebpackPlugin package #5198 +* Dev - Migrate devdocs examples to Storybook stories #5271 +* Dev - Remove Enzyme in favor of React Testing Library #5299 +* Dev - Add exclusion rule to PHPCS config for TODO comments #5388 +* Dev - Remove no longer used isPanelEmpty logic. #5423 +* Dev - Use new @wordpress/components Card on Marketing page. #5428 +* Dev - Add PSR-4 naming checks to PHP linting. #5512 +* Dev - Rearrange the store management links under categories add filter woocommerce_admin_homescreen_quicklinks. #5476 +* Dev - Restyle the setup task list header to display incomplete tasks #5520 + +**WooCommerce Blocks - 3.7.0 & 3.7.1 & 3.8.0 & 3.8.1** + +* Enhancement - Allow shoppers to sign-up for an account from the Checkout block. #3331 +* Enhancement - Standardise & refactor colors scss to align with Gutenberg colors and WooCommerce brand. #3300 +* Tweak - Show the phone number field in the billing section when shipping is disabled in settings. #3376 +* Tweak - Add new doc referencing feature flags and experimental interfaces. #3348 +* Tweak - Add __experimental_woocommerce_blocks_checkout_order_processed action. #3238 +* Fix - Fix PHP 8 error when argument is not invocable in AssetsDataRegistry::Add_data. #3315 +* Fix - Improve layout of Cart block line item quantity selector & price on smaller screens. #3299 +* Fix - Correctly process orders with $0 total (e.g. via coupon) in Checkout block. #3298 +* Fix - Respect Enable Taxes setting for checkout block taxes display. #3291 +* Fix - Fix 3D secure payment errors. #3272 +* Fix - Show current selected attributes when re-edit Products by Attribute block. #3185 +* Fix - Ensure that accounts are not created via checkout block request if account registration is disabled for WooCommerce. #3371 +* Fix - radio controls and checkboxes in Twenty Twenty One dark theme. #3446 +* Fix - Twenty Twenty One Price filter, Active filters and radio control styling. #3444 +* Fix - Twenty Twenty One Button and Placeholder Styling. #3443 +* Fix - checkbox and textarea styles in Twenty Twenty One when it has dark controls active. #3450 + = 4.7.1 - 2020-11-24 = **WooCommerce** diff --git a/readme.txt b/readme.txt index 12833f7d8bc..62267eeb801 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: e-commerce, store, sales, sell, woo, shop, cart, checkout, downloadable, d Requires at least: 5.3 Tested up to: 5.6 Requires PHP: 7.0 -Stable tag: 4.6.2 +Stable tag: 4.8.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html From 8821bf41c519065cef192717a9458999f6479784 Mon Sep 17 00:00:00 2001 From: jlavoie13 Date: Fri, 6 Nov 2020 11:37:56 -0500 Subject: [PATCH 066/144] pass email object to header and footer templates --- includes/class-wc-emails.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/class-wc-emails.php b/includes/class-wc-emails.php index e4aeb5c185d..36cefe958e2 100644 --- a/includes/class-wc-emails.php +++ b/includes/class-wc-emails.php @@ -190,7 +190,7 @@ class WC_Emails { $this->init(); // Email Header, Footer and content hooks. - add_action( 'woocommerce_email_header', array( $this, 'email_header' ) ); + add_action( 'woocommerce_email_header', array( $this, 'email_header' ), 10, 2 ); add_action( 'woocommerce_email_footer', array( $this, 'email_footer' ) ); add_action( 'woocommerce_email_order_details', array( $this, 'order_downloads' ), 10, 4 ); add_action( 'woocommerce_email_order_details', array( $this, 'order_details' ), 10, 4 ); @@ -264,16 +264,19 @@ class WC_Emails { * Get the email header. * * @param mixed $email_heading Heading for the email. + * @param WC_Email $email Email object for the email. */ - public function email_header( $email_heading ) { - wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) ); + public function email_header( $email_heading, $email ) { + wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'email' => $email ) ); } /** * Get the email footer. + * + * @param WC_Email $email Email object for the email. */ - public function email_footer() { - wc_get_template( 'emails/email-footer.php' ); + public function email_footer( $email ) { + wc_get_template( 'emails/email-footer.php', array( 'email' => $email ) ); } /** From 27f9f1304ce307b17de7f18f09b7e79277955980 Mon Sep 17 00:00:00 2001 From: jlavoie13 Date: Fri, 13 Nov 2020 13:42:52 -0500 Subject: [PATCH 067/144] phpcs fixes --- includes/class-wc-emails.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-emails.php b/includes/class-wc-emails.php index 36cefe958e2..338c8caff18 100644 --- a/includes/class-wc-emails.php +++ b/includes/class-wc-emails.php @@ -263,11 +263,17 @@ class WC_Emails { /** * Get the email header. * - * @param mixed $email_heading Heading for the email. - * @param WC_Email $email Email object for the email. + * @param mixed $email_heading Heading for the email. + * @param WC_Email $email Email object for the email. */ public function email_header( $email_heading, $email ) { - wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'email' => $email ) ); + wc_get_template( + 'emails/email-header.php', + array( + 'email_heading' => $email_heading, + 'email' => $email, + ) + ); } /** From 1dfedf425cca28b49aace01739128fce850a88f8 Mon Sep 17 00:00:00 2001 From: zhongruige Date: Tue, 8 Dec 2020 15:09:23 -0700 Subject: [PATCH 068/144] Code review feedback--setting the consts in the test itself --- .../wp-admin-order-status-filters.test.js | 180 ++++++++++-------- tests/e2e/env/config/default.json | 9 - 2 files changed, 101 insertions(+), 88 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js index 80f0099a3d9..5cf69225996 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-status-filters.test.js @@ -11,15 +11,37 @@ const { const statusColumnTextSelector = 'mark.order-status > span'; -// Order Statuses to filter against -const config = require( 'config' ); -const pendingPayment = config.get( 'orderstatuses.pendingpayment' ); -const processing = config.get( 'orderstatuses.processing' ); -const onHold = config.get( 'orderstatuses.onhold' ); -const completed = config.get( 'orderstatuses.completed' ); -const cancelled = config.get( 'orderstatuses.cancelled' ); -const refunded = config.get( 'orderstatuses.refunded' ); -const failed = config.get( 'orderstatuses.failed' ); +// Define order statuses to filter against +const orderStatus = { + pending: { + name: 'wc-pending', + description: { text: 'Pending payment' }, + }, + processing: { + name: 'wc-processing', + description: { text: 'Processing' }, + }, + onHold: { + name: 'wc-on-hold', + description: { text: 'On hold' }, + }, + completed: { + name: 'wc-completed', + description: { text: 'Completed' }, + }, + cancelled: { + name: 'wc-cancelled', + description: { text: 'Cancelled' }, + }, + refunded: { + name: 'wc-refunded', + description: { text: 'Refunded' }, + }, + failed: { + name: 'wc-failed', + description: { text: 'Failed' }, + } +}; const runOrderStatusFiltersTest = () => { describe('WooCommerce Orders > Filter Orders by Status', () => { @@ -28,13 +50,13 @@ const runOrderStatusFiltersTest = () => { await StoreOwnerFlow.login(); // Next, let's create some orders we can filter against - await createSimpleOrder(pendingPayment); - await createSimpleOrder(processing); - await createSimpleOrder(onHold); - await createSimpleOrder(completed); - await createSimpleOrder(cancelled); - await createSimpleOrder(refunded); - await createSimpleOrder(failed); + await createSimpleOrder(orderStatus.pending.description.text); + await createSimpleOrder(orderStatus.processing.description.text); + await createSimpleOrder(orderStatus.onHold.description.text); + await createSimpleOrder(orderStatus.completed.description.text); + await createSimpleOrder(orderStatus.cancelled.description.text); + await createSimpleOrder(orderStatus.refunded.description.text); + await createSimpleOrder(orderStatus.failed.description.text); }, 40000); afterAll( async () => { @@ -45,113 +67,113 @@ const runOrderStatusFiltersTest = () => { it('should filter by Pending payment', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-pending'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: pendingPayment }); + await clickFilter('.' + orderStatus.pending.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.pending.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by Processing', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-processing'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: processing }); + await clickFilter('.' + orderStatus.processing.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.processing.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by On hold', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-on-hold'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: onHold }); + await clickFilter('.' + orderStatus.onHold.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by Completed', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-completed'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: completed }); + await clickFilter('.' + orderStatus.completed.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.completed.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by Cancelled', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-cancelled'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: cancelled }); + await clickFilter('.' + orderStatus.cancelled.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by Refunded', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-refunded'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: refunded }); + await clickFilter('.' + orderStatus.refunded.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); it('should filter by Failed', async () => { await StoreOwnerFlow.openAllOrdersView(); - await clickFilter('.wc-failed'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: failed }); + await clickFilter('.' + orderStatus.failed.name); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.failed.description); // Verify other statuses don't show - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).not.toMatchElement(statusColumnTextSelector, { text: onHold }); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).not.toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); }); it('should filter by All', async () => { await StoreOwnerFlow.openAllOrdersView(); // Make sure all the order statuses that were created show in this list await clickFilter('.all'); - await expect(page).toMatchElement(statusColumnTextSelector, { text: pendingPayment }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: processing }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: completed }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: cancelled }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: refunded }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: onHold }); - await expect(page).toMatchElement(statusColumnTextSelector, { text: failed }); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.pending.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.processing.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.completed.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.cancelled.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.refunded.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.onHold.description); + await expect(page).toMatchElement(statusColumnTextSelector, orderStatus.failed.description); }); }); diff --git a/tests/e2e/env/config/default.json b/tests/e2e/env/config/default.json index 0f5fb666016..19693eece88 100644 --- a/tests/e2e/env/config/default.json +++ b/tests/e2e/env/config/default.json @@ -71,14 +71,5 @@ "zoneregions": "United States (US)", "shippingmethod": "Free shipping" } - }, - "orderstatuses": { - "pendingpayment": "Pending payment", - "processing": "Processing", - "onhold": "On hold", - "completed": "Completed", - "cancelled": "Cancelled", - "refunded": "Refunded", - "failed": "Failed" } } From e6a7f0f40a561dd5a9f0b8c25bd1921ec9953989 Mon Sep 17 00:00:00 2001 From: Gary Cao Date: Thu, 10 Dec 2020 15:21:34 +0900 Subject: [PATCH 069/144] Fix Unknown named parameter error on PHP 8 --- includes/class-wc-install.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 7419ae0ea7f..f79bfdafda7 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -221,16 +221,17 @@ class WC_Install { /** * Run an update callback when triggered by ActionScheduler. * + * @param string $update_callback Callback name. + * * @since 3.6.0 - * @param string $callback Callback name. */ - public static function run_update_callback( $callback ) { + public static function run_update_callback( $update_callback ) { include_once dirname( __FILE__ ) . '/wc-update-functions.php'; - if ( is_callable( $callback ) ) { - self::run_update_callback_start( $callback ); - $result = (bool) call_user_func( $callback ); - self::run_update_callback_end( $callback, $result ); + if ( is_callable( $update_callback ) ) { + self::run_update_callback_start( $update_callback ); + $result = (bool) call_user_func( $update_callback ); + self::run_update_callback_end( $update_callback, $result ); } } From 135294dfdd2369ed6b2cbee4dbe5c1c00ddebc50 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Thu, 10 Dec 2020 09:46:24 +0100 Subject: [PATCH 070/144] Removed GB from EU VAT zone. --- includes/class-wc-countries.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index 8989bd422a1..c7304d4e47f 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -359,8 +359,6 @@ class WC_Countries { if ( 'eu_vat' === $type ) { $countries[] = 'MC'; $countries[] = 'IM'; - // The UK is still part of the EU VAT zone. - $countries[] = 'GB'; } return apply_filters( 'woocommerce_european_union_countries', $countries, $type ); From 60e8082398fb663f26e5984b3c82a1452ab615b8 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Thu, 10 Dec 2020 09:59:26 +0100 Subject: [PATCH 071/144] Isle of Man will probably also stop being part of EU VAT area. --- includes/class-wc-countries.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index c7304d4e47f..91c7b691fbc 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -358,7 +358,6 @@ class WC_Countries { if ( 'eu_vat' === $type ) { $countries[] = 'MC'; - $countries[] = 'IM'; } return apply_filters( 'woocommerce_european_union_countries', $countries, $type ); From 5554f9c6f9fa3fd2e5953911aaa263dfcfe76276 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 10 Dec 2020 10:09:02 -0300 Subject: [PATCH 072/144] Revert "Sets Select a country option element value attribute to default." This reverts commit 9faee1d909f81dd027e5ddc1e46a7abff9c0921d as it causes issues during checkout (see #27521). --- includes/wc-template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index cca00d02bd5..a11262df132 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2748,7 +2748,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) { } else { - $field = ''; foreach ( $countries as $ckey => $cvalue ) { $field .= ''; From 93dae948b275b31af606ef88779fb61b8d5cdb4b Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 10 Dec 2020 11:12:39 -0300 Subject: [PATCH 073/144] Add placeholder text to country select field in the checkout page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds the 'Select a country / region...' text as a placeholder text displayed in the country select field indicating to the user that they need to select a country. This is only needed when the option ¨Default customer location" is set to "No location by default". --- includes/wc-template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index a11262df132..3cb0ff50245 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2748,7 +2748,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) { } else { - $field = ''; foreach ( $countries as $ckey => $cvalue ) { $field .= ''; From 2accebdd2e27aabcfabb6ce256ffc1ea40bdf9f3 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 10 Dec 2020 14:26:33 -0300 Subject: [PATCH 074/144] Retry e2e tests automatically in case of failure This commit adds again the Travis function `travis_retry` (https://docs.travis-ci.com/user/common-build-problems/#travis_retry) to all the commands used to execute the E2E tests as they sometimes fail due to factors outside our control and they pass if we retry them manually. See for example this issue for an instance where often times the E2E tests fail, the issue describes a problem that happened in a local environment, but we see the same error happening on Travis as well: https://github.com/woocommerce/woocommerce/issues/27846. I actually just saw it and had to restart a Travis build job manually and that is what prompted me to create this commit. Having Travis retry the command automatically should save us some time when we review PRs as there is a chance the command will pass on a subsequent run and we won't have to retry it manually and wait for it to finish. We have used this function in the past (see 67b5b270f355ed91dac100a028cc8d36b5f6da6e), but it got removed in 1658dd39625751d966e11d5080b88878c57d2c65. But after some conversation about it a couple of weeks ago, we decided to use it again. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 216fb609ea5..ce2355150d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,9 @@ jobs: - npm install - composer install --no-dev script: - - npm run build:assets - - npm run docker:up - - npm run test:e2e + - travis_retry npm run build:assets + - travis_retry npm run docker:up + - travis_retry npm run test:e2e after_script: - npm run docker:down - name: "WP Nightly" From 2caac87d030ce1c76c6191193dc843d012b83ec7 Mon Sep 17 00:00:00 2001 From: zhongruige Date: Thu, 10 Dec 2020 21:27:04 -0700 Subject: [PATCH 075/144] Added new tests for the merchant order refund flow --- tests/e2e/core-tests/CHANGELOG.md | 1 + tests/e2e/core-tests/README.md | 1 + tests/e2e/core-tests/specs/index.js | 3 + .../merchant/wp-admin-order-refund.test.js | 71 +++++++++++++++++++ tests/e2e/specs/wp-admin/test-order-refund.js | 6 ++ tests/e2e/utils/CHANGELOG.md | 5 ++ tests/e2e/utils/README.md | 30 ++++---- tests/e2e/utils/src/components.js | 29 ++++++++ tests/e2e/utils/src/flows.js | 18 +++++ 9 files changed, 150 insertions(+), 14 deletions(-) create mode 100644 tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js create mode 100644 tests/e2e/specs/wp-admin/test-order-refund.js diff --git a/tests/e2e/core-tests/CHANGELOG.md b/tests/e2e/core-tests/CHANGELOG.md index 1a2f57d864e..e7f3b8bc641 100644 --- a/tests/e2e/core-tests/CHANGELOG.md +++ b/tests/e2e/core-tests/CHANGELOG.md @@ -2,6 +2,7 @@ ## Added - Merchant Order Status Filter tests +- Merchant Order Refund tests ## Fixed diff --git a/tests/e2e/core-tests/README.md b/tests/e2e/core-tests/README.md index c90af7e4bf5..1004f2dc48b 100644 --- a/tests/e2e/core-tests/README.md +++ b/tests/e2e/core-tests/README.md @@ -53,6 +53,7 @@ The functions to access the core tests are: - `runProductSettingsTest` - Merchant can update product settings - `runTaxSettingsTest` - Merchant can update tax settings - `runOrderStatusFilterTest` - Merchant can filter orders by order status +- `runOrderRefundTest` - Merchant can refund an order ### Shopper diff --git a/tests/e2e/core-tests/specs/index.js b/tests/e2e/core-tests/specs/index.js index b404e8bf19d..d7f5edd8e4e 100644 --- a/tests/e2e/core-tests/specs/index.js +++ b/tests/e2e/core-tests/specs/index.js @@ -22,6 +22,7 @@ const runUpdateGeneralSettingsTest = require( './merchant/wp-admin-settings-gene const runProductSettingsTest = require( './merchant/wp-admin-settings-product.test' ); const runTaxSettingsTest = require( './merchant/wp-admin-settings-tax.test' ); const runOrderStatusFiltersTest = require( './merchant/wp-admin-order-status-filters.test' ); +const runOrderRefundTest = require( './merchant/wp-admin-order-refund.test' ); const runSetupOnboardingTests = () => { runActivationTest(); @@ -46,6 +47,7 @@ const runMerchantTests = () => { runProductSettingsTest(); runTaxSettingsTest(); runOrderStatusFiltersTest(); + runOrderRefundTest(); } module.exports = { @@ -67,5 +69,6 @@ module.exports = { runProductSettingsTest, runTaxSettingsTest, runOrderStatusFiltersTest, + runOrderRefundTest, runMerchantTests, }; diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js new file mode 100644 index 00000000000..6a875156ba1 --- /dev/null +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js @@ -0,0 +1,71 @@ +/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/no-standalone-expect */ + +/** + * Internal dependencies + */ +const { + StoreOwnerFlow, + createSimpleProduct, + createSimpleOrder, + verifyCheckboxIsSet, + verifyValueOfInputField, + uiUnblocked, + addProductToOrder, +} = require( '@woocommerce/e2e-utils' ); + +const config = require( 'config' ); +const simpleProductName = config.get( 'products.simple.name' ); + +let orderId; + +const runRefundOrderTest = () => { + describe('WooCommerce Orders > Refund an order', () => { + beforeAll(async () => { + await StoreOwnerFlow.login(); + + await createSimpleProduct(); + orderId = await createSimpleOrder(); + await addProductToOrder(orderId, simpleProductName); + + // Update order status to `Completed` so we can issue a refund + await StoreOwnerFlow.updateOrderStatus(orderId, 'Completed'); + }); + + it('can issue a refund by quantity', async () => { + // Click the Refund button + await expect(page).toClick('button.refund-items'); + + // Verify the refund section shows + await page.waitForSelector('div.wc-order-refund-items', { visible: true }); + await verifyCheckboxIsSet('#restock_refunded_items'); + + // Initiate a refund + await expect(page).toFill('.refund_order_item_qty', '1'); + await expect(page).toFill('#refund_reason', 'No longer wanted'); + + await Promise.all([ + verifyValueOfInputField('.refund_line_total', '9.99'), + verifyValueOfInputField('#refund_amount', '9.99'), + expect(page).toMatchElement('.do-manual-refund', { text: 'Refund £9.99 manually' }), + ]); + + await expect(page).toClick('.do-manual-refund'); + + await uiUnblocked(); + + await Promise.all([ + // Verify the product line item shows the refunded quantity and amount + expect(page).toMatchElement('.quantity .refunded', { text: '-1' }), + expect(page).toMatchElement('.line_cost .refunded', { text: '-£9.99' }), + + // Verify the refund shows in the list with the amount + expect(page).toMatchElement('.refund .description', { text: 'No longer wanted' }), + expect(page).toMatchElement('.refund > .line_cost', { text: '-£9.99' }), + ]); + }); + + }); + +}; + +module.exports = runRefundOrderTest; diff --git a/tests/e2e/specs/wp-admin/test-order-refund.js b/tests/e2e/specs/wp-admin/test-order-refund.js new file mode 100644 index 00000000000..5e1d2877bc4 --- /dev/null +++ b/tests/e2e/specs/wp-admin/test-order-refund.js @@ -0,0 +1,6 @@ +/* + * Internal dependencies + */ +const { runOrderRefundTest } = require( '@woocommerce/e2e-core-tests' ); + +runOrderRefundTest(); diff --git a/tests/e2e/utils/CHANGELOG.md b/tests/e2e/utils/CHANGELOG.md index d77108f787d..6396c47f553 100644 --- a/tests/e2e/utils/CHANGELOG.md +++ b/tests/e2e/utils/CHANGELOG.md @@ -9,6 +9,11 @@ - `clickFilter()` util helper method that clicks on a list page filter - `moveAllItemsToTrash()` util helper method that checks every item in a list page and moves them to the trash - `createSimpleOrder( status )` component which accepts an order status string and creates a basic order with that status +- `addProductToOrder( orderId, productName )` component which adds the provided productName to the passed in orderId + +## Changes + +- `createSimpleOrder( status )` returns the ID of the order that was created # 0.1.1 diff --git a/tests/e2e/utils/README.md b/tests/e2e/utils/README.md index 6a31fde72dc..08481e99b8e 100644 --- a/tests/e2e/utils/README.md +++ b/tests/e2e/utils/README.md @@ -38,20 +38,22 @@ describe( 'Cart page', () => { ### Merchant `StoreOwnerFlow` -| Function | Description | -|----------|-------------| -| `login` | Log in as merchant | -| `logout` | log out of merchant account | -| `openAllOrdersView` | Go to the orders listing | -| `openDashboard` | Go to the WordPress dashboard | -| `openNewCoupon` | Go to the new coupon editor | -| `openNewOrder` | Go to the new order editor | -| `openNewProduct` | Go to the new product editor | -| `openPermalinkSettings` | Go to Settings -> Permalinks | -| `openPlugins` | Go to the Plugins screen | -| `openSettings` | Go to WooCommerce -> Settings | -| `runSetupWizard` | Open the onboarding profiler | -|----------|-------------| +| Function | Parameters | Description | +|----------|-------------|------------| +| `login` | | Log in as merchant | +| `logout` | | Log out of merchant account | +| `openAllOrdersView` | | Go to the orders listing | +| `openDashboard` | | Go to the WordPress dashboard | +| `openNewCoupon` | | Go to the new coupon editor | +| `openNewOrder` | | Go to the new order editor | +| `openNewProduct` | | Go to the new product editor | +| `openPermalinkSettings` | | Go to Settings -> Permalinks | +| `openPlugins` | | Go to the Plugins screen | +| `openSettings` | | Go to WooCommerce -> Settings | +| `runSetupWizard` | | Open the onboarding profiler | +| `goToOrder` | `orderId` | Go to view a single order | +| `updateOrderStatus` | `orderId, status` | Update the status of an order | +|----------|-------------|-------------| ### Shopper `CustomerFlow` diff --git a/tests/e2e/utils/src/components.js b/tests/e2e/utils/src/components.js index 4e82df359ae..6f344c9bf87 100644 --- a/tests/e2e/utils/src/components.js +++ b/tests/e2e/utils/src/components.js @@ -368,12 +368,41 @@ const createSimpleOrder = async ( orderStatus = 'Pending payment' ) => { // Verify await expect( page ).toMatchElement( '#message', { text: 'Order updated.' } ); + + const variablePostId = await page.$( '#post_ID' ); + let variablePostIdValue = ( await ( await variablePostId.getProperty( 'value' ) ).jsonValue() ); + return variablePostIdValue; }; +/** + * Adds a product to an order in the StoreOwnerFlow. + * + * @param orderId ID of the order to add the product to. + * @param productName Name of the product being added to the order. + */ +const addProductToOrder = async ( orderId, productName ) => { + await StoreOwnerFlow.goToOrder( orderId ); + + // Add a product to the order + await expect( page ).toClick( 'button.add-line-item' ); + await expect( page ).toClick( 'button.add-order-item' ); + await page.waitForSelector( '.wc-backbone-modal-header' ); + await expect( page ).toClick( '.wc-backbone-modal-content .wc-product-search' ); + await expect( page ).toFill( '#wc-backbone-modal-dialog + .select2-container .select2-search__field', productName ); + await expect( page ).toClick( 'li[aria-selected="true"]' ); + await page.click( '.wc-backbone-modal-content #btn-ok' ); + + await uiUnblocked(); + + // Verify the product we added shows as a line item now + await expect( page ).toMatchElement( '.wc-order-item-name', { text: productName } ); +} + export { completeOnboardingWizard, createSimpleProduct, createVariableProduct, createSimpleOrder, verifyAndPublish, + addProductToOrder, }; diff --git a/tests/e2e/utils/src/flows.js b/tests/e2e/utils/src/flows.js index 94b1340f548..f10109aba8b 100644 --- a/tests/e2e/utils/src/flows.js +++ b/tests/e2e/utils/src/flows.js @@ -25,6 +25,7 @@ const WP_ADMIN_NEW_ORDER = baseUrl + 'wp-admin/post-new.php?post_type=shop_order const WP_ADMIN_NEW_PRODUCT = baseUrl + 'wp-admin/post-new.php?post_type=product'; const WP_ADMIN_WC_SETTINGS = baseUrl + 'wp-admin/admin.php?page=wc-settings&tab='; const WP_ADMIN_PERMALINK_SETTINGS = baseUrl + 'wp-admin/options-permalink.php'; +const WP_ADMIN_SINGLE_CPT_VIEW = ( postId ) => baseUrl + `wp-admin/post.php?post=${ postId }&action=edit`; const SHOP_PAGE = baseUrl + 'shop'; const SHOP_PRODUCT_PAGE = baseUrl + '?p='; @@ -310,6 +311,23 @@ const StoreOwnerFlow = { waitUntil: 'networkidle0', } ); }, + + goToOrder: async ( orderId ) => { + await page.goto( WP_ADMIN_SINGLE_CPT_VIEW( orderId ), { + waitUntil: 'networkidle0', + } ); + }, + + updateOrderStatus: async ( orderId, status ) => { + await page.goto( WP_ADMIN_SINGLE_CPT_VIEW( orderId ), { + waitUntil: 'networkidle0', + } ); + await expect( page ).toSelect( '#order_status', status ); + await page.waitFor( 2000 ); + await expect( page ).toClick( 'button.save_order' ); + await page.waitForSelector( '#message' ); + await expect( page ).toMatchElement( '#message', { text: 'Order updated.' } ); + } }; export { CustomerFlow, StoreOwnerFlow }; From 4ca6114476aaddbd9bda3467654226c02fd21769 Mon Sep 17 00:00:00 2001 From: zhongruige Date: Fri, 11 Dec 2020 09:47:03 -0700 Subject: [PATCH 076/144] Swap out currency symbol --- .../core-tests/specs/merchant/wp-admin-order-refund.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js index 6a875156ba1..a4449afb316 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js @@ -46,7 +46,7 @@ const runRefundOrderTest = () => { await Promise.all([ verifyValueOfInputField('.refund_line_total', '9.99'), verifyValueOfInputField('#refund_amount', '9.99'), - expect(page).toMatchElement('.do-manual-refund', { text: 'Refund £9.99 manually' }), + expect(page).toMatchElement('.do-manual-refund', { text: 'Refund $9.99 manually' }), ]); await expect(page).toClick('.do-manual-refund'); @@ -56,11 +56,11 @@ const runRefundOrderTest = () => { await Promise.all([ // Verify the product line item shows the refunded quantity and amount expect(page).toMatchElement('.quantity .refunded', { text: '-1' }), - expect(page).toMatchElement('.line_cost .refunded', { text: '-£9.99' }), + expect(page).toMatchElement('.line_cost .refunded', { text: '-$9.99' }), // Verify the refund shows in the list with the amount expect(page).toMatchElement('.refund .description', { text: 'No longer wanted' }), - expect(page).toMatchElement('.refund > .line_cost', { text: '-£9.99' }), + expect(page).toMatchElement('.refund > .line_cost', { text: '-$9.99' }), ]); }); From 88ddefbcb329ca9073ad501ded500b45694083c3 Mon Sep 17 00:00:00 2001 From: zhongruige Date: Fri, 11 Dec 2020 10:48:20 -0700 Subject: [PATCH 077/144] Dynamically pull the currency symbol instead of hard-coding it --- .../specs/merchant/wp-admin-order-refund.test.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js index a4449afb316..941fc273407 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js @@ -17,16 +17,21 @@ const config = require( 'config' ); const simpleProductName = config.get( 'products.simple.name' ); let orderId; +let currencySymbol; const runRefundOrderTest = () => { describe('WooCommerce Orders > Refund an order', () => { beforeAll(async () => { await StoreOwnerFlow.login(); - await createSimpleProduct(); orderId = await createSimpleOrder(); await addProductToOrder(orderId, simpleProductName); + // Get the currency symbol for the store's selected currency + await page.waitForSelector('.woocommerce-Price-currencySymbol') + let currencyElement = await page.$('.woocommerce-Price-currencySymbol') + currencySymbol = await page.evaluate(el => el.textContent, currencyElement) + // Update order status to `Completed` so we can issue a refund await StoreOwnerFlow.updateOrderStatus(orderId, 'Completed'); }); @@ -46,7 +51,7 @@ const runRefundOrderTest = () => { await Promise.all([ verifyValueOfInputField('.refund_line_total', '9.99'), verifyValueOfInputField('#refund_amount', '9.99'), - expect(page).toMatchElement('.do-manual-refund', { text: 'Refund $9.99 manually' }), + expect(page).toMatchElement('.do-manual-refund', { text: `Refund ${currencySymbol}9.99 manually` }), ]); await expect(page).toClick('.do-manual-refund'); @@ -56,11 +61,14 @@ const runRefundOrderTest = () => { await Promise.all([ // Verify the product line item shows the refunded quantity and amount expect(page).toMatchElement('.quantity .refunded', { text: '-1' }), - expect(page).toMatchElement('.line_cost .refunded', { text: '-$9.99' }), + expect(page).toMatchElement('.line_cost .refunded', { text: `-${currencySymbol}9.99` }), // Verify the refund shows in the list with the amount expect(page).toMatchElement('.refund .description', { text: 'No longer wanted' }), - expect(page).toMatchElement('.refund > .line_cost', { text: '-$9.99' }), + expect(page).toMatchElement('.refund > .line_cost', { text: `-${currencySymbol}9.99` }), + + // Verify system note was added + expect(page).toMatchElement('.system-note', { text: 'Order status changed from Completed to Refunded.' }), ]); }); From 9d95a21f4882c8234f8074514a7fcfb0cdbbf172 Mon Sep 17 00:00:00 2001 From: zhongruige Date: Fri, 11 Dec 2020 10:54:42 -0700 Subject: [PATCH 078/144] Cleanup unused no-standalone-expect --- .../e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js index 941fc273407..3da8d1d280d 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/no-standalone-expect */ +/* eslint-disable jest/no-export, jest/no-disabled-tests, */ /** * Internal dependencies From 83f327026f9db8c4031bb42c09110637520f872a Mon Sep 17 00:00:00 2001 From: roykho Date: Fri, 11 Dec 2020 12:34:31 -0800 Subject: [PATCH 079/144] Fix error tooltip misaligned on tax country field closes #28260 --- assets/css/admin.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 1b6fbdbe9ae..230d5924400 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -3169,6 +3169,12 @@ table.wc_input_table { } } +table.wc_tax_rates { + td.country { + position: relative; + } +} + table.wc_gateways, table.wc_emails, table.wc_shipping { From 46164b032d36f0e37fc0c01116022bf98b998c5e Mon Sep 17 00:00:00 2001 From: zhongruige Date: Sat, 12 Dec 2020 15:46:13 -0700 Subject: [PATCH 080/144] Add config variable for simple product price and update tests to utilize it --- .../merchant/wp-admin-product-new.test.js | 3 +- .../specs/shopper/front-end-cart.test.js | 29 +++++++++++-------- .../specs/shopper/front-end-checkout.test.js | 20 ++++++++----- tests/e2e/env/config/default.json | 3 +- tests/e2e/utils/src/components.js | 3 +- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js index f345d030d87..cda8b336cfe 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js @@ -19,6 +19,7 @@ const { const config = require( 'config' ); const simpleProductName = config.get( 'products.simple.name' ); +const simpleProductPrice = config.get( 'products.simple.price' ); const verifyPublishAndTrash = async () => { // Wait for auto save @@ -57,7 +58,7 @@ const runAddSimpleProductTest = () => { await expect(page).toFill('#title', simpleProductName); await expect(page).toClick('#_virtual'); await clickTab('General'); - await expect(page).toFill('#_regular_price', '9.99'); + await expect(page).toFill('#_regular_price', simpleProductPrice); // Publish product, verify that it was published. Trash product, verify that it was trashed. await verifyPublishAndTrash( diff --git a/tests/e2e/core-tests/specs/shopper/front-end-cart.test.js b/tests/e2e/core-tests/specs/shopper/front-end-cart.test.js index 75c50895c63..e7e4a5eef70 100644 --- a/tests/e2e/core-tests/specs/shopper/front-end-cart.test.js +++ b/tests/e2e/core-tests/specs/shopper/front-end-cart.test.js @@ -18,6 +18,11 @@ const { beforeAll, } = require( '@jest/globals' ); +const config = require( 'config' ); +const simpleProductName = config.get( 'products.simple.name' ); +const singleProductPrice = config.get( 'products.simple.price' ); +const twoProductPrice = singleProductPrice * 2; + const runCartPageTest = () => { describe('Cart page', () => { beforeAll(async () => { @@ -33,32 +38,32 @@ const runCartPageTest = () => { it('should add the product to the cart when "Add to cart" is clicked', async () => { await CustomerFlow.goToShop(); - await CustomerFlow.addToCartFromShopPage('Simple product'); + await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCart(); - await CustomerFlow.productIsInCart('Simple product'); + await CustomerFlow.productIsInCart(simpleProductName); }); it('should increase item qty when "Add to cart" of the same product is clicked', async () => { await CustomerFlow.goToShop(); - await CustomerFlow.addToCartFromShopPage('Simple product'); + await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCart(); - await CustomerFlow.productIsInCart('Simple product', 2); + await CustomerFlow.productIsInCart(simpleProductName, 2); }); it('should update qty when updated via qty input', async () => { await CustomerFlow.goToCart(); - await CustomerFlow.setCartQuantity('Simple product', 4); + await CustomerFlow.setCartQuantity(simpleProductName, 4); await expect(page).toClick('button', {text: 'Update cart'}); await uiUnblocked(); - await CustomerFlow.productIsInCart('Simple product', 4); + await CustomerFlow.productIsInCart(simpleProductName, 4); }); it('should remove the item from the cart when remove is clicked', async () => { await CustomerFlow.goToCart(); - await CustomerFlow.removeFromCart('Simple product'); + await CustomerFlow.removeFromCart(simpleProductName); await uiUnblocked(); await expect(page).toMatchElement('.cart-empty', {text: 'Your cart is currently empty.'}); @@ -66,17 +71,17 @@ const runCartPageTest = () => { it('should update subtotal in cart totals when adding product to the cart', async () => { await CustomerFlow.goToShop(); - await CustomerFlow.addToCartFromShopPage('Simple product'); + await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCart(); - await CustomerFlow.productIsInCart('Simple product', 1); - await expect(page).toMatchElement('.cart-subtotal .amount', {text: '$9.99'}); + await CustomerFlow.productIsInCart(simpleProductName, 1); + await expect(page).toMatchElement('.cart-subtotal .amount', {text: `$${ singleProductPrice }`}); - await CustomerFlow.setCartQuantity('Simple product', 2); + await CustomerFlow.setCartQuantity(simpleProductName, 2); await expect(page).toClick('button', {text: 'Update cart'}); await uiUnblocked(); - await expect(page).toMatchElement('.cart-subtotal .amount', {text: '$19.98'}); + await expect(page).toMatchElement('.cart-subtotal .amount', {text: `$${ twoProductPrice }`}); }); it('should go to the checkout page when "Proceed to Checkout" is clicked', async () => { diff --git a/tests/e2e/core-tests/specs/shopper/front-end-checkout.test.js b/tests/e2e/core-tests/specs/shopper/front-end-checkout.test.js index 5f95304abf9..24a3f85d197 100644 --- a/tests/e2e/core-tests/specs/shopper/front-end-checkout.test.js +++ b/tests/e2e/core-tests/specs/shopper/front-end-checkout.test.js @@ -14,6 +14,12 @@ const { const config = require( 'config' ); const simpleProductName = config.get( 'products.simple.name' ); +const singleProductPrice = config.get( 'products.simple.price' ); +const twoProductPrice = singleProductPrice * 2; +const threeProductPrice = singleProductPrice * 3; +const fourProductPrice = singleProductPrice * 4; +const fiveProductPrice = singleProductPrice * 5; + let orderId; const runCheckoutPageTest = () => { @@ -74,14 +80,14 @@ const runCheckoutPageTest = () => { await CustomerFlow.goToShop(); await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCheckout(); - await CustomerFlow.productIsInCheckout(simpleProductName, `1`, `9.99`, `9.99`); + await CustomerFlow.productIsInCheckout(simpleProductName, `1`, singleProductPrice, singleProductPrice); }); it('allows customer to choose available payment methods', async () => { await CustomerFlow.goToShop(); await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCheckout(); - await CustomerFlow.productIsInCheckout(simpleProductName, `2`, `19.98`, `19.98`); + await CustomerFlow.productIsInCheckout(simpleProductName, `2`, twoProductPrice, twoProductPrice); await expect(page).toClick('.wc_payment_method label', {text: 'PayPal'}); await expect(page).toClick('.wc_payment_method label', {text: 'Direct bank transfer'}); @@ -92,7 +98,7 @@ const runCheckoutPageTest = () => { await CustomerFlow.goToShop(); await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCheckout(); - await CustomerFlow.productIsInCheckout(simpleProductName, `3`, `29.97`, `29.97`); + await CustomerFlow.productIsInCheckout(simpleProductName, `3`, threeProductPrice, threeProductPrice); await CustomerFlow.fillBillingDetails(config.get('addresses.customer.billing')); }); @@ -100,7 +106,7 @@ const runCheckoutPageTest = () => { await CustomerFlow.goToShop(); await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCheckout(); - await CustomerFlow.productIsInCheckout(simpleProductName, `4`, `39.96`, `39.96`); + await CustomerFlow.productIsInCheckout(simpleProductName, `4`, fourProductPrice, fourProductPrice); // Select checkbox to ship to a different address await page.evaluate(() => { @@ -115,7 +121,7 @@ const runCheckoutPageTest = () => { await CustomerFlow.goToShop(); await CustomerFlow.addToCartFromShopPage(simpleProductName); await CustomerFlow.goToCheckout(); - await CustomerFlow.productIsInCheckout(simpleProductName, `5`, `49.95`, `49.95`); + await CustomerFlow.productIsInCheckout(simpleProductName, `5`, fiveProductPrice, fiveProductPrice); await CustomerFlow.fillBillingDetails(config.get('addresses.customer.billing')); await uiUnblocked(); @@ -151,13 +157,13 @@ const runCheckoutPageTest = () => { await expect(page).toMatchElement('.wc-order-item-name', {text: simpleProductName}); // Verify product cost - await expect(page).toMatchElement('.woocommerce-Price-amount.amount', {text: '9.99'}); + await expect(page).toMatchElement('.woocommerce-Price-amount.amount', {text: singleProductPrice}); // Verify product quantity await expect(page).toMatchElement('.quantity', {text: '5'}); // Verify total order amount without shipping - await expect(page).toMatchElement('.line_cost', {text: '49.95'}); + await expect(page).toMatchElement('.line_cost', {text: fiveProductPrice}); }); }); }; diff --git a/tests/e2e/env/config/default.json b/tests/e2e/env/config/default.json index 19693eece88..9dd72fb0f9c 100644 --- a/tests/e2e/env/config/default.json +++ b/tests/e2e/env/config/default.json @@ -12,7 +12,8 @@ }, "products": { "simple": { - "name": "Simple product" + "name": "Simple product", + "price": "9.99" }, "variable": { "name": "Variable Product with Three Variations" diff --git a/tests/e2e/utils/src/components.js b/tests/e2e/utils/src/components.js index 4e82df359ae..eef3a8751a5 100644 --- a/tests/e2e/utils/src/components.js +++ b/tests/e2e/utils/src/components.js @@ -11,6 +11,7 @@ import factories from './factories'; const config = require( 'config' ); const simpleProductName = config.get( 'products.simple.name' ); +const simpleProductPrice = config.get( 'products.simple.price' ); const verifyAndPublish = async () => { // Wait for auto save @@ -208,7 +209,7 @@ const completeOnboardingWizard = async () => { const createSimpleProduct = async () => { const product = await factories.products.simple.create( { name: simpleProductName, - regularPrice: '9.99' + regularPrice: simpleProductPrice } ); return product.id; } ; From 88630e2a325e3c054497006c770d60e2b4cb2c0e Mon Sep 17 00:00:00 2001 From: zhongruige Date: Sun, 13 Dec 2020 16:07:16 -0700 Subject: [PATCH 081/144] Add delete issued refund test --- .../merchant/wp-admin-order-refund.test.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js index 3da8d1d280d..bf4b8e3062c 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-refund.test.js @@ -72,6 +72,27 @@ const runRefundOrderTest = () => { ]); }); + it('can delete an issued refund', async () => { + // We need to use this here as `expect(page).toClick()` was unable to find the element + // See: https://github.com/puppeteer/puppeteer/issues/1769#issuecomment-637645219 + page.$eval('a.delete_refund', elem => elem.click()); + + await uiUnblocked(); + + // Verify the refunded row item is no longer showing + await page.waitForSelector('tr.refund', { visible: false }); + + await Promise.all([ + // Verify the product line item shows the refunded quantity and amount + expect(page).not.toMatchElement('.quantity .refunded', { text: '-1' }), + expect(page).not.toMatchElement('.line_cost .refunded', { text: `-${currencySymbol}9.99` }), + + // Verify the refund shows in the list with the amount + expect(page).not.toMatchElement('.refund .description', { text: 'No longer wanted' }), + expect(page).not.toMatchElement('.refund > .line_cost', { text: `-${currencySymbol}9.99` }), + ]); + }); + }); }; From ef6190382246c98749251e30b0a251947e9eeeb6 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 14 Dec 2020 10:42:39 -0400 Subject: [PATCH 082/144] add 12 hour delay to pulling new docker tags --- tests/e2e/env/bin/get-latest-docker-tag.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/e2e/env/bin/get-latest-docker-tag.js b/tests/e2e/env/bin/get-latest-docker-tag.js index 1e3814e6c89..23adf48317a 100755 --- a/tests/e2e/env/bin/get-latest-docker-tag.js +++ b/tests/e2e/env/bin/get-latest-docker-tag.js @@ -36,12 +36,22 @@ async function fetchLatestTagFromPage( image, nameSearch, page ) { if ( ! data.count ) { reject( "No image '" + image + '" found' ); } else { + // Implement a 12 hour delay on pulling newly released docker tags. + const delayMilliseconds = 12 * 3600 * 1000; + const currentTime = Date.now(); let latestTag = null; + let lastUpdated = null; for ( let tag of data.results ) { tag.semver = tag.name.match( /^\d+\.\d+(.\d+)*$/ ); if ( ! tag.semver ) { continue; } + + lastUpdated = Date.parse( tag.last_updated ); + if ( currentTime - lastUpdated < delayMilliseconds ) { + continue; + } + tag.semver = semver.coerce( tag.semver[0] ); if ( ! latestTag || semver.gt( tag.semver, latestTag.semver ) ) { latestTag = tag; From 733157638be09e6406be52469ce01a2bf6200d18 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 14 Dec 2020 10:54:29 -0400 Subject: [PATCH 083/144] update package changelog --- tests/e2e/env/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/e2e/env/CHANGELOG.md b/tests/e2e/env/CHANGELOG.md index b6a38c5bdc5..d1f5c9be9c1 100644 --- a/tests/e2e/env/CHANGELOG.md +++ b/tests/e2e/env/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +## Added + +- Insert a 12 hour delay in using new docker image tags + ## Fixed - Remove redundant `puppeteer` dependency From f89355f821894079473f3ee5a8e573f85d45e917 Mon Sep 17 00:00:00 2001 From: roykho Date: Mon, 14 Dec 2020 07:32:54 -0800 Subject: [PATCH 084/144] Git ignore packaged min files --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index c1723b0345e..2e3d16a5daf 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,25 @@ none # Minified JS /assets/js/admin/*.min.js /assets/js/frontend/*.min.js +/assets/js/accounting/*.min.js +/assets/js/flexslider/*.min.js +/assets/js/jquery-blockui/*.min.js +/assets/js/jquery-cookie/*.min.js +/assets/js/jquery-flot/*.min.js +/assets/js/jquery-payment/*.min.js +/assets/js/jquery-qrcode/*.min.js +/assets/js/jquery-serializejson/*.min.js +/assets/js/jquery-tiptip/*.min.js +/assets/js/jquery-ui-touch-punch/*.min.js +/assets/js/js-cookie/*.min.js +/assets/js/photoswipe/*.min.js +/assets/js/prettyPhoto/*.min.js +/assets/js/round/*.min.js +/assets/js/select2/*.min.js +/assets/js/selectWoo/*.min.js +/assets/js/stupidtable/*.min.js +/assets/js/zeroclipboard/*.min.js +/assets/js/zoom/*.min.js # OS X metadata .DS_Store From cce5cbe985b8627b92fba4a5b07e9e9234e04509 Mon Sep 17 00:00:00 2001 From: roykho Date: Mon, 14 Dec 2020 07:41:45 -0800 Subject: [PATCH 085/144] Remove packaged minified files --- assets/js/accounting/accounting.min.js | 21 ------------------- assets/js/flexslider/jquery.flexslider.min.js | 1 - .../js/jquery-blockui/jquery.blockUI.min.js | 14 ------------- assets/js/jquery-cookie/jquery.cookie.min.js | 8 ------- assets/js/jquery-flot/jquery.flot.min.js | 1 - assets/js/jquery-flot/jquery.flot.pie.min.js | 1 - .../js/jquery-flot/jquery.flot.resize.min.js | 1 - .../js/jquery-flot/jquery.flot.stack.min.js | 1 - assets/js/jquery-flot/jquery.flot.time.min.js | 1 - .../js/jquery-payment/jquery.payment.min.js | 1 - assets/js/jquery-qrcode/jquery.qrcode.min.js | 1 - .../jquery.serializejson.min.js | 10 --------- assets/js/jquery-tiptip/jquery.tipTip.min.js | 1 - .../jquery-ui-touch-punch.min.js | 11 ---------- assets/js/js-cookie/js.cookie.min.js | 8 ------- .../photoswipe/photoswipe-ui-default.min.js | 4 ---- assets/js/photoswipe/photoswipe.min.js | 4 ---- .../jquery.prettyPhoto.init.min.js | 1 - .../js/prettyPhoto/jquery.prettyPhoto.min.js | 1 - assets/js/round/round.min.js | 1 - assets/js/select2/select2.full.min.js | 3 --- assets/js/select2/select2.min.js | 13 ------------ assets/js/selectWoo/selectWoo.full.min.js | 16 -------------- assets/js/selectWoo/selectWoo.min.js | 8 ------- assets/js/stupidtable/stupidtable.min.js | 1 - .../zeroclipboard/jquery.zeroclipboard.min.js | 17 --------------- assets/js/zoom/jquery.zoom.min.js | 6 ------ 27 files changed, 156 deletions(-) delete mode 100644 assets/js/accounting/accounting.min.js delete mode 100644 assets/js/flexslider/jquery.flexslider.min.js delete mode 100644 assets/js/jquery-blockui/jquery.blockUI.min.js delete mode 100644 assets/js/jquery-cookie/jquery.cookie.min.js delete mode 100644 assets/js/jquery-flot/jquery.flot.min.js delete mode 100644 assets/js/jquery-flot/jquery.flot.pie.min.js delete mode 100644 assets/js/jquery-flot/jquery.flot.resize.min.js delete mode 100644 assets/js/jquery-flot/jquery.flot.stack.min.js delete mode 100644 assets/js/jquery-flot/jquery.flot.time.min.js delete mode 100644 assets/js/jquery-payment/jquery.payment.min.js delete mode 100644 assets/js/jquery-qrcode/jquery.qrcode.min.js delete mode 100644 assets/js/jquery-serializejson/jquery.serializejson.min.js delete mode 100644 assets/js/jquery-tiptip/jquery.tipTip.min.js delete mode 100644 assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js delete mode 100644 assets/js/js-cookie/js.cookie.min.js delete mode 100755 assets/js/photoswipe/photoswipe-ui-default.min.js delete mode 100755 assets/js/photoswipe/photoswipe.min.js delete mode 100644 assets/js/prettyPhoto/jquery.prettyPhoto.init.min.js delete mode 100644 assets/js/prettyPhoto/jquery.prettyPhoto.min.js delete mode 100644 assets/js/round/round.min.js delete mode 100644 assets/js/select2/select2.full.min.js delete mode 100644 assets/js/select2/select2.min.js delete mode 100644 assets/js/selectWoo/selectWoo.full.min.js delete mode 100644 assets/js/selectWoo/selectWoo.min.js delete mode 100644 assets/js/stupidtable/stupidtable.min.js delete mode 100644 assets/js/zeroclipboard/jquery.zeroclipboard.min.js delete mode 100755 assets/js/zoom/jquery.zoom.min.js diff --git a/assets/js/accounting/accounting.min.js b/assets/js/accounting/accounting.min.js deleted file mode 100644 index d2d9228ad3d..00000000000 --- a/assets/js/accounting/accounting.min.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * accounting.js v0.4.2 - * Copyright 2014 Open Exchange Rates - * - * Freely distributable under the MIT license. - * Portions of accounting.js are inspired or borrowed from underscore.js - * - * Full details and documentation: - * http://openexchangerates.github.io/accounting.js/ - */ -!function(n,r){function e(n){return!!(""===n||n&&n.charCodeAt&&n.substr)}function t(n){return p?p(n):"[object Array]"===l.call(n)}function o(n){return n&&"[object Object]"===l.call(n)}function a(n,r){var e;n=n||{},r=r||{};for(e in r)r.hasOwnProperty(e)&&null==n[e]&&(n[e]=r[e]);return n}function i(n,r,e){var t,o,a=[];if(!n)return a;if(f&&n.map===f)return n.map(r,e);for(t=0,o=n.length;t3?h.length%3:0;return l+(y?h.substr(0,y)+f.thousand:"")+h.substr(y).replace(/(\d{3})(?=\d)/g,"$1"+f.thousand)+(p?f.decimal+d(Math.abs(n),p).split(".")[1]:"")},h=s.formatMoney=function(n,r,e,f,p,l){if(t(n))return i(n,function(n){return h(n,r,e,f,p,l)});n=m(n);var d=a(o(r)?r:{symbol:r,precision:e,thousand:f,decimal:p,format:l},s.settings.currency),y=c(d.format);return(n>0?y.pos:n<0?y.neg:y.zero).replace("%s",d.symbol).replace("%v",g(Math.abs(n),u(d.precision),d.thousand,d.decimal))};s.formatColumn=function(n,r,f,p,l,d){if(!n)return[];var h=a(o(r)?r:{symbol:r,precision:f,thousand:p,decimal:l,format:d},s.settings.currency),y=c(h.format),b=y.pos.indexOf("%s")0?y.pos:n<0?y.neg:y.zero).replace("%s",h.symbol).replace("%v",g(Math.abs(n),u(h.precision),h.thousand,h.decimal));return e.length>v&&(v=e.length),e}),function(n,r){return e(n)&&n.length'),1").attr("href","#").text(n),"thumbnails"===h.vars.controlNav&&(e=m("").attr("src",t.attr("data-thumb"))),""!==t.attr("data-thumb-alt")&&e.attr("alt",t.attr("data-thumb-alt")),"thumbnails"===h.vars.controlNav&&!0===h.vars.thumbCaptions){var r=t.attr("data-thumbcaption");if(""!==r&&undefined!==r){var s=m("").addClass(c+"caption").text(r);e.append(s)}}var o=m("
  • ");e.appendTo(o),o.append("
  • "),h.controlNavScaffold.append(o),n++}h.controlsContainer?m(h.controlsContainer).append(h.controlNavScaffold):h.append(h.controlNavScaffold),p.controlNav.set(),p.controlNav.active(),h.controlNavScaffold.delegate("a, img",l,function(e){if(e.preventDefault(),""===d||d===e.type){var t=m(this),a=h.controlNav.index(t);t.hasClass(c+"active")||(h.direction=a>h.currentSlide?"next":"prev",h.flexAnimate(a,h.vars.pauseOnAction))}""===d&&(d=e.type),p.setToClearWatchedEvent()})},setupManual:function(){h.controlNav=h.manualControls,p.controlNav.active(),h.controlNav.bind(l,function(e){if(e.preventDefault(),""===d||d===e.type){var t=m(this),a=h.controlNav.index(t);t.hasClass(c+"active")||(a>h.currentSlide?h.direction="next":h.direction="prev",h.flexAnimate(a,h.vars.pauseOnAction))}""===d&&(d=e.type),p.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===h.vars.controlNav?"img":"a";h.controlNav=m("."+c+"control-nav li "+e,h.controlsContainer?h.controlsContainer:h)},active:function(){h.controlNav.removeClass(c+"active").eq(h.animatingTo).addClass(c+"active")},update:function(e,t){1'+h.count+"")):1===h.pagingCount?h.controlNavScaffold.find("li").remove():h.controlNav.eq(t).closest("li").remove(),p.controlNav.set(),1
  • '+h.vars.prevText+'
  • '+h.vars.nextText+"
  • ");h.customDirectionNav?h.directionNav=h.customDirectionNav:h.controlsContainer?(m(h.controlsContainer).append(e),h.directionNav=m("."+c+"direction-nav li a",h.controlsContainer)):(h.append(e),h.directionNav=m("."+c+"direction-nav li a",h)),p.directionNav.update(),h.directionNav.bind(l,function(e){var t;e.preventDefault(),""!==d&&d!==e.type||(t=m(this).hasClass(c+"next")?h.getTarget("next"):h.getTarget("prev"),h.flexAnimate(t,h.vars.pauseOnAction)),""===d&&(d=e.type),p.setToClearWatchedEvent()})},update:function(){var e=c+"disabled";1===h.pagingCount?h.directionNav.addClass(e).attr("tabindex","-1"):h.vars.animationLoop?h.directionNav.removeClass(e).removeAttr("tabindex"):0===h.animatingTo?h.directionNav.removeClass(e).filter("."+c+"prev").addClass(e).attr("tabindex","-1"):h.animatingTo===h.last?h.directionNav.removeClass(e).filter("."+c+"next").addClass(e).attr("tabindex","-1"):h.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=m('
    ');h.controlsContainer?(h.controlsContainer.append(e),h.pausePlay=m("."+c+"pauseplay a",h.controlsContainer)):(h.append(e),h.pausePlay=m("."+c+"pauseplay a",h)),p.pausePlay.update(h.vars.slideshow?c+"pause":c+"play"),h.pausePlay.bind(l,function(e){e.preventDefault(),""!==d&&d!==e.type||(m(this).hasClass(c+"pause")?(h.manualPause=!0,h.manualPlay=!1,h.pause()):(h.manualPause=!1,h.manualPlay=!0,h.play())),""===d&&(d=e.type),p.setToClearWatchedEvent()})},update:function(e){"play"===e?h.pausePlay.removeClass(c+"pause").addClass(c+"play").html(h.vars.playText):h.pausePlay.removeClass(c+"play").addClass(c+"pause").html(h.vars.pauseText)}},touch:function(){var i,r,s,o,l,d,e,n,c,u=!1,t=0,a=0,v=0;if(S){g.style.msTouchAction="none",g._gesture=new MSGesture,(g._gesture.target=g).addEventListener("MSPointerDown",function p(e){e.stopPropagation(),h.animating?e.preventDefault():(h.pause(),g._gesture.addPointer(e.pointerId),v=0,o=x?h.h:h.w,d=Number(new Date),s=b&&y&&h.animatingTo===h.last?0:b&&y?h.limit-(h.itemW+h.vars.itemMargin)*h.move*h.animatingTo:b&&h.currentSlide===h.last?h.limit:b?(h.itemW+h.vars.itemMargin)*h.move*h.currentSlide:y?(h.last-h.currentSlide+h.cloneOffset)*o:(h.currentSlide+h.cloneOffset)*o)},!1),g._slider=h,g.addEventListener("MSGestureChange",function m(e){e.stopPropagation();var t=e.target._slider;if(!t)return;var a=-e.translationX,n=-e.translationY;if(v+=x?n:a,l=(t.vars.rtl?-1:1)*v,u=x?Math.abs(v)o/2)?t.flexAnimate(n,t.vars.pauseOnAction):w||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}s=l=r=i=null,v=0},!1)}else e=function(e){h.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(h.pause(),o=x?h.h:h.w,d=Number(new Date),t=e.touches[0].pageX,a=e.touches[0].pageY,s=b&&y&&h.animatingTo===h.last?0:b&&y?h.limit-(h.itemW+h.vars.itemMargin)*h.move*h.animatingTo:b&&h.currentSlide===h.last?h.limit:b?(h.itemW+h.vars.itemMargin)*h.move*h.currentSlide:y?(h.last-h.currentSlide+h.cloneOffset)*o:(h.currentSlide+h.cloneOffset)*o,i=x?a:t,r=x?t:a,g.addEventListener("touchmove",n,!1),g.addEventListener("touchend",c,!1))},n=function(e){t=e.touches[0].pageX,a=e.touches[0].pageY,l=x?i-a:(h.vars.rtl?-1:1)*(i-t);(!(u=x?Math.abs(l)o/2)?h.flexAnimate(a,h.vars.pauseOnAction):w||h.flexAnimate(h.currentSlide,h.vars.pauseOnAction,!0)}g.removeEventListener("touchend",c,!1),s=l=r=i=null},g.addEventListener("touchstart",e,!1)},resize:function(){!h.animating&&h.is(":visible")&&(b||h.doMath(),w?p.smoothHeight():b?(h.slides.width(h.computedW),h.update(h.pagingCount),h.setProps()):x?(h.viewport.height(h.h),h.setProps(h.h,"setTotal")):(h.vars.smoothHeight&&p.smoothHeight(),h.newSlides.width(h.computedW),h.setProps(h.computedW,"setTotal")))},smoothHeight:function(e){if(!x||w){var t=w?h:h.viewport;e?t.animate({height:h.slides.eq(h.animatingTo).innerHeight()},e):t.innerHeight(h.slides.eq(h.animatingTo).innerHeight())}},sync:function(e){var t=m(h.vars.sync).data("flexslider"),a=h.animatingTo;switch(e){case"animate":t.flexAnimate(a,h.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=m(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=p.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){p.pauseInvisible.isHidden()?h.startTimeout?clearTimeout(h.startTimeout):h.pause():h.started?h.play():0h.currentSlide?"next":"prev"),v&&1===h.pagingCount&&(h.direction=h.currentItemh.limit&&1!==h.visible?h.limit:l):0===h.currentSlide&&e===h.count-1&&h.vars.animationLoop&&"next"!==h.direction?y?(h.count+h.cloneOffset)*d:0:h.currentSlide===h.last&&0===e&&h.vars.animationLoop&&"prev"!==h.direction?y?0:(h.count+1)*d:y?(h.count-1-e+h.cloneOffset)*d:(e+h.cloneOffset)*d,h.setProps(o,"",h.vars.animationSpeed),h.transitions?(h.vars.animationLoop&&h.atEnd||(h.animating=!1,h.currentSlide=h.animatingTo),h.container.unbind("webkitTransitionEnd transitionend"),h.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(h.ensureAnimationEnd),h.wrapup(d)}),clearTimeout(h.ensureAnimationEnd),h.ensureAnimationEnd=setTimeout(function(){h.wrapup(d)},h.vars.animationSpeed+100)):h.container.animate(h.args,h.vars.animationSpeed,h.vars.easing,function(){h.wrapup(d)})}h.vars.smoothHeight&&p.smoothHeight(h.vars.animationSpeed)}},h.wrapup=function(e){w||b||(0===h.currentSlide&&h.animatingTo===h.last&&h.vars.animationLoop?h.setProps(e,"jumpEnd"):h.currentSlide===h.last&&0===h.animatingTo&&h.vars.animationLoop&&h.setProps(e,"jumpStart")),h.animating=!1,h.currentSlide=h.animatingTo,h.vars.after(h)},h.animateSlides=function(){!h.animating&&a&&h.flexAnimate(h.getTarget("next"))},h.pause=function(){clearInterval(h.animatedSlides),h.animatedSlides=null,h.playing=!1,h.vars.pausePlay&&p.pausePlay.update("play"),h.syncExists&&p.sync("pause")},h.play=function(){h.playing&&clearInterval(h.animatedSlides),h.animatedSlides=h.animatedSlides||setInterval(h.animateSlides,h.vars.slideshowSpeed),h.started=h.playing=!0,h.vars.pausePlay&&p.pausePlay.update("pause"),h.syncExists&&p.sync("play")},h.stop=function(){h.pause(),h.stopped=!0},h.canAdvance=function(e,t){var a=v?h.pagingCount-1:h.last;return!!t||(v&&h.currentItem===h.count-1&&0===e&&"prev"===h.direction||(!v||0!==h.currentItem||e!==h.pagingCount-1||"next"===h.direction)&&((e!==h.currentSlide||v)&&(!!h.vars.animationLoop||(!h.atEnd||0!==h.currentSlide||e!==a||"next"===h.direction)&&(!h.atEnd||h.currentSlide!==a||0!==e||"next"!==h.direction))))},h.getTarget=function(e){return"next"===(h.direction=e)?h.currentSlide===h.last?0:h.currentSlide+1:0===h.currentSlide?h.last:h.currentSlide-1},h.setProps=function(e,t,a){var n,i=(n=e||(h.itemW+h.vars.itemMargin)*h.move*h.animatingTo,function(){if(b)return"setTouch"===t?e:y&&h.animatingTo===h.last?0:y?h.limit-(h.itemW+h.vars.itemMargin)*h.move*h.animatingTo:h.animatingTo===h.last?h.limit:n;switch(t){case"setTotal":return y?(h.count-1-h.currentSlide+h.cloneOffset)*e:(h.currentSlide+h.cloneOffset)*e;case"setTouch":return e;case"jumpEnd":return y?e:h.count*e;case"jumpStart":return y?h.count*e:e;default:return e}}()*(h.vars.rtl?1:-1)+"px");h.transitions&&(i=x?"translate3d(0,"+i+",0)":"translate3d("+parseInt(i)+"px,0,0)",a=a!==undefined?a/1e3+"s":"0s",h.container.css("-"+h.pfx+"-transition-duration",a),h.container.css("transition-duration",a)),h.args[h.prop]=i,(h.transitions||a===undefined)&&h.container.css(h.args),h.container.css("transform",i)},h.setup=function(e){var t,a;w?(h.vars.rtl?h.slides.css({width:"100%","float":"right",marginLeft:"-100%",position:"relative"}):h.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(u?h.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+h.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(h.currentSlide).css({opacity:1,zIndex:2}):0==h.vars.fadeFirstSlide?h.slides.css({opacity:0,display:"block",zIndex:1}).eq(h.currentSlide).css({zIndex:2}).css({opacity:1}):h.slides.css({opacity:0,display:"block",zIndex:1}).eq(h.currentSlide).css({zIndex:2}).animate({opacity:1},h.vars.animationSpeed,h.vars.easing)),h.vars.smoothHeight&&p.smoothHeight()):("init"===e&&(h.viewport=m('
    ').css({overflow:"hidden",position:"relative"}).appendTo(h).append(h.container),h.cloneCount=0,h.cloneOffset=0,y&&(a=m.makeArray(h.slides).reverse(),h.slides=m(a),h.container.empty().append(h.slides))),h.vars.animationLoop&&!b&&(h.cloneCount=2,h.cloneOffset=1,"init"!==e&&h.container.find(".clone").remove(),h.container.append(p.uniqueID(h.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(p.uniqueID(h.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),h.newSlides=m(h.vars.selector,h),t=y?h.count-1-h.currentSlide+h.cloneOffset:h.currentSlide+h.cloneOffset,x&&!b?(h.container.height(200*(h.count+h.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){h.newSlides.css({display:"block"}),h.doMath(),h.viewport.height(h.h),h.setProps(t*h.h,"init")},"init"===e?100:0)):(h.container.width(200*(h.count+h.cloneCount)+"%"),h.setProps(t*h.computedW,"init"),setTimeout(function(){h.doMath(),h.vars.rtl?h.newSlides.css({width:h.computedW,marginRight:h.computedM,"float":"right",display:"block"}):h.newSlides.css({width:h.computedW,marginRight:h.computedM,"float":"left",display:"block"}),h.vars.smoothHeight&&p.smoothHeight()},"init"===e?100:0)));b||h.slides.removeClass(c+"active-slide").eq(h.currentSlide).addClass(c+"active-slide"),h.vars.init(h)},h.doMath=function(){var e=h.slides.first(),t=h.vars.itemMargin,a=h.vars.minItems,n=h.vars.maxItems;h.w=h.viewport===undefined?h.width():h.viewport.width(),h.isFirefox&&(h.w=h.width()),h.h=e.height(),h.boxPadding=e.outerWidth()-e.width(),b?(h.itemT=h.vars.itemWidth+t,h.itemM=t,h.minW=a?a*h.itemT:h.w,h.maxW=n?n*h.itemT-t:h.w,h.itemW=h.minW>h.w?(h.w-t*(a-1))/a:h.maxWh.w?h.w:h.vars.itemWidth,h.visible=Math.floor(h.w/h.itemW),h.move=0h.w?h.itemW*(h.count-1)+t*(h.count-1):(h.itemW+t)*h.count-h.w-t):(h.itemW=h.w,h.itemM=t,h.pagingCount=h.count,h.last=h.count-1),h.computedW=h.itemW-h.boxPadding,h.computedM=h.itemM},h.update=function(e,t){h.doMath(),b||(eh.controlNav.length?p.controlNav.update("add"):("remove"===t&&!b||h.pagingCounth.last&&(h.currentSlide-=1,h.animatingTo-=1),p.controlNav.update("remove",h.last))),h.vars.directionNav&&p.directionNav.update()},h.addSlide=function(e,t){var a=m(e);h.count+=1,h.last=h.count-1,x&&y?t!==undefined?h.slides.eq(h.count-t).after(a):h.container.prepend(a):t!==undefined?h.slides.eq(t).before(a):h.container.append(a),h.update(t,"add"),h.slides=m(h.vars.selector+":not(.clone)",h),h.setup(),h.vars.added(h)},h.removeSlide=function(e){var t=isNaN(e)?h.slides.index(m(e)):e;h.count-=1,h.last=h.count-1,isNaN(e)?m(e,h.slides).remove():x&&y?h.slides.eq(h.last).remove():h.slides.eq(e).remove(),h.doMath(),h.update(t,"remove"),h.slides=m(h.vars.selector+":not(.clone)",h),h.setup(),h.vars.removed(h)},p.init()},m(window).blur(function(e){a=!1}).focus(function(e){a=!0}),m.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,isFirefox:!1,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){},rtl:!1},m.fn.flexslider=function(n){if(n===undefined&&(n={}),"object"==typeof n)return this.each(function(){var e=m(this),t=n.selector?n.selector:".slides > li",a=e.find(t);1===a.length&&!1===n.allowOneSlide||0===a.length?(a.fadeIn(400),n.start&&n.start(e)):e.data("flexslider")===undefined&&new m.flexslider(this,n)});var e=m(this).data("flexslider");switch(n){case"play":e.play();break;case"pause":e.pause();break;case"stop":e.stop();break;case"next":e.flexAnimate(e.getTarget("next"),!0);break;case"prev":case"previous":e.flexAnimate(e.getTarget("prev"),!0);break;default:"number"==typeof n&&e.flexAnimate(n,!0)}}}(jQuery); \ No newline at end of file diff --git a/assets/js/jquery-blockui/jquery.blockUI.min.js b/assets/js/jquery-blockui/jquery.blockUI.min.js deleted file mode 100644 index 6215612f7dd..00000000000 --- a/assets/js/jquery-blockui/jquery.blockUI.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * jQuery blockUI plugin - * Version 2.70.0-2014.11.23 - * Requires jQuery v1.7 or later - * - * Examples at: http://malsup.com/jquery/block/ - * Copyright (c) 2007-2013 M. Alsup - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Thanks to Amir-Hossein Sobhi for some excellent contributions! - */ -!function(){"use strict";function e(e){function t(t,n){var s,h,k=t==window,y=n&&n.message!==undefined?n.message:undefined;if(!(n=e.extend({},e.blockUI.defaults,n||{})).ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=y===undefined?n.message:y,k&&p&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var m=y.jquery?y[0]:y,g={};e(t).data("blockUI.history",g),g.el=m,g.parent=m.parentNode,g.display=m.style.display,g.position=m.style.position,g.parent&&g.parent.removeChild(m)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,I,w,U,x=n.baseZ;v=e(r||n.forceIframe?'':''),I=e(n.theme?'':''),n.theme&&k?(U='"):n.theme?(U='"):U=k?'':'',w=e(U),y&&(n.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),n.theme||I.css(n.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||n.forceIframe)&&v.css("opacity",0);var C=[v,I,w],S=e(k?"body":t);e.each(C,function(){this.appendTo(S)}),n.theme&&n.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:t).length>0);if(u||O){if(k&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=a(t,"borderTopWidth"),T=a(t,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)k?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&o.setExpression("left",B),M&&o.setExpression("top",M);else if(n.centerY)k&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&k){var i="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(n.css&&n.css.top?parseInt(n.css.top,10):0)+') + "px"';o.setExpression("top",i)}})}if(y&&(n.theme?w.find(".ui-widget-content").append(y):w.append(y),(y.jquery||y.nodeType)&&e(y).show()),(r||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var j=n.onBlock?n.onBlock:c,H=n.showOverlay&&!y?j:c,z=y?j:c;n.showOverlay&&I._fadeIn(n.fadeIn,H),y&&w._fadeIn(n.fadeIn,z)}else n.showOverlay&&I.show(),y&&w.show(),n.onBlock&&n.onBlock.bind(w)();if(i(1,t,n),k?(p=w[0],b=e(n.focusableElements,p),n.focusInput&&setTimeout(l,20)):d(w[0],n.centerX,n.centerY),n.timeout){var W=setTimeout(function(){k?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",W)}}}function o(t,o){var s,l=t==window,d=e(t),a=d.data("blockUI.history"),c=d.data("blockUI.timeout");c&&(clearTimeout(c),d.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=d.data("blockUI.onUnblock"),d.removeData("blockUI.onUnblock"));var r;r=l?e(document.body).children().filter(".blockUI").add("body > .blockUI"):d.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),l&&(p=b=null),o.fadeOut?(s=r.length,r.stop().fadeOut(o.fadeOut,function(){0==--s&&n(r,a,o,t)})):n(r,a,o,t)}function n(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),d=l.width(),a=l[0].style.width;l.width(d-1).width(d),l[0].style.width=a}}function i(t,o,n){var i=o==window,l=e(o);if((t||(!i||p)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var d="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(d,n,s):e(document).unbind(d,s)}}function s(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&p&&t.data.constrainTabKey){var o=b,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){l(i)},10),!1}var s=t.data,d=e(t.target);return d.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(t),d.parents("div."+s.blockMsgClass).length>0||0===d.parents().children().filter("div.blockUI").length}function l(e){if(b){var t=b[!0===e?b.length-1:0];t&&t.focus()}}function d(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),o&&(i.top=l>0?l+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),f=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var s=e('
    ');t&&s.append("

    "+t+"

    "),o&&s.append("

    "+o+"

    "),n===undefined&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.mouseover(function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"

    Please wait...

    ",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var p=null,b=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(); \ No newline at end of file diff --git a/assets/js/jquery-cookie/jquery.cookie.min.js b/assets/js/jquery-cookie/jquery.cookie.min.js deleted file mode 100644 index 3a05387971d..00000000000 --- a/assets/js/jquery-cookie/jquery.cookie.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * jQuery Cookie Plugin v1.4.1 - * https://github.com/carhartl/jquery-cookie - * - * Copyright 2013 Klaus Hartl - * Released under the MIT license - */ -!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return c.raw?e:encodeURIComponent(e)}function i(e){return c.raw?e:decodeURIComponent(e)}function o(e){return n(c.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(u," ")),c.json?JSON.parse(e):e}catch(n){}}function t(n,i){var o=c.raw?n:r(n);return e.isFunction(i)?i(o):o}var u=/\+/g,c=e.cookie=function(r,u,f){if(u!==undefined&&!e.isFunction(u)){if("number"==typeof(f=e.extend({},c.defaults,f)).expires){var d=f.expires,a=f.expires=new Date;a.setTime(+a+864e5*d)}return document.cookie=[n(r),"=",o(u),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?undefined:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;m=1?"rgb("+[r.r,r.g,r.b].join(",")+")":"rgba("+[r.r,r.g,r.b,r.a].join(",")+")"},r.normalize=function(){function t(t,i,e){return ie?e:i}return r.r=t(0,parseInt(r.r),255),r.g=t(0,parseInt(r.g),255),r.b=t(0,parseInt(r.b),255),r.a=t(0,r.a,1),r},r.clone=function(){return t.color.make(r.r,r.b,r.g,r.a)},r.normalize()},t.color.extract=function(i,e){var o;do{if(""!=(o=i.css(e).toLowerCase())&&"transparent"!=o)break;i=i.parent()}while(!t.nodeName(i.get(0),"body"));return"rgba(0, 0, 0, 0)"==o&&(o="transparent"),t.color.parse(o)},t.color.parse=function(e){var o,n=t.color.make;if(o=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10));if(o=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),parseFloat(o[4]));if(o=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]));if(o=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3]),parseFloat(o[4]));if(o=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return n(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16));if(o=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return n(parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16));var r=t.trim(e).toLowerCase();return"transparent"==r?n(255,255,255,0):(o=i[r]||[0,0,0],n(o[0],o[1],o[2]))};var i={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(t){function i(i,e){var o=e.children("."+i)[0];if(null==o&&(o=document.createElement("canvas"),o.className=i,t(o).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(e),!o.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");o=window.G_vmlCanvasManager.initElement(o)}this.element=o;var n=this.context=o.getContext("2d"),r=window.devicePixelRatio||1,a=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;this.pixelRatio=r/a,this.resize(e.width(),e.height()),this.textContainer=null,this.text={},this._textCache={}}function e(e,n,r,a){function l(t,i){i=[ft].concat(i);for(var e=0;eo&&(o=n))}e<=o&&(e=o+1);var r,a=[],l=K.colors,s=l.length,c=0;for(i=0;i=0?c<.5?-c-.2:0:-c),a[i]=r.scale("rgb",1+c);var h,u=0;for(i=0;i<$.length;++i){if(null==(h=$[i]).color?(h.color=a[u].toString(),++u):"number"==typeof h.color&&(h.color=a[h.color].toString()),null==h.lines.show){var p,m=!0;for(p in h)if(h[p]&&h[p].show){m=!1;break}m&&(h.lines.show=!0)}null==h.lines.zero&&(h.lines.zero=!!h.lines.fill),h.xaxis=d(nt,f(h,"x")),h.yaxis=d(rt,f(h,"y"))}}function m(){function i(t,i,e){it.datamax&&e!=b&&(t.datamax=e)}var e,o,n,r,a,s,c,f,u,d,p,m,x=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,b=Number.MAX_VALUE;for(t.each(h(),function(t,i){i.datamin=x,i.datamax=g,i.used=!1}),e=0;e<$.length;++e)(a=$[e]).datapoints={points:[]},l(ct.processRawData,[a,a.data,a.datapoints]);for(e=0;e<$.length;++e){if(a=$[e],p=a.data,!(m=a.datapoints.format)){if((m=[]).push({x:!0,number:!0,required:!0}),m.push({y:!0,number:!0,required:!0}),a.bars.show||a.lines.show&&a.lines.fill){var v=!!(a.bars.show&&a.bars.zero||a.lines.show&&a.lines.zero);m.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:v}),a.bars.horizontal&&(delete m[m.length-1].y,m[m.length-1].x=!0)}a.datapoints.format=m}if(null==a.datapoints.pointsize){a.datapoints.pointsize=m.length,c=a.datapoints.pointsize,s=a.datapoints.points;var k=a.lines.show&&a.lines.steps;for(a.xaxis.used=a.yaxis.used=!0,o=n=0;o0&&null!=s[n-c]&&s[n-c]!=s[n]&&s[n-c+1]!=s[n+1]){for(r=0;rM&&(M=f)),u.y&&(fC&&(C=f)));if(a.bars.show){var S;switch(a.bars.align){case"left":S=0;break;case"right":S=-a.bars.barWidth;break;case"center":S=-a.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+a.bars.align)}a.bars.horizontal?(T+=S,C+=S+a.bars.barWidth):(w+=S,M+=S+a.bars.barWidth)}i(a.xaxis,w,M),i(a.yaxis,T,C)}t.each(h(),function(t,i){i.datamin==x&&(i.datamin=null),i.datamax==g&&(i.datamax=null)})}function x(t){function i(t){return t}var e,o,n=t.options.transform||i,r=t.options.inverseTransform;"x"==t.direction?(e=t.scale=lt/Math.abs(n(t.max)-n(t.min)),o=Math.min(n(t.max),n(t.min))):(e=t.scale=st/Math.abs(n(t.max)-n(t.min)),e=-e,o=Math.max(n(t.max),n(t.min))),t.p2c=n==i?function(t){return(t-o)*e}:function(t){return(n(t)-o)*e},t.c2p=r?function(t){return r(o+t/e)}:function(t){return o+t/e}}function g(t){var i=t.options,e=t.ticks||[],o=i.labelWidth||0,n=i.labelHeight||0,r=o||"x"==t.direction?Math.floor(Z.width/(e.length||1)):null;legacyStyles=t.direction+"Axis "+t.direction+t.n+"Axis",layer="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+legacyStyles,font=i.font||"flot-tick-label tickLabel";for(var a=0;a=0;--i)b(a[i]);k(),t.each(a,function(t,i){v(i)})}lt=Z.width-at.left-at.right,st=Z.height-at.bottom-at.top,t.each(e,function(t,i){x(i)}),o&&A(),E()}function w(t){var i=t.options,e=+(null!=i.min?i.min:t.datamin),o=+(null!=i.max?i.max:t.datamax),n=o-e;if(0==n){var r=0==o?1:.01;null==i.min&&(e-=r),null!=i.max&&null==i.min||(o+=r)}else{var a=i.autoscaleMargin;null!=a&&(null==i.min&&(e-=n*a)<0&&null!=t.datamin&&t.datamin>=0&&(e=0),null==i.max&&(o+=n*a)>0&&null!=t.datamax&&t.datamax<=0&&(o=0))}t.min=e,t.max=o}function T(i){var e,n=i.options;e="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"==i.direction?Z.width:Z.height);var r=(i.max-i.min)/e,a=-Math.floor(Math.log(r)/Math.LN10),l=n.tickDecimals;null!=l&&a>l&&(a=l);var s,c=Math.pow(10,-a),f=r/c;if(f<1.5?s=1:f<3?(s=2,f>2.25&&(null==l||a+1<=l)&&(s=2.5,++a)):s=f<7.5?5:10,s*=c,null!=n.minTickSize&&s0&&(null==n.min&&(i.min=Math.min(i.min,u[0])),null==n.max&&u.length>1&&(i.max=Math.max(i.max,u[u.length-1]))),i.tickGenerator=function(t){var i,e,o=[];for(e=0;e1&&/\..*0$/.test((p[1]-p[0]).toFixed(d))||(i.tickDecimals=d)}}}}function M(i){var e=i.options.ticks,o=[];null==e||"number"==typeof e&&e>0?o=i.tickGenerator(i):e&&(o=t.isFunction(e)?e(i):e);var n,r;for(i.ticks=[],n=0;n1&&(a=l[1])):r=+l,null==a&&(a=i.tickFormatter(r,i)),isNaN(r)||i.ticks.push({v:r,label:a})}}function C(t,i){t.options.autoscaleMargin&&i.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,i[0].v)),null==t.options.max&&i.length>1&&(t.max=Math.max(t.max,i[i.length-1].v)))}function S(){Z.clear(),l(ct.drawBackground,[et]);var t=K.grid;t.show&&t.backgroundColor&&z(),t.show&&!t.aboveData&&I();for(var i=0;i<$.length;++i)l(ct.drawSeries,[et,$[i]]),P($[i]);l(ct.draw,[et]),t.show&&t.aboveData&&I(),Z.render(),_()}function W(t,i){for(var e,o,n,r,a=h(),l=0;ln){var s=o;o=n,n=s}return{from:o,to:n,axis:e}}function z(){et.save(),et.translate(at.left,at.top),et.fillStyle=J(K.grid.backgroundColor,st,0,"rgba(255, 255, 255, 0)"),et.fillRect(0,0,lt,st),et.restore()}function I(){var i,e,o,n;et.save(),et.translate(at.left,at.top);var r=K.grid.markings;if(r)for(t.isFunction(r)&&((e=ft.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,r=r(e)),i=0;il.axis.max||s.tos.axis.max||(l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max),l.from==l.to&&s.from==s.to||(l.from=l.axis.p2c(l.from),l.to=l.axis.p2c(l.to),s.from=s.axis.p2c(s.from),s.to=s.axis.p2c(s.to),l.from==l.to||s.from==s.to?(et.beginPath(),et.strokeStyle=a.color||K.grid.markingsColor,et.lineWidth=a.lineWidth||K.grid.markingsLineWidth,et.moveTo(l.from,s.from),et.lineTo(l.to,s.to),et.stroke()):(et.fillStyle=a.color||K.grid.markingsColor,et.fillRect(l.from,s.to,l.to-l.from,s.from-s.to))))}e=h(),o=K.grid.borderWidth;for(var c=0;cm.max||"full"==g&&("object"==typeof o&&o[m.position]>0||o>0)&&(b==m.min||b==m.max)||("x"==m.direction?(f=m.p2c(b),p="full"==g?-st:g,"top"==m.position&&(p=-p)):(u=m.p2c(b),d="full"==g?-lt:g,"left"==m.position&&(d=-d)),1==et.lineWidth&&("x"==m.direction?f=Math.floor(f)+.5:u=Math.floor(u)+.5),et.moveTo(f,u),et.lineTo(f+d,u+p))}et.stroke()}}o&&(n=K.grid.borderColor,"object"==typeof o||"object"==typeof n?("object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),"object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),o.top>0&&(et.strokeStyle=n.top,et.lineWidth=o.top,et.beginPath(),et.moveTo(0-o.left,0-o.top/2),et.lineTo(lt,0-o.top/2),et.stroke()),o.right>0&&(et.strokeStyle=n.right,et.lineWidth=o.right,et.beginPath(),et.moveTo(lt+o.right/2,0-o.top),et.lineTo(lt+o.right/2,st),et.stroke()),o.bottom>0&&(et.strokeStyle=n.bottom,et.lineWidth=o.bottom,et.beginPath(),et.moveTo(lt+o.right,st+o.bottom/2),et.lineTo(0,st+o.bottom/2),et.stroke()),o.left>0&&(et.strokeStyle=n.left,et.lineWidth=o.left,et.beginPath(),et.moveTo(0-o.left/2,st+o.bottom),et.lineTo(0-o.left/2,0),et.stroke())):(et.lineWidth=o,et.strokeStyle=K.grid.borderColor,et.strokeRect(-o/2,-o/2,lt+o,st+o))),et.restore()}function A(){t.each(h(),function(t,i){if(i.show&&0!=i.ticks.length){var e,o,n,r,a,l=i.box,s=i.direction+"Axis "+i.direction+i.n+"Axis",c="flot-"+i.direction+"-axis flot-"+i.direction+i.n+"-axis "+s,f=i.options.font||"flot-tick-label tickLabel";Z.removeText(c);for(var h=0;hi.max||("x"==i.direction?(r="center",o=at.left+i.p2c(e.v),"bottom"==i.position?n=l.top+l.padding:(n=l.top+l.height-l.padding,a="bottom")):(a="middle",n=at.top+i.p2c(e.v),"left"==i.position?(o=l.left+l.width-l.padding,r="right"):o=l.left+l.padding),Z.addText(c,o,n,e.label,f,null,null,r,a))}})}function P(t){t.lines.show&&F(t),t.bars.show&&L(t),t.points.show&&N(t)}function F(t){function i(t,i,e,o,n){var r=t.points,a=t.pointsize,l=null,s=null;et.beginPath();for(var c=a;c=d&&h>n.max){if(d>n.max)continue;f=(n.max-h)/(d-h)*(u-f)+f,h=n.max}else if(d>=h&&d>n.max){if(h>n.max)continue;u=(n.max-h)/(d-h)*(u-f)+f,d=n.max}if(f<=u&&f=u&&f>o.max){if(u>o.max)continue;h=(o.max-f)/(u-f)*(d-h)+h,f=o.max}else if(u>=f&&u>o.max){if(f>o.max)continue;d=(o.max-f)/(u-f)*(d-h)+h,u=o.max}f==l&&h==s||et.moveTo(o.p2c(f)+i,n.p2c(h)+e),l=u,s=d,et.lineTo(o.p2c(u)+i,n.p2c(d)+e)}}et.stroke()}et.save(),et.translate(at.left,at.top),et.lineJoin="round";var e=t.lines.lineWidth,o=t.shadowSize;if(e>0&&o>0){et.lineWidth=o,et.strokeStyle="rgba(0,0,0,0.1)";var n=Math.PI/18;i(t.datapoints,Math.sin(n)*(e/2+o/2),Math.cos(n)*(e/2+o/2),t.xaxis,t.yaxis),et.lineWidth=o/2,i(t.datapoints,Math.sin(n)*(e/2+o/4),Math.cos(n)*(e/2+o/4),t.xaxis,t.yaxis)}et.lineWidth=e,et.strokeStyle=t.color;var r=O(t.lines,t.color,0,st);r&&(et.fillStyle=r,function(t,i,e){for(var o=t.points,n=t.pointsize,r=Math.min(Math.max(0,e.min),e.max),a=0,l=!1,s=1,c=0,f=0;!(n>0&&a>o.length+n);){var h=o[(a+=n)-n],u=o[a-n+s],d=o[a],p=o[a+s];if(l){if(n>0&&null!=h&&null==d){f=a,n=-n,s=2;continue}if(n<0&&a==c+n){et.fill(),l=!1,s=1,a=c=f+(n=-n);continue}}if(null!=h&&null!=d){if(h<=d&&h=d&&h>i.max){if(d>i.max)continue;u=(i.max-h)/(d-h)*(p-u)+u,h=i.max}else if(d>=h&&d>i.max){if(h>i.max)continue;p=(i.max-h)/(d-h)*(p-u)+u,d=i.max}if(l||(et.beginPath(),et.moveTo(i.p2c(h),e.p2c(r)),l=!0),u>=e.max&&p>=e.max)et.lineTo(i.p2c(h),e.p2c(e.max)),et.lineTo(i.p2c(d),e.p2c(e.max));else if(u<=e.min&&p<=e.min)et.lineTo(i.p2c(h),e.p2c(e.min)),et.lineTo(i.p2c(d),e.p2c(e.min));else{var m=h,x=d;u<=p&&u=e.min?(h=(e.min-u)/(p-u)*(d-h)+h,u=e.min):p<=u&&p=e.min&&(d=(e.min-u)/(p-u)*(d-h)+h,p=e.min),u>=p&&u>e.max&&p<=e.max?(h=(e.max-u)/(p-u)*(d-h)+h,u=e.max):p>=u&&p>e.max&&u<=e.max&&(d=(e.max-u)/(p-u)*(d-h)+h,p=e.max),h!=m&&et.lineTo(i.p2c(m),e.p2c(u)),et.lineTo(i.p2c(h),e.p2c(u)),et.lineTo(i.p2c(d),e.p2c(p)),d!=x&&(et.lineTo(i.p2c(d),e.p2c(p)),et.lineTo(i.p2c(x),e.p2c(p)))}}}}(t.datapoints,t.xaxis,t.yaxis)),e>0&&i(t.datapoints,0,0,t.xaxis,t.yaxis),et.restore()}function N(t){function i(t,i,e,o,n,r,a,l){for(var s=t.points,c=t.pointsize,f=0;fr.max||ua.max||(et.beginPath(),h=r.p2c(h),u=a.p2c(u)+o,"circle"==l?et.arc(h,u,i,0,n?Math.PI:2*Math.PI,!1):l(et,h,u,i,n),et.closePath(),e&&(et.fillStyle=e,et.fill()),et.stroke())}}et.save(),et.translate(at.left,at.top);var e=t.points.lineWidth,o=t.shadowSize,n=t.points.radius,r=t.points.symbol;if(0==e&&(e=1e-4),e>0&&o>0){var a=o/2;et.lineWidth=a,et.strokeStyle="rgba(0,0,0,0.1)",i(t.datapoints,n,null,a+a/2,!0,t.xaxis,t.yaxis,r),et.strokeStyle="rgba(0,0,0,0.2)",i(t.datapoints,n,null,a/2,!0,t.xaxis,t.yaxis,r)}et.lineWidth=e,et.strokeStyle=t.color,i(t.datapoints,n,O(t.points,t.color),0,!1,t.xaxis,t.yaxis,r),et.restore()}function D(t,i,e,o,n,r,a,l,s,c,f,h){var u,d,p,m,x,g,b,v,k;f?(v=g=b=!0,x=!1,m=i+o,p=i+n,(d=t)<(u=e)&&(k=d,d=u,u=k,x=!0,g=!1)):(x=g=b=!0,v=!1,u=t+o,d=t+n,(m=i)<(p=e)&&(k=m,m=p,p=k,v=!0,b=!1)),dl.max||ms.max||(ul.max&&(d=l.max,g=!1),ps.max&&(m=s.max,b=!1),u=l.p2c(u),p=s.p2c(p),d=l.p2c(d),m=s.p2c(m),a&&(c.beginPath(),c.moveTo(u,p),c.lineTo(u,m),c.lineTo(d,m),c.lineTo(d,p),c.fillStyle=a(p,m),c.fill()),h>0&&(x||g||b||v)&&(c.beginPath(),c.moveTo(u,p+r),x?c.lineTo(u,m+r):c.moveTo(u,m+r),b?c.lineTo(d,m+r):c.moveTo(d,m+r),g?c.lineTo(d,p+r):c.moveTo(d,p+r),v?c.lineTo(u,p+r):c.moveTo(u,p+r),c.stroke()))}function L(t){et.save(),et.translate(at.left,at.top),et.lineWidth=t.bars.lineWidth,et.strokeStyle=t.color;var i;switch(t.bars.align){case"left":i=0;break;case"right":i=-t.bars.barWidth;break;case"center":i=-t.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+t.bars.align)}var e=t.bars.fill?function(i,e){return O(t.bars,t.color,i,e)}:null;!function(i,e,o,n,r,a,l){for(var s=i.points,c=i.pointsize,f=0;f"),n.push(""),a=!0),n.push('
    '+f.label+"")}if(a&&n.push(""),0!=n.length){var h=''+n.join("")+"
    ";if(null!=K.legend.container)t(K.legend.container).html(h);else{var u="",d=K.legend.position,p=K.legend.margin;null==p[0]&&(p=[p,p]),"n"==d.charAt(0)?u+="top:"+(p[1]+at.top)+"px;":"s"==d.charAt(0)&&(u+="bottom:"+(p[1]+at.bottom)+"px;"),"e"==d.charAt(1)?u+="right:"+(p[0]+at.right)+"px;":"w"==d.charAt(1)&&(u+="left:"+(p[0]+at.left)+"px;");var m=t('
    '+h.replace('style="','style="position:absolute;'+u+";")+"
    ").appendTo(e);if(0!=K.legend.backgroundOpacity){var x=K.legend.backgroundColor;null==x&&((x=(x=K.grid.backgroundColor)&&"string"==typeof x?t.color.parse(x):t.color.extract(m,"background-color")).a=1,x=x.toString());var g=m.children();t('
    ').prependTo(m).css("opacity",K.legend.backgroundOpacity)}}}}}function R(t,i,e){var o,n,r,a=K.grid.mouseActiveRadius,l=a*a+1,s=null;for(o=$.length-1;o>=0;--o)if(e($[o])){var c=$[o],f=c.xaxis,h=c.yaxis,u=c.datapoints.points,d=f.c2p(t),p=h.c2p(i),m=a/f.scale,x=a/h.scale;if(r=c.datapoints.pointsize,f.options.inverseTransform&&(m=Number.MAX_VALUE),h.options.inverseTransform&&(x=Number.MAX_VALUE),c.lines.show||c.points.show)for(n=0;nm||g-d<-m||b-p>x||b-p<-x)){var v=Math.abs(f.p2c(g)-t),k=Math.abs(h.p2c(b)-i),y=v*v+k*k;y=Math.min(M,g)&&p>=b+w&&p<=b+T:d>=g+w&&d<=g+T&&p>=Math.min(M,b)&&p<=Math.max(M,b))&&(s=[o,n/r]))}}}return s?(o=s[0],n=s[1],r=$[o].datapoints.pointsize,{datapoint:$[o].datapoints.points.slice(n*r,(n+1)*r),dataIndex:n,series:$[o],seriesIndex:o}):null}function j(t){K.grid.hoverable&&G("plothover",t,function(t){return 0!=t.hoverable})}function B(t){K.grid.hoverable&&G("plothover",t,function(t){return!1})}function H(t){G("plotclick",t,function(t){return 0!=t.clickable})}function G(t,i,o){var n=it.offset(),r=i.pageX-n.left-at.left,a=i.pageY-n.top-at.top,l=u({left:r,top:a});l.pageX=i.pageX,l.pageY=i.pageY;var s=R(r,a,o);if(s&&(s.pageX=parseInt(s.series.xaxis.p2c(s.datapoint[0])+n.left+at.left,10),s.pageY=parseInt(s.series.yaxis.p2c(s.datapoint[1])+n.top+at.top,10)),K.grid.autoHighlight){for(var c=0;cr.max||na.max)){var s=i.points.radius+i.points.lineWidth/2;ot.lineWidth=s,ot.strokeStyle=l;var c=1.5*s;o=r.p2c(o),n=a.p2c(n),ot.beginPath(),"circle"==i.points.symbol?ot.arc(o,n,c,0,2*Math.PI,!1):i.points.symbol(ot,o,n,c,!1),ot.closePath(),ot.stroke()}}function U(i,e){var o="string"==typeof i.highlightColor?i.highlightColor:t.color.parse(i.color).scale("a",.5).toString(),n=o,r="left"==i.bars.align?0:-i.bars.barWidth/2;ot.lineWidth=i.bars.lineWidth,ot.strokeStyle=o,D(e[0],e[1],e[2]||0,r,r+i.bars.barWidth,0,function(){return n},i.xaxis,i.yaxis,ot,i.bars.horizontal,i.bars.lineWidth)}function J(i,e,o,n){if("string"==typeof i)return i;for(var r=et.createLinearGradient(0,o,0,e),a=0,l=i.colors.length;a").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),e=this.text[i]=t("
    ").addClass(i).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),e},i.prototype.getTextInfo=function(i,e,o,n,r){var a,l,s,c;if(e=""+e,a="object"==typeof o?o.style+" "+o.variant+" "+o.weight+" "+o.size+"px/"+o.lineHeight+"px "+o.family:o,null==(l=this._textCache[i])&&(l=this._textCache[i]={}),null==(s=l[a])&&(s=l[a]={}),null==(c=s[e])){var f=t("
    ").html(e).css({position:"absolute","max-width":r,top:-9999}).appendTo(this.getTextLayer(i));"object"==typeof o?f.css({font:a,color:o.color}):"string"==typeof o&&f.addClass(o),c=s[e]={width:f.outerWidth(!0),height:f.outerHeight(!0),element:f,positions:[]},f.detach()}return c},i.prototype.addText=function(t,i,e,o,n,r,a,l,s){var c=this.getTextInfo(t,o,n,r,a),f=c.positions;"center"==l?i-=c.width/2:"right"==l&&(i-=c.width),"middle"==s?e-=c.height/2:"bottom"==s&&(e-=c.height);for(var h,u=0;h=f[u];u++)if(h.x==i&&h.y==e)return void(h.active=!0);h={active:!0,rendered:!1,element:f.length?c.element.clone():c.element,x:i,y:e},f.push(h),h.element.css({top:Math.round(e),left:Math.round(i),"text-align":l})},i.prototype.removeText=function(t,i,e,o,r,a){if(null==o){var l=this._textCache[t];if(null!=l)for(var s in l)if(n.call(l,s)){var c=l[s];for(var f in c)if(n.call(c,f))for(var h=c[f].positions,u=0;d=h[u];u++)d.active=!1}}else for(var d,h=this.getTextInfo(t,o,r,a).positions,u=0;d=h[u];u++)d.x==i&&d.y==e&&(d.active=!1)},t.plot=function(i,o,n){return new e(t(i),o,n,t.plot.plugins)},t.plot.version="0.8.1",t.plot.plugins=[],t.fn.plot=function(i,e){return this.each(function(){t.plot(this,i,e)})}}(jQuery); \ No newline at end of file diff --git a/assets/js/jquery-flot/jquery.flot.pie.min.js b/assets/js/jquery-flot/jquery.flot.pie.min.js deleted file mode 100644 index 5a0959a541a..00000000000 --- a/assets/js/jquery-flot/jquery.flot.pie.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){var i=10,s=.95,t={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(e,i){return"
    "+e+"
    "+Math.round(i.percent)+"%
    "},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plot.plugins.push({init:function(r){function a(i,s,r){y||(y=!0,w=i.getCanvas(),k=e(w).parent(),t=i.getOptions(),i.setData(l(i.getData())))}function l(i){for(var s=0,r=0,a=0,l=t.series.pie.combine.color,n=[],o=0;ot.series.pie.combine.threshold)&&n.push({data:[[1,p]],color:i[o].color,label:i[o].label,angle:p*Math.PI*2/s,percent:p/(s/100)})}return a>1&&n.push({data:[[1,r]],color:l,label:t.series.pie.combine.label,angle:r*Math.PI*2/s,percent:r/(s/100)}),n}function n(r,a){function l(){m.clearRect(0,0,n,p),k.children().filter(".pieLabel, .pieLabelBackground").remove()}if(k){var n=r.getPlaceholder().width(),p=r.getPlaceholder().height(),h=k.children().filter(".legend").children().width()||0;m=a,y=!1,M=Math.min(n,p/t.series.pie.tilt)/2,A=p/2+t.series.pie.offset.top,P=n/2,"auto"==t.series.pie.offset.left?t.legend.position.match("w")?P+=h/2:P-=h/2:P+=t.series.pie.offset.left,Pn-M&&(P=n-M);var g=r.getData(),c=0;do{c>0&&(M*=s),c+=1,l(),t.series.pie.tilt<=.8&&function(){var e=t.series.pie.shadow.left,i=t.series.pie.shadow.top,s=t.series.pie.shadow.alpha,r=t.series.pie.radius>1?t.series.pie.radius:M*t.series.pie.radius;if(!(r>=n/2-e||r*t.series.pie.tilt>=p/2-i||r<=10)){m.save(),m.translate(e,i),m.globalAlpha=s,m.fillStyle="#000",m.translate(P,A),m.scale(1,t.series.pie.tilt);for(var a=1;a<=10;a++)m.beginPath(),m.arc(0,0,r,0,2*Math.PI,!1),m.fill(),r-=a;m.restore()}}()}while(!function(){function i(e,i,s){e<=0||isNaN(e)||(s?m.fillStyle=i:(m.strokeStyle=i,m.lineJoin="round"),m.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&m.moveTo(0,0),m.arc(0,0,r,a,a+e/2,!1),m.arc(0,0,r,a+e/2,a+e,!1),m.closePath(),a+=e,s?m.fill():m.stroke())}var s=Math.PI*t.series.pie.startAngle,r=t.series.pie.radius>1?t.series.pie.radius:M*t.series.pie.radius;m.save(),m.translate(P,A),m.scale(1,t.series.pie.tilt),m.save();for(var a=s,l=0;l0){for(m.save(),m.lineWidth=t.series.pie.stroke.width,a=s,l=0;l1?t.series.pie.label.radius:M*t.series.pie.label.radius,a=0;a=100*t.series.pie.label.threshold&&!function(i,s,a){if(0==i.data[0][1])return!0;var l,o=t.legend.labelFormatter,h=t.series.pie.label.formatter;l=o?o(i.label,i):i.label,h&&(l=h(l,i));var g=(s+i.angle+s)/2,c=P+Math.round(Math.cos(g)*r),u=A+Math.round(Math.sin(g)*r)*t.series.pie.tilt,d=""+l+"";k.append(d);var f=k.children("#pieLabel"+a),v=u-f.height()/2,b=c-f.width()/2;if(f.css("top",v),f.css("left",b),0-v>0||0-b>0||p-(v+f.height())<0||n-(b+f.width())<0)return!1;if(0!=t.series.pie.label.background.opacity){var w=t.series.pie.label.background.color;null==w&&(w=i.color);var M="top:"+v+"px;left:"+b+"px;";e("
    ").css("opacity",t.series.pie.label.background.opacity).insertBefore(f)}return!0}(g[a],i,a))return!1;i+=g[a].angle}return!0}()}()&&c=i&&(l(),k.prepend("
    Could not draw pie with labels contained inside canvas
    ")),r.setSeries&&r.insertLegend&&(r.setSeries(g),r.insertLegend())}}function o(e){if(t.series.pie.innerRadius>0){e.save();var i=t.series.pie.innerRadius>1?t.series.pie.innerRadius:M*t.series.pie.innerRadius;e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle=t.series.pie.stroke.color,e.arc(0,0,i,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.strokeStyle=t.series.pie.stroke.color,e.arc(0,0,i,0,2*Math.PI,!1),e.stroke(),e.closePath(),e.restore()}}function p(e,i){for(var s=!1,t=-1,r=e.length,a=r-1;++t1?l.series.pie.radius:M*l.series.pie.radius,o=0;o1?s.series.pie.radius:M*s.series.pie.radius;i.save(),i.translate(P,A),i.scale(1,s.series.pie.tilt);for(var r=0;r1e-9&&i.moveTo(0,0),i.arc(0,0,t,e.startAngle,e.startAngle+e.angle/2,!1),i.arc(0,0,t,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),i.closePath(),i.fill())}(I[r].series);o(i),i.restore()}var w=null,k=null,M=null,P=null,A=null,y=!1,m=null,I=[];r.hooks.processOptions.push(function(e,i){i.series.pie.show&&(i.grid.show=!1,"auto"==i.series.pie.label.show&&(i.legend.show?i.series.pie.label.show=!1:i.series.pie.label.show=!0),"auto"==i.series.pie.radius&&(i.series.pie.label.show?i.series.pie.radius=.75:i.series.pie.radius=1),i.series.pie.tilt>1?i.series.pie.tilt=1:i.series.pie.tilt<0&&(i.series.pie.tilt=0))}),r.hooks.bindEvents.push(function(e,i){var s=e.getOptions();s.series.pie.show&&(s.grid.hoverable&&i.unbind("mousemove").mousemove(g),s.grid.clickable&&i.unbind("click").click(c))}),r.hooks.processDatapoints.push(function(e,i,s,t){e.getOptions().series.pie.show&&a(e)}),r.hooks.drawOverlay.push(function(e,i){e.getOptions().series.pie.show&&b(e,i)}),r.hooks.draw.push(function(e,i){e.getOptions().series.pie.show&&n(e,i)})},options:t,name:"pie",version:"1.1"})}(jQuery); \ No newline at end of file diff --git a/assets/js/jquery-flot/jquery.flot.resize.min.js b/assets/js/jquery-flot/jquery.flot.resize.min.js deleted file mode 100644 index d40e7be3ff8..00000000000 --- a/assets/js/jquery-flot/jquery.flot.resize.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e,i){function n(){h=e[o](function(){r.each(function(){var e=t(this),i=e.width(),n=e.height(),h=t.data(this,u);i===h.w&&n===h.h||e.trigger(a,[h.w=i,h.h=n])}),n()},s[d])}var h,r=t([]),s=t.resize=t.extend(t.resize,{}),o="setTimeout",a="resize",u=a+"-special-event",d="delay",c="throttleWindow";s[d]=250,s[c]=!0,t.event.special[a]={setup:function(){if(!s[c]&&this[o])return!1;var e=t(this);r=r.add(e),t.data(this,u,{w:e.width(),h:e.height()}),1===r.length&&n()},teardown:function(){if(!s[c]&&this[o])return!1;var e=t(this);r=r.not(e),e.removeData(u),r.length||clearTimeout(h)},add:function(e){function n(e,n,r){var s=t(this),o=t.data(this,u);o.w=n!==i?n:s.width(),o.h=r!==i?r:s.height(),h.apply(this,arguments)}if(!s[c]&&this[o])return!1;var h;if(t.isFunction(e))return h=e,n;h=e.handler,e.handler=n}}}(jQuery,this),function(t){var e={};jQuery.plot.plugins.push({init:function(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}t.hooks.bindEvents.push(function(t,i){t.getPlaceholder().resize(e)}),t.hooks.shutdown.push(function(t,i){t.getPlaceholder().unbind("resize",e)})},options:e,name:"resize",version:"1.0"})}(); \ No newline at end of file diff --git a/assets/js/jquery-flot/jquery.flot.stack.min.js b/assets/js/jquery-flot/jquery.flot.stack.min.js deleted file mode 100644 index a16c8c63f8d..00000000000 --- a/assets/js/jquery-flot/jquery.flot.stack.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(s){var n={series:{stack:null}};jQuery.plot.plugins.push({init:function(s){function n(s,n){for(var t=null,i=0;i2&&(d?i.format[2].x:i.format[2].y),D=z&&t.lines.steps,b=!0,j=d?1:0,w=d?0:1,x=0,Q=0;!(x>=g.length);){if(r=m.length,null==g[x]){for(h=0;h=v.length){if(!z)for(h=0;hf){if(z&&x>0&&null!=g[x-c]){for(u=e+(g[x-c+w]-e)*(f-o)/(g[x-c+j]-o),m.push(f),m.push(u+a),h=2;h0&&null!=v[Q-k]&&(p=a+(v[Q-k+w]-a)*(o-f)/(v[Q-k+j]-f)),m[r+w]+=p,x+=c}b=!1,r!=m.length&&y&&(m[r+2]+=p)}if(D&&r!=m.length&&r>0&&null!=m[r]&&m[r]!=m[r-c]&&m[r+1]!=m[r-c+1]){for(h=0;h12?s-12:0==s?12:s;for(var m=0;m=s);++l);var h=m[l][0],f=m[l][1];if("year"==f){if(null!=a.minTickSize&&"year"==a.minTickSize[1])h=Math.floor(a.minTickSize[0]);else{var k=Math.pow(10,Math.floor(Math.log(e.delta/o.year)/Math.LN10)),d=e.delta/o.year/k;h=d<1.5?1:d<3?2:d<7.5?5:10,h*=k}h<1&&(h=1)}e.tickSize=a.tickSize||[h,f];var M=e.tickSize[0];f=e.tickSize[1];var g=M*o[f];"second"==f?r.setSeconds(t(r.getSeconds(),M)):"minute"==f?r.setMinutes(t(r.getMinutes(),M)):"hour"==f?r.setHours(t(r.getHours(),M)):"month"==f?r.setMonth(t(r.getMonth(),M)):"quarter"==f?r.setMonth(3*t(r.getMonth()/3,M)):"year"==f&&r.setFullYear(t(r.getFullYear(),M)),r.setMilliseconds(0),g>=o.minute&&r.setSeconds(0),g>=o.hour&&r.setMinutes(0),g>=o.day&&r.setHours(0),g>=4*o.day&&r.setDate(1),g>=2*o.month&&r.setMonth(t(r.getMonth(),3)),g>=2*o.quarter&&r.setMonth(t(r.getMonth(),6)),g>=o.year&&r.setMonth(0);var y,S=0,z=Number.NaN;do{if(y=z,z=r.getTime(),n.push(z),"month"==f||"quarter"==f)if(M<1){r.setDate(1);var p=r.getTime();r.setMonth(r.getMonth()+("quarter"==f?3:1));var v=r.getTime();r.setTime(z+S*o.hour+(v-p)*M),S=r.getHours(),r.setHours(0)}else r.setMonth(r.getMonth()+M*("quarter"==f?3:1));else"year"==f?r.setFullYear(r.getFullYear()+M):r.setTime(z+g)}while(z9&&(e-=9),a+=e;return a%10==0},h=function(t){var e;return null!=t.prop("selectionStart")&&t.prop("selectionStart")!==t.prop("selectionEnd")||!(null==("undefined"!=typeof document&&null!==document&&null!=(e=document.selection)?e.createRange:void 0)||!document.selection.createRange().text)},$=function(t,e){var n,r,a,i,o;try{r=e.prop("selectionStart")}catch(l){l,r=null}if(i=e.val(),e.val(t),null!==r&&e.is(":focus"))return r===i.length&&(r=t.length),i!==t&&(o=i.slice(r-1,+r+1||9e9),n=t.slice(r-1,+r+1||9e9),a=t[r],/\d/.test(a)&&o===a+" "&&n===" "+a&&(r+=1)),e.prop("selectionStart",r),e.prop("selectionEnd",r)},m=function(t){var e,n,r,a,i,o;for(null==t&&(t=""),"0123456789","0123456789",a="",i=0,o=(e=t.split("")).length;i-1&&(n="0123456789"[r]),a+=n;return a},d=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,""),$(t,n)})},g=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatCardNumber(e),$(e,n)})},l=function(n){var r,a,i,o,l,u,s;if(i=String.fromCharCode(n.which),/^\d+$/.test(i)&&(r=t(n.currentTarget),s=r.val(),a=e(s+i),o=(s.replace(/\D/g,"")+i).length,u=16,a&&(u=a.length[a.length.length-1]),!(o>=u||null!=r.prop("selectionStart")&&r.prop("selectionStart")!==s.length)))return(l=a&&"amex"===a.type?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/).test(s)?(n.preventDefault(),setTimeout(function(){return r.val(s+" "+i)})):l.test(s+i)?(n.preventDefault(),setTimeout(function(){return r.val(s+i+" ")})):void 0},i=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s$/,""))})):/\s\d?$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d$/,""))})):void 0},v=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatExpiry(e),$(e,n)})},u=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val()+r,/^\d$/.test(a)&&"0"!==a&&"1"!==a?(e.preventDefault(),setTimeout(function(){return n.val("0"+a+" / ")})):/^\d\d$/.test(a)?(e.preventDefault(),setTimeout(function(){var t,e;return t=parseInt(a[0],10),(e=parseInt(a[1],10))>2&&0!==t?n.val("0"+t+" / "+e):n.val(a+" / ")})):void 0},s=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val(),/^\d\d$/.test(a)?n.val(a+" / "):void 0},c=function(e){var n,r,a;if("/"===(a=String.fromCharCode(e.which))||" "===a)return n=t(e.currentTarget),r=n.val(),/^\d$/.test(r)&&"0"!==r?n.val("0"+r+" / "):void 0},o=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s\/\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s\/\s$/,""))})):void 0},f=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,"").slice(0,4),$(t,n)})},w=function(t){var e;return!(!t.metaKey&&!t.ctrlKey)||32!==t.which&&(0===t.which||(t.which<33||(e=String.fromCharCode(t.which),!!/[\d\s]/.test(e))))},C=function(n){var r,a,i,o;if(r=t(n.currentTarget),i=String.fromCharCode(n.which),/^\d+$/.test(i)&&!h(r))return o=(r.val()+i).replace(/\D/g,""),(a=e(o))?o.length<=a.length[a.length.length-1]:o.length<=16},T=function(e){var n,r,a;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return a=n.val()+r,!((a=a.replace(/\D/g,"")).length>6)&&void 0},y=function(e){var n,r;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return(n.val()+r).length<=4},D=function(e){var n,a,i,o,l;if(n=t(e.currentTarget),l=n.val(),o=t.payment.cardType(l)||"unknown",!n.hasClass(o))return a=function(){var t,e,n;for(n=[],t=0,e=r.length;t=0&&(!1===n.luhn||p(t))))},t.payment.validateCardExpiry=function(e,n){var r,a,i;return"object"==typeof e&&"month"in e&&(e=(i=e).month,n=i.year),!(!e||!n)&&(e=t.trim(e),n=t.trim(n),!!/^\d+$/.test(e)&&(!!/^\d+$/.test(n)&&(1<=e&&e<=12&&(2===n.length&&(n=n<70?"20"+n:"19"+n),4===n.length&&(a=new Date(n,e),r=new Date,a.setMonth(a.getMonth()-1),a.setMonth(a.getMonth()+1,1),a>r)))))},t.payment.validateCardCVC=function(e,r){var a,i;return e=t.trim(e),!!/^\d+$/.test(e)&&(null!=(a=n(r))?(i=e.length,k.call(a.cvcLength,i)>=0):e.length>=3&&e.length<=4)},t.payment.cardType=function(t){var n;return t?(null!=(n=e(t))?n.type:void 0)||null:null},t.payment.formatCardNumber=function(n){var r,a,i,o;return n=n.replace(/\D/g,""),(r=e(n))?(i=r.length[r.length.length-1],n=n.slice(0,i),r.format.global?null!=(o=n.match(r.format))?o.join(" "):void 0:null!=(a=r.format.exec(n))?(a.shift(),(a=t.grep(a,function(t){return t})).join(" ")):void 0):n},t.payment.formatExpiry=function(t){var e,n,r,a;return(n=t.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))?(e=n[1]||"",r=n[2]||"",(a=n[3]||"").length>0?r=" / ":" /"===r?(e=e.substring(0,1),r=""):2===e.length||r.length>0?r=" / ":1===e.length&&"0"!==e&&"1"!==e&&(e="0"+e,r=" / "),e+r+a):""}}).call(this)}); \ No newline at end of file diff --git a/assets/js/jquery-qrcode/jquery.qrcode.min.js b/assets/js/jquery-qrcode/jquery.qrcode.min.js deleted file mode 100644 index a6791313d1c..00000000000 --- a/assets/js/jquery-qrcode/jquery.qrcode.min.js +++ /dev/null @@ -1 +0,0 @@ -function QR8bitByte(t){this.mode=QRMode.MODE_8BIT_BYTE,this.data=t}function QRCode(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}function QRPolynomial(t,e){if(t.length==undefined)throw new Error(t.length+"/"+e);for(var r=0;r=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=QRCode.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var o=-1;o<=7;o++)e+o<=-1||this.moduleCount<=e+o||(this.modules[t+r][e+o]=0<=r&&r<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=o&&o<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var o=QRUtil.getLostPoint(this);(0==r||t>o)&&(t=o,e=r)}return e},createMovieClip:function(t,e,r){var o=t.createEmptyMovieClip(e,r);this.make();for(var n=0;n>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=o}for(r=0;r<18;r++){var o=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=o}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,o=QRUtil.getBCHTypeInfo(r),n=0;n<15;n++){i=!t&&1==(o>>n&1);n<6?this.modules[n][8]=i:n<8?this.modules[n+1][8]=i:this.modules[this.moduleCount-15+n][8]=i}for(n=0;n<15;n++){var i=!t&&1==(o>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=i:n<9?this.modules[8][15-n-1+1]=i:this.modules[8][15-n-1]=i}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,o=this.moduleCount-1,n=7,i=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[o][a-s]){var u=!1;i>>n&1)),QRUtil.getMask(e,o,a-s)&&(u=!u),this.modules[o][a-s]=u,-1==--n&&(i++,n=7)}if((o+=r)<0||this.moduleCount<=o){o-=r,r=-r;break}}}},QRCode.PAD0=236,QRCode.PAD1=17,QRCode.createData=function(t,e,r){for(var o=QRRSBlock.getRSBlocks(t,e),n=new QRBitBuffer,i=0;i8*s)throw new Error("code length overflow. ("+n.getLengthInBits()+">"+8*s+")");for(n.getLengthInBits()+4<=8*s&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;;){if(n.getLengthInBits()>=8*s)break;if(n.put(QRCode.PAD0,8),n.getLengthInBits()>=8*s)break;n.put(QRCode.PAD1,8)}return QRCode.createBytes(n,o)},QRCode.createBytes=function(t,e){for(var r=0,o=0,n=0,i=new Array(e.length),a=new Array(e.length),s=0;s=0?f.get(g):0}}for(var d=0,R=0;R=0;)e^=QRUtil.G15<=0;)e^=QRUtil.G18<>>=1;return e},getPatternPosition:function(t){return QRUtil.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case QRMaskPattern.PATTERN000:return(e+r)%2==0;case QRMaskPattern.PATTERN001:return e%2==0;case QRMaskPattern.PATTERN010:return r%3==0;case QRMaskPattern.PATTERN011:return(e+r)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case QRMaskPattern.PATTERN101:return e*r%2+e*r%3==0;case QRMaskPattern.PATTERN110:return(e*r%2+e*r%3)%2==0;case QRMaskPattern.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new QRPolynomial([1],0),r=0;r5&&(r+=3+n-5)}for(o=0;o=256;)t-=255;return QRMath.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},function(t){t.fn.qrcode=function(e){"string"==typeof e&&(e={text:e}),e=t.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:QRErrorCorrectLevel.H,background:"#ffffff",foreground:"#000000"},e);var r=function(){var t=new QRCode(e.typeNumber,e.correctLevel);t.addData(e.text),t.make();var r=document.createElement("canvas");r.width=e.width,r.height=e.height;for(var o=r.getContext("2d"),n=e.width/t.getModuleCount(),i=e.height/t.getModuleCount(),a=0;a").css("width",e.width+"px").css("height",e.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",e.background),n=e.width/r.getModuleCount(),i=e.height/r.getModuleCount(),a=0;a").css("height",i+"px").appendTo(o),u=0;u").css("width",n+"px").css("background-color",r.isDark(a,u)?e.foreground:e.background).appendTo(s);return o};return this.each(function(){var n="canvas"==e.render?r():o();t(n).appendTo(this)})}}(jQuery); \ No newline at end of file diff --git a/assets/js/jquery-serializejson/jquery.serializejson.min.js b/assets/js/jquery-serializejson/jquery.serializejson.min.js deleted file mode 100644 index 731cffe739c..00000000000 --- a/assets/js/jquery-serializejson/jquery.serializejson.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - SerializeJSON jQuery plugin. - https://github.com/marioizquierdo/jquery.serializeJSON - version 2.8.1 (Dec, 2016) - - Copyright (c) 2012, 2017 Mario Izquierdo - Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. -*/ -!function(e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("object"==typeof exports){var n=require("jquery");module.exports=e(n)}else e(window.jQuery||window.Zepto||window.$)}(function(e){"use strict";e.fn.serializeJSON=function(n){var r,s,t,a,i,u,l,o,p,c,d,f,y;return r=e.serializeJSON,s=this,t=r.setupOpts(n),a=s.serializeArray(),r.readCheckboxUncheckedValues(a,t,s),i={},e.each(a,function(e,n){u=n.name,l=n.value,p=r.extractTypeAndNameWithNoType(u),c=p.nameWithNoType,(d=p.type)||(d=r.attrFromInputWithName(s,u,"data-value-type")),r.validateType(u,d,t),"skip"!==d&&(f=r.splitInputNameIntoKeysArray(c),o=r.parseValue(l,u,d,t),(y=!o&&r.shouldSkipFalsy(s,u,c,d,t))||r.deepSet(i,f,o,t))}),i},e.serializeJSON={defaultOptions:{checkboxUncheckedValue:undefined,parseNumbers:!1,parseBooleans:!1,parseNulls:!1,parseAll:!1,parseWithFunction:null,skipFalsyValuesForTypes:[],skipFalsyValuesForFields:[],customTypes:{},defaultTypes:{string:function(e){return String(e)},number:function(e){return Number(e)},"boolean":function(e){return-1===["false","null","undefined","","0"].indexOf(e)},"null":function(e){return-1===["false","null","undefined","","0"].indexOf(e)?e:null},array:function(e){return JSON.parse(e)},object:function(e){return JSON.parse(e)},auto:function(n){return e.serializeJSON.parseValue(n,null,null,{parseNumbers:!0,parseBooleans:!0,parseNulls:!0})},skip:null},useIntKeysAsArrayIndex:!1},setupOpts:function(n){var r,s,t,a,i,u;u=e.serializeJSON,null==n&&(n={}),t=u.defaultOptions||{},s=["checkboxUncheckedValue","parseNumbers","parseBooleans","parseNulls","parseAll","parseWithFunction","skipFalsyValuesForTypes","skipFalsyValuesForFields","customTypes","defaultTypes","useIntKeysAsArrayIndex"];for(r in n)if(-1===s.indexOf(r))throw new Error("serializeJSON ERROR: invalid option '"+r+"'. Please use one of "+s.join(", "));return a=function(e){return!1!==n[e]&&""!==n[e]&&(n[e]||t[e])},i=a("parseAll"),{checkboxUncheckedValue:a("checkboxUncheckedValue"),parseNumbers:i||a("parseNumbers"),parseBooleans:i||a("parseBooleans"),parseNulls:i||a("parseNulls"),parseWithFunction:a("parseWithFunction"),skipFalsyValuesForTypes:a("skipFalsyValuesForTypes"),skipFalsyValuesForFields:a("skipFalsyValuesForFields"),typeFunctions:e.extend({},a("defaultTypes"),a("customTypes")),useIntKeysAsArrayIndex:a("useIntKeysAsArrayIndex")}},parseValue:function(n,r,s,t){var a,i;return a=e.serializeJSON,i=n,t.typeFunctions&&s&&t.typeFunctions[s]?i=t.typeFunctions[s](n):t.parseNumbers&&a.isNumeric(n)?i=Number(n):!t.parseBooleans||"true"!==n&&"false"!==n?t.parseNulls&&"null"==n&&(i=null):i="true"===n,t.parseWithFunction&&!s&&(i=t.parseWithFunction(i,r)),i},isObject:function(e){return e===Object(e)},isUndefined:function(e){return void 0===e},isValidArrayIndex:function(e){return/^[0-9]+$/.test(String(e))},isNumeric:function(e){return e-parseFloat(e)>=0},optionKeys:function(e){if(Object.keys)return Object.keys(e);var n,r=[];for(n in e)r.push(n);return r},readCheckboxUncheckedValues:function(n,r,s){var t,a,i;null==r&&(r={}),e.serializeJSON,t="input[type=checkbox][name]:not(:checked):not([disabled])",s.find(t).add(s.filter(t)).each(function(s,t){if(a=e(t),null==(i=a.attr("data-unchecked-value"))&&(i=r.checkboxUncheckedValue),null!=i){if(t.name&&-1!==t.name.indexOf("[]["))throw new Error("serializeJSON ERROR: checkbox unchecked values are not supported on nested arrays of objects like '"+t.name+"'. See https://github.com/marioizquierdo/jquery.serializeJSON/issues/67");n.push({name:t.name,value:i})}})},extractTypeAndNameWithNoType:function(e){var n;return(n=e.match(/(.*):([^:]+)$/))?{nameWithNoType:n[1],type:n[2]}:{nameWithNoType:e,type:null}},shouldSkipFalsy:function(n,r,s,t,a){var i=e.serializeJSON.attrFromInputWithName(n,r,"data-skip-falsy");if(null!=i)return"false"!==i;var u=a.skipFalsyValuesForFields;if(u&&(-1!==u.indexOf(s)||-1!==u.indexOf(r)))return!0;var l=a.skipFalsyValuesForTypes;return null==t&&(t="string"),!(!l||-1===l.indexOf(t))},attrFromInputWithName:function(e,n,r){var s,t;return s=n.replace(/(:|\.|\[|\]|\s)/g,"\\$1"),t='[name="'+s+'"]',e.find(t).add(e.filter(t)).attr(r)},validateType:function(n,r,s){var t,a;if(a=e.serializeJSON,t=a.optionKeys(s?s.typeFunctions:a.defaultOptions.defaultTypes),r&&-1===t.indexOf(r))throw new Error("serializeJSON ERROR: Invalid type "+r+" found in input name '"+n+"', please use one of "+t.join(", "));return!0},splitInputNameIntoKeysArray:function(n){var r;return e.serializeJSON,r=n.split("["),""===(r=e.map(r,function(e){return e.replace(/\]/g,"")}))[0]&&r.shift(),r},deepSet:function(n,r,s,t){var a,i,u,l,o,p;if(null==t&&(t={}),(p=e.serializeJSON).isUndefined(n))throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined");if(!r||0===r.length)throw new Error("ArgumentError: param 'keys' expected to be an array with least one element");a=r[0],1===r.length?""===a?n.push(s):n[a]=s:(i=r[1],""===a&&(o=n[l=n.length-1],a=p.isObject(o)&&(p.isUndefined(o[i])||r.length>2)?l:l+1),""===i?!p.isUndefined(n[a])&&e.isArray(n[a])||(n[a]=[]):t.useIntKeysAsArrayIndex&&p.isValidArrayIndex(i)?!p.isUndefined(n[a])&&e.isArray(n[a])||(n[a]=[]):!p.isUndefined(n[a])&&p.isObject(n[a])||(n[a]={}),u=r.slice(1),p.deepSet(n[a],u,s,t))}}}); \ No newline at end of file diff --git a/assets/js/jquery-tiptip/jquery.tipTip.min.js b/assets/js/jquery-tiptip/jquery.tipTip.min.js deleted file mode 100644 index af7b5a8b354..00000000000 --- a/assets/js/jquery-tiptip/jquery.tipTip.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(O){O.fn.tipTip=function(t){var g,b,M,w=O.extend({activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},t);return O("#tiptip_holder").length<=0?(g=O('
    '),b=O('
    '),M=O('
    '),O("body").append(g.html(b).prepend(M.html('
    ')))):(g=O("#tiptip_holder"),b=O("#tiptip_content"),M=O("#tiptip_arrow")),this.each(function(){var _,v,m=O(this);function t(){w.enter.call(this),b.html(_),g.hide().removeAttr("class").css("margin","0"),M.removeAttr("style");var t=parseInt(m.offset().top),e=parseInt(m.offset().left),o=parseInt(m.outerWidth()),i=parseInt(m.outerHeight()),n=g.outerWidth(),r=g.outerHeight(),a=Math.round((o-n)/2),f=Math.round((i-r)/2),d=Math.round(e+a),u=Math.round(t+i+w.edgeOffset),p="",h="",l=Math.round(n-12)/2;"bottom"==w.defaultPosition?p="_bottom":"top"==w.defaultPosition?p="_top":"left"==w.defaultPosition?p="_left":"right"==w.defaultPosition&&(p="_right");var c=a+eparseInt(O(window).width());c&&a<0||"_right"==p&&!s||"_left"==p&&eparseInt(O(window).height()+O(window).scrollTop()),f=t+i-(w.edgeOffset+r+8)<0;n||"_bottom"==p&&n||"_top"==p&&!f?("_top"==p||"_bottom"==p?p="_top":p+="_top",h=r,u=Math.round(t-(r+5+w.edgeOffset))):(f|("_top"==p&&f)||"_bottom"==p&&!n)&&("_top"==p||"_bottom"==p?p="_bottom":p+="_bottom",h=-12,u=Math.round(t+i+w.edgeOffset)),"_right_top"==p||"_left_top"==p?u+=5:"_right_bottom"!=p&&"_left_bottom"!=p||(u-=5),"_left_top"!=p&&"_left_bottom"!=p||(d+=5),M.css({"margin-left":l+"px","margin-top":h+"px"}),g.css({"margin-left":d+"px","margin-top":u+"px"}).attr("class","tip"+p),v&&clearTimeout(v),v=setTimeout(function(){g.stop(!0,!0).fadeIn(w.fadeIn)},w.delay)}function e(){w.exit.call(this),v&&clearTimeout(v),g.fadeOut(w.fadeOut)}""!=(_=w.content?w.content:m.attr(w.attribute))&&(w.content||m.removeAttr(w.attribute),v=!1,"hover"==w.activation?(m.hover(function(){t()},function(){w.keepAlive&&g.is(":hover")||e()}),w.keepAlive&&g.hover(function(){},function(){e()})):"focus"==w.activation?m.focus(function(){t()}).blur(function(){e()}):"click"==w.activation&&(m.click(function(){return t(),!1}).hover(function(){},function(){w.keepAlive||e()}),w.keepAlive&&g.hover(function(){},function(){e()})))})}}(jQuery); \ No newline at end of file diff --git a/assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js b/assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js deleted file mode 100644 index d4d30a2c37d..00000000000 --- a/assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * jQuery UI Touch Punch 0.2.3 - * - * Copyright 2011–2014, Dave Furfero - * Dual licensed under the MIT or GPL Version 2 licenses. - * - * Depends: - * jquery.ui.widget.js - * jquery.ui.mouse.js - */ -!function(o){function t(o,t){if(!(o.originalEvent.touches.length>1)){o.preventDefault();var e=o.originalEvent.changedTouches[0],u=document.createEvent("MouseEvents");u.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),o.target.dispatchEvent(u)}}if(o.support.touch="ontouchend"in document,o.support.touch){var e,u=o.ui.mouse.prototype,n=u._mouseInit,c=u._mouseDestroy;u._touchStart=function(o){var u=this;!e&&u._mouseCapture(o.originalEvent.changedTouches[0])&&(e=!0,u._touchMoved=!1,t(o,"mouseover"),t(o,"mousemove"),t(o,"mousedown"))},u._touchMove=function(o){e&&(this._touchMoved=!0,t(o,"mousemove"))},u._touchEnd=function(o){e&&(t(o,"mouseup"),t(o,"mouseout"),this._touchMoved||t(o,"click"),e=!1)},u._mouseInit=function(){var t=this;t.element.bind({touchstart:o.proxy(t,"_touchStart"),touchmove:o.proxy(t,"_touchMove"),touchend:o.proxy(t,"_touchEnd")}),n.call(t)},u._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:o.proxy(t,"_touchStart"),touchmove:o.proxy(t,"_touchMove"),touchend:o.proxy(t,"_touchEnd")}),c.call(t)}}}(jQuery); \ No newline at end of file diff --git a/assets/js/js-cookie/js.cookie.min.js b/assets/js/js-cookie/js.cookie.min.js deleted file mode 100644 index ab19f878e02..00000000000 --- a/assets/js/js-cookie/js.cookie.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * JavaScript Cookie v2.1.4 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2015 Klaus Hartl & Fagner Brack - * Released under the MIT license - */ -!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(m){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,!0!==i[s]&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!!c.href&&(!!c.hasAttribute("download")||(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1))},H=function(){for(var a,b,c,d,e,f="",g=0;g