woocommerce_ajax_loader_url

This commit is contained in:
Mike Jolley 2012-08-25 10:32:14 +01:00
parent 555cd9af60
commit b450616848
9 changed files with 11 additions and 9 deletions

View File

@ -49,7 +49,7 @@ jQuery(document).ready(function($) {
}
// Block widgets and fragments
$('.widget_shopping_cart, .shop_table.cart, .updating, .cart_totals').fadeTo('400', '0.6').block({message: null, overlayCSS: {background: 'transparent url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } } );
$('.widget_shopping_cart, .shop_table.cart, .updating, .cart_totals').fadeTo('400', '0.6').block({message: null, overlayCSS: {background: 'transparent url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', opacity: 0.6 } } );
// Changes button classes
$thisbutton.addClass('added');

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".add_to_cart_button").live("click",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});t.addClass("added");if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});
jQuery(document).ready(function(e){e(".add_to_cart_button").live("click",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.ajax_loader_url+") no-repeat center",opacity:.6}});t.addClass("added");if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});

View File

@ -13,7 +13,7 @@ jQuery(document).ready(function($) {
var method = $(this).val();
$('div.cart_totals').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
$('div.cart_totals').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', opacity: 0.6}});
var data = {
action: 'woocommerce_update_shipping_method',

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".shipping-calculator-form").hide();e(".shipping-calculator-button").click(function(){e(".shipping-calculator-form").slideToggle("slow");return!1});e("select#shipping_method, input[name=shipping_method]").live("change",function(){var t=e(this).val();e("div.cart_totals").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var n={action:"woocommerce_update_shipping_method",security:woocommerce_params.update_shipping_method_nonce,shipping_method:t};e.post(woocommerce_params.ajax_url,n,function(t){e("div.cart_totals").replaceWith(t);e("body").trigger("updated_shipping_method")})})});
jQuery(document).ready(function(e){e(".shipping-calculator-form").hide();e(".shipping-calculator-button").click(function(){e(".shipping-calculator-form").slideToggle("slow");return!1});e("select#shipping_method, input[name=shipping_method]").live("change",function(){var t=e(this).val();e("div.cart_totals").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.ajax_loader_url+") no-repeat center",opacity:.6}});var n={action:"woocommerce_update_shipping_method",security:woocommerce_params.update_shipping_method_nonce,shipping_method:t};e.post(woocommerce_params.ajax_url,n,function(t){e("div.cart_totals").replaceWith(t);e("body").trigger("updated_shipping_method")})})});

View File

@ -29,7 +29,7 @@ jQuery(document).ready(function($) {
var s_postcode = $('input#shipping_postcode').val();
}
$('#order_methods, #order_review').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
$('#order_methods, #order_review').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', opacity: 0.6}});
var data = {
action: 'woocommerce_update_order_review',
@ -146,7 +146,7 @@ jQuery(document).ready(function($) {
if ( $form.is('.processing') ) return false;
$form.addClass('processing').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
$form.addClass('processing').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', opacity: 0.6}});
var data = {
action: 'woocommerce_apply_coupon',
@ -191,7 +191,7 @@ jQuery(document).ready(function($) {
var form_data = $form.data();
if ( form_data["blockUI.isBlocked"] != 1 )
$form.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
$form.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', opacity: 0.6}});
$.ajax({
type: 'POST',

File diff suppressed because one or more lines are too long

View File

@ -388,7 +388,7 @@ class WC_Paypal extends WC_Payment_Gateway {
$woocommerce->add_inline_js('
jQuery("body").block({
message: "<img src=\"'.esc_url( $woocommerce->plugin_url() ).'/assets/images/ajax-loader.gif\" alt=\"Redirecting&hellip;\" style=\"float:left; margin-right: 10px;\" />'.__('Thank you for your order. We are now redirecting you to PayPal to make payment.', 'woocommerce').'",
message: "<img src=\"' . esc_url( apply_filters( 'woocommerce_ajax_loader_url', $woocommerce->plugin_url() . '/assets/images/ajax-loader.gif' ) ) . '\" alt=\"Redirecting&hellip;\" style=\"float:left; margin-right: 10px;\" />'.__('Thank you for your order. We are now redirecting you to PayPal to make payment.', 'woocommerce').'",
overlayCSS:
{
background: "#fff",

View File

@ -158,6 +158,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Pass variation to show_variation trigger (JS)
* Tweak - Appended version to scripts to prevent cache issues upon upgrade
* Tweak - Added fallback for variations variable (JS)
* Tweak - Filter for the ajax_loader_url
* Fix - notice in woocommerce_create_term (kudos nathanielks)
* Localization - Few strings (kudos maxistore)

View File

@ -1155,6 +1155,7 @@ class Woocommerce {
'select_state_text' => __( 'Select an option&hellip;', 'woocommerce' ),
'plugin_url' => $this->plugin_url(),
'ajax_url' => $this->ajax_url(),
'ajax_loader_url' => apply_filters( 'woocommerce_ajax_loader_url', $this->plugin_url() . '/assets/images/ajax-loader.gif' ),
'required_rating_text' => esc_attr__( 'Please select a rating', 'woocommerce' ),
'review_rating_required' => get_option( 'woocommerce_review_rating_required' ),
'required_text' => esc_attr__( 'required', 'woocommerce' ),