Skip to content

Commit db4b667

Browse files
author
Woo
committed
Updates to 2.1.0
1 parent c89604d commit db4b667

File tree

176 files changed

+14927
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+14927
-0
lines changed

assets/css/wc-pre-orders-admin.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/wc-pre-orders-admin.scss

+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
// WooCommerce Pre-Orders Admin.
2+
3+
// Variables from woocommerce/assets/css/_variables.scss.
4+
$green: #7ad03a;
5+
$red: #a00;
6+
$blue: #2ea2cc;
7+
8+
// Mixins from woocommerce/assets/css/_mixins.scss.
9+
@mixin ir() {
10+
display: block;
11+
text-indent: -9999px;
12+
position: relative;
13+
height: 1em;
14+
width: 1em;
15+
}
16+
17+
@mixin icon( $glyph: '\e001' ) {
18+
font-family: 'WooCommerce';
19+
speak: none;
20+
font-weight: normal;
21+
font-variant: normal;
22+
text-transform: none;
23+
line-height: 1;
24+
margin: 0;
25+
text-indent: 0;
26+
position: absolute;
27+
top: 0;
28+
left: 0;
29+
width: 100%;
30+
height: 100%;
31+
text-align: center;
32+
content: $glyph;
33+
}
34+
35+
// Order status icon
36+
.widefat .column-order_status {
37+
mark.pre-ordered {
38+
@include ir();
39+
background: none;
40+
font-size: 1.4em;
41+
margin: 0 auto;
42+
43+
&:after {
44+
@include icon( "\e012" );
45+
color: $green;
46+
}
47+
}
48+
}
49+
.pre-orders {
50+
.column-status {
51+
width: 90px;
52+
}
53+
}
54+
55+
// Product tab
56+
#woocommerce-product-data {
57+
ul.product_data_tabs {
58+
li.wc_pre_orders_tab a {
59+
&:before {
60+
content: "";
61+
}
62+
}
63+
}
64+
}
65+
66+
// jQuery UI timepicker
67+
.ui-timepicker-div {
68+
69+
.ui-widget-header {
70+
margin-bottom: 8px;
71+
}
72+
73+
dl {
74+
text-align: left;
75+
dt {
76+
height: 25px; margin-bottom: -25px;
77+
}
78+
dd {
79+
margin: 0 10px 10px 65px;
80+
}
81+
}
82+
83+
td {
84+
font-size: 90%;
85+
}
86+
}
87+
88+
.ui-tpicker-grid-label {
89+
background: none;
90+
border: none;
91+
margin: 0;
92+
padding: 0;
93+
}
94+
95+
.ui-timepicker-rtl {
96+
direction: rtl;
97+
dl {
98+
text-align: right;
99+
dd {
100+
margin: 0 65px 10px 10px;
101+
}
102+
}
103+
}
104+
105+
// List Table
106+
.widefat.pre-orders {
107+
108+
td {
109+
&.column-status {
110+
padding: 6px 7px;
111+
}
112+
113+
}
114+
115+
.column-status {
116+
text-align: left;
117+
118+
mark.active, mark.completed, mark.cancelled {
119+
@include ir();
120+
background: none;
121+
font-size: 1.4em;
122+
margin: 0 auto;
123+
124+
&:after {
125+
@include icon();
126+
}
127+
}
128+
129+
mark {
130+
&.active {
131+
&:after {
132+
content: "\e012";
133+
color: $green;
134+
}
135+
}
136+
&.completed {
137+
&:after {
138+
content: "\e015";
139+
color: $blue;
140+
}
141+
}
142+
&.cancelled {
143+
&:after {
144+
content: "\e013";
145+
color: $red;
146+
}
147+
}
148+
}
149+
}
150+
151+
.column-customer {
152+
width: 15%;
153+
}
154+
155+
.column-product {
156+
width: 30%;
157+
}
158+
159+
.column-order {
160+
width: 15%;
161+
}
162+
163+
.column-order_date {
164+
width: 100px;
165+
}
166+
167+
.column-availability-date {
168+
width: 100px;
169+
}
170+
}
171+
172+
// List table row actions
173+
.wp-list-table.pre-orders .column-status .row-actions {
174+
text-align: center;
175+
176+
.cancel {
177+
a {
178+
color: $red;
179+
180+
&:hover {
181+
color: $red + #444;
182+
}
183+
}
184+
}
185+
}
186+
187+
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
jQuery( document ).ready( function( $ ) {
2+
'use strict';
3+
4+
var $actionEmailMessage = $( 'textarea[name="wc_pre_orders_action_email_message"]' ),
5+
$dateTimeField = null;
6+
7+
// Get the proper datetime field (either on the edit product page or the pre-orders > actions tab
8+
if ( $( 'input[name="_wc_pre_orders_availability_datetime"]' ).length ) {
9+
$dateTimeField = $( 'input[name="_wc_pre_orders_availability_datetime"]' );
10+
} else if ( $( 'input[name="wc_pre_orders_action_new_availability_date"]').length ) {
11+
$dateTimeField = $( 'input[name="wc_pre_orders_action_new_availability_date"]' );
12+
}
13+
14+
// Add Pre-Order DateTimePicker (see http://trentrichardson.com/examples/timepicker/)
15+
if ( null !== $dateTimeField ) {
16+
$dateTimeField.datetimepicker({
17+
dateFormat: 'yy-mm-dd',
18+
numberOfMonths: 1
19+
});
20+
}
21+
22+
// Hide email notification message textarea when "send email notification" is disabled
23+
if ( $actionEmailMessage.length ) {
24+
$( 'input[name="wc_pre_orders_action_enable_email_notification"]').on( 'change', function() {
25+
if ( ! $( this ).is( ':checked' ) ) {
26+
$actionEmailMessage.removeAttr( 'required' );
27+
$actionEmailMessage.closest( 'tr' ).hide();
28+
} else {
29+
$actionEmailMessage.closest( 'tr' ).show();
30+
$actionEmailMessage.attr( 'required', 'required' );
31+
}
32+
}).trigger( 'change' );
33+
}
34+
35+
/**
36+
* Hide pre-orders options when product type is changed to variable-subscription.
37+
*
38+
* Read explanation about this change in WC_Pre_Orders_Admin_Products::product_data_tab function
39+
* @since 2.0.2
40+
*/
41+
$( 'body' ).on( 'woocommerce-product-type-change', function ( e, select_val ) {
42+
if ( 'variable-subscription' === select_val ) {
43+
$( 'li.pre_orders_options' ).hide();
44+
}
45+
} );
46+
});

assets/js/admin/wc-pre-orders-admin.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)