Fix sorting indicator and add help text to parent. Fixes #5977

This commit is contained in:
Mike Jolley 2014-08-08 10:24:38 +01:00
parent b23b292cd2
commit fe12b330c0
11 changed files with 102 additions and 96 deletions

File diff suppressed because one or more lines are too long

View File

@ -1316,11 +1316,11 @@ table.wp-list-table {
width: 11% !important;
}
.column-featured, .column-product_type {
width: 46px;
width: 48px;
text-align: left !important;
}
.column-customer_message, .column-order_notes {
width: 46px;
width: 48px;
text-align: center;
img {
margin: 0 auto;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.clear{clear:both}.nobr{white-space:nowrap}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format('embedded-opentype'),url(../fonts/WooCommerce.woff) format('woff'),url(../fonts/WooCommerce.ttf) format('truetype'),url(../fonts/WooCommerce.svg#WooCommerce) format('svg');font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover:before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0 12px 12px 0;text-indent:0;top:0;left:0;height:100%;text-align:center;content:"\e001";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a:before{content:"\e01f"}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a:before{content:"\e006"}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a:before{content:"\e011";color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a:before{content:"\e033";color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a:before{content:"\e02c";color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a:before{content:"\e02c";color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating:before{content:"\e021\e021\e021\e021\e021";color:#b3b3b3;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span:before{content:"\e020\e020\e020\e020\e020";top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a:before{font-family:WooCommerce;content:"\e01d"}
.clear{clear:both}.nobr{white-space:nowrap}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format('embedded-opentype'),url(../fonts/WooCommerce.woff) format('woff'),url(../fonts/WooCommerce.ttf) format('truetype'),url(../fonts/WooCommerce.svg#WooCommerce) format('svg');font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover:before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a:before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;top:0;left:0;height:100%;text-align:center;content:"\e001";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a:before{content:"\e01f"}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a:before{content:"\e006"}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a:before{content:"\e011";color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a:before{content:"\e033";color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a:before{content:"\e02c";color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a:before{content:"\e02c";color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating:before{content:"\e021\e021\e021\e021\e021";color:#b3b3b3;float:left;top:0;left:0;position:absolute;letter-spacing:.1em;letter-spacing:0\9}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span:before{content:"\e020\e020\e020\e020\e020";top:0;position:absolute;left:0;letter-spacing:.1em;letter-spacing:0\9;color:#9c5d90}#dash-right-now li.product-count a:before{font-family:WooCommerce;content:"\e01d"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.clear{clear:both}.nobr{white-space:nowrap}.woocommerce .col2-set .col-1,.woocommerce .col2-set .col-2,.woocommerce-page .col2-set .col-1,.woocommerce-page .col2-set .col-2{float:none;width:100%}.woocommerce ul.products li.product,.woocommerce-page ul.products li.product{width:48%;float:left;clear:both;margin:0 0 2.992em}.woocommerce ul.products li.product:nth-child(2n),.woocommerce-page ul.products li.product:nth-child(2n){float:right;clear:none!important}.woocommerce #content div.product div.images,.woocommerce #content div.product div.summary,.woocommerce div.product div.images,.woocommerce div.product div.summary,.woocommerce-page #content div.product div.images,.woocommerce-page #content div.product div.summary,.woocommerce-page div.product div.images,.woocommerce-page div.product div.summary{float:none;width:100%}.woocommerce #content table.cart .product-thumbnail,.woocommerce table.cart .product-thumbnail,.woocommerce-page #content table.cart .product-thumbnail,.woocommerce-page table.cart .product-thumbnail{display:none}.woocommerce #content table.cart td.actions,.woocommerce table.cart td.actions,.woocommerce-page #content table.cart td.actions,.woocommerce-page table.cart td.actions{text-align:left}.woocommerce #content table.cart td.actions .coupon,.woocommerce table.cart td.actions .coupon,.woocommerce-page #content table.cart td.actions .coupon,.woocommerce-page table.cart td.actions .coupon{float:none;padding-bottom:.5em}.woocommerce #content table.cart td.actions .coupon:after,.woocommerce #content table.cart td.actions .coupon:before,.woocommerce table.cart td.actions .coupon:after,.woocommerce table.cart td.actions .coupon:before,.woocommerce-page #content table.cart td.actions .coupon:after,.woocommerce-page #content table.cart td.actions .coupon:before,.woocommerce-page table.cart td.actions .coupon:after,.woocommerce-page table.cart td.actions .coupon:before{content:" ";display:table}.woocommerce #content table.cart td.actions .coupon:after,.woocommerce table.cart td.actions .coupon:after,.woocommerce-page #content table.cart td.actions .coupon:after,.woocommerce-page table.cart td.actions .coupon:after{clear:both}.woocommerce #content table.cart td.actions .button,.woocommerce #content table.cart td.actions .input-text,.woocommerce #content table.cart td.actions input,.woocommerce table.cart td.actions .button,.woocommerce table.cart td.actions .input-text,.woocommerce table.cart td.actions input,.woocommerce-page #content table.cart td.actions .button,.woocommerce-page #content table.cart td.actions .input-text,.woocommerce-page #content table.cart td.actions input,.woocommerce-page table.cart td.actions .button,.woocommerce-page table.cart td.actions .input-text,.woocommerce-page table.cart td.actions input{width:48%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.woocommerce #content table.cart td.actions .button.alt,.woocommerce #content table.cart td.actions .input-text+.button,.woocommerce table.cart td.actions .button.alt,.woocommerce table.cart td.actions .input-text+.button,.woocommerce-page #content table.cart td.actions .button.alt,.woocommerce-page #content table.cart td.actions .input-text+.button,.woocommerce-page table.cart td.actions .button.alt,.woocommerce-page table.cart td.actions .input-text+.button{float:right}.woocommerce .cart-collaterals .cart_totals,.woocommerce .cart-collaterals .cross-sells,.woocommerce .cart-collaterals .shipping_calculator,.woocommerce-page .cart-collaterals .cart_totals,.woocommerce-page .cart-collaterals .cross-sells,.woocommerce-page .cart-collaterals .shipping_calculator{width:100%;float:none;text-align:left}.woocommerce-page.woocommerce-checkout form.login .form-row,.woocommerce.woocommerce-checkout form.login .form-row{width:100%;float:none}.woocommerce #payment .terms,.woocommerce-page #payment .terms{text-align:left;padding:0}.woocommerce #payment #place_order,.woocommerce-page #payment #place_order{float:none;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}.woocommerce .lost_reset_password .form-row-first,.woocommerce .lost_reset_password .form-row-last,.woocommerce-page .lost_reset_password .form-row-first,.woocommerce-page .lost_reset_password .form-row-last{width:100%;float:none;margin-right:0}.single-product .twentythirteen .panel{padding-left:20px!important;padding-right:20px!important}
.clear{clear:both}.nobr{white-space:nowrap}.woocommerce .col2-set .col-1,.woocommerce .col2-set .col-2,.woocommerce-page .col2-set .col-1,.woocommerce-page .col2-set .col-2{float:none;width:100%}.woocommerce ul.products li.product,.woocommerce-page ul.products li.product{width:48%;float:left;clear:both;margin:0 0 2.992em}.woocommerce ul.products li.product:nth-child(2n),.woocommerce-page ul.products li.product:nth-child(2n){float:right;clear:none!important}.woocommerce #content div.product div.images,.woocommerce #content div.product div.summary,.woocommerce div.product div.images,.woocommerce div.product div.summary,.woocommerce-page #content div.product div.images,.woocommerce-page #content div.product div.summary,.woocommerce-page div.product div.images,.woocommerce-page div.product div.summary{float:none;width:100%}.woocommerce #content table.cart .product-thumbnail,.woocommerce table.cart .product-thumbnail,.woocommerce-page #content table.cart .product-thumbnail,.woocommerce-page table.cart .product-thumbnail{display:none}.woocommerce #content table.cart td.actions,.woocommerce table.cart td.actions,.woocommerce-page #content table.cart td.actions,.woocommerce-page table.cart td.actions{text-align:left}.woocommerce #content table.cart td.actions .coupon,.woocommerce table.cart td.actions .coupon,.woocommerce-page #content table.cart td.actions .coupon,.woocommerce-page table.cart td.actions .coupon{float:none;*zoom:1;padding-bottom:.5em}.woocommerce #content table.cart td.actions .coupon:after,.woocommerce #content table.cart td.actions .coupon:before,.woocommerce table.cart td.actions .coupon:after,.woocommerce table.cart td.actions .coupon:before,.woocommerce-page #content table.cart td.actions .coupon:after,.woocommerce-page #content table.cart td.actions .coupon:before,.woocommerce-page table.cart td.actions .coupon:after,.woocommerce-page table.cart td.actions .coupon:before{content:" ";display:table}.woocommerce #content table.cart td.actions .coupon:after,.woocommerce table.cart td.actions .coupon:after,.woocommerce-page #content table.cart td.actions .coupon:after,.woocommerce-page table.cart td.actions .coupon:after{clear:both}.woocommerce #content table.cart td.actions .button,.woocommerce #content table.cart td.actions .input-text,.woocommerce #content table.cart td.actions input,.woocommerce table.cart td.actions .button,.woocommerce table.cart td.actions .input-text,.woocommerce table.cart td.actions input,.woocommerce-page #content table.cart td.actions .button,.woocommerce-page #content table.cart td.actions .input-text,.woocommerce-page #content table.cart td.actions input,.woocommerce-page table.cart td.actions .button,.woocommerce-page table.cart td.actions .input-text,.woocommerce-page table.cart td.actions input{width:48%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.woocommerce #content table.cart td.actions .button.alt,.woocommerce #content table.cart td.actions .input-text+.button,.woocommerce table.cart td.actions .button.alt,.woocommerce table.cart td.actions .input-text+.button,.woocommerce-page #content table.cart td.actions .button.alt,.woocommerce-page #content table.cart td.actions .input-text+.button,.woocommerce-page table.cart td.actions .button.alt,.woocommerce-page table.cart td.actions .input-text+.button{float:right}.woocommerce .cart-collaterals .cart_totals,.woocommerce .cart-collaterals .cross-sells,.woocommerce .cart-collaterals .shipping_calculator,.woocommerce-page .cart-collaterals .cart_totals,.woocommerce-page .cart-collaterals .cross-sells,.woocommerce-page .cart-collaterals .shipping_calculator{width:100%;float:none;text-align:left}.woocommerce-page.woocommerce-checkout form.login .form-row,.woocommerce.woocommerce-checkout form.login .form-row{width:100%;float:none}.woocommerce #payment .terms,.woocommerce-page #payment .terms{text-align:left;padding:0}.woocommerce #payment #place_order,.woocommerce-page #payment #place_order{float:none;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}.woocommerce .lost_reset_password .form-row-first,.woocommerce .lost_reset_password .form-row-last,.woocommerce-page .lost_reset_password .form-row-first,.woocommerce-page .lost_reset_password .form-row-last{width:100%;float:none;margin-right:0}.single-product .twentythirteen .panel{padding-left:20px!important;padding-right:20px!important}

File diff suppressed because one or more lines are too long

View File

@ -3,108 +3,114 @@
/**
* WooCommerce Admin JS
*/
jQuery(function(){
jQuery( function ( $ ) {
// Price input validation
jQuery('body').on( 'blur', '.wc_input_decimal[type=text], .wc_input_price[type=text], .wc_input_country_iso[type=text]', function() {
jQuery('.wc_error_tip').fadeOut('100', function(){ jQuery(this).remove(); } );
$('body').on( 'blur', '.wc_input_decimal[type=text], .wc_input_price[type=text], .wc_input_country_iso[type=text]', function() {
$('.wc_error_tip').fadeOut('100', function(){ $(this).remove(); } );
return this;
});
jQuery('body').on('keyup change', '.wc_input_price[type=text]', function(){
var value = jQuery(this).val();
$('body').on('keyup change', '.wc_input_price[type=text]', function(){
var value = $(this).val();
var regex = new RegExp( "[^\-0-9\%.\\" + woocommerce_admin.mon_decimal_point + "]+", "gi" );
var newvalue = value.replace( regex, '' );
if ( value !== newvalue ) {
jQuery(this).val( newvalue );
if ( jQuery(this).parent().find('.wc_error_tip').size() == 0 ) {
var offset = jQuery(this).position();
jQuery(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_mon_decimal_error + '</div>' );
jQuery('.wc_error_tip')
.css('left', offset.left + jQuery(this).width() - ( jQuery(this).width() / 2 ) - ( jQuery('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + jQuery(this).height() )
$(this).val( newvalue );
if ( $(this).parent().find('.wc_error_tip').size() == 0 ) {
var offset = $(this).position();
$(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_mon_decimal_error + '</div>' );
$('.wc_error_tip')
.css('left', offset.left + $(this).width() - ( $(this).width() / 2 ) - ( $('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + $(this).height() )
.fadeIn('100');
}
}
return this;
});
jQuery('body').on('keyup change', '.wc_input_decimal[type=text]', function(){
var value = jQuery(this).val();
$('body').on('keyup change', '.wc_input_decimal[type=text]', function(){
var value = $(this).val();
var regex = new RegExp( "[^\-0-9\%.\\" + woocommerce_admin.decimal_point + "]+", "gi" );
var newvalue = value.replace( regex, '' );
if ( value !== newvalue ) {
jQuery(this).val( newvalue );
if ( jQuery(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = jQuery(this).position();
jQuery(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_decimal_error + '</div>' );
jQuery('.wc_error_tip')
.css('left', offset.left + jQuery(this).width() - ( jQuery(this).width() / 2 ) - ( jQuery('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + jQuery(this).height() )
$(this).val( newvalue );
if ( $(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = $(this).position();
$(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_decimal_error + '</div>' );
$('.wc_error_tip')
.css('left', offset.left + $(this).width() - ( $(this).width() / 2 ) - ( $('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + $(this).height() )
.fadeIn('100');
}
}
return this;
});
jQuery('body').on('keyup change', '#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]', function(){
var sale_price_field = jQuery(this);
$('body').on('keyup change', '#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]', function(){
var sale_price_field = $(this);
var sale_price = parseInt( sale_price_field.val() );
if( sale_price_field.attr('name').indexOf('variable') !== -1 ) {
var regular_price = parseInt(sale_price_field.parents('.variable_pricing').find('.wc_input_price[name^=variable_regular_price]').val());
} else {
var regular_price = parseInt(jQuery('#_regular_price').val());
var regular_price = parseInt($('#_regular_price').val());
}
if( sale_price >= regular_price ) {
jQuery(this).val( regular_price );
if ( jQuery(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = jQuery(this).position();
jQuery(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18_sale_less_than_regular_error + '</div>' );
jQuery('.wc_error_tip')
.css('left', offset.left + jQuery(this).width() - ( jQuery(this).width() / 2 ) - ( jQuery('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + jQuery(this).height() )
$(this).val( regular_price );
if ( $(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = $(this).position();
$(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18_sale_less_than_regular_error + '</div>' );
$('.wc_error_tip')
.css('left', offset.left + $(this).width() - ( $(this).width() / 2 ) - ( $('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + $(this).height() )
.fadeIn('100');
}
}
return this;
});
jQuery('body').on('keyup change', '.wc_input_country_iso[type=text]', function(){
var value = jQuery(this).val();
$('body').on('keyup change', '.wc_input_country_iso[type=text]', function(){
var value = $(this).val();
var regex = new RegExp( '^([A-Z])?([A-Z])$' );
if ( ! regex.test( value ) ) {
jQuery(this).val( '' );
if ( jQuery(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = jQuery(this).position();
jQuery(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_country_iso_error + '</div>' );
jQuery('.wc_error_tip')
.css('left', offset.left + jQuery(this).width() - ( jQuery(this).width() / 2 ) - ( jQuery('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + jQuery(this).height() )
$(this).val( '' );
if ( $(this).parent().find('.wc_error_tip').size() === 0 ) {
var offset = $(this).position();
$(this).after( '<div class="wc_error_tip">' + woocommerce_admin.i18n_country_iso_error + '</div>' );
$('.wc_error_tip')
.css('left', offset.left + $(this).width() - ( $(this).width() / 2 ) - ( $('.wc_error_tip').width() / 2 ) )
.css('top', offset.top + $(this).height() )
.fadeIn('100');
}
}
return this;
});
jQuery("body").click(function(){
jQuery('.wc_error_tip').fadeOut('100', function(){ jQuery(this).remove(); } );
$("body").click(function(){
$('.wc_error_tip').fadeOut('100', function(){ $(this).remove(); } );
});
// Tooltips
jQuery(".tips, .help_tip").tipTip({
var tiptip_args = {
'attribute' : 'data-tip',
'fadeIn' : 50,
'fadeOut' : 50,
'delay' : 200
};
$(".tips, .help_tip").tipTip( tiptip_args );
// Add tiptip to parent element for widefat tables
$(".parent-tips").each(function(){
$(this).closest( 'a, th' ).attr( 'data-tip', $(this).data( 'tip' ) ).tipTip( tiptip_args ).css( 'cursor', 'help' );
});
// wc_input_table tables
jQuery('.wc_input_table.sortable tbody').sortable({
$('.wc_input_table.sortable tbody').sortable({
items:'tr',
cursor:'move',
axis:'y',
@ -121,13 +127,13 @@ jQuery(function(){
}
});
jQuery('.wc_input_table .remove_rows').click(function() {
var $tbody = jQuery(this).closest('.wc_input_table').find('tbody');
$('.wc_input_table .remove_rows').click(function() {
var $tbody = $(this).closest('.wc_input_table').find('tbody');
if ( $tbody.find('tr.current').size() > 0 ) {
$current = $tbody.find('tr.current');
$current.each(function(){
jQuery(this).remove();
$(this).remove();
});
}
return false;
@ -137,44 +143,44 @@ jQuery(function(){
var shifted = false;
var hasFocus = false;
jQuery(document).bind('keyup keydown', function(e){ shifted = e.shiftKey; controlled = e.ctrlKey || e.metaKey } );
$(document).bind('keyup keydown', function(e){ shifted = e.shiftKey; controlled = e.ctrlKey || e.metaKey } );
jQuery('.wc_input_table').on( 'focus click', 'input', function( e ) {
$('.wc_input_table').on( 'focus click', 'input', function( e ) {
$this_table = jQuery(this).closest('table');
$this_row = jQuery(this).closest('tr');
$this_table = $(this).closest('table');
$this_row = $(this).closest('tr');
if ( ( e.type == 'focus' && hasFocus != $this_row.index() ) || ( e.type == 'click' && jQuery(this).is(':focus') ) ) {
if ( ( e.type == 'focus' && hasFocus != $this_row.index() ) || ( e.type == 'click' && $(this).is(':focus') ) ) {
hasFocus = $this_row.index();
if ( ! shifted && ! controlled ) {
jQuery('tr', $this_table).removeClass('current').removeClass('last_selected');
$('tr', $this_table).removeClass('current').removeClass('last_selected');
$this_row.addClass('current').addClass('last_selected');
} else if ( shifted ) {
jQuery('tr', $this_table).removeClass('current');
$('tr', $this_table).removeClass('current');
$this_row.addClass('selected_now').addClass('current');
if ( jQuery('tr.last_selected', $this_table).size() > 0 ) {
if ( $this_row.index() > jQuery('tr.last_selected, $this_table').index() ) {
jQuery('tr', $this_table).slice( jQuery('tr.last_selected', $this_table).index(), $this_row.index() ).addClass('current');
if ( $('tr.last_selected', $this_table).size() > 0 ) {
if ( $this_row.index() > $('tr.last_selected, $this_table').index() ) {
$('tr', $this_table).slice( $('tr.last_selected', $this_table).index(), $this_row.index() ).addClass('current');
} else {
jQuery('tr', $this_table).slice( $this_row.index(), jQuery('tr.last_selected', $this_table).index() + 1 ).addClass('current');
$('tr', $this_table).slice( $this_row.index(), $('tr.last_selected', $this_table).index() + 1 ).addClass('current');
}
}
jQuery('tr', $this_table).removeClass('last_selected');
$('tr', $this_table).removeClass('last_selected');
$this_row.addClass('last_selected');
} else {
jQuery('tr', $this_table).removeClass('last_selected');
if ( controlled && jQuery(this).closest('tr').is('.current') ) {
$('tr', $this_table).removeClass('last_selected');
if ( controlled && $(this).closest('tr').is('.current') ) {
$this_row.removeClass('current');
} else {
$this_row.addClass('current').addClass('last_selected');
}
}
jQuery('tr', $this_table).removeClass('selected_now');
$('tr', $this_table).removeClass('selected_now');
}
}).on( 'blur', 'input', function( e ) {
@ -182,61 +188,61 @@ jQuery(function(){
});
// Additional cost tables
jQuery( '.woocommerce_page_wc-settings .shippingrows tbody tr:even' ).addClass( 'alternate' );
$( '.woocommerce_page_wc-settings .shippingrows tbody tr:even' ).addClass( 'alternate' );
// Availability inputs
jQuery('select.availability').change(function(){
if ( jQuery(this).val() == "all" ) {
jQuery(this).closest('tr').next('tr').hide();
$('select.availability').change(function(){
if ( $(this).val() == "all" ) {
$(this).closest('tr').next('tr').hide();
} else {
jQuery(this).closest('tr').next('tr').show();
$(this).closest('tr').next('tr').show();
}
}).change();
// Show order items on orders page
jQuery('body').on( 'click', '.show_order_items', function() {
jQuery(this).closest('td').find('table').toggle();
$('body').on( 'click', '.show_order_items', function() {
$(this).closest('td').find('table').toggle();
return false;
});
// Hidden options
jQuery('.hide_options_if_checked').each(function(){
$('.hide_options_if_checked').each(function(){
jQuery(this).find('input:eq(0)').change(function() {
$(this).find('input:eq(0)').change(function() {
if (jQuery(this).is(':checked')) {
jQuery(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
if ($(this).is(':checked')) {
$(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
} else {
jQuery(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
$(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
}
}).change();
});
jQuery('.show_options_if_checked').each(function(){
$('.show_options_if_checked').each(function(){
jQuery(this).find('input:eq(0)').change(function() {
$(this).find('input:eq(0)').change(function() {
if (jQuery(this).is(':checked')) {
jQuery(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
if ($(this).is(':checked')) {
$(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
} else {
jQuery(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
$(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
}
}).change();
});
jQuery('input#woocommerce_demo_store').change(function() {
if (jQuery(this).is(':checked')) {
jQuery('#woocommerce_demo_store_notice').closest('tr').show();
$('input#woocommerce_demo_store').change(function() {
if ($(this).is(':checked')) {
$('#woocommerce_demo_store_notice').closest('tr').show();
} else {
jQuery('#woocommerce_demo_store_notice').closest('tr').hide();
$('#woocommerce_demo_store_notice').closest('tr').hide();
}
}).change();
// Attribute term table
jQuery( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' );
$( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' );
});

File diff suppressed because one or more lines are too long

View File

@ -119,8 +119,8 @@ class WC_Admin_Post_Types {
$columns['price'] = __( 'Price', 'woocommerce' );
$columns['product_cat'] = __( 'Categories', 'woocommerce' );
$columns['product_tag'] = __( 'Tags', 'woocommerce' );
$columns['featured'] = '<span class="wc-featured tips" data-tip="' . __( 'Featured', 'woocommerce' ) . '">' . __( 'Featured', 'woocommerce' ) . '</span>';
$columns['product_type'] = '<span class="wc-type tips" data-tip="' . __( 'Type', 'woocommerce' ) . '">' . __( 'Type', 'woocommerce' ) . '</span>';
$columns['featured'] = '<span class="wc-featured parent-tips" data-tip="' . __( 'Featured', 'woocommerce' ) . '">' . __( 'Featured', 'woocommerce' ) . '</span>';
$columns['product_type'] = '<span class="wc-type parent-tips" data-tip="' . __( 'Type', 'woocommerce' ) . '">' . __( 'Type', 'woocommerce' ) . '</span>';
$columns['date'] = __( 'Date', 'woocommerce' );
return array_merge( $columns, $existing_columns );