Version Description
- Added: Compatible with WordPress version 5.5
- Added: Compatible with WooCommerce version 4.3.2
- Fixed: Replaced deprecated jQuery methods for jquery.chosen.js
Download this release
Release Info
Developer | byronkeet |
Plugin | WooCommerce – Store Exporter |
Version | 2.6 |
Comparing to | |
See all releases |
Code changes from version 2.5 to 2.6
- exporter.php +2 -2
- includes/functions.php +40 -0
- js/jquery.chosen.js +738 -442
- readme.txt +8 -3
- templates/admin/woo-admin_ce-export.css +76 -0
- templates/admin/woo-admin_ce-export.js +179 -0
- templates/admin/woo-admin_ce-export.php +13 -0
- templates/admin/woo-admin_ce-export_archive.php +65 -0
- templates/admin/woo-admin_ce-export_export.php +511 -0
- templates/admin/woo-admin_ce-export_overview.php +85 -0
- templates/admin/woo-admin_ce-export_settings.php +153 -0
- templates/admin/woo-admin_ce-export_tools.php +22 -0
- templates/admin/woo-admin_ce-media_csv_file.php +12 -0
- templates/admin/woo-admin_ce-media_export_details.php +54 -0
exporter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WooCommerce - Store Exporter
|
4 |
* Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
|
5 |
* Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, TSV, Excel formats including XLS and XLSX, XML, etc.)
|
6 |
-
* Version: 2.
|
7 |
* Author: Visser Labs
|
8 |
* Author URI: http://www.visser.com.au/solutions/
|
9 |
* License: GPL2
|
@@ -12,7 +12,7 @@
|
|
12 |
* Domain Path: /languages/
|
13 |
*
|
14 |
* WC requires at least: 2.3
|
15 |
-
* WC tested up to: 4.
|
16 |
*/
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
3 |
* Plugin Name: WooCommerce - Store Exporter
|
4 |
* Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
|
5 |
* Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, TSV, Excel formats including XLS and XLSX, XML, etc.)
|
6 |
+
* Version: 2.6
|
7 |
* Author: Visser Labs
|
8 |
* Author URI: http://www.visser.com.au/solutions/
|
9 |
* License: GPL2
|
12 |
* Domain Path: /languages/
|
13 |
*
|
14 |
* WC requires at least: 2.3
|
15 |
+
* WC tested up to: 4.3.2
|
16 |
*/
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
includes/functions.php
CHANGED
@@ -2091,6 +2091,46 @@ function woo_ce_modules_list( $module_status = false ) {
|
|
2091 |
'url' => 'https://www.pluginhive.com/product/woocommerce-ups-shipping-plugin-with-print-label/',
|
2092 |
'class' => 'UPS_WooCommerce_Shipping'
|
2093 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2094 |
|
2095 |
// Ship to Multiple Addresses - WC_Ship_Multiple
|
2096 |
|
2091 |
'url' => 'https://www.pluginhive.com/product/woocommerce-ups-shipping-plugin-with-print-label/',
|
2092 |
'class' => 'UPS_WooCommerce_Shipping'
|
2093 |
);
|
2094 |
+
$modules[] = array(
|
2095 |
+
'name' => 'wc_ppom',
|
2096 |
+
'title' => __( 'PPOM for WooCommerce', 'woocommerce-exporter' ),
|
2097 |
+
'description' => __( 'Adds input fields on product page to personalized your product.', 'woocommerce-exporter' ),
|
2098 |
+
'url' => 'https://wordpress.org/plugins/woocommerce-product-addon/',
|
2099 |
+
'slug' => 'woocommerce-product-addon',
|
2100 |
+
'function' => 'PPOM'
|
2101 |
+
);
|
2102 |
+
$modules[] = array(
|
2103 |
+
'name' => 'wc_pwb',
|
2104 |
+
'title' => __( 'Perfect WooCommerce Brands', 'woocommerce-exporter' ),
|
2105 |
+
'description' => __( 'Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.', 'woocommerce-exporter' ),
|
2106 |
+
'url' => 'https://wordpress.org/plugins/perfect-woocommerce-brands/',
|
2107 |
+
'slug' => 'perfect-woocommerce-brands',
|
2108 |
+
'class' => '\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands'
|
2109 |
+
);
|
2110 |
+
$modules[] = array(
|
2111 |
+
'name' => 'wc_piva',
|
2112 |
+
'title' => __( 'WooCommerce P.IVA e Codice Fiscale per Italia', 'woocommerce-exporter' ),
|
2113 |
+
'description' => __( 'Il plugin che rende compatibile woocommerce per il mercato italiano.', 'woocommerce-exporter' ),
|
2114 |
+
'url' => 'https://wordpress.org/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/',
|
2115 |
+
'slug' => 'woo-piva-codice-fiscale-e-fattura-pdf-per-italia',
|
2116 |
+
'class' => 'WC_Piva_Cf_Invoice_Ita'
|
2117 |
+
);
|
2118 |
+
$modules[] = array(
|
2119 |
+
'name' => 'wc_easy_cf_piva',
|
2120 |
+
'title' => __( 'WooCommerce Easy Codice Fiscale Partita Iva', 'woocommerce-exporter' ),
|
2121 |
+
'description' => __( 'Add the Partita IVA e Codice Fiscale fields in WooCommerce for the italian market.', 'woocommerce-exporter' ),
|
2122 |
+
'url' => 'https://wordpress.org/plugins/woo-easy-codice-fiscale-partita-iva/',
|
2123 |
+
'slug' => 'woo-easy-codice-fiscale-partita-iva',
|
2124 |
+
'function' => 'run_mdt_wc_easy_cf_piva'
|
2125 |
+
);
|
2126 |
+
$modules[] = array(
|
2127 |
+
'name' => 'wc_serial_numbers',
|
2128 |
+
'title' => __( 'WooCommerce Serial Numbers', 'woocommerce-exporter' ),
|
2129 |
+
'description' => __( 'The best WooCommerce Plugin to sell license keys, redeem cards and other secret numbers!', 'woocommerce-exporter' ),
|
2130 |
+
'url' => 'http://wordpress.org/extend/plugins/wc-serial-numbers/',
|
2131 |
+
'slug' => 'wc-serial-numbers',
|
2132 |
+
'class' => 'WCSerialNumbers'
|
2133 |
+
);
|
2134 |
|
2135 |
// Ship to Multiple Addresses - WC_Ship_Multiple
|
2136 |
|
js/jquery.chosen.js
CHANGED
@@ -1,24 +1,28 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
(function() {
|
11 |
-
var SelectParser
|
|
|
|
|
12 |
|
13 |
SelectParser = (function() {
|
14 |
-
|
15 |
function SelectParser() {
|
16 |
this.options_index = 0;
|
17 |
this.parsed = [];
|
18 |
}
|
19 |
|
20 |
SelectParser.prototype.add_node = function(child) {
|
21 |
-
if (child.nodeName === "OPTGROUP") {
|
22 |
return this.add_group(child);
|
23 |
} else {
|
24 |
return this.add_option(child);
|
@@ -31,9 +35,11 @@
|
|
31 |
this.parsed.push({
|
32 |
array_index: group_position,
|
33 |
group: true,
|
34 |
-
label: group.label,
|
|
|
35 |
children: 0,
|
36 |
-
disabled: group.disabled
|
|
|
37 |
});
|
38 |
_ref = group.childNodes;
|
39 |
_results = [];
|
@@ -45,18 +51,22 @@
|
|
45 |
};
|
46 |
|
47 |
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
48 |
-
if (option.nodeName === "OPTION") {
|
49 |
if (option.text !== "") {
|
50 |
-
if (group_position != null)
|
|
|
|
|
51 |
this.parsed.push({
|
52 |
array_index: this.parsed.length,
|
53 |
options_index: this.options_index,
|
54 |
value: option.value,
|
55 |
text: option.text,
|
56 |
html: option.innerHTML,
|
|
|
57 |
selected: option.selected,
|
58 |
disabled: group_disabled === true ? group_disabled : option.disabled,
|
59 |
group_array_index: group_position,
|
|
|
60 |
classes: option.className,
|
61 |
style: option.style.cssText
|
62 |
});
|
@@ -71,6 +81,27 @@
|
|
71 |
}
|
72 |
};
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
return SelectParser;
|
75 |
|
76 |
})();
|
@@ -86,32 +117,20 @@
|
|
86 |
return parser.parsed;
|
87 |
};
|
88 |
|
89 |
-
this.SelectParser = SelectParser;
|
90 |
-
|
91 |
-
}).call(this);
|
92 |
-
|
93 |
-
/*
|
94 |
-
Chosen source: generate output using 'cake build'
|
95 |
-
Copyright (c) 2011 by Harvest
|
96 |
-
*/
|
97 |
-
|
98 |
-
(function() {
|
99 |
-
var AbstractChosen, root;
|
100 |
-
|
101 |
-
root = this;
|
102 |
-
|
103 |
AbstractChosen = (function() {
|
104 |
-
|
105 |
function AbstractChosen(form_field, options) {
|
106 |
this.form_field = form_field;
|
107 |
this.options = options != null ? options : {};
|
108 |
-
|
|
|
|
|
109 |
this.is_multiple = this.form_field.multiple;
|
110 |
this.set_default_text();
|
|
|
111 |
this.setup();
|
112 |
this.set_up_html();
|
113 |
this.register_observers();
|
114 |
-
this.
|
115 |
}
|
116 |
|
117 |
AbstractChosen.prototype.set_default_values = function() {
|
@@ -126,23 +145,38 @@ Copyright (c) 2011 by Harvest
|
|
126 |
this.mouse_on_container = false;
|
127 |
this.results_showing = false;
|
128 |
this.result_highlighted = null;
|
129 |
-
this.result_single_selected = null;
|
130 |
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
131 |
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
|
|
|
|
|
|
132 |
this.search_contains = this.options.search_contains || false;
|
133 |
-
this.
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
135 |
};
|
136 |
|
137 |
AbstractChosen.prototype.set_default_text = function() {
|
138 |
if (this.form_field.getAttribute("data-placeholder")) {
|
139 |
this.default_text = this.form_field.getAttribute("data-placeholder");
|
140 |
} else if (this.is_multiple) {
|
141 |
-
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
} else {
|
143 |
-
|
144 |
}
|
145 |
-
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
|
146 |
};
|
147 |
|
148 |
AbstractChosen.prototype.mouse_enter = function() {
|
@@ -155,10 +189,16 @@ Copyright (c) 2011 by Harvest
|
|
155 |
|
156 |
AbstractChosen.prototype.input_focus = function(evt) {
|
157 |
var _this = this;
|
158 |
-
if (
|
159 |
-
|
160 |
-
return
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
}
|
163 |
};
|
164 |
|
@@ -172,26 +212,119 @@ Copyright (c) 2011 by Harvest
|
|
172 |
}
|
173 |
};
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
AbstractChosen.prototype.result_add_option = function(option) {
|
176 |
-
var classes,
|
177 |
-
if (!option.
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
187 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
};
|
189 |
|
190 |
AbstractChosen.prototype.results_update_field = function() {
|
191 |
-
this.
|
|
|
|
|
|
|
192 |
this.result_clear_highlight();
|
193 |
-
this.
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
};
|
196 |
|
197 |
AbstractChosen.prototype.results_toggle = function() {
|
@@ -210,13 +343,115 @@ Copyright (c) 2011 by Harvest
|
|
210 |
}
|
211 |
};
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
AbstractChosen.prototype.keyup_checker = function(evt) {
|
214 |
var stroke, _ref;
|
215 |
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
216 |
this.search_field_scale();
|
217 |
switch (stroke) {
|
218 |
case 8:
|
219 |
-
if (this.is_multiple && this.backstroke_length < 1 && this.
|
220 |
return this.keydown_backstroke();
|
221 |
} else if (!this.pending_backstroke) {
|
222 |
this.result_clear_highlight();
|
@@ -225,10 +460,14 @@ Copyright (c) 2011 by Harvest
|
|
225 |
break;
|
226 |
case 13:
|
227 |
evt.preventDefault();
|
228 |
-
if (this.results_showing)
|
|
|
|
|
229 |
break;
|
230 |
case 27:
|
231 |
-
if (this.results_showing)
|
|
|
|
|
232 |
return true;
|
233 |
case 9:
|
234 |
case 38:
|
@@ -236,255 +475,370 @@ Copyright (c) 2011 by Harvest
|
|
236 |
case 16:
|
237 |
case 91:
|
238 |
case 17:
|
|
|
239 |
break;
|
240 |
default:
|
241 |
return this.results_search();
|
242 |
}
|
243 |
};
|
244 |
|
245 |
-
AbstractChosen.prototype.
|
246 |
-
var
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
};
|
251 |
|
252 |
-
AbstractChosen.prototype.
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
|
|
257 |
};
|
258 |
|
259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
|
261 |
-
|
|
|
|
|
|
|
262 |
|
263 |
-
|
|
|
|
|
|
|
264 |
|
265 |
-
|
|
|
|
|
|
|
|
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
$ = jQuery;
|
280 |
|
281 |
$.fn.extend({
|
282 |
chosen: function(options) {
|
283 |
-
if (
|
284 |
return this;
|
285 |
}
|
286 |
return this.each(function(input_field) {
|
287 |
-
var $this;
|
288 |
$this = $(this);
|
289 |
-
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
}
|
292 |
});
|
293 |
}
|
294 |
});
|
295 |
|
296 |
Chosen = (function(_super) {
|
297 |
-
|
298 |
__extends(Chosen, _super);
|
299 |
|
300 |
function Chosen() {
|
301 |
-
Chosen.__super__.constructor.apply(this, arguments);
|
|
|
302 |
}
|
303 |
|
304 |
Chosen.prototype.setup = function() {
|
305 |
this.form_field_jq = $(this.form_field);
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
Chosen.prototype.finish_setup = function() {
|
310 |
-
return this.form_field_jq.addClass("chzn-done");
|
311 |
};
|
312 |
|
313 |
Chosen.prototype.set_up_html = function() {
|
314 |
-
var
|
315 |
-
|
316 |
-
this.
|
317 |
-
this.
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
if (this.is_multiple) {
|
324 |
-
|
325 |
} else {
|
326 |
-
|
327 |
-
}
|
328 |
-
this.form_field_jq.hide().after(
|
329 |
-
this.
|
330 |
-
this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
331 |
-
this.dropdown = this.container.find('div.chzn-drop').first();
|
332 |
-
dd_top = this.container.height();
|
333 |
-
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
334 |
-
this.dropdown.css({
|
335 |
-
"width": dd_width + "px",
|
336 |
-
"top": dd_top + "px"
|
337 |
-
});
|
338 |
this.search_field = this.container.find('input').first();
|
339 |
-
this.search_results = this.container.find('ul.
|
340 |
this.search_field_scale();
|
341 |
this.search_no_results = this.container.find('li.no-results').first();
|
342 |
if (this.is_multiple) {
|
343 |
-
this.search_choices = this.container.find('ul.
|
344 |
this.search_container = this.container.find('li.search-field').first();
|
345 |
} else {
|
346 |
-
this.search_container = this.container.find('div.
|
347 |
-
this.selected_item = this.container.find('.
|
348 |
-
sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
|
349 |
-
this.search_field.css({
|
350 |
-
"width": sf_width + "px"
|
351 |
-
});
|
352 |
}
|
353 |
this.results_build();
|
354 |
this.set_tab_index();
|
355 |
-
return this.
|
|
|
|
|
|
|
|
|
356 |
chosen: this
|
357 |
});
|
358 |
};
|
359 |
|
360 |
Chosen.prototype.register_observers = function() {
|
361 |
var _this = this;
|
362 |
-
this.container.
|
363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
});
|
365 |
-
this.
|
366 |
-
|
367 |
});
|
368 |
-
this.
|
369 |
-
|
370 |
});
|
371 |
-
this.
|
372 |
-
|
373 |
});
|
374 |
-
this.search_results.
|
375 |
-
|
376 |
});
|
377 |
-
this.search_results.
|
378 |
-
|
379 |
});
|
380 |
-
this.search_results.
|
381 |
-
|
382 |
});
|
383 |
-
this.form_field_jq.bind("
|
384 |
-
|
385 |
});
|
386 |
-
this.
|
387 |
-
|
388 |
});
|
389 |
-
this.
|
390 |
-
|
391 |
});
|
392 |
-
this.
|
393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
});
|
395 |
if (this.is_multiple) {
|
396 |
-
this.search_choices.click
|
397 |
-
|
398 |
-
});
|
399 |
-
return this.search_field.focus(function(evt) {
|
400 |
-
return _this.input_focus(evt);
|
401 |
});
|
402 |
} else {
|
403 |
-
return this.container.click
|
404 |
-
|
405 |
});
|
406 |
}
|
407 |
};
|
408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
Chosen.prototype.search_field_disabled = function() {
|
410 |
this.is_disabled = this.form_field_jq[0].disabled;
|
411 |
if (this.is_disabled) {
|
412 |
-
this.container.addClass('
|
413 |
this.search_field[0].disabled = true;
|
414 |
if (!this.is_multiple) {
|
415 |
-
this.selected_item.unbind("focus", this.activate_action);
|
416 |
}
|
417 |
return this.close_field();
|
418 |
} else {
|
419 |
-
this.container.removeClass('
|
420 |
this.search_field[0].disabled = false;
|
421 |
if (!this.is_multiple) {
|
422 |
-
return this.selected_item.bind("focus", this.activate_action);
|
423 |
}
|
424 |
}
|
425 |
};
|
426 |
|
427 |
Chosen.prototype.container_mousedown = function(evt) {
|
428 |
-
var target_closelink;
|
429 |
if (!this.is_disabled) {
|
430 |
-
target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
|
431 |
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
432 |
-
evt.
|
433 |
}
|
434 |
-
if (!
|
435 |
if (!this.active_field) {
|
436 |
-
if (this.is_multiple)
|
437 |
-
|
|
|
|
|
438 |
this.results_show();
|
439 |
-
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.
|
440 |
evt.preventDefault();
|
441 |
this.results_toggle();
|
442 |
}
|
443 |
return this.activate_field();
|
444 |
-
} else {
|
445 |
-
return this.pending_destroy_click = false;
|
446 |
}
|
447 |
}
|
448 |
};
|
449 |
|
450 |
Chosen.prototype.container_mouseup = function(evt) {
|
451 |
-
if (evt.target.nodeName === "ABBR"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
};
|
453 |
|
454 |
Chosen.prototype.blur_test = function(evt) {
|
455 |
-
if (!this.active_field && this.container.hasClass("
|
456 |
return this.close_field();
|
457 |
}
|
458 |
};
|
459 |
|
460 |
Chosen.prototype.close_field = function() {
|
461 |
-
$(
|
462 |
-
if (!this.is_multiple) {
|
463 |
-
this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
|
464 |
-
this.search_field.attr("tabindex", -1);
|
465 |
-
}
|
466 |
this.active_field = false;
|
467 |
this.results_hide();
|
468 |
-
this.container.removeClass("
|
469 |
-
this.winnow_results_clear();
|
470 |
this.clear_backstroke();
|
471 |
this.show_search_field_default();
|
472 |
return this.search_field_scale();
|
473 |
};
|
474 |
|
475 |
Chosen.prototype.activate_field = function() {
|
476 |
-
|
477 |
-
this.search_field.attr("tabindex", this.selected_item.attr("tabindex"));
|
478 |
-
this.selected_item.attr("tabindex", -1);
|
479 |
-
}
|
480 |
-
this.container.addClass("chzn-container-active");
|
481 |
this.active_field = true;
|
482 |
this.search_field.val(this.search_field.val());
|
483 |
return this.search_field.focus();
|
484 |
};
|
485 |
|
486 |
Chosen.prototype.test_active_click = function(evt) {
|
487 |
-
|
|
|
|
|
488 |
return this.active_field = true;
|
489 |
} else {
|
490 |
return this.close_field();
|
@@ -492,52 +846,30 @@ Copyright (c) 2011 by Harvest
|
|
492 |
};
|
493 |
|
494 |
Chosen.prototype.results_build = function() {
|
495 |
-
var content, data, _i, _len, _ref;
|
496 |
this.parsing = true;
|
497 |
-
this.
|
498 |
-
|
|
|
499 |
this.search_choices.find("li.search-choice").remove();
|
500 |
-
this.choices = 0;
|
501 |
} else if (!this.is_multiple) {
|
502 |
-
this.
|
503 |
-
if (this.form_field.options.length <= this.disable_search_threshold) {
|
504 |
-
this.
|
|
|
505 |
} else {
|
506 |
-
this.
|
507 |
-
|
508 |
-
}
|
509 |
-
content = '';
|
510 |
-
_ref = this.results_data;
|
511 |
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
512 |
-
data = _ref[_i];
|
513 |
-
if (data.group) {
|
514 |
-
content += this.result_add_group(data);
|
515 |
-
} else if (!data.empty) {
|
516 |
-
content += this.result_add_option(data);
|
517 |
-
if (data.selected && this.is_multiple) {
|
518 |
-
this.choice_build(data);
|
519 |
-
} else if (data.selected && !this.is_multiple) {
|
520 |
-
this.selected_item.removeClass("chzn-default").find("span").text(data.text);
|
521 |
-
if (this.allow_single_deselect) this.single_deselect_control_build();
|
522 |
-
}
|
523 |
}
|
524 |
}
|
|
|
|
|
|
|
525 |
this.search_field_disabled();
|
526 |
this.show_search_field_default();
|
527 |
this.search_field_scale();
|
528 |
-
this.search_results.html(content);
|
529 |
return this.parsing = false;
|
530 |
};
|
531 |
|
532 |
-
Chosen.prototype.result_add_group = function(group) {
|
533 |
-
if (!group.disabled) {
|
534 |
-
group.dom_id = this.container_id + "_g_" + group.array_index;
|
535 |
-
return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
|
536 |
-
} else {
|
537 |
-
return "";
|
538 |
-
}
|
539 |
-
};
|
540 |
-
|
541 |
Chosen.prototype.result_do_highlight = function(el) {
|
542 |
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
543 |
if (el.length) {
|
@@ -558,67 +890,72 @@ Copyright (c) 2011 by Harvest
|
|
558 |
};
|
559 |
|
560 |
Chosen.prototype.result_clear_highlight = function() {
|
561 |
-
if (this.result_highlight)
|
|
|
|
|
562 |
return this.result_highlight = null;
|
563 |
};
|
564 |
|
565 |
Chosen.prototype.results_show = function() {
|
566 |
-
|
567 |
-
|
568 |
-
this.selected_item.addClass("chzn-single-with-drop");
|
569 |
-
if (this.result_single_selected) {
|
570 |
-
this.result_do_highlight(this.result_single_selected);
|
571 |
-
}
|
572 |
-
} else if (this.max_selected_options <= this.choices) {
|
573 |
-
this.form_field_jq.trigger("liszt:maxselected", {
|
574 |
chosen: this
|
575 |
});
|
576 |
return false;
|
577 |
}
|
578 |
-
|
579 |
-
this.form_field_jq.trigger("liszt:showing_dropdown", {
|
580 |
-
chosen: this
|
581 |
-
});
|
582 |
-
this.dropdown.css({
|
583 |
-
"top": dd_top + "px",
|
584 |
-
"left": 0
|
585 |
-
});
|
586 |
this.results_showing = true;
|
587 |
this.search_field.focus();
|
588 |
this.search_field.val(this.search_field.val());
|
589 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
};
|
591 |
|
592 |
Chosen.prototype.results_hide = function() {
|
593 |
-
if (
|
594 |
-
this.
|
|
|
|
|
|
|
|
|
595 |
}
|
596 |
-
this.result_clear_highlight();
|
597 |
-
this.form_field_jq.trigger("liszt:hiding_dropdown", {
|
598 |
-
chosen: this
|
599 |
-
});
|
600 |
-
this.dropdown.css({
|
601 |
-
"left": "-9000px"
|
602 |
-
});
|
603 |
return this.results_showing = false;
|
604 |
};
|
605 |
|
606 |
Chosen.prototype.set_tab_index = function(el) {
|
607 |
var ti;
|
608 |
-
if (this.
|
609 |
-
ti = this.
|
610 |
-
this.
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
}
|
618 |
};
|
619 |
|
620 |
Chosen.prototype.show_search_field_default = function() {
|
621 |
-
if (this.is_multiple && this.
|
622 |
this.search_field.val(this.default_text);
|
623 |
return this.search_field.addClass("default");
|
624 |
} else {
|
@@ -632,14 +969,17 @@ Copyright (c) 2011 by Harvest
|
|
632 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
633 |
if (target.length) {
|
634 |
this.result_highlight = target;
|
635 |
-
|
|
|
636 |
}
|
637 |
};
|
638 |
|
639 |
Chosen.prototype.search_results_mouseover = function(evt) {
|
640 |
var target;
|
641 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
642 |
-
if (target)
|
|
|
|
|
643 |
};
|
644 |
|
645 |
Chosen.prototype.search_results_mouseout = function(evt) {
|
@@ -648,210 +988,158 @@ Copyright (c) 2011 by Harvest
|
|
648 |
}
|
649 |
};
|
650 |
|
651 |
-
Chosen.prototype.choices_click = function(evt) {
|
652 |
-
evt.preventDefault();
|
653 |
-
if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
|
654 |
-
return this.results_show();
|
655 |
-
}
|
656 |
-
};
|
657 |
-
|
658 |
Chosen.prototype.choice_build = function(item) {
|
659 |
-
var
|
660 |
_this = this;
|
661 |
-
|
662 |
-
|
663 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
});
|
665 |
-
|
|
|
|
|
|
|
666 |
}
|
667 |
-
|
668 |
-
this.choices += 1;
|
669 |
-
this.search_container.before('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
|
670 |
-
link = $('#' + choice_id).find("a").first();
|
671 |
-
return link.click(function(evt) {
|
672 |
-
return _this.choice_destroy_link_click(evt);
|
673 |
-
});
|
674 |
};
|
675 |
|
676 |
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
677 |
evt.preventDefault();
|
|
|
678 |
if (!this.is_disabled) {
|
679 |
-
this.pending_destroy_click = true;
|
680 |
return this.choice_destroy($(evt.target));
|
681 |
-
} else {
|
682 |
-
return evt.stopPropagation;
|
683 |
}
|
684 |
};
|
685 |
|
686 |
Chosen.prototype.choice_destroy = function(link) {
|
687 |
-
this.
|
688 |
-
|
689 |
-
|
690 |
-
|
|
|
|
|
|
|
691 |
}
|
692 |
-
this.result_deselect(link.attr("rel"));
|
693 |
-
return link.parents('li').first().remove();
|
694 |
};
|
695 |
|
696 |
Chosen.prototype.results_reset = function() {
|
|
|
697 |
this.form_field.options[0].selected = true;
|
698 |
-
this.
|
699 |
-
if (!this.is_multiple) this.selected_item.addClass("chzn-default");
|
700 |
this.show_search_field_default();
|
701 |
-
this.
|
702 |
this.form_field_jq.trigger("change");
|
703 |
-
if (this.active_field)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
};
|
705 |
|
706 |
Chosen.prototype.result_select = function(evt) {
|
707 |
-
var high,
|
708 |
if (this.result_highlight) {
|
709 |
high = this.result_highlight;
|
710 |
-
high_id = high.attr("id");
|
711 |
this.result_clear_highlight();
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
if (this.is_multiple) {
|
713 |
-
|
714 |
} else {
|
715 |
-
this.
|
716 |
-
this.result_single_selected = high;
|
717 |
-
this.selected_item.removeClass("chzn-default");
|
718 |
}
|
719 |
high.addClass("result-selected");
|
720 |
-
|
721 |
-
item = this.results_data[position];
|
722 |
item.selected = true;
|
723 |
this.form_field.options[item.options_index].selected = true;
|
|
|
724 |
if (this.is_multiple) {
|
725 |
this.choice_build(item);
|
726 |
} else {
|
727 |
-
this.
|
728 |
-
if (this.allow_single_deselect) this.single_deselect_control_build();
|
729 |
}
|
730 |
-
if (!(evt.metaKey && this.is_multiple))
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
735 |
return this.search_field_scale();
|
736 |
}
|
737 |
};
|
738 |
|
739 |
-
Chosen.prototype.
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
|
|
|
|
|
|
|
|
|
|
745 |
};
|
746 |
|
747 |
Chosen.prototype.result_deselect = function(pos) {
|
748 |
-
var
|
749 |
result_data = this.results_data[pos];
|
750 |
-
result_data.
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
return
|
765 |
}
|
766 |
};
|
767 |
|
768 |
-
Chosen.prototype.
|
769 |
-
|
770 |
-
|
771 |
-
results = 0;
|
772 |
-
searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
|
773 |
-
regexAnchor = this.search_contains ? "" : "^";
|
774 |
-
regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
|
775 |
-
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
|
776 |
-
_ref = this.results_data;
|
777 |
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
778 |
-
option = _ref[_i];
|
779 |
-
if (!option.disabled && !option.empty) {
|
780 |
-
if (option.group) {
|
781 |
-
$('#' + option.dom_id).css('display', 'none');
|
782 |
-
} else if (!(this.is_multiple && option.selected)) {
|
783 |
-
found = false;
|
784 |
-
result_id = option.dom_id;
|
785 |
-
result = $("#" + result_id);
|
786 |
-
if (regex.test(option.html)) {
|
787 |
-
found = true;
|
788 |
-
results += 1;
|
789 |
-
} else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
|
790 |
-
parts = option.html.replace(/\[|\]/g, "").split(" ");
|
791 |
-
if (parts.length) {
|
792 |
-
for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
|
793 |
-
part = parts[_j];
|
794 |
-
if (regex.test(part)) {
|
795 |
-
found = true;
|
796 |
-
results += 1;
|
797 |
-
}
|
798 |
-
}
|
799 |
-
}
|
800 |
-
}
|
801 |
-
if (found) {
|
802 |
-
if (searchText.length) {
|
803 |
-
startpos = option.html.search(zregex);
|
804 |
-
text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
|
805 |
-
text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
806 |
-
} else {
|
807 |
-
text = option.html;
|
808 |
-
}
|
809 |
-
result.html(text);
|
810 |
-
this.result_activate(result);
|
811 |
-
if (option.group_array_index != null) {
|
812 |
-
$("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
|
813 |
-
}
|
814 |
-
} else {
|
815 |
-
if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
|
816 |
-
this.result_clear_highlight();
|
817 |
-
}
|
818 |
-
this.result_deactivate(result);
|
819 |
-
}
|
820 |
-
}
|
821 |
-
}
|
822 |
}
|
823 |
-
if (
|
824 |
-
|
825 |
-
} else {
|
826 |
-
return this.winnow_results_set_highlight();
|
827 |
}
|
|
|
828 |
};
|
829 |
|
830 |
-
Chosen.prototype.
|
831 |
-
|
832 |
-
this.search_field.val("");
|
833 |
-
lis = this.search_results.find("li");
|
834 |
-
_results = [];
|
835 |
-
for (_i = 0, _len = lis.length; _i < _len; _i++) {
|
836 |
-
li = lis[_i];
|
837 |
-
li = $(li);
|
838 |
-
if (li.hasClass("group-result")) {
|
839 |
-
_results.push(li.css('display', 'auto'));
|
840 |
-
} else if (!this.is_multiple || !li.hasClass("result-selected")) {
|
841 |
-
_results.push(this.result_activate(li));
|
842 |
-
} else {
|
843 |
-
_results.push(void 0);
|
844 |
-
}
|
845 |
-
}
|
846 |
-
return _results;
|
847 |
};
|
848 |
|
849 |
Chosen.prototype.winnow_results_set_highlight = function() {
|
850 |
var do_high, selected_results;
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
}
|
856 |
};
|
857 |
|
@@ -859,7 +1147,10 @@ Copyright (c) 2011 by Harvest
|
|
859 |
var no_results_html;
|
860 |
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
861 |
no_results_html.find("span").first().html(terms);
|
862 |
-
|
|
|
|
|
|
|
863 |
};
|
864 |
|
865 |
Chosen.prototype.no_results_clear = function() {
|
@@ -867,15 +1158,15 @@ Copyright (c) 2011 by Harvest
|
|
867 |
};
|
868 |
|
869 |
Chosen.prototype.keydown_arrow = function() {
|
870 |
-
var
|
871 |
-
if (
|
872 |
-
first_active = this.search_results.find("li.active-result").first();
|
873 |
-
if (first_active) this.result_do_highlight($(first_active));
|
874 |
-
} else if (this.results_showing) {
|
875 |
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
876 |
-
if (next_sib)
|
|
|
|
|
|
|
|
|
877 |
}
|
878 |
-
if (!this.results_showing) return this.results_show();
|
879 |
};
|
880 |
|
881 |
Chosen.prototype.keyup_arrow = function() {
|
@@ -887,19 +1178,29 @@ Copyright (c) 2011 by Harvest
|
|
887 |
if (prev_sibs.length) {
|
888 |
return this.result_do_highlight(prev_sibs.first());
|
889 |
} else {
|
890 |
-
if (this.
|
|
|
|
|
891 |
return this.result_clear_highlight();
|
892 |
}
|
893 |
}
|
894 |
};
|
895 |
|
896 |
Chosen.prototype.keydown_backstroke = function() {
|
|
|
897 |
if (this.pending_backstroke) {
|
898 |
this.choice_destroy(this.pending_backstroke.find("a").first());
|
899 |
return this.clear_backstroke();
|
900 |
} else {
|
901 |
-
|
902 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
903 |
}
|
904 |
};
|
905 |
|
@@ -911,33 +1212,45 @@ Copyright (c) 2011 by Harvest
|
|
911 |
};
|
912 |
|
913 |
Chosen.prototype.keydown_checker = function(evt) {
|
914 |
-
var stroke,
|
915 |
-
stroke = (
|
916 |
this.search_field_scale();
|
917 |
-
if (stroke !== 8 && this.pending_backstroke)
|
|
|
|
|
918 |
switch (stroke) {
|
919 |
case 8:
|
920 |
this.backstroke_length = this.search_field.val().length;
|
921 |
break;
|
922 |
case 9:
|
923 |
-
if (this.results_showing && !this.is_multiple)
|
|
|
|
|
924 |
this.mouse_on_container = false;
|
925 |
break;
|
926 |
case 13:
|
927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
break;
|
929 |
case 38:
|
930 |
evt.preventDefault();
|
931 |
this.keyup_arrow();
|
932 |
break;
|
933 |
case 40:
|
|
|
934 |
this.keydown_arrow();
|
935 |
break;
|
936 |
}
|
937 |
};
|
938 |
|
939 |
Chosen.prototype.search_field_scale = function() {
|
940 |
-
var
|
941 |
if (this.is_multiple) {
|
942 |
h = 0;
|
943 |
w = 0;
|
@@ -954,35 +1267,18 @@ Copyright (c) 2011 by Harvest
|
|
954 |
$('body').append(div);
|
955 |
w = div.width() + 25;
|
956 |
div.remove();
|
957 |
-
|
958 |
-
|
|
|
|
|
|
|
959 |
'width': w + 'px'
|
960 |
});
|
961 |
-
dd_top = this.container.height();
|
962 |
-
return this.dropdown.css({
|
963 |
-
"top": dd_top + "px"
|
964 |
-
});
|
965 |
}
|
966 |
};
|
967 |
|
968 |
-
Chosen.prototype.generate_random_id = function() {
|
969 |
-
var string;
|
970 |
-
string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
|
971 |
-
while ($("#" + string).length > 0) {
|
972 |
-
string += this.generate_random_char();
|
973 |
-
}
|
974 |
-
return string;
|
975 |
-
};
|
976 |
-
|
977 |
return Chosen;
|
978 |
|
979 |
})(AbstractChosen);
|
980 |
|
981 |
-
get_side_border_padding = function(elmt) {
|
982 |
-
var side_border_padding;
|
983 |
-
return side_border_padding = elmt.outerWidth() - elmt.width();
|
984 |
-
};
|
985 |
-
|
986 |
-
root.get_side_border_padding = get_side_border_padding;
|
987 |
-
|
988 |
}).call(this);
|
1 |
+
/*!
|
2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
4 |
+
|
5 |
+
Version 1.5.1
|
6 |
+
Full source at https://github.com/harvesthq/chosen
|
7 |
+
Copyright (c) 2011-2016 Harvest http://getharvest.com
|
8 |
+
|
9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
11 |
+
*/
|
12 |
+
|
13 |
(function() {
|
14 |
+
var $, AbstractChosen, Chosen, SelectParser, _ref,
|
15 |
+
__hasProp = {}.hasOwnProperty,
|
16 |
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
17 |
|
18 |
SelectParser = (function() {
|
|
|
19 |
function SelectParser() {
|
20 |
this.options_index = 0;
|
21 |
this.parsed = [];
|
22 |
}
|
23 |
|
24 |
SelectParser.prototype.add_node = function(child) {
|
25 |
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
26 |
return this.add_group(child);
|
27 |
} else {
|
28 |
return this.add_option(child);
|
35 |
this.parsed.push({
|
36 |
array_index: group_position,
|
37 |
group: true,
|
38 |
+
label: this.escapeExpression(group.label),
|
39 |
+
title: group.title ? group.title : void 0,
|
40 |
children: 0,
|
41 |
+
disabled: group.disabled,
|
42 |
+
classes: group.className
|
43 |
});
|
44 |
_ref = group.childNodes;
|
45 |
_results = [];
|
51 |
};
|
52 |
|
53 |
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
54 |
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
55 |
if (option.text !== "") {
|
56 |
+
if (group_position != null) {
|
57 |
+
this.parsed[group_position].children += 1;
|
58 |
+
}
|
59 |
this.parsed.push({
|
60 |
array_index: this.parsed.length,
|
61 |
options_index: this.options_index,
|
62 |
value: option.value,
|
63 |
text: option.text,
|
64 |
html: option.innerHTML,
|
65 |
+
title: option.title ? option.title : void 0,
|
66 |
selected: option.selected,
|
67 |
disabled: group_disabled === true ? group_disabled : option.disabled,
|
68 |
group_array_index: group_position,
|
69 |
+
group_label: group_position != null ? this.parsed[group_position].label : null,
|
70 |
classes: option.className,
|
71 |
style: option.style.cssText
|
72 |
});
|
81 |
}
|
82 |
};
|
83 |
|
84 |
+
SelectParser.prototype.escapeExpression = function(text) {
|
85 |
+
var map, unsafe_chars;
|
86 |
+
if ((text == null) || text === false) {
|
87 |
+
return "";
|
88 |
+
}
|
89 |
+
if (!/[\&\<\>\"\'\`]/.test(text)) {
|
90 |
+
return text;
|
91 |
+
}
|
92 |
+
map = {
|
93 |
+
"<": "<",
|
94 |
+
">": ">",
|
95 |
+
'"': """,
|
96 |
+
"'": "'",
|
97 |
+
"`": "`"
|
98 |
+
};
|
99 |
+
unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
|
100 |
+
return text.replace(unsafe_chars, function(chr) {
|
101 |
+
return map[chr] || "&";
|
102 |
+
});
|
103 |
+
};
|
104 |
+
|
105 |
return SelectParser;
|
106 |
|
107 |
})();
|
117 |
return parser.parsed;
|
118 |
};
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
AbstractChosen = (function() {
|
|
|
121 |
function AbstractChosen(form_field, options) {
|
122 |
this.form_field = form_field;
|
123 |
this.options = options != null ? options : {};
|
124 |
+
if (!AbstractChosen.browser_is_supported()) {
|
125 |
+
return;
|
126 |
+
}
|
127 |
this.is_multiple = this.form_field.multiple;
|
128 |
this.set_default_text();
|
129 |
+
this.set_default_values();
|
130 |
this.setup();
|
131 |
this.set_up_html();
|
132 |
this.register_observers();
|
133 |
+
this.on_ready();
|
134 |
}
|
135 |
|
136 |
AbstractChosen.prototype.set_default_values = function() {
|
145 |
this.mouse_on_container = false;
|
146 |
this.results_showing = false;
|
147 |
this.result_highlighted = null;
|
|
|
148 |
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
149 |
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
150 |
+
this.disable_search = this.options.disable_search || false;
|
151 |
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
152 |
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
153 |
this.search_contains = this.options.search_contains || false;
|
154 |
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
155 |
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
156 |
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
157 |
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
158 |
+
this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
159 |
+
this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
|
160 |
+
return this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
|
161 |
};
|
162 |
|
163 |
AbstractChosen.prototype.set_default_text = function() {
|
164 |
if (this.form_field.getAttribute("data-placeholder")) {
|
165 |
this.default_text = this.form_field.getAttribute("data-placeholder");
|
166 |
} else if (this.is_multiple) {
|
167 |
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
168 |
+
} else {
|
169 |
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
170 |
+
}
|
171 |
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
172 |
+
};
|
173 |
+
|
174 |
+
AbstractChosen.prototype.choice_label = function(item) {
|
175 |
+
if (this.include_group_label_in_selected && (item.group_label != null)) {
|
176 |
+
return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
|
177 |
} else {
|
178 |
+
return item.html;
|
179 |
}
|
|
|
180 |
};
|
181 |
|
182 |
AbstractChosen.prototype.mouse_enter = function() {
|
189 |
|
190 |
AbstractChosen.prototype.input_focus = function(evt) {
|
191 |
var _this = this;
|
192 |
+
if (this.is_multiple) {
|
193 |
+
if (!this.active_field) {
|
194 |
+
return setTimeout((function() {
|
195 |
+
return _this.container_mousedown();
|
196 |
+
}), 50);
|
197 |
+
}
|
198 |
+
} else {
|
199 |
+
if (!this.active_field) {
|
200 |
+
return this.activate_field();
|
201 |
+
}
|
202 |
}
|
203 |
};
|
204 |
|
212 |
}
|
213 |
};
|
214 |
|
215 |
+
AbstractChosen.prototype.results_option_build = function(options) {
|
216 |
+
var content, data, data_content, shown_results, _i, _len, _ref;
|
217 |
+
content = '';
|
218 |
+
shown_results = 0;
|
219 |
+
_ref = this.results_data;
|
220 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
221 |
+
data = _ref[_i];
|
222 |
+
data_content = '';
|
223 |
+
if (data.group) {
|
224 |
+
data_content = this.result_add_group(data);
|
225 |
+
} else {
|
226 |
+
data_content = this.result_add_option(data);
|
227 |
+
}
|
228 |
+
if (data_content !== '') {
|
229 |
+
shown_results++;
|
230 |
+
content += data_content;
|
231 |
+
}
|
232 |
+
if (options != null ? options.first : void 0) {
|
233 |
+
if (data.selected && this.is_multiple) {
|
234 |
+
this.choice_build(data);
|
235 |
+
} else if (data.selected && !this.is_multiple) {
|
236 |
+
this.single_set_selected_text(this.choice_label(data));
|
237 |
+
}
|
238 |
+
}
|
239 |
+
if (shown_results >= this.max_shown_results) {
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
return content;
|
244 |
+
};
|
245 |
+
|
246 |
AbstractChosen.prototype.result_add_option = function(option) {
|
247 |
+
var classes, option_el;
|
248 |
+
if (!option.search_match) {
|
249 |
+
return '';
|
250 |
+
}
|
251 |
+
if (!this.include_option_in_results(option)) {
|
252 |
+
return '';
|
253 |
+
}
|
254 |
+
classes = [];
|
255 |
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
256 |
+
classes.push("active-result");
|
257 |
+
}
|
258 |
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
259 |
+
classes.push("disabled-result");
|
260 |
}
|
261 |
+
if (option.selected) {
|
262 |
+
classes.push("result-selected");
|
263 |
+
}
|
264 |
+
if (option.group_array_index != null) {
|
265 |
+
classes.push("group-option");
|
266 |
+
}
|
267 |
+
if (option.classes !== "") {
|
268 |
+
classes.push(option.classes);
|
269 |
+
}
|
270 |
+
option_el = document.createElement("li");
|
271 |
+
option_el.className = classes.join(" ");
|
272 |
+
option_el.style.cssText = option.style;
|
273 |
+
option_el.setAttribute("data-option-array-index", option.array_index);
|
274 |
+
option_el.innerHTML = option.search_text;
|
275 |
+
if (option.title) {
|
276 |
+
option_el.title = option.title;
|
277 |
+
}
|
278 |
+
return this.outerHTML(option_el);
|
279 |
+
};
|
280 |
+
|
281 |
+
AbstractChosen.prototype.result_add_group = function(group) {
|
282 |
+
var classes, group_el;
|
283 |
+
if (!(group.search_match || group.group_match)) {
|
284 |
+
return '';
|
285 |
+
}
|
286 |
+
if (!(group.active_options > 0)) {
|
287 |
+
return '';
|
288 |
+
}
|
289 |
+
classes = [];
|
290 |
+
classes.push("group-result");
|
291 |
+
if (group.classes) {
|
292 |
+
classes.push(group.classes);
|
293 |
+
}
|
294 |
+
group_el = document.createElement("li");
|
295 |
+
group_el.className = classes.join(" ");
|
296 |
+
group_el.innerHTML = group.search_text;
|
297 |
+
if (group.title) {
|
298 |
+
group_el.title = group.title;
|
299 |
+
}
|
300 |
+
return this.outerHTML(group_el);
|
301 |
};
|
302 |
|
303 |
AbstractChosen.prototype.results_update_field = function() {
|
304 |
+
this.set_default_text();
|
305 |
+
if (!this.is_multiple) {
|
306 |
+
this.results_reset_cleanup();
|
307 |
+
}
|
308 |
this.result_clear_highlight();
|
309 |
+
this.results_build();
|
310 |
+
if (this.results_showing) {
|
311 |
+
return this.winnow_results();
|
312 |
+
}
|
313 |
+
};
|
314 |
+
|
315 |
+
AbstractChosen.prototype.reset_single_select_options = function() {
|
316 |
+
var result, _i, _len, _ref, _results;
|
317 |
+
_ref = this.results_data;
|
318 |
+
_results = [];
|
319 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
320 |
+
result = _ref[_i];
|
321 |
+
if (result.selected) {
|
322 |
+
_results.push(result.selected = false);
|
323 |
+
} else {
|
324 |
+
_results.push(void 0);
|
325 |
+
}
|
326 |
+
}
|
327 |
+
return _results;
|
328 |
};
|
329 |
|
330 |
AbstractChosen.prototype.results_toggle = function() {
|
343 |
}
|
344 |
};
|
345 |
|
346 |
+
AbstractChosen.prototype.winnow_results = function() {
|
347 |
+
var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
|
348 |
+
this.no_results_clear();
|
349 |
+
results = 0;
|
350 |
+
searchText = this.get_search_text();
|
351 |
+
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
352 |
+
zregex = new RegExp(escapedSearchText, 'i');
|
353 |
+
regex = this.get_search_regex(escapedSearchText);
|
354 |
+
_ref = this.results_data;
|
355 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
356 |
+
option = _ref[_i];
|
357 |
+
option.search_match = false;
|
358 |
+
results_group = null;
|
359 |
+
if (this.include_option_in_results(option)) {
|
360 |
+
if (option.group) {
|
361 |
+
option.group_match = false;
|
362 |
+
option.active_options = 0;
|
363 |
+
}
|
364 |
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
365 |
+
results_group = this.results_data[option.group_array_index];
|
366 |
+
if (results_group.active_options === 0 && results_group.search_match) {
|
367 |
+
results += 1;
|
368 |
+
}
|
369 |
+
results_group.active_options += 1;
|
370 |
+
}
|
371 |
+
option.search_text = option.group ? option.label : option.html;
|
372 |
+
if (!(option.group && !this.group_search)) {
|
373 |
+
option.search_match = this.search_string_match(option.search_text, regex);
|
374 |
+
if (option.search_match && !option.group) {
|
375 |
+
results += 1;
|
376 |
+
}
|
377 |
+
if (option.search_match) {
|
378 |
+
if (searchText.length) {
|
379 |
+
startpos = option.search_text.search(zregex);
|
380 |
+
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
|
381 |
+
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
382 |
+
}
|
383 |
+
if (results_group != null) {
|
384 |
+
results_group.group_match = true;
|
385 |
+
}
|
386 |
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
387 |
+
option.search_match = true;
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
}
|
392 |
+
this.result_clear_highlight();
|
393 |
+
if (results < 1 && searchText.length) {
|
394 |
+
this.update_results_content("");
|
395 |
+
return this.no_results(searchText);
|
396 |
+
} else {
|
397 |
+
this.update_results_content(this.results_option_build());
|
398 |
+
return this.winnow_results_set_highlight();
|
399 |
+
}
|
400 |
+
};
|
401 |
+
|
402 |
+
AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
|
403 |
+
var regex_anchor;
|
404 |
+
regex_anchor = this.search_contains ? "" : "^";
|
405 |
+
return new RegExp(regex_anchor + escaped_search_string, 'i');
|
406 |
+
};
|
407 |
+
|
408 |
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
409 |
+
var part, parts, _i, _len;
|
410 |
+
if (regex.test(search_string)) {
|
411 |
+
return true;
|
412 |
+
} else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
|
413 |
+
parts = search_string.replace(/\[|\]/g, "").split(" ");
|
414 |
+
if (parts.length) {
|
415 |
+
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
416 |
+
part = parts[_i];
|
417 |
+
if (regex.test(part)) {
|
418 |
+
return true;
|
419 |
+
}
|
420 |
+
}
|
421 |
+
}
|
422 |
+
}
|
423 |
+
};
|
424 |
+
|
425 |
+
AbstractChosen.prototype.choices_count = function() {
|
426 |
+
var option, _i, _len, _ref;
|
427 |
+
if (this.selected_option_count != null) {
|
428 |
+
return this.selected_option_count;
|
429 |
+
}
|
430 |
+
this.selected_option_count = 0;
|
431 |
+
_ref = this.form_field.options;
|
432 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
433 |
+
option = _ref[_i];
|
434 |
+
if (option.selected) {
|
435 |
+
this.selected_option_count += 1;
|
436 |
+
}
|
437 |
+
}
|
438 |
+
return this.selected_option_count;
|
439 |
+
};
|
440 |
+
|
441 |
+
AbstractChosen.prototype.choices_click = function(evt) {
|
442 |
+
evt.preventDefault();
|
443 |
+
if (!(this.results_showing || this.is_disabled)) {
|
444 |
+
return this.results_show();
|
445 |
+
}
|
446 |
+
};
|
447 |
+
|
448 |
AbstractChosen.prototype.keyup_checker = function(evt) {
|
449 |
var stroke, _ref;
|
450 |
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
451 |
this.search_field_scale();
|
452 |
switch (stroke) {
|
453 |
case 8:
|
454 |
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
455 |
return this.keydown_backstroke();
|
456 |
} else if (!this.pending_backstroke) {
|
457 |
this.result_clear_highlight();
|
460 |
break;
|
461 |
case 13:
|
462 |
evt.preventDefault();
|
463 |
+
if (this.results_showing) {
|
464 |
+
return this.result_select(evt);
|
465 |
+
}
|
466 |
break;
|
467 |
case 27:
|
468 |
+
if (this.results_showing) {
|
469 |
+
this.results_hide();
|
470 |
+
}
|
471 |
return true;
|
472 |
case 9:
|
473 |
case 38:
|
475 |
case 16:
|
476 |
case 91:
|
477 |
case 17:
|
478 |
+
case 18:
|
479 |
break;
|
480 |
default:
|
481 |
return this.results_search();
|
482 |
}
|
483 |
};
|
484 |
|
485 |
+
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
486 |
+
var _this = this;
|
487 |
+
return setTimeout((function() {
|
488 |
+
return _this.results_search();
|
489 |
+
}), 50);
|
490 |
};
|
491 |
|
492 |
+
AbstractChosen.prototype.container_width = function() {
|
493 |
+
if (this.options.width != null) {
|
494 |
+
return this.options.width;
|
495 |
+
} else {
|
496 |
+
return "" + this.form_field.offsetWidth + "px";
|
497 |
+
}
|
498 |
};
|
499 |
|
500 |
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
501 |
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
502 |
+
return false;
|
503 |
+
}
|
504 |
+
if (!this.display_disabled_options && option.disabled) {
|
505 |
+
return false;
|
506 |
+
}
|
507 |
+
if (option.empty) {
|
508 |
+
return false;
|
509 |
+
}
|
510 |
+
return true;
|
511 |
+
};
|
512 |
|
513 |
+
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
514 |
+
this.touch_started = true;
|
515 |
+
return this.search_results_mouseover(evt);
|
516 |
+
};
|
517 |
|
518 |
+
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
519 |
+
this.touch_started = false;
|
520 |
+
return this.search_results_mouseout(evt);
|
521 |
+
};
|
522 |
|
523 |
+
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
524 |
+
if (this.touch_started) {
|
525 |
+
return this.search_results_mouseup(evt);
|
526 |
+
}
|
527 |
+
};
|
528 |
|
529 |
+
AbstractChosen.prototype.outerHTML = function(element) {
|
530 |
+
var tmp;
|
531 |
+
if (element.outerHTML) {
|
532 |
+
return element.outerHTML;
|
533 |
+
}
|
534 |
+
tmp = document.createElement("div");
|
535 |
+
tmp.appendChild(element);
|
536 |
+
return tmp.innerHTML;
|
537 |
+
};
|
538 |
|
539 |
+
AbstractChosen.browser_is_supported = function() {
|
540 |
+
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
|
541 |
+
return false;
|
542 |
+
}
|
543 |
+
if (/Android/i.test(window.navigator.userAgent)) {
|
544 |
+
if (/Mobile/i.test(window.navigator.userAgent)) {
|
545 |
+
return false;
|
546 |
+
}
|
547 |
+
}
|
548 |
+
if (/IEMobile/i.test(window.navigator.userAgent)) {
|
549 |
+
return false;
|
550 |
+
}
|
551 |
+
if (/Windows Phone/i.test(window.navigator.userAgent)) {
|
552 |
+
return false;
|
553 |
+
}
|
554 |
+
if (/BlackBerry/i.test(window.navigator.userAgent)) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
if (/BB10/i.test(window.navigator.userAgent)) {
|
558 |
+
return false;
|
559 |
+
}
|
560 |
+
if (window.navigator.appName === "Microsoft Internet Explorer") {
|
561 |
+
return document.documentMode >= 8;
|
562 |
+
}
|
563 |
+
return true;
|
564 |
+
};
|
565 |
+
|
566 |
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
567 |
|
568 |
+
AbstractChosen.default_single_text = "Select an Option";
|
569 |
+
|
570 |
+
AbstractChosen.default_no_result_text = "No results match";
|
571 |
+
|
572 |
+
return AbstractChosen;
|
573 |
+
|
574 |
+
})();
|
575 |
|
576 |
$ = jQuery;
|
577 |
|
578 |
$.fn.extend({
|
579 |
chosen: function(options) {
|
580 |
+
if (!AbstractChosen.browser_is_supported()) {
|
581 |
return this;
|
582 |
}
|
583 |
return this.each(function(input_field) {
|
584 |
+
var $this, chosen;
|
585 |
$this = $(this);
|
586 |
+
chosen = $this.data('chosen');
|
587 |
+
if (options === 'destroy') {
|
588 |
+
if (chosen instanceof Chosen) {
|
589 |
+
chosen.destroy();
|
590 |
+
}
|
591 |
+
return;
|
592 |
+
}
|
593 |
+
if (!(chosen instanceof Chosen)) {
|
594 |
+
$this.data('chosen', new Chosen(this, options));
|
595 |
}
|
596 |
});
|
597 |
}
|
598 |
});
|
599 |
|
600 |
Chosen = (function(_super) {
|
|
|
601 |
__extends(Chosen, _super);
|
602 |
|
603 |
function Chosen() {
|
604 |
+
_ref = Chosen.__super__.constructor.apply(this, arguments);
|
605 |
+
return _ref;
|
606 |
}
|
607 |
|
608 |
Chosen.prototype.setup = function() {
|
609 |
this.form_field_jq = $(this.form_field);
|
610 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
611 |
+
return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
|
|
|
|
|
|
|
612 |
};
|
613 |
|
614 |
Chosen.prototype.set_up_html = function() {
|
615 |
+
var container_classes, container_props;
|
616 |
+
container_classes = ["chosen-container"];
|
617 |
+
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
618 |
+
if (this.inherit_select_classes && this.form_field.className) {
|
619 |
+
container_classes.push(this.form_field.className);
|
620 |
+
}
|
621 |
+
if (this.is_rtl) {
|
622 |
+
container_classes.push("chosen-rtl");
|
623 |
+
}
|
624 |
+
container_props = {
|
625 |
+
'class': container_classes.join(' '),
|
626 |
+
'style': "width: " + (this.container_width()) + ";",
|
627 |
+
'title': this.form_field.title
|
628 |
+
};
|
629 |
+
if (this.form_field.id.length) {
|
630 |
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
631 |
+
}
|
632 |
+
this.container = $("<div />", container_props);
|
633 |
if (this.is_multiple) {
|
634 |
+
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
|
635 |
} else {
|
636 |
+
this.container.html('<a class="chosen-single chosen-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
|
637 |
+
}
|
638 |
+
this.form_field_jq.hide().after(this.container);
|
639 |
+
this.dropdown = this.container.find('div.chosen-drop').first();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
this.search_field = this.container.find('input').first();
|
641 |
+
this.search_results = this.container.find('ul.chosen-results').first();
|
642 |
this.search_field_scale();
|
643 |
this.search_no_results = this.container.find('li.no-results').first();
|
644 |
if (this.is_multiple) {
|
645 |
+
this.search_choices = this.container.find('ul.chosen-choices').first();
|
646 |
this.search_container = this.container.find('li.search-field').first();
|
647 |
} else {
|
648 |
+
this.search_container = this.container.find('div.chosen-search').first();
|
649 |
+
this.selected_item = this.container.find('.chosen-single').first();
|
|
|
|
|
|
|
|
|
650 |
}
|
651 |
this.results_build();
|
652 |
this.set_tab_index();
|
653 |
+
return this.set_label_behavior();
|
654 |
+
};
|
655 |
+
|
656 |
+
Chosen.prototype.on_ready = function() {
|
657 |
+
return this.form_field_jq.trigger("chosen:ready", {
|
658 |
chosen: this
|
659 |
});
|
660 |
};
|
661 |
|
662 |
Chosen.prototype.register_observers = function() {
|
663 |
var _this = this;
|
664 |
+
this.container.bind('touchstart.chosen', function(evt) {
|
665 |
+
_this.container_mousedown(evt);
|
666 |
+
return evt.preventDefault();
|
667 |
+
});
|
668 |
+
this.container.bind('touchend.chosen', function(evt) {
|
669 |
+
_this.container_mouseup(evt);
|
670 |
+
return evt.preventDefault();
|
671 |
+
});
|
672 |
+
this.container.bind('mousedown.chosen', function(evt) {
|
673 |
+
_this.container_mousedown(evt);
|
674 |
+
});
|
675 |
+
this.container.bind('mouseup.chosen', function(evt) {
|
676 |
+
_this.container_mouseup(evt);
|
677 |
+
});
|
678 |
+
this.container.bind('mouseenter.chosen', function(evt) {
|
679 |
+
_this.mouse_enter(evt);
|
680 |
+
});
|
681 |
+
this.container.bind('mouseleave.chosen', function(evt) {
|
682 |
+
_this.mouse_leave(evt);
|
683 |
+
});
|
684 |
+
this.search_results.bind('mouseup.chosen', function(evt) {
|
685 |
+
_this.search_results_mouseup(evt);
|
686 |
});
|
687 |
+
this.search_results.bind('mouseover.chosen', function(evt) {
|
688 |
+
_this.search_results_mouseover(evt);
|
689 |
});
|
690 |
+
this.search_results.bind('mouseout.chosen', function(evt) {
|
691 |
+
_this.search_results_mouseout(evt);
|
692 |
});
|
693 |
+
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
|
694 |
+
_this.search_results_mousewheel(evt);
|
695 |
});
|
696 |
+
this.search_results.bind('touchstart.chosen', function(evt) {
|
697 |
+
_this.search_results_touchstart(evt);
|
698 |
});
|
699 |
+
this.search_results.bind('touchmove.chosen', function(evt) {
|
700 |
+
_this.search_results_touchmove(evt);
|
701 |
});
|
702 |
+
this.search_results.bind('touchend.chosen', function(evt) {
|
703 |
+
_this.search_results_touchend(evt);
|
704 |
});
|
705 |
+
this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
|
706 |
+
_this.results_update_field(evt);
|
707 |
});
|
708 |
+
this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
|
709 |
+
_this.activate_field(evt);
|
710 |
});
|
711 |
+
this.form_field_jq.bind("chosen:open.chosen", function(evt) {
|
712 |
+
_this.container_mousedown(evt);
|
713 |
});
|
714 |
+
this.form_field_jq.bind("chosen:close.chosen", function(evt) {
|
715 |
+
_this.input_blur(evt);
|
716 |
+
});
|
717 |
+
this.search_field.bind('blur.chosen', function(evt) {
|
718 |
+
_this.input_blur(evt);
|
719 |
+
});
|
720 |
+
this.search_field.bind('keyup.chosen', function(evt) {
|
721 |
+
_this.keyup_checker(evt);
|
722 |
+
});
|
723 |
+
this.search_field.bind('keydown.chosen', function(evt) {
|
724 |
+
_this.keydown_checker(evt);
|
725 |
+
});
|
726 |
+
this.search_field.bind('focus.chosen', function(evt) {
|
727 |
+
_this.input_focus(evt);
|
728 |
+
});
|
729 |
+
this.search_field.bind('cut.chosen', function(evt) {
|
730 |
+
_this.clipboard_event_checker(evt);
|
731 |
+
});
|
732 |
+
this.search_field.bind('paste.chosen', function(evt) {
|
733 |
+
_this.clipboard_event_checker(evt);
|
734 |
});
|
735 |
if (this.is_multiple) {
|
736 |
+
return this.search_choices.bind('click.chosen', function(evt) {
|
737 |
+
_this.choices_click(evt);
|
|
|
|
|
|
|
738 |
});
|
739 |
} else {
|
740 |
+
return this.container.bind('click.chosen', function(evt) {
|
741 |
+
evt.preventDefault();
|
742 |
});
|
743 |
}
|
744 |
};
|
745 |
|
746 |
+
Chosen.prototype.destroy = function() {
|
747 |
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
748 |
+
if (this.search_field[0].tabIndex) {
|
749 |
+
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
750 |
+
}
|
751 |
+
this.container.remove();
|
752 |
+
this.form_field_jq.removeData('chosen');
|
753 |
+
return this.form_field_jq.show();
|
754 |
+
};
|
755 |
+
|
756 |
Chosen.prototype.search_field_disabled = function() {
|
757 |
this.is_disabled = this.form_field_jq[0].disabled;
|
758 |
if (this.is_disabled) {
|
759 |
+
this.container.addClass('chosen-disabled');
|
760 |
this.search_field[0].disabled = true;
|
761 |
if (!this.is_multiple) {
|
762 |
+
this.selected_item.unbind("focus.chosen", this.activate_action);
|
763 |
}
|
764 |
return this.close_field();
|
765 |
} else {
|
766 |
+
this.container.removeClass('chosen-disabled');
|
767 |
this.search_field[0].disabled = false;
|
768 |
if (!this.is_multiple) {
|
769 |
+
return this.selected_item.bind("focus.chosen", this.activate_action);
|
770 |
}
|
771 |
}
|
772 |
};
|
773 |
|
774 |
Chosen.prototype.container_mousedown = function(evt) {
|
|
|
775 |
if (!this.is_disabled) {
|
|
|
776 |
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
777 |
+
evt.preventDefault();
|
778 |
}
|
779 |
+
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
780 |
if (!this.active_field) {
|
781 |
+
if (this.is_multiple) {
|
782 |
+
this.search_field.val("");
|
783 |
+
}
|
784 |
+
$(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
|
785 |
this.results_show();
|
786 |
+
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
|
787 |
evt.preventDefault();
|
788 |
this.results_toggle();
|
789 |
}
|
790 |
return this.activate_field();
|
|
|
|
|
791 |
}
|
792 |
}
|
793 |
};
|
794 |
|
795 |
Chosen.prototype.container_mouseup = function(evt) {
|
796 |
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
797 |
+
return this.results_reset(evt);
|
798 |
+
}
|
799 |
+
};
|
800 |
+
|
801 |
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
802 |
+
var delta;
|
803 |
+
if (evt.originalEvent) {
|
804 |
+
delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
|
805 |
+
}
|
806 |
+
if (delta != null) {
|
807 |
+
evt.preventDefault();
|
808 |
+
if (evt.type === 'DOMMouseScroll') {
|
809 |
+
delta = delta * 40;
|
810 |
+
}
|
811 |
+
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
812 |
+
}
|
813 |
};
|
814 |
|
815 |
Chosen.prototype.blur_test = function(evt) {
|
816 |
+
if (!this.active_field && this.container.hasClass("chosen-container-active")) {
|
817 |
return this.close_field();
|
818 |
}
|
819 |
};
|
820 |
|
821 |
Chosen.prototype.close_field = function() {
|
822 |
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
|
|
|
|
|
|
|
|
823 |
this.active_field = false;
|
824 |
this.results_hide();
|
825 |
+
this.container.removeClass("chosen-container-active");
|
|
|
826 |
this.clear_backstroke();
|
827 |
this.show_search_field_default();
|
828 |
return this.search_field_scale();
|
829 |
};
|
830 |
|
831 |
Chosen.prototype.activate_field = function() {
|
832 |
+
this.container.addClass("chosen-container-active");
|
|
|
|
|
|
|
|
|
833 |
this.active_field = true;
|
834 |
this.search_field.val(this.search_field.val());
|
835 |
return this.search_field.focus();
|
836 |
};
|
837 |
|
838 |
Chosen.prototype.test_active_click = function(evt) {
|
839 |
+
var active_container;
|
840 |
+
active_container = $(evt.target).closest('.chosen-container');
|
841 |
+
if (active_container.length && this.container[0] === active_container[0]) {
|
842 |
return this.active_field = true;
|
843 |
} else {
|
844 |
return this.close_field();
|
846 |
};
|
847 |
|
848 |
Chosen.prototype.results_build = function() {
|
|
|
849 |
this.parsing = true;
|
850 |
+
this.selected_option_count = null;
|
851 |
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
852 |
+
if (this.is_multiple) {
|
853 |
this.search_choices.find("li.search-choice").remove();
|
|
|
854 |
} else if (!this.is_multiple) {
|
855 |
+
this.single_set_selected_text();
|
856 |
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
857 |
+
this.search_field[0].readOnly = true;
|
858 |
+
this.container.addClass("chosen-container-single-nosearch");
|
859 |
} else {
|
860 |
+
this.search_field[0].readOnly = false;
|
861 |
+
this.container.removeClass("chosen-container-single-nosearch");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
}
|
863 |
}
|
864 |
+
this.update_results_content(this.results_option_build({
|
865 |
+
first: true
|
866 |
+
}));
|
867 |
this.search_field_disabled();
|
868 |
this.show_search_field_default();
|
869 |
this.search_field_scale();
|
|
|
870 |
return this.parsing = false;
|
871 |
};
|
872 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
Chosen.prototype.result_do_highlight = function(el) {
|
874 |
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
875 |
if (el.length) {
|
890 |
};
|
891 |
|
892 |
Chosen.prototype.result_clear_highlight = function() {
|
893 |
+
if (this.result_highlight) {
|
894 |
+
this.result_highlight.removeClass("highlighted");
|
895 |
+
}
|
896 |
return this.result_highlight = null;
|
897 |
};
|
898 |
|
899 |
Chosen.prototype.results_show = function() {
|
900 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
901 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
|
|
|
|
|
|
|
|
|
|
|
|
902 |
chosen: this
|
903 |
});
|
904 |
return false;
|
905 |
}
|
906 |
+
this.container.addClass("chosen-with-drop");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
907 |
this.results_showing = true;
|
908 |
this.search_field.focus();
|
909 |
this.search_field.val(this.search_field.val());
|
910 |
+
this.winnow_results();
|
911 |
+
return this.form_field_jq.trigger("chosen:showing_dropdown", {
|
912 |
+
chosen: this
|
913 |
+
});
|
914 |
+
};
|
915 |
+
|
916 |
+
Chosen.prototype.update_results_content = function(content) {
|
917 |
+
return this.search_results.html(content);
|
918 |
};
|
919 |
|
920 |
Chosen.prototype.results_hide = function() {
|
921 |
+
if (this.results_showing) {
|
922 |
+
this.result_clear_highlight();
|
923 |
+
this.container.removeClass("chosen-with-drop");
|
924 |
+
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
925 |
+
chosen: this
|
926 |
+
});
|
927 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
return this.results_showing = false;
|
929 |
};
|
930 |
|
931 |
Chosen.prototype.set_tab_index = function(el) {
|
932 |
var ti;
|
933 |
+
if (this.form_field.tabIndex) {
|
934 |
+
ti = this.form_field.tabIndex;
|
935 |
+
this.form_field.tabIndex = -1;
|
936 |
+
return this.search_field[0].tabIndex = ti;
|
937 |
+
}
|
938 |
+
};
|
939 |
+
|
940 |
+
Chosen.prototype.set_label_behavior = function() {
|
941 |
+
var _this = this;
|
942 |
+
this.form_field_label = this.form_field_jq.parents("label");
|
943 |
+
if (!this.form_field_label.length && this.form_field.id.length) {
|
944 |
+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
945 |
+
}
|
946 |
+
if (this.form_field_label.length > 0) {
|
947 |
+
return this.form_field_label.bind('click.chosen', function(evt) {
|
948 |
+
if (_this.is_multiple) {
|
949 |
+
return _this.container_mousedown(evt);
|
950 |
+
} else {
|
951 |
+
return _this.activate_field();
|
952 |
+
}
|
953 |
+
});
|
954 |
}
|
955 |
};
|
956 |
|
957 |
Chosen.prototype.show_search_field_default = function() {
|
958 |
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
959 |
this.search_field.val(this.default_text);
|
960 |
return this.search_field.addClass("default");
|
961 |
} else {
|
969 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
970 |
if (target.length) {
|
971 |
this.result_highlight = target;
|
972 |
+
this.result_select(evt);
|
973 |
+
return this.search_field.focus();
|
974 |
}
|
975 |
};
|
976 |
|
977 |
Chosen.prototype.search_results_mouseover = function(evt) {
|
978 |
var target;
|
979 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
980 |
+
if (target) {
|
981 |
+
return this.result_do_highlight(target);
|
982 |
+
}
|
983 |
};
|
984 |
|
985 |
Chosen.prototype.search_results_mouseout = function(evt) {
|
988 |
}
|
989 |
};
|
990 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
991 |
Chosen.prototype.choice_build = function(item) {
|
992 |
+
var choice, close_link,
|
993 |
_this = this;
|
994 |
+
choice = $('<li />', {
|
995 |
+
"class": "search-choice"
|
996 |
+
}).html("<span>" + (this.choice_label(item)) + "</span>");
|
997 |
+
if (item.disabled) {
|
998 |
+
choice.addClass('search-choice-disabled');
|
999 |
+
} else {
|
1000 |
+
close_link = $('<a />', {
|
1001 |
+
"class": 'search-choice-close',
|
1002 |
+
'data-option-array-index': item.array_index
|
1003 |
});
|
1004 |
+
close_link.bind('click.chosen', function(evt) {
|
1005 |
+
return _this.choice_destroy_link_click(evt);
|
1006 |
+
});
|
1007 |
+
choice.append(close_link);
|
1008 |
}
|
1009 |
+
return this.search_container.before(choice);
|
|
|
|
|
|
|
|
|
|
|
|
|
1010 |
};
|
1011 |
|
1012 |
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
1013 |
evt.preventDefault();
|
1014 |
+
evt.stopPropagation();
|
1015 |
if (!this.is_disabled) {
|
|
|
1016 |
return this.choice_destroy($(evt.target));
|
|
|
|
|
1017 |
}
|
1018 |
};
|
1019 |
|
1020 |
Chosen.prototype.choice_destroy = function(link) {
|
1021 |
+
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
1022 |
+
this.show_search_field_default();
|
1023 |
+
if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
|
1024 |
+
this.results_hide();
|
1025 |
+
}
|
1026 |
+
link.parents('li').first().remove();
|
1027 |
+
return this.search_field_scale();
|
1028 |
}
|
|
|
|
|
1029 |
};
|
1030 |
|
1031 |
Chosen.prototype.results_reset = function() {
|
1032 |
+
this.reset_single_select_options();
|
1033 |
this.form_field.options[0].selected = true;
|
1034 |
+
this.single_set_selected_text();
|
|
|
1035 |
this.show_search_field_default();
|
1036 |
+
this.results_reset_cleanup();
|
1037 |
this.form_field_jq.trigger("change");
|
1038 |
+
if (this.active_field) {
|
1039 |
+
return this.results_hide();
|
1040 |
+
}
|
1041 |
+
};
|
1042 |
+
|
1043 |
+
Chosen.prototype.results_reset_cleanup = function() {
|
1044 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1045 |
+
return this.selected_item.find("abbr").remove();
|
1046 |
};
|
1047 |
|
1048 |
Chosen.prototype.result_select = function(evt) {
|
1049 |
+
var high, item;
|
1050 |
if (this.result_highlight) {
|
1051 |
high = this.result_highlight;
|
|
|
1052 |
this.result_clear_highlight();
|
1053 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
1054 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
1055 |
+
chosen: this
|
1056 |
+
});
|
1057 |
+
return false;
|
1058 |
+
}
|
1059 |
if (this.is_multiple) {
|
1060 |
+
high.removeClass("active-result");
|
1061 |
} else {
|
1062 |
+
this.reset_single_select_options();
|
|
|
|
|
1063 |
}
|
1064 |
high.addClass("result-selected");
|
1065 |
+
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
|
|
1066 |
item.selected = true;
|
1067 |
this.form_field.options[item.options_index].selected = true;
|
1068 |
+
this.selected_option_count = null;
|
1069 |
if (this.is_multiple) {
|
1070 |
this.choice_build(item);
|
1071 |
} else {
|
1072 |
+
this.single_set_selected_text(this.choice_label(item));
|
|
|
1073 |
}
|
1074 |
+
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
|
1075 |
+
this.results_hide();
|
1076 |
+
}
|
1077 |
+
this.show_search_field_default();
|
1078 |
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
1079 |
+
this.form_field_jq.trigger("change", {
|
1080 |
+
'selected': this.form_field.options[item.options_index].value
|
1081 |
+
});
|
1082 |
+
}
|
1083 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1084 |
+
evt.preventDefault();
|
1085 |
return this.search_field_scale();
|
1086 |
}
|
1087 |
};
|
1088 |
|
1089 |
+
Chosen.prototype.single_set_selected_text = function(text) {
|
1090 |
+
if (text == null) {
|
1091 |
+
text = this.default_text;
|
1092 |
+
}
|
1093 |
+
if (text === this.default_text) {
|
1094 |
+
this.selected_item.addClass("chosen-default");
|
1095 |
+
} else {
|
1096 |
+
this.single_deselect_control_build();
|
1097 |
+
this.selected_item.removeClass("chosen-default");
|
1098 |
+
}
|
1099 |
+
return this.selected_item.find("span").html(text);
|
1100 |
};
|
1101 |
|
1102 |
Chosen.prototype.result_deselect = function(pos) {
|
1103 |
+
var result_data;
|
1104 |
result_data = this.results_data[pos];
|
1105 |
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
1106 |
+
result_data.selected = false;
|
1107 |
+
this.form_field.options[result_data.options_index].selected = false;
|
1108 |
+
this.selected_option_count = null;
|
1109 |
+
this.result_clear_highlight();
|
1110 |
+
if (this.results_showing) {
|
1111 |
+
this.winnow_results();
|
1112 |
+
}
|
1113 |
+
this.form_field_jq.trigger("change", {
|
1114 |
+
deselected: this.form_field.options[result_data.options_index].value
|
1115 |
+
});
|
1116 |
+
this.search_field_scale();
|
1117 |
+
return true;
|
1118 |
+
} else {
|
1119 |
+
return false;
|
1120 |
}
|
1121 |
};
|
1122 |
|
1123 |
+
Chosen.prototype.single_deselect_control_build = function() {
|
1124 |
+
if (!this.allow_single_deselect) {
|
1125 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1126 |
}
|
1127 |
+
if (!this.selected_item.find("abbr").length) {
|
1128 |
+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
|
|
|
|
1129 |
}
|
1130 |
+
return this.selected_item.addClass("chosen-single-with-deselect");
|
1131 |
};
|
1132 |
|
1133 |
+
Chosen.prototype.get_search_text = function() {
|
1134 |
+
return $('<div/>').text($.trim(this.search_field.val())).html();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
};
|
1136 |
|
1137 |
Chosen.prototype.winnow_results_set_highlight = function() {
|
1138 |
var do_high, selected_results;
|
1139 |
+
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
1140 |
+
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
1141 |
+
if (do_high != null) {
|
1142 |
+
return this.result_do_highlight(do_high);
|
1143 |
}
|
1144 |
};
|
1145 |
|
1147 |
var no_results_html;
|
1148 |
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
1149 |
no_results_html.find("span").first().html(terms);
|
1150 |
+
this.search_results.append(no_results_html);
|
1151 |
+
return this.form_field_jq.trigger("chosen:no_results", {
|
1152 |
+
chosen: this
|
1153 |
+
});
|
1154 |
};
|
1155 |
|
1156 |
Chosen.prototype.no_results_clear = function() {
|
1158 |
};
|
1159 |
|
1160 |
Chosen.prototype.keydown_arrow = function() {
|
1161 |
+
var next_sib;
|
1162 |
+
if (this.results_showing && this.result_highlight) {
|
|
|
|
|
|
|
1163 |
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
1164 |
+
if (next_sib) {
|
1165 |
+
return this.result_do_highlight(next_sib);
|
1166 |
+
}
|
1167 |
+
} else {
|
1168 |
+
return this.results_show();
|
1169 |
}
|
|
|
1170 |
};
|
1171 |
|
1172 |
Chosen.prototype.keyup_arrow = function() {
|
1178 |
if (prev_sibs.length) {
|
1179 |
return this.result_do_highlight(prev_sibs.first());
|
1180 |
} else {
|
1181 |
+
if (this.choices_count() > 0) {
|
1182 |
+
this.results_hide();
|
1183 |
+
}
|
1184 |
return this.result_clear_highlight();
|
1185 |
}
|
1186 |
}
|
1187 |
};
|
1188 |
|
1189 |
Chosen.prototype.keydown_backstroke = function() {
|
1190 |
+
var next_available_destroy;
|
1191 |
if (this.pending_backstroke) {
|
1192 |
this.choice_destroy(this.pending_backstroke.find("a").first());
|
1193 |
return this.clear_backstroke();
|
1194 |
} else {
|
1195 |
+
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
1196 |
+
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
1197 |
+
this.pending_backstroke = next_available_destroy;
|
1198 |
+
if (this.single_backstroke_delete) {
|
1199 |
+
return this.keydown_backstroke();
|
1200 |
+
} else {
|
1201 |
+
return this.pending_backstroke.addClass("search-choice-focus");
|
1202 |
+
}
|
1203 |
+
}
|
1204 |
}
|
1205 |
};
|
1206 |
|
1212 |
};
|
1213 |
|
1214 |
Chosen.prototype.keydown_checker = function(evt) {
|
1215 |
+
var stroke, _ref1;
|
1216 |
+
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
|
1217 |
this.search_field_scale();
|
1218 |
+
if (stroke !== 8 && this.pending_backstroke) {
|
1219 |
+
this.clear_backstroke();
|
1220 |
+
}
|
1221 |
switch (stroke) {
|
1222 |
case 8:
|
1223 |
this.backstroke_length = this.search_field.val().length;
|
1224 |
break;
|
1225 |
case 9:
|
1226 |
+
if (this.results_showing && !this.is_multiple) {
|
1227 |
+
this.result_select(evt);
|
1228 |
+
}
|
1229 |
this.mouse_on_container = false;
|
1230 |
break;
|
1231 |
case 13:
|
1232 |
+
if (this.results_showing) {
|
1233 |
+
evt.preventDefault();
|
1234 |
+
}
|
1235 |
+
break;
|
1236 |
+
case 32:
|
1237 |
+
if (this.disable_search) {
|
1238 |
+
evt.preventDefault();
|
1239 |
+
}
|
1240 |
break;
|
1241 |
case 38:
|
1242 |
evt.preventDefault();
|
1243 |
this.keyup_arrow();
|
1244 |
break;
|
1245 |
case 40:
|
1246 |
+
evt.preventDefault();
|
1247 |
this.keydown_arrow();
|
1248 |
break;
|
1249 |
}
|
1250 |
};
|
1251 |
|
1252 |
Chosen.prototype.search_field_scale = function() {
|
1253 |
+
var div, f_width, h, style, style_block, styles, w, _i, _len;
|
1254 |
if (this.is_multiple) {
|
1255 |
h = 0;
|
1256 |
w = 0;
|
1267 |
$('body').append(div);
|
1268 |
w = div.width() + 25;
|
1269 |
div.remove();
|
1270 |
+
f_width = this.container.outerWidth();
|
1271 |
+
if (w > f_width - 10) {
|
1272 |
+
w = f_width - 10;
|
1273 |
+
}
|
1274 |
+
return this.search_field.css({
|
1275 |
'width': w + 'px'
|
1276 |
});
|
|
|
|
|
|
|
|
|
1277 |
}
|
1278 |
};
|
1279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1280 |
return Chosen;
|
1281 |
|
1282 |
})(AbstractChosen);
|
1283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1284 |
}).call(this);
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== WooCommerce - Store Exporter ===
|
2 |
|
3 |
-
Contributors: visser, visser.labs
|
4 |
Donate link: https://www.visser.com.au/donations/
|
5 |
Tags: woocommerce, export, products, sales, orders, coupons, users, subscriptions, csv
|
6 |
Requires at least: 2.9.2
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag: 2.
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007, XLS, etc.).
|
@@ -154,6 +154,11 @@ If you have any problems, questions or suggestions please create a topic here on
|
|
154 |
|
155 |
== Changelog ==
|
156 |
|
|
|
|
|
|
|
|
|
|
|
157 |
= 2.5 =
|
158 |
* Added: Export button to the Products, Categories, Product Tags and Orders screen
|
159 |
* Fixed: Quantity not populating for Variable Products in WooCommerce version 3.8 and above (thanks Hanny)
|
1 |
=== WooCommerce - Store Exporter ===
|
2 |
|
3 |
+
Contributors: visser, visser.labs
|
4 |
Donate link: https://www.visser.com.au/donations/
|
5 |
Tags: woocommerce, export, products, sales, orders, coupons, users, subscriptions, csv
|
6 |
Requires at least: 2.9.2
|
7 |
+
Tested up to: 5.5
|
8 |
+
Stable tag: 2.6
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007, XLS, etc.).
|
154 |
|
155 |
== Changelog ==
|
156 |
|
157 |
+
= 2.6 =
|
158 |
+
* Added: Compatible with WordPress version 5.5
|
159 |
+
* Added: Compatible with WooCommerce version 4.3.2
|
160 |
+
* Fixed: Replaced deprecated jQuery methods for jquery.chosen.js
|
161 |
+
|
162 |
= 2.5 =
|
163 |
* Added: Export button to the Products, Categories, Product Tags and Orders screen
|
164 |
* Fixed: Quantity not populating for Variable Products in WooCommerce version 3.8 and above (thanks Hanny)
|
templates/admin/woo-admin_ce-export.css
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Tabbed navigation */
|
2 |
+
|
3 |
+
.woocommerce_page_woo_ce h2 .nav-tab {
|
4 |
+
font-size: 16px;
|
5 |
+
margin-right:0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.woocommerce_page_woo_ce h2.nav-tab-wrapper {
|
9 |
+
padding-left:7px;
|
10 |
+
}
|
11 |
+
|
12 |
+
/* Export */
|
13 |
+
|
14 |
+
.woocommerce_page_woo_ce #export-type th {
|
15 |
+
padding:0;
|
16 |
+
}
|
17 |
+
.woocommerce_page_woo_ce #export-type td {
|
18 |
+
padding:0;
|
19 |
+
}
|
20 |
+
.woocommerce_page_woo_ce .postbox .submit {
|
21 |
+
padding:0.3em 0;
|
22 |
+
}
|
23 |
+
.woocommerce_page_woo_ce textarea#export_log {
|
24 |
+
font:12px Consolas, Monaco, Courier, monospace;
|
25 |
+
width:100%;
|
26 |
+
height:200px;
|
27 |
+
}
|
28 |
+
.woocommerce_page_woo_ce .separator {
|
29 |
+
border-bottom:1px solid #dfdfdf;
|
30 |
+
}
|
31 |
+
|
32 |
+
.woocommerce_page_woo_ce .overview-left {
|
33 |
+
float:left;
|
34 |
+
width:73%;
|
35 |
+
}
|
36 |
+
.woocommerce_page_woo_ce .overview-right {
|
37 |
+
float:left;
|
38 |
+
width:24%;
|
39 |
+
}
|
40 |
+
.woocommerce_page_woo_ce .overview-right h3 {
|
41 |
+
font-size:16px;
|
42 |
+
}
|
43 |
+
.woocommerce_page_woo_ce .overview-right h3 span {
|
44 |
+
float:right;
|
45 |
+
font-size:11px;
|
46 |
+
font-weight:normal;
|
47 |
+
}
|
48 |
+
.woocommerce_page_woo_ce .overview-right p {
|
49 |
+
font-size:12px;
|
50 |
+
color:#333;
|
51 |
+
line-height:1.6em;
|
52 |
+
}
|
53 |
+
.woocommerce_page_woo_ce .overview-right ul {
|
54 |
+
font-size:12px;
|
55 |
+
line-height:1.2em;
|
56 |
+
}
|
57 |
+
|
58 |
+
/* Support - Donate / Rate */
|
59 |
+
|
60 |
+
.woocommerce_page_woo_ce .support-donate_rate {
|
61 |
+
display:block;
|
62 |
+
float:right;
|
63 |
+
}
|
64 |
+
.woocommerce_page_woo_ce .support-donate_rate p {
|
65 |
+
margin-top:16px;
|
66 |
+
}
|
67 |
+
.woocommerce_page_woo_ce .support-donate_rate .star {
|
68 |
+
vertical-align:bottom;
|
69 |
+
display:inline-block;
|
70 |
+
width:17px;
|
71 |
+
height:17px;
|
72 |
+
background:url('images/star.png') no-repeat;
|
73 |
+
}
|
74 |
+
.woocommerce_page_woo_ce .support-donate_rate span {
|
75 |
+
display:none;
|
76 |
+
}
|
templates/admin/woo-admin_ce-export.js
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var $j = jQuery.noConflict();
|
2 |
+
$j(function() {
|
3 |
+
|
4 |
+
$j('#skip_overview').click(function(){
|
5 |
+
$j('#skip_overview_form').submit();
|
6 |
+
});
|
7 |
+
|
8 |
+
// Date Picker
|
9 |
+
$j('.datepicker').datepicker({
|
10 |
+
dateFormat: 'dd/mm/yy'
|
11 |
+
});
|
12 |
+
|
13 |
+
// Chosen
|
14 |
+
$j(".chzn-select").chosen({
|
15 |
+
search_contains: true
|
16 |
+
});
|
17 |
+
|
18 |
+
$j('#export-products').show();
|
19 |
+
// Categories
|
20 |
+
$j('#export-products-filters-categories').hide();
|
21 |
+
if( $j('#products-filters-categories').attr('checked') ) {
|
22 |
+
$j('#export-products-filters-categories').show();
|
23 |
+
}
|
24 |
+
// Tags
|
25 |
+
$j('#export-products-filters-tags').hide();
|
26 |
+
if( $j('#products-filters-tags').attr('checked') ) {
|
27 |
+
$j('#export-products-filters-tags').show();
|
28 |
+
}
|
29 |
+
// Product Status
|
30 |
+
$j('#export-products-filters-status').hide();
|
31 |
+
if( $j('#products-filters-status').attr('checked') ) {
|
32 |
+
$j('#export-products-filters-status').show();
|
33 |
+
}
|
34 |
+
$j('#export-products-filters-type').hide();
|
35 |
+
if( $j('#products-filters-type').attr('checked') ) {
|
36 |
+
$j('#export-products-filters-type').show();
|
37 |
+
}
|
38 |
+
$j('#export-categories').hide();
|
39 |
+
$j('#export-tags').hide();
|
40 |
+
$j('#export-orders').hide();
|
41 |
+
$j('#export-orders-filters-status').hide();
|
42 |
+
if( $j('#orders-filters-status').attr('checked') ) {
|
43 |
+
$j('#export-orders-filters-status').show();
|
44 |
+
}
|
45 |
+
$j('#export-orders-filters-date').hide();
|
46 |
+
if( $j('#orders-filters-date').attr('checked') ) {
|
47 |
+
$j('#export-orders-filters-date').show();
|
48 |
+
}
|
49 |
+
$j('#export-orders-filters-user_role').hide();
|
50 |
+
if( $j('#orders-filters-user_role').attr('checked') ) {
|
51 |
+
$j('#export-orders-filters-user_role').show();
|
52 |
+
}
|
53 |
+
$j('#export-customers').hide();
|
54 |
+
$j('#export-coupons').hide();
|
55 |
+
|
56 |
+
$j('#products-filters-categories').click(function(){
|
57 |
+
$j('#export-products-filters-categories').toggle();
|
58 |
+
});
|
59 |
+
$j('#products-filters-tags').click(function(){
|
60 |
+
$j('#export-products-filters-tags').toggle();
|
61 |
+
});
|
62 |
+
$j('#products-filters-status').click(function(){
|
63 |
+
$j('#export-products-filters-status').toggle();
|
64 |
+
});
|
65 |
+
$j('#products-filters-type').click(function(){
|
66 |
+
$j('#export-products-filters-type').toggle();
|
67 |
+
});
|
68 |
+
$j('#orders-filters-status').click(function(){
|
69 |
+
$j('#export-orders-filters-status').toggle();
|
70 |
+
});
|
71 |
+
$j('#orders-filters-date').click(function(){
|
72 |
+
$j('#export-orders-filters-date').toggle();
|
73 |
+
});
|
74 |
+
$j('#orders-filters-user_role').click(function(){
|
75 |
+
$j('#export-orders-filters-user_role').toggle();
|
76 |
+
});
|
77 |
+
|
78 |
+
// Export types
|
79 |
+
$j('#products').click(function(){
|
80 |
+
$j('#export-products').show();
|
81 |
+
$j('#export-categories').hide();
|
82 |
+
$j('#export-tags').hide();
|
83 |
+
$j('#export-orders').hide();
|
84 |
+
$j('#export-customers').hide();
|
85 |
+
$j('#export-coupons').hide();
|
86 |
+
|
87 |
+
$j('.export-options').hide();
|
88 |
+
$j('.product-options').show();
|
89 |
+
});
|
90 |
+
$j('#categories').click(function(){
|
91 |
+
$j('#export-products').hide();
|
92 |
+
$j('#export-categories').show();
|
93 |
+
$j('#export-tags').hide();
|
94 |
+
$j('#export-orders').hide();
|
95 |
+
$j('#export-customers').hide();
|
96 |
+
$j('#export-coupons').hide();
|
97 |
+
|
98 |
+
$j('.export-options').hide();
|
99 |
+
$j('.category-options').show();
|
100 |
+
});
|
101 |
+
$j('#tags').click(function(){
|
102 |
+
$j('#export-products').hide();
|
103 |
+
$j('#export-categories').hide();
|
104 |
+
$j('#export-tags').show();
|
105 |
+
$j('#export-orders').hide();
|
106 |
+
$j('#export-customers').hide();
|
107 |
+
$j('#export-coupons').hide();
|
108 |
+
|
109 |
+
$j('.export-options').hide();
|
110 |
+
$j('.tag-options').show();
|
111 |
+
});
|
112 |
+
$j('#orders').click(function(){
|
113 |
+
$j('#export-products').hide();
|
114 |
+
$j('#export-categories').hide();
|
115 |
+
$j('#export-tags').hide();
|
116 |
+
$j('#export-orders').show();
|
117 |
+
$j('#export-customers').hide();
|
118 |
+
$j('#export-coupons').hide();
|
119 |
+
|
120 |
+
$j('.export-options').hide();
|
121 |
+
$j('.order-options').show();
|
122 |
+
});
|
123 |
+
$j('#customers').click(function(){
|
124 |
+
$j('#export-products').hide();
|
125 |
+
$j('#export-categories').hide();
|
126 |
+
$j('#export-tags').hide();
|
127 |
+
$j('#export-orders').hide();
|
128 |
+
$j('#export-customers').show();
|
129 |
+
$j('#export-coupons').hide();
|
130 |
+
|
131 |
+
$j('.export-options').hide();
|
132 |
+
$j('.customer-options').show();
|
133 |
+
});
|
134 |
+
$j('#coupons').click(function(){
|
135 |
+
$j('#export-products').hide();
|
136 |
+
$j('#export-categories').hide();
|
137 |
+
$j('#export-tags').hide();
|
138 |
+
$j('#export-orders').hide();
|
139 |
+
$j('#export-customers').hide();
|
140 |
+
$j('#export-coupons').show();
|
141 |
+
|
142 |
+
$j('.export-options').hide();
|
143 |
+
$j('.coupon-options').show();
|
144 |
+
});
|
145 |
+
|
146 |
+
// Export button
|
147 |
+
$j('#export_products').click(function(){
|
148 |
+
$j('input:radio[name=dataset]:nth(0)').attr('checked',true);
|
149 |
+
});
|
150 |
+
$j('#export_orders').click(function(){
|
151 |
+
$j('input:radio[name=dataset]:nth(3)').attr('checked',true);
|
152 |
+
});
|
153 |
+
$j('#export_customers').click(function(){
|
154 |
+
$j('input:radio[name=dataset]:nth(4)').attr('checked',true);
|
155 |
+
});
|
156 |
+
$j('#export_coupons').click(function(){
|
157 |
+
$j('input:radio[name=dataset]:nth(5)').attr('checked',true);
|
158 |
+
});
|
159 |
+
|
160 |
+
// Select all
|
161 |
+
$j('.checkall').click(function () {
|
162 |
+
$j(this).closest('.postbox').find(':checkbox').attr('checked', true);
|
163 |
+
});
|
164 |
+
$j('.uncheckall').click(function () {
|
165 |
+
$j(this).closest('.postbox').find(':checkbox').attr('checked', false);
|
166 |
+
});
|
167 |
+
|
168 |
+
$j(document).ready(function() {
|
169 |
+
var href = jQuery(location).attr('href');
|
170 |
+
if (href.toLowerCase().indexOf('tab=export') >= 0) {
|
171 |
+
if (href.toLowerCase().indexOf('#') >= 0 ) {
|
172 |
+
var type = href.substr(href.indexOf("#") + 1)
|
173 |
+
var type = type.replace('export-','');
|
174 |
+
$j('#'+type).trigger('click');
|
175 |
+
}
|
176 |
+
}
|
177 |
+
});
|
178 |
+
|
179 |
+
});
|
templates/admin/woo-admin_ce-export.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="content">
|
2 |
+
|
3 |
+
<h2 class="nav-tab-wrapper">
|
4 |
+
<a data-tab-id="overview" class="nav-tab<?php woo_ce_admin_active_tab( 'overview' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'overview' ), 'admin.php' ); ?>"><?php _e( 'Overview', 'woo_ce' ); ?></a>
|
5 |
+
<a data-tab-id="export" class="nav-tab<?php woo_ce_admin_active_tab( 'export' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'export' ), 'admin.php' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a>
|
6 |
+
<a data-tab-id="archive" class="nav-tab<?php woo_ce_admin_active_tab( 'archive' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'archive' ), 'admin.php' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a>
|
7 |
+
<a data-tab-id="settings" class="nav-tab<?php woo_ce_admin_active_tab( 'settings' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'settings' ), 'admin.php' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a>
|
8 |
+
<a data-tab-id="tools" class="nav-tab<?php woo_ce_admin_active_tab( 'tools' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'tools' ), 'admin.php' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a>
|
9 |
+
</h2>
|
10 |
+
<?php woo_ce_tab_template( $tab ); ?>
|
11 |
+
|
12 |
+
</div>
|
13 |
+
<!-- #content -->
|
templates/admin/woo-admin_ce-export_archive.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul class="subsubsub">
|
2 |
+
<li><a href="<?php echo add_query_arg( 'filter', null ); ?>"<?php woo_ce_archives_quicklink_current( 'all' ); ?>><?php _e( 'All', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count(); ?>)</span></a> |</li>
|
3 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'products' ); ?>"<?php woo_ce_archives_quicklink_current( 'products' ); ?>><?php _e( 'Products', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'products' ); ?>)</span></a> |</li>
|
4 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'categories' ); ?>"<?php woo_ce_archives_quicklink_current( 'categories' ); ?>><?php _e( 'Categories', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'categories' ); ?>)</span></a> |</li>
|
5 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'tags' ); ?>"<?php woo_ce_archives_quicklink_current( 'tags' ); ?>><?php _e( 'Tags', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'tags' ); ?>)</span></a> |</li>
|
6 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'orders' ); ?>"<?php woo_ce_archives_quicklink_current( 'orders' ); ?>><?php _e( 'Orders', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'orders' ); ?>)</span></a> |</li>
|
7 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'customers' ); ?>"<?php woo_ce_archives_quicklink_current( 'customers' ); ?>><?php _e( 'Customers', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'customers' ); ?>)</span></a> |</li>
|
8 |
+
<li><a href="<?php echo add_query_arg( 'filter', 'coupons' ); ?>"<?php woo_ce_archives_quicklink_current( 'coupons' ); ?>><?php _e( 'Coupons', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'coupons' ); ?>)</span></a></li>
|
9 |
+
</ul>
|
10 |
+
<br class="clear" />
|
11 |
+
<form action="" method="GET">
|
12 |
+
<table class="widefat fixed media" cellspacing="0">
|
13 |
+
<thead>
|
14 |
+
|
15 |
+
<tr>
|
16 |
+
<th scope="col" id="icon" class="manage-column column-icon"></th>
|
17 |
+
<th scope="col" id="title" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
|
18 |
+
<th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
|
19 |
+
<th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
|
20 |
+
<th scope="col" id="title" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
|
21 |
+
</tr>
|
22 |
+
|
23 |
+
</thead>
|
24 |
+
<tfoot>
|
25 |
+
|
26 |
+
<tr>
|
27 |
+
<th scope="col" class="manage-column column-icon"></th>
|
28 |
+
<th scope="col" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
|
29 |
+
<th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
|
30 |
+
<th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
|
31 |
+
<th scope="col" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
|
32 |
+
</tr>
|
33 |
+
|
34 |
+
</tfoot>
|
35 |
+
<tbody id="the-list">
|
36 |
+
|
37 |
+
<?php if( $files ) { ?>
|
38 |
+
<?php foreach( $files as $file ) { ?>
|
39 |
+
<tr id="post-<?php echo $file->ID; ?>" class="author-self status-<?php echo $file->post_status; ?>" valign="top">
|
40 |
+
<td class="column-icon media-icon">
|
41 |
+
<?php echo $file->media_icon; ?>
|
42 |
+
</td>
|
43 |
+
<td class="post-title page-title column-title">
|
44 |
+
<strong><a href="<?php echo $file->guid; ?>" class="row-title"><?php echo $file->post_title; ?></a></strong>
|
45 |
+
<div class="row-actions">
|
46 |
+
<span class="view"><a href="<?php echo get_edit_post_link( $file->ID ); ?>" title="<?php _e( 'Edit', 'woo_ce' ); ?>"><?php _e( 'Edit', 'woo_ce' ); ?></a></span> |
|
47 |
+
<span class="trash"><a href="<?php echo get_delete_post_link( $file->ID, '', true ); ?>" title="<?php _e( 'Delete Permanently', 'woo_ce' ); ?>"><?php _e( 'Delete', 'woo_ce' ); ?></a></span>
|
48 |
+
</div>
|
49 |
+
</td>
|
50 |
+
<td class="title">
|
51 |
+
<a href="<?php echo add_query_arg( 'filter', $file->export_type ); ?>"><?php echo $file->export_type_label; ?></a>
|
52 |
+
</td>
|
53 |
+
<td class="author column-author"><?php echo $file->post_author_name; ?></td>
|
54 |
+
<td class="date column-date"><?php echo $file->post_date; ?></td>
|
55 |
+
</tr>
|
56 |
+
<?php } ?>
|
57 |
+
<?php } else { ?>
|
58 |
+
<tr id="post-<?php echo $file->ID; ?>" class="author-self" valign="top">
|
59 |
+
<td colspan="3" class="colspanchange"><?php _e( 'No past exports found.', 'woo_ce' ); ?></td>
|
60 |
+
</tr>
|
61 |
+
<?php } ?>
|
62 |
+
|
63 |
+
</tbody>
|
64 |
+
</table>
|
65 |
+
</form>
|
templates/admin/woo-admin_ce-export_export.php
ADDED
@@ -0,0 +1,511 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul class="subsubsub">
|
2 |
+
<li><a href="#export-type"><?php _e( 'Export Type', 'woo_ce' ); ?></a> |</li>
|
3 |
+
<li><a href="#export-options"><?php _e( 'Export Options', 'woo_ce' ); ?></a></li>
|
4 |
+
<?php do_action( 'woo_ce_export_quicklinks' ); ?>
|
5 |
+
</ul>
|
6 |
+
<br class="clear" />
|
7 |
+
<p><?php _e( 'Select an export type from the list below to export entries. Once you have selected an export type you may select the fields you would like to export and optional filters available for each export type. When you click the export button below, Store Exporter will create a CSV file for you to save to your computer.', 'woo_ce' ); ?></p>
|
8 |
+
<form method="post" action="<?php echo add_query_arg( array( 'failed' => null, 'empty' => null, 'message' => null ) ); ?>" id="postform">
|
9 |
+
<div id="poststuff">
|
10 |
+
|
11 |
+
<div class="postbox" id="export-type">
|
12 |
+
<h3 class="hndle"><?php _e( 'Export Type', 'woo_ce' ); ?></h3>
|
13 |
+
<div class="inside">
|
14 |
+
<p class="description"><?php _e( 'Select the data type you want to export.', 'woo_ce' ); ?></p>
|
15 |
+
<table class="form-table">
|
16 |
+
|
17 |
+
<tr>
|
18 |
+
<th>
|
19 |
+
<input type="radio" id="products" name="dataset" value="products"<?php disabled( $products, 0 ); ?><?php checked( $dataset, 'products' ); ?> />
|
20 |
+
<label for="products"><?php _e( 'Products', 'woo_ce' ); ?></label>
|
21 |
+
</th>
|
22 |
+
<td>
|
23 |
+
<span class="description">(<?php echo $products; ?>)</span>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
|
27 |
+
<tr>
|
28 |
+
<th>
|
29 |
+
<input type="radio" id="categories" name="dataset" value="categories"<?php disabled( $categories, 0 ); ?><?php checked( $dataset, 'categories' ); ?> />
|
30 |
+
<label for="categories"><?php _e( 'Categories', 'woo_ce' ); ?></label>
|
31 |
+
</th>
|
32 |
+
<td>
|
33 |
+
<span class="description">(<?php echo $categories; ?>)</span>
|
34 |
+
</td>
|
35 |
+
</tr>
|
36 |
+
|
37 |
+
<tr>
|
38 |
+
<th>
|
39 |
+
<input type="radio" id="tags" name="dataset" value="tags"<?php disabled( $tags, 0 ); ?><?php checked( $dataset, 'tags' ); ?> />
|
40 |
+
<label for="tags"><?php _e( 'Tags', 'woo_ce' ); ?></label>
|
41 |
+
</th>
|
42 |
+
<td>
|
43 |
+
<span class="description">(<?php echo $tags; ?>)</span>
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
|
47 |
+
<tr>
|
48 |
+
<th>
|
49 |
+
<input type="radio" id="orders" name="dataset" value="orders"<?php disabled( $orders, 0 ); ?><?php checked( $dataset, 'orders' ); ?>/>
|
50 |
+
<label for="orders"><?php _e( 'Orders', 'woo_ce' ); ?></label>
|
51 |
+
</th>
|
52 |
+
<td>
|
53 |
+
<span class="description">(<?php echo $orders; ?>)</span>
|
54 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
55 |
+
<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
|
56 |
+
<?php } ?>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
|
60 |
+
<tr>
|
61 |
+
<th>
|
62 |
+
<input type="radio" id="customers" name="dataset" value="customers"<?php disabled( $customers, 0 ); ?><?php checked( $dataset, 'customers' ); ?>/>
|
63 |
+
<label for="customers"><?php _e( 'Customers', 'woo_ce' ); ?></label>
|
64 |
+
</th>
|
65 |
+
<td>
|
66 |
+
<span class="description">(<?php echo $customers; ?>)</span>
|
67 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
68 |
+
<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
|
69 |
+
<?php } ?>
|
70 |
+
</td>
|
71 |
+
</tr>
|
72 |
+
|
73 |
+
<tr>
|
74 |
+
<th>
|
75 |
+
<input type="radio" id="coupons" name="dataset" value="coupons"<?php disabled( $coupons, 0 ); ?><?php checked( $dataset, 'coupons' ); ?> />
|
76 |
+
<label for="coupons"><?php _e( 'Coupons', 'woo_ce' ); ?></label>
|
77 |
+
</th>
|
78 |
+
<td>
|
79 |
+
<span class="description">(<?php echo $coupons; ?>)</span>
|
80 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
81 |
+
<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
|
82 |
+
<?php } ?>
|
83 |
+
</td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
</table>
|
87 |
+
<!--
|
88 |
+
<p class="submit">
|
89 |
+
<input type="submit" value="<?php _e( 'Export', 'woo_ce' ); ?>" class="button-primary" />
|
90 |
+
</p>
|
91 |
+
-->
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
<!-- .postbox -->
|
95 |
+
|
96 |
+
<?php if( $product_fields ) { ?>
|
97 |
+
<div id="export-products">
|
98 |
+
|
99 |
+
<div class="postbox">
|
100 |
+
<h3 class="hndle"><?php _e( 'Product Fields', 'woo_ce' ); ?></h3>
|
101 |
+
<div class="inside">
|
102 |
+
<?php if( $products ) { ?>
|
103 |
+
<p class="description"><?php _e( 'Select the Product fields you would like to export, your field selection is saved for future exports.', 'woo_ce' ); ?></p>
|
104 |
+
<p><a href="javascript:void(0)" id="products-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="products-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
105 |
+
<table>
|
106 |
+
|
107 |
+
<?php foreach( $product_fields as $product_field ) { ?>
|
108 |
+
<tr>
|
109 |
+
<td>
|
110 |
+
<label>
|
111 |
+
<input type="checkbox" name="product_fields[<?php echo $product_field['name']; ?>]" class="product_field"<?php checked( $product_field['default'], 1 ); ?><?php disabled( $product_field['disabled'], 1 ); ?> />
|
112 |
+
<?php echo $product_field['label']; ?>
|
113 |
+
</label>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
|
117 |
+
<?php } ?>
|
118 |
+
</table>
|
119 |
+
<p class="submit">
|
120 |
+
<input type="submit" id="export_products" value="<?php _e( 'Export Products', 'woo_ce' ); ?> " class="button-primary" />
|
121 |
+
</p>
|
122 |
+
<p class="description"><?php _e( 'Can\'t find a particular Product field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
123 |
+
<?php } else { ?>
|
124 |
+
<p><?php _e( 'No Products have been found.', 'woo_ce' ); ?></p>
|
125 |
+
<?php } ?>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
<!-- .postbox -->
|
129 |
+
|
130 |
+
<div id="export-products-filters" class="postbox">
|
131 |
+
<h3 class="hndle"><?php _e( 'Product Filters', 'woo_ce' ); ?></h3>
|
132 |
+
<div class="inside">
|
133 |
+
|
134 |
+
<p><label><input type="checkbox" id="products-filters-categories" /> <?php _e( 'Filter Products by Product Categories', 'woo_ce' ); ?></label></p>
|
135 |
+
<div id="export-products-filters-categories" class="separator">
|
136 |
+
<?php if( $product_categories ) { ?>
|
137 |
+
<ul>
|
138 |
+
<?php foreach( $product_categories as $product_category ) { ?>
|
139 |
+
<li><label><input type="checkbox" name="product_filter_categories[<?php echo $product_category->term_id; ?>]" value="<?php echo $product_category->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_category->term_id ); ?>"<?php disabled( $product_category->count, 0 ); ?> /> <?php echo woo_ce_format_product_category_label( $product_category->name, $product_category->parent_name ); ?> (<?php echo $product_category->count; ?>)</label></li>
|
140 |
+
<?php } ?>
|
141 |
+
</ul>
|
142 |
+
<p class="description"><?php _e( 'Select the Product Categories you want to filter exported Products by. Default is to include all Product Categories.', 'woo_ce' ); ?></p>
|
143 |
+
<?php } else { ?>
|
144 |
+
<p><?php _e( 'No Product Categories have been found.', 'woo_ce' ); ?></p>
|
145 |
+
<?php } ?>
|
146 |
+
</div>
|
147 |
+
<!-- #export-products-filters-categories -->
|
148 |
+
|
149 |
+
<p><label><input type="checkbox" id="products-filters-tags" /> <?php _e( 'Filter Products by Product Tags', 'woo_ce' ); ?></label></p>
|
150 |
+
<div id="export-products-filters-tags" class="separator">
|
151 |
+
<?php if( $product_tags ) { ?>
|
152 |
+
<ul>
|
153 |
+
<?php foreach( $product_tags as $product_tag ) { ?>
|
154 |
+
<li><label><input type="checkbox" name="product_filter_tags[<?php echo $product_tag->term_id; ?>]" value="<?php echo $product_tag->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_tag->term_id ); ?>"<?php disabled( $product_tag->count, 0 ); ?> /> <?php echo $product_tag->name; ?> (<?php echo $product_tag->count; ?>)</label></li>
|
155 |
+
<?php } ?>
|
156 |
+
</ul>
|
157 |
+
<p class="description"><?php _e( 'Select the Product Tags you want to filter exported Products by. Default is to include all Product Tags.', 'woo_ce' ); ?></p>
|
158 |
+
<?php } else { ?>
|
159 |
+
<p><?php _e( 'No Product Tags have been found.', 'woo_ce' ); ?></p>
|
160 |
+
<?php } ?>
|
161 |
+
</div>
|
162 |
+
<!-- #export-products-filters-tags -->
|
163 |
+
|
164 |
+
<p><label><input type="checkbox" id="products-filters-status" /> <?php _e( 'Filter Products by Product Status', 'woo_ce' ); ?></label></p>
|
165 |
+
<div id="export-products-filters-status" class="separator">
|
166 |
+
<ul>
|
167 |
+
<?php foreach( $product_statuses as $key => $product_status ) { ?>
|
168 |
+
<li><label><input type="checkbox" name="product_filter_status[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo $product_status; ?></label></li>
|
169 |
+
<?php } ?>
|
170 |
+
</ul>
|
171 |
+
<p class="description"><?php _e( 'Select the Product Status options you want to filter exported Products by. Default is to include all Product Status options.', 'woo_ce' ); ?></p>
|
172 |
+
</div>
|
173 |
+
<!-- #export-products-filters-status -->
|
174 |
+
|
175 |
+
<p><label><input type="checkbox" id="products-filters-type" /> <?php _e( 'Filter Products by Product Type', 'woo_ce' ); ?></label></p>
|
176 |
+
<div id="export-products-filters-type" class="separator">
|
177 |
+
<ul>
|
178 |
+
<?php foreach( $product_types as $key => $product_type ) { ?>
|
179 |
+
<li><label><input type="checkbox" name="product_filter_type[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo woo_ce_format_product_type( $product_type['name'] ); ?> (<?php echo $product_type['count']; ?>)</label></li>
|
180 |
+
<?php } ?>
|
181 |
+
</ul>
|
182 |
+
<p class="description"><?php _e( 'Select the Product Type\'s you want to filter exported Products by. Default is to include all Product Types and Variations.', 'woo_ce' ); ?></p>
|
183 |
+
</div>
|
184 |
+
<!-- #export-products-filters-type -->
|
185 |
+
|
186 |
+
<p><label><?php _e( 'Product Sorting', 'woo_ce' ); ?></label></p>
|
187 |
+
<div>
|
188 |
+
<select name="product_orderby">
|
189 |
+
<option value="ID"<?php selected( 'ID', $product_orderby ); ?>><?php _e( 'Product ID', 'woo_ce' ); ?></option>
|
190 |
+
<option value="title"<?php selected( 'title', $product_orderby ); ?>><?php _e( 'Product Name', 'woo_ce' ); ?></option>
|
191 |
+
<option value="date"<?php selected( 'date', $product_orderby ); ?>><?php _e( 'Date Created', 'woo_ce' ); ?></option>
|
192 |
+
<option value="modified"<?php selected( 'modified', $product_orderby ); ?>><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
|
193 |
+
<option value="rand"<?php selected( 'rand', $product_orderby ); ?>><?php _e( 'Random', 'woo_ce' ); ?></option>
|
194 |
+
<option value="menu_order"<?php selected( 'menu_order', $product_orderby ); ?>><?php _e( 'Sort Order', 'woo_ce' ); ?></option>
|
195 |
+
</select>
|
196 |
+
<select name="product_order">
|
197 |
+
<option value="ASC"<?php selected( 'ASC', $product_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
|
198 |
+
<option value="DESC"<?php selected( 'DESC', $product_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
|
199 |
+
</select>
|
200 |
+
<p class="description"><?php _e( 'Select the sorting of Products within the exported file. By default this is set to export Products by Product ID in Desending order.', 'woo_ce' ); ?></p>
|
201 |
+
</div>
|
202 |
+
|
203 |
+
</div>
|
204 |
+
<!-- .inside -->
|
205 |
+
</div>
|
206 |
+
<!-- .postbox -->
|
207 |
+
|
208 |
+
</div>
|
209 |
+
<!-- #export-products -->
|
210 |
+
|
211 |
+
<?php } ?>
|
212 |
+
<div id="export-categories">
|
213 |
+
|
214 |
+
<div class="postbox">
|
215 |
+
<h3 class="hndle"><?php _e( 'Category Fields', 'woo_ce' ); ?></h3>
|
216 |
+
<div class="inside">
|
217 |
+
<p class="description"><?php _e( 'Select the Category fields you would like to export.', 'woo_ce' ); ?></p>
|
218 |
+
<p><a href="javascript:void(0)" id="categories-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="categories-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
219 |
+
<table>
|
220 |
+
|
221 |
+
<?php foreach( $category_fields as $category_field ) { ?>
|
222 |
+
<tr>
|
223 |
+
<td>
|
224 |
+
<label>
|
225 |
+
<input type="checkbox" name="category_fields[<?php echo $category_field['name']; ?>]" class="category_field"<?php checked( $category_field['default'], 1 ); ?><?php disabled( $category_field['disabled'], 1 ); ?> />
|
226 |
+
<?php echo $category_field['label']; ?>
|
227 |
+
</label>
|
228 |
+
</td>
|
229 |
+
</tr>
|
230 |
+
|
231 |
+
<?php } ?>
|
232 |
+
</table>
|
233 |
+
<p class="submit">
|
234 |
+
<input type="submit" id="export_categories" value="<?php _e( 'Export Categories', 'woo_ce' ); ?> " class="button-primary" />
|
235 |
+
</p>
|
236 |
+
<p class="description"><?php _e( 'Can\'t find a particular Category field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
237 |
+
</div>
|
238 |
+
<!-- .inside -->
|
239 |
+
</div>
|
240 |
+
<!-- .postbox -->
|
241 |
+
|
242 |
+
<div id="export-categories-filters" class="postbox">
|
243 |
+
<h3 class="hndle"><?php _e( 'Category Filters', 'woo_ce' ); ?></h3>
|
244 |
+
<div class="inside">
|
245 |
+
|
246 |
+
<p><label><?php _e( 'Category Sorting', 'woo_ce' ); ?></label></p>
|
247 |
+
<div>
|
248 |
+
<select name="category_orderby">
|
249 |
+
<option value="id"<?php selected( 'id', $category_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
|
250 |
+
<option value="name"<?php selected( 'name', $category_orderby ); ?>><?php _e( 'Category Name', 'woo_ce' ); ?></option>
|
251 |
+
</select>
|
252 |
+
<select name="category_order">
|
253 |
+
<option value="ASC"<?php selected( 'ASC', $category_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
|
254 |
+
<option value="DESC"<?php selected( 'DESC', $category_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
|
255 |
+
</select>
|
256 |
+
<p class="description"><?php _e( 'Select the sorting of Categories within the exported file. By default this is set to export Categories by Term ID in Desending order.', 'woo_ce' ); ?></p>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
</div>
|
260 |
+
<!-- .inside -->
|
261 |
+
</div>
|
262 |
+
<!-- #export-categories-filters -->
|
263 |
+
|
264 |
+
</div>
|
265 |
+
<!-- #export-categories -->
|
266 |
+
|
267 |
+
<div id="export-tags">
|
268 |
+
|
269 |
+
<div class="postbox">
|
270 |
+
<h3 class="hndle"><?php _e( 'Tag Fields', 'woo_ce' ); ?></h3>
|
271 |
+
<div class="inside">
|
272 |
+
<p class="description"><?php _e( 'Select the Tag fields you would like to export.', 'woo_ce' ); ?></p>
|
273 |
+
<p><a href="javascript:void(0)" id="tags-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="tags-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
274 |
+
<table>
|
275 |
+
|
276 |
+
<?php foreach( $tag_fields as $tag_field ) { ?>
|
277 |
+
<tr>
|
278 |
+
<td>
|
279 |
+
<label>
|
280 |
+
<input type="checkbox" name="tag_fields[<?php echo $tag_field['name']; ?>]" class="tag_field"<?php checked( $tag_field['default'], 1 ); ?><?php disabled( $tag_field['disabled'], 1 ); ?> />
|
281 |
+
<?php echo $tag_field['label']; ?>
|
282 |
+
</label>
|
283 |
+
</td>
|
284 |
+
</tr>
|
285 |
+
|
286 |
+
<?php } ?>
|
287 |
+
</table>
|
288 |
+
<p class="submit">
|
289 |
+
<input type="submit" id="export_tags" value="<?php _e( 'Export Tags', 'woo_ce' ); ?> " class="button-primary" />
|
290 |
+
</p>
|
291 |
+
<p class="description"><?php _e( 'Can\'t find a particular Tag field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
292 |
+
</div>
|
293 |
+
<!-- .inside -->
|
294 |
+
</div>
|
295 |
+
<!-- .postbox -->
|
296 |
+
|
297 |
+
<div id="export-tags-filters" class="postbox">
|
298 |
+
<h3 class="hndle"><?php _e( 'Product Tag Filters', 'woo_ce' ); ?></h3>
|
299 |
+
<div class="inside">
|
300 |
+
|
301 |
+
<p><label><?php _e( 'Product Tag Sorting', 'woo_ce' ); ?></label></p>
|
302 |
+
<div>
|
303 |
+
<select name="tag_orderby">
|
304 |
+
<option value="id"<?php selected( 'id', $tag_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
|
305 |
+
<option value="name"<?php selected( 'name', $tag_orderby ); ?>><?php _e( 'Tag Name', 'woo_ce' ); ?></option>
|
306 |
+
</select>
|
307 |
+
<select name="tag_order">
|
308 |
+
<option value="ASC"<?php selected( 'ASC', $tag_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
|
309 |
+
<option value="DESC"<?php selected( 'DESC', $tag_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
|
310 |
+
</select>
|
311 |
+
<p class="description"><?php _e( 'Select the sorting of Product Tags within the exported file. By default this is set to export Product Tags by Term ID in Desending order.', 'woo_ce' ); ?></p>
|
312 |
+
</div>
|
313 |
+
|
314 |
+
</div>
|
315 |
+
<!-- .inside -->
|
316 |
+
</div>
|
317 |
+
<!-- #export-tags-filters -->
|
318 |
+
|
319 |
+
</div>
|
320 |
+
<!-- #export-tags -->
|
321 |
+
|
322 |
+
<?php if( $order_fields ) { ?>
|
323 |
+
<div id="export-orders">
|
324 |
+
|
325 |
+
<div class="postbox">
|
326 |
+
<h3 class="hndle"><?php _e( 'Order Fields', 'woo_ce' ); ?></h3>
|
327 |
+
<div class="inside">
|
328 |
+
|
329 |
+
<?php if( $orders ) { ?>
|
330 |
+
<p class="description"><?php _e( 'Select the Order fields you would like to export.', 'woo_ce' ); ?></p>
|
331 |
+
<p><a href="javascript:void(0)" id="orders-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="orders-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
332 |
+
<table>
|
333 |
+
|
334 |
+
<?php foreach( $order_fields as $order_field ) { ?>
|
335 |
+
<tr>
|
336 |
+
<td>
|
337 |
+
<label>
|
338 |
+
<input type="checkbox" name="order_fields[<?php echo $order_field['name']; ?>]" class="order_field"<?php checked( $order_field['default'], 1 ); ?><?php disabled( $woo_cd_exists, false ); ?> />
|
339 |
+
<?php echo $order_field['label']; ?>
|
340 |
+
</label>
|
341 |
+
</td>
|
342 |
+
</tr>
|
343 |
+
|
344 |
+
<?php } ?>
|
345 |
+
</table>
|
346 |
+
<p class="submit">
|
347 |
+
<?php if( function_exists( 'woo_cd_admin_init' ) ) { ?>
|
348 |
+
<input type="submit" id="export_orders" value="<?php _e( 'Export Orders', 'woo_ce' ); ?> " class="button-primary" />
|
349 |
+
<?php } else { ?>
|
350 |
+
<input type="button" class="button button-disabled" value="<?php _e( 'Export Orders', 'woo_ce' ); ?>" />
|
351 |
+
<?php } ?>
|
352 |
+
</p>
|
353 |
+
<p class="description"><?php _e( 'Can\'t find a particular Order field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
354 |
+
<?php } else { ?>
|
355 |
+
<p><?php _e( 'No Orders have been found.', 'woo_ce' ); ?></p>
|
356 |
+
<?php } ?>
|
357 |
+
|
358 |
+
</div>
|
359 |
+
</div>
|
360 |
+
<!-- .postbox -->
|
361 |
+
|
362 |
+
<div id="export-orders-filters" class="postbox">
|
363 |
+
<h3 class="hndle"><?php _e( 'Order Filters', 'woo_ce' ); ?></h3>
|
364 |
+
<div class="inside">
|
365 |
+
|
366 |
+
<?php do_action( 'woo_ce_export_order_options_before_table' ); ?>
|
367 |
+
|
368 |
+
<table class="form-table">
|
369 |
+
<?php do_action( 'woo_ce_export_order_options_table' ); ?>
|
370 |
+
</table>
|
371 |
+
|
372 |
+
<?php do_action( 'woo_ce_export_order_options_after_table' ); ?>
|
373 |
+
|
374 |
+
</div>
|
375 |
+
<!-- .inside -->
|
376 |
+
</div>
|
377 |
+
<!-- .postbox -->
|
378 |
+
|
379 |
+
</div>
|
380 |
+
<!-- #export-orders -->
|
381 |
+
|
382 |
+
<?php } ?>
|
383 |
+
<?php if( $customer_fields ) { ?>
|
384 |
+
<div class="postbox" id="export-customers">
|
385 |
+
<h3 class="hndle"><?php _e( 'Customer Fields', 'woo_ce' ); ?></h3>
|
386 |
+
<div class="inside">
|
387 |
+
<?php if( $customers ) { ?>
|
388 |
+
<p class="description"><?php _e( 'Select the Customer fields you would like to export.', 'woo_ce' ); ?></p>
|
389 |
+
<p><a href="javascript:void(0)" id="customers-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="customers-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
390 |
+
<table>
|
391 |
+
|
392 |
+
<?php foreach( $customer_fields as $customer_field ) { ?>
|
393 |
+
<tr>
|
394 |
+
<td>
|
395 |
+
<label>
|
396 |
+
<input type="checkbox" name="customer_fields[<?php echo $customer_field['name']; ?>]" class="customer_field"<?php checked( $customer_field['default'], 1 ); ?><?php disabled( $woo_cd_exists, false ); ?> />
|
397 |
+
<?php echo $customer_field['label']; ?>
|
398 |
+
</label>
|
399 |
+
</td>
|
400 |
+
</tr>
|
401 |
+
|
402 |
+
<?php } ?>
|
403 |
+
</table>
|
404 |
+
<p class="submit">
|
405 |
+
<?php if( function_exists( 'woo_cd_admin_init' ) ) { ?>
|
406 |
+
<input type="submit" id="export_customers" value="<?php _e( 'Export Customers', 'woo_ce' ); ?>" class="button-primary" />
|
407 |
+
<?php } else { ?>
|
408 |
+
<input type="button" class="button button-disabled" value="<?php _e( 'Export Customers', 'woo_ce' ); ?>" />
|
409 |
+
<?php } ?>
|
410 |
+
</p>
|
411 |
+
<p class="description"><?php _e( 'Can\'t find a particular Customer field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
412 |
+
<?php } else { ?>
|
413 |
+
<p><?php _e( 'No Customers have been found.', 'woo_ce' ); ?></p>
|
414 |
+
<?php } ?>
|
415 |
+
</div>
|
416 |
+
</div>
|
417 |
+
<!-- .postbox -->
|
418 |
+
|
419 |
+
<?php } ?>
|
420 |
+
<?php if( $coupon_fields ) { ?>
|
421 |
+
<div class="postbox" id="export-coupons">
|
422 |
+
<h3 class="hndle"><?php _e( 'Coupon Fields', 'woo_ce' ); ?></h3>
|
423 |
+
<div class="inside">
|
424 |
+
<?php if( $coupons ) { ?>
|
425 |
+
<p class="description"><?php _e( 'Select the Coupon fields you would like to export.', 'woo_ce' ); ?></p>
|
426 |
+
<p><a href="javascript:void(0)" id="coupons-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="coupons-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
|
427 |
+
<table>
|
428 |
+
|
429 |
+
<?php foreach( $coupon_fields as $coupon_field ) { ?>
|
430 |
+
<tr>
|
431 |
+
<td>
|
432 |
+
<label>
|
433 |
+
<input type="checkbox" name="coupon_fields[<?php echo $coupon_field['name']; ?>]" class="coupon_field"<?php checked( $coupon_field['default'], 1 ); ?><?php disabled( $woo_cd_exists, false ); ?> />
|
434 |
+
<?php echo $coupon_field['label']; ?>
|
435 |
+
</label>
|
436 |
+
</td>
|
437 |
+
</tr>
|
438 |
+
|
439 |
+
<?php } ?>
|
440 |
+
</table>
|
441 |
+
<p class="submit">
|
442 |
+
<?php if( function_exists( 'woo_cd_admin_init' ) ) { ?>
|
443 |
+
<input type="submit" id="export_coupons" value="<?php _e( 'Export Coupons', 'woo_ce' ); ?>" class="button-primary" />
|
444 |
+
<?php } else { ?>
|
445 |
+
<input type="button" class="button button-disabled" value="<?php _e( 'Export Coupons', 'woo_ce' ); ?>" />
|
446 |
+
<?php } ?>
|
447 |
+
</p>
|
448 |
+
<p class="description"><?php _e( 'Can\'t find a particular Coupon field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
|
449 |
+
<?php } else { ?>
|
450 |
+
<p><?php _e( 'No Coupons have been found.', 'woo_ce' ); ?></p>
|
451 |
+
<?php } ?>
|
452 |
+
</div>
|
453 |
+
</div>
|
454 |
+
<!-- .postbox -->
|
455 |
+
|
456 |
+
<?php } ?>
|
457 |
+
<div class="postbox" id="export-options">
|
458 |
+
<h3 class="hndle"><?php _e( 'Export Options', 'woo_ce' ); ?></h3>
|
459 |
+
<div class="inside">
|
460 |
+
<p class="description"><?php _e( 'You can find additional export options under the Settings tab at the top of this screen.', 'woo_ce' ); ?></p>
|
461 |
+
|
462 |
+
<?php do_action( 'woo_ce_export_options_before' ); ?>
|
463 |
+
|
464 |
+
<table class="form-table">
|
465 |
+
|
466 |
+
<?php do_action( 'woo_ce_export_options' ); ?>
|
467 |
+
|
468 |
+
<tr class="export-options product-options">
|
469 |
+
<th><label for=""><?php _e( 'Up-sells formatting', 'woo_ce' ); ?></label></th>
|
470 |
+
<td>
|
471 |
+
<label><input type="radio" name="product_upsell_formatting" value="0"<?php checked( $upsell_formatting, 0 ); ?> /> <?php _e( 'Export Up-Sells as Product ID', 'woo_ce' ); ?></label><br />
|
472 |
+
<label><input type="radio" name="product_upsell_formatting" value="1"<?php checked( $upsell_formatting, 1 ); ?> /> <?php _e( 'Export Up-Sells as Product SKU', 'woo_ce' ); ?></label>
|
473 |
+
<p class="description"><?php _e( 'Choose the up-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
|
474 |
+
</td>
|
475 |
+
</tr>
|
476 |
+
|
477 |
+
<tr class="export-options product-options">
|
478 |
+
<th><label for=""><?php _e( 'Cross-sells formatting', 'woo_ce' ); ?></label></th>
|
479 |
+
<td>
|
480 |
+
<label><input type="radio" name="product_crosssell_formatting" value="0"<?php checked( $crosssell_formatting, 0 ); ?> /> <?php _e( 'Export Cross-Sells as Product ID', 'woo_ce' ); ?></label><br />
|
481 |
+
<label><input type="radio" name="product_crosssell_formatting" value="1"<?php checked( $crosssell_formatting, 1 ); ?> /> <?php _e( 'Export Cross-Sells as Product SKU', 'woo_ce' ); ?></label>
|
482 |
+
<p class="description"><?php _e( 'Choose the cross-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
|
483 |
+
</td>
|
484 |
+
</tr>
|
485 |
+
|
486 |
+
<tr>
|
487 |
+
<th>
|
488 |
+
<label for="offset"><?php _e( 'Volume offset', 'woo_ce' ); ?></label> / <label for="limit_volume"><?php _e( 'Limit volume', 'woo_ce' ); ?></label>
|
489 |
+
</th>
|
490 |
+
<td>
|
491 |
+
<input type="text" size="3" id="offset" name="offset" value="<?php echo $offset; ?>" size="5" class="text" /> <?php _e( 'to', 'woo_ce' ); ?> <input type="text" size="3" id="limit_volume" name="limit_volume" value="<?php echo $limit_volume; ?>" size="5" class="text" />
|
492 |
+
<p class="description"><?php _e( 'Volume offset and limit allows for partial exporting of an export type (e.g. records 0 to 500, etc.). This is useful when encountering timeout and/or memory errors during the a large or memory intensive export. To be used effectively both fields must be filled. By default this is not used and is left empty.', 'woo_ce' ); ?></p>
|
493 |
+
</td>
|
494 |
+
</tr>
|
495 |
+
|
496 |
+
<?php do_action( 'woo_ce_export_options_table_after' ); ?>
|
497 |
+
|
498 |
+
</table>
|
499 |
+
|
500 |
+
<?php do_action( 'woo_ce_export_options_after' ); ?>
|
501 |
+
|
502 |
+
</div>
|
503 |
+
</div>
|
504 |
+
<!-- .postbox -->
|
505 |
+
|
506 |
+
</div>
|
507 |
+
<!-- #poststuff -->
|
508 |
+
<input type="hidden" name="action" value="export" />
|
509 |
+
</form>
|
510 |
+
|
511 |
+
<?php do_action( 'woo_ce_export_after_form' ); ?>
|
templates/admin/woo-admin_ce-export_overview.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="overview-left">
|
2 |
+
|
3 |
+
<h3><a href="<?php echo add_query_arg( 'tab', 'export' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a></h3>
|
4 |
+
<p><?php _e( 'Export store details out of WooCommerce into a CSV-formatted file.', 'woo_ce' ); ?></p>
|
5 |
+
<ul class="ul-disc">
|
6 |
+
<li>
|
7 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-products"><?php _e( 'Export Products', 'woo_ce' ); ?></a>
|
8 |
+
</li>
|
9 |
+
<li>
|
10 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-categories"><?php _e( 'Export Categories', 'woo_ce' ); ?></a>
|
11 |
+
</li>
|
12 |
+
<li>
|
13 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-tags"><?php _e( 'Export Tags', 'woo_ce' ); ?></a>
|
14 |
+
</li>
|
15 |
+
<li>
|
16 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-orders"><?php _e( 'Export Orders', 'woo_ce' ); ?></a>
|
17 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
18 |
+
<span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
|
19 |
+
<?php } ?>
|
20 |
+
</li>
|
21 |
+
<li>
|
22 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-customers"><?php _e( 'Export Customers', 'woo_ce' ); ?></a>
|
23 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
24 |
+
<span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
|
25 |
+
<?php } ?>
|
26 |
+
</li>
|
27 |
+
<li>
|
28 |
+
<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-coupons"><?php _e( 'Export Coupons', 'woo_ce' ); ?></a>
|
29 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
30 |
+
<span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
|
31 |
+
<?php } ?>
|
32 |
+
</li>
|
33 |
+
</ul>
|
34 |
+
|
35 |
+
<h3><a href="<?php echo add_query_arg( 'tab', 'archive' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a></h3>
|
36 |
+
<p><?php _e( 'Download copies of prior store exports.', 'woo_ce' ); ?></p>
|
37 |
+
|
38 |
+
<h3><a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a></h3>
|
39 |
+
<p><?php _e( 'Manage CSV export options from a single detailed screen.', 'woo_ce' ); ?></p>
|
40 |
+
|
41 |
+
<h3><a href="<?php echo add_query_arg( 'tab', 'tools' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a></h3>
|
42 |
+
<p><?php _e( 'Export tools for WooCommerce.', 'woo_ce' ); ?></p>
|
43 |
+
|
44 |
+
<hr />
|
45 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
46 |
+
<label class="description">
|
47 |
+
<input type="checkbox" disabled="disabled" /> <?php _e( 'Jump to Export screen in the future', 'woo_ce' ); ?>
|
48 |
+
<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
|
49 |
+
</label>
|
50 |
+
<?php } else { ?>
|
51 |
+
<form id="skip_overview_form" method="post">
|
52 |
+
<label><input type="checkbox" id="skip_overview" name="skip_overview"<?php checked( $skip_overview ); ?> /> <?php _e( 'Jump to Export screen in the future', 'woo_ce' ); ?></label>
|
53 |
+
<input type="hidden" name="action" value="skip_overview" />
|
54 |
+
</form>
|
55 |
+
<?php } ?>
|
56 |
+
|
57 |
+
</div>
|
58 |
+
<!-- .overview-left -->
|
59 |
+
<?php if( !function_exists( 'woo_cd_admin_init' ) ) { ?>
|
60 |
+
<div class="welcome-panel overview-right">
|
61 |
+
<h3>
|
62 |
+
<!-- <span><a href="#"><attr title="<?php _e( 'Dismiss this message', 'woo_ce' ); ?>"><?php _e( 'Dismiss', 'woo_ce' ); ?></attr></a></span> -->
|
63 |
+
<?php _e( 'Upgrade to Pro', 'woo_ce' ); ?>
|
64 |
+
</h3>
|
65 |
+
<p class="clear"><?php _e( 'Upgrade to Store Exporter Deluxe to unlock business focused e-commerce features within Store Exporter, including:', 'woo_ce' ); ?></p>
|
66 |
+
<ul class="ul-disc">
|
67 |
+
<li><?php _e( 'Select export date ranges', 'woo_ce' ); ?></li>
|
68 |
+
<li><?php _e( 'Export Orders', 'woo_ce' ); ?></li>
|
69 |
+
<li><?php _e( 'Select Order fields to export', 'woo_ce' ); ?></li>
|
70 |
+
<li><?php _e( 'Export custom Order and Order Item meta', 'woo_ce' ); ?></li>
|
71 |
+
<li><?php _e( 'Export Customers', 'woo_ce' ); ?></li>
|
72 |
+
<li><?php _e( 'Select Customer fields to export', 'woo_ce' ); ?></li>
|
73 |
+
<li><?php _e( 'Export Coupons', 'woo_ce' ); ?></li>
|
74 |
+
<li><?php _e( 'Select Coupon fields to export', 'woo_ce' ); ?></li>
|
75 |
+
<li><?php _e( 'CRON / Scheduled Exports', 'woo_ce' ); ?></li>
|
76 |
+
<li><?php _e( 'Export to XML', 'woo_ce' ); ?></li>
|
77 |
+
<li><?php _e( 'Premium Support', 'woo_ce' ); ?></li>
|
78 |
+
</ul>
|
79 |
+
<p>
|
80 |
+
<a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button"><?php _e( 'More Features', 'woo_ce' ); ?></a>
|
81 |
+
<a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button button-primary"><?php _e( 'Buy Now', 'woo_ce' ); ?></a>
|
82 |
+
</p>
|
83 |
+
</div>
|
84 |
+
<!-- .overview-right -->
|
85 |
+
<?php } ?>
|
templates/admin/woo-admin_ce-export_settings.php
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul class="subsubsub">
|
2 |
+
<li><a href="#general-settings"><?php _e( 'General Settings', 'woo_ce' ); ?></a> |</li>
|
3 |
+
<li><a href="#csv-settings"><?php _e( 'CSV Settings', 'woo_ce' ); ?></a></li>
|
4 |
+
<?php do_action( 'woo_ce_export_settings_top' ); ?>
|
5 |
+
</ul>
|
6 |
+
<!-- .subsubsub -->
|
7 |
+
<form method="post">
|
8 |
+
<table class="form-table">
|
9 |
+
<tbody>
|
10 |
+
|
11 |
+
<?php do_action( 'woo_ce_export_settings_before' ); ?>
|
12 |
+
|
13 |
+
<tr id="general-settings">
|
14 |
+
<td colspan="2" style="padding:0;">
|
15 |
+
<h3><?php _e( 'General Settings', 'woo_ce' ); ?></h3>
|
16 |
+
</td>
|
17 |
+
</tr>
|
18 |
+
|
19 |
+
<tr valign="top">
|
20 |
+
<th scope="row"><label for="export_filename"><?php _e( 'Export filename', 'woo_ce' ); ?></label></th>
|
21 |
+
<td>
|
22 |
+
<input name="export_filename" type="text" id="export_filename" value="<?php echo $export_filename; ?>" class="regular-text code" />
|
23 |
+
<p class="description"><?php _e( 'The filename of the exported export type. Tags can be used: ', 'woo_ce' ); ?> <code>%dataset%</code>, <code>%date%</code>, <code>%time%</code>, <code>%store_name%</code>.</p>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
|
27 |
+
<tr>
|
28 |
+
<th>
|
29 |
+
<label for="delete_temporary_csv"><?php _e( 'Enable archives', 'woo_ce' ); ?></label>
|
30 |
+
</th>
|
31 |
+
<td>
|
32 |
+
<select id="delete_temporary_csv" name="delete_temporary_csv">
|
33 |
+
<option value="0"<?php selected( $delete_csv, 0 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
|
34 |
+
<option value="1"<?php selected( $delete_csv, 1 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
|
35 |
+
</select>
|
36 |
+
<p class="description"><?php _e( 'Save copies of CSV exports to the WordPress Media for downloading later. By default this option is turned on.', 'woo_ce' ); ?></p>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
|
40 |
+
<tr>
|
41 |
+
<th>
|
42 |
+
<label for="encoding"><?php _e( 'Character encoding', 'woo_ce' ); ?></label>
|
43 |
+
</th>
|
44 |
+
<td>
|
45 |
+
<?php if( $file_encodings ) { ?>
|
46 |
+
<select id="encoding" name="encoding">
|
47 |
+
<option value=""><?php _e( 'System default', 'woo_ce' ); ?></option>
|
48 |
+
<?php foreach( $file_encodings as $key => $chr ) { ?>
|
49 |
+
<option value="<?php echo $chr; ?>"<?php selected( $chr, $encoding ); ?>><?php echo $chr; ?></option>
|
50 |
+
<?php } ?>
|
51 |
+
</select>
|
52 |
+
<?php } else { ?>
|
53 |
+
<p class="description"><?php _e( 'Character encoding options are unavailable in PHP 4, contact your hosting provider to update your site install to use PHP 5 or higher.', 'woo_ce' ); ?></p>
|
54 |
+
<?php } ?>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
|
58 |
+
<tr>
|
59 |
+
<th><?php _e( 'Date format', 'woo_ce' ); ?></th>
|
60 |
+
<td>
|
61 |
+
<fieldset>
|
62 |
+
<label title="F j, Y"><input type="radio" name="date_format" value="F j, Y"<?php checked( $date_format, 'F j, Y' ); ?>> <span><?php echo date( 'F j, Y' ); ?></span></label><br>
|
63 |
+
<label title="Y/m/d"><input type="radio" name="date_format" value="Y/m/d"<?php checked( $date_format, 'Y/m/d' ); ?>> <span><?php echo date( 'Y/m/d' ); ?></span></label><br>
|
64 |
+
<label title="m/d/Y"><input type="radio" name="date_format" value="m/d/Y"<?php checked( $date_format, 'm/d/Y' ); ?>> <span><?php echo date( 'm/d/Y' ); ?></span></label><br>
|
65 |
+
<label title="d/m/Y"><input type="radio" name="date_format" value="d/m/Y"<?php checked( $date_format, 'd/m/Y' ); ?>> <span><?php echo date( 'd/m/Y' ); ?></span></label><br>
|
66 |
+
<!--
|
67 |
+
<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"> Custom: </label><input type="text" name="date_format_custom" value="F j, Y" class="small-text"> <span class="example"> January 6, 2014</span> <span class="spinner"></span>
|
68 |
+
<p><a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date and time formatting', 'woo_ce' ); ?></a>.</p>
|
69 |
+
-->
|
70 |
+
</fieldset>
|
71 |
+
<p class="description"><?php _e( 'The date format option affects how date\'s are presented within your CSV file. Default is set to DD/MM/YYYY.', 'woo_ce' ); ?></p>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
+
|
75 |
+
<?php if( !ini_get( 'safe_mode' ) ) { ?>
|
76 |
+
<tr>
|
77 |
+
<th>
|
78 |
+
<label for="timeout"><?php _e( 'Script timeout', 'woo_ce' ); ?></label>
|
79 |
+
</th>
|
80 |
+
<td>
|
81 |
+
<select id="timeout" name="timeout">
|
82 |
+
<option value="600"<?php selected( $timeout, 600 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 10 ); ?></option>
|
83 |
+
<option value="1800"<?php selected( $timeout, 1800 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 30 ); ?></option>
|
84 |
+
<option value="3600"<?php selected( $timeout, 3600 ); ?>><?php printf( __( '%s hour', 'woo_ce' ), 1 ); ?></option>
|
85 |
+
<option value="0"<?php selected( $timeout, 0 ); ?>><?php _e( 'Unlimited', 'woo_ce' ); ?></option>
|
86 |
+
</select>
|
87 |
+
<p class="description"><?php _e( 'Script timeout defines how long Store Exporter is \'allowed\' to process your CSV file, once the time limit is reached the export process halts.', 'woo_ce' ); ?></p>
|
88 |
+
</td>
|
89 |
+
</tr>
|
90 |
+
<?php } ?>
|
91 |
+
|
92 |
+
<tr id="csv-settings">
|
93 |
+
<td colspan="2" style="padding:0;">
|
94 |
+
<hr />
|
95 |
+
<h3><?php _e( 'CSV Settings', 'woo_ce' ); ?></h3>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
|
99 |
+
<tr>
|
100 |
+
<th>
|
101 |
+
<label for="delimiter"><?php _e( 'Field delimiter', 'woo_ce' ); ?></label>
|
102 |
+
</th>
|
103 |
+
<td>
|
104 |
+
<input type="text" size="3" id="delimiter" name="delimiter" value="<?php echo $delimiter; ?>" maxlength="1" class="text" />
|
105 |
+
<p class="description"><?php _e( 'The field delimiter is the character separating each cell in your CSV. This is typically the \',\' (comma) character.', 'woo_pc' ); ?></p>
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
|
109 |
+
<tr>
|
110 |
+
<th>
|
111 |
+
<label for="category_separator"><?php _e( 'Category separator', 'woo_ce' ); ?></label>
|
112 |
+
</th>
|
113 |
+
<td>
|
114 |
+
<input type="text" size="3" id="category_separator" name="category_separator" value="<?php echo $category_separator; ?>" maxlength="1" class="text" />
|
115 |
+
<p class="description"><?php _e( 'The Product Category separator allows you to assign individual Products to multiple Product Categories/Tags/Images at a time. It is suggested to use the \'|\' (vertical pipe) character between each item. For instance: <code>Clothing|Mens|Shirts</code>.', 'woo_ce' ); ?></p>
|
116 |
+
</td>
|
117 |
+
</tr>
|
118 |
+
|
119 |
+
<tr>
|
120 |
+
<th>
|
121 |
+
<label for="bom"><?php _e( 'Add BOM character', 'woo_ce' ); ?></label>
|
122 |
+
</th>
|
123 |
+
<td>
|
124 |
+
<select id="bom" name="bom">
|
125 |
+
<option value="1"<?php selected( $bom, 1 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
|
126 |
+
<option value="0"<?php selected( $bom, 0 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
|
127 |
+
</select>
|
128 |
+
<p class="description"><?php _e( 'Mark the CSV file as UTF8 by adding a byte order mark (BOM) to the export, useful for non-English character sets.', 'woo_ce' ); ?></p>
|
129 |
+
</td>
|
130 |
+
</tr>
|
131 |
+
|
132 |
+
<tr>
|
133 |
+
<th>
|
134 |
+
<label for="escape_formatting"><?php _e( 'Field escape formatting', 'woo_ce' ); ?></label>
|
135 |
+
</th>
|
136 |
+
<td>
|
137 |
+
<label><input type="radio" name="escape_formatting" value="all"<?php checked( $escape_formatting, 'all' ); ?> /> <?php _e( 'Escape all fields', 'woo_ce' ); ?></label><br />
|
138 |
+
<label><input type="radio" name="escape_formatting" value="excel"<?php checked( $escape_formatting, 'excel' ); ?> /> <?php _e( 'Escape fields as Excel would', 'woo_ce' ); ?></label>
|
139 |
+
<p class="description"><?php _e( 'Choose the field escape format that suits your spreadsheet software (e.g. Excel).', 'woo_ce' ); ?></p>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
|
143 |
+
<?php do_action( 'woo_ce_export_settings_after' ); ?>
|
144 |
+
|
145 |
+
</tbody>
|
146 |
+
</table>
|
147 |
+
<p class="submit">
|
148 |
+
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'woo_ce' ); ?>" />
|
149 |
+
</p>
|
150 |
+
|
151 |
+
<input type="hidden" name="action" value="save" />
|
152 |
+
</form>
|
153 |
+
<?php do_action( 'woo_ce_export_settings_bottom' ); ?>
|
templates/admin/woo-admin_ce-export_tools.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h3><?php _e( 'WooCommerce Tools', 'woo_ce' ); ?></h3>
|
2 |
+
<div id="poststuff">
|
3 |
+
|
4 |
+
<div class="postbox">
|
5 |
+
<h3 class="hndle"><?php _e( 'Tools', 'woo_pd' ); ?></h3>
|
6 |
+
<div class="inside">
|
7 |
+
<table class="form-table">
|
8 |
+
|
9 |
+
<tr>
|
10 |
+
<td>
|
11 |
+
<a href="<?php echo $woo_pd_url; ?>"<?php echo $woo_pd_target; ?>><?php _e( 'Import Products from CSV', 'woo_ce' ); ?></a>
|
12 |
+
<p class="description"><?php _e( 'Use Product Importer Deluxe to import Product changes back into your store.', 'woo_ce' ); ?></p>
|
13 |
+
</td>
|
14 |
+
</tr>
|
15 |
+
|
16 |
+
</table>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
<!-- .postbox -->
|
20 |
+
|
21 |
+
</div>
|
22 |
+
<!-- #poststuff -->
|
templates/admin/woo-admin_ce-media_csv_file.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="postbox-container">
|
2 |
+
<div class="postbox">
|
3 |
+
<h3 class="hndle"><?php _e( 'CSV File', 'woo_ce' ); ?></h3>
|
4 |
+
<div class="inside">
|
5 |
+
<textarea style="font:12px Consolas, Monaco, Courier, monospace; width:100%; height:200px;"><?php echo $contents; ?></textarea>
|
6 |
+
</div>
|
7 |
+
<!-- .inside -->
|
8 |
+
</div>
|
9 |
+
<!-- .postbox -->
|
10 |
+
|
11 |
+
</div>
|
12 |
+
<!-- .postbox-container -->
|
templates/admin/woo-admin_ce-media_export_details.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<table class="widefat" style="font-family:monospace;">
|
2 |
+
<thead>
|
3 |
+
|
4 |
+
<tr>
|
5 |
+
<th colspan="2"><?php _e( 'Export Details', 'woo_ce' ); ?></th>
|
6 |
+
</tr>
|
7 |
+
|
8 |
+
</thead>
|
9 |
+
<tbody>
|
10 |
+
|
11 |
+
<tr>
|
12 |
+
<th style="width:20%;"><?php _e( 'Export type', 'woo_ce' ); ?></th>
|
13 |
+
<td><?php echo woo_ce_export_type_label( $export_type ); ?></td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<th><?php _e( 'Filepath', 'woo_ce' ); ?></th>
|
17 |
+
<td><?php echo $filepath; ?></td>
|
18 |
+
</tr>
|
19 |
+
<tr>
|
20 |
+
<th><?php _e( 'Total columns', 'woo_ce' ); ?></th>
|
21 |
+
<td><?php echo ( ( $columns != false ) ? $columns : '-' ); ?></td>
|
22 |
+
</tr>
|
23 |
+
<tr>
|
24 |
+
<th><?php _e( 'Total rows', 'woo_ce' ); ?></th>
|
25 |
+
<td><?php echo ( ( $rows != false ) ? $rows : '-' ); ?></td>
|
26 |
+
</tr>
|
27 |
+
<tr>
|
28 |
+
<th><?php _e( 'Process time', 'woo_ce' ); ?></th>
|
29 |
+
<td><?php echo ( ( ( $start_time != false ) && ( $end_time != false ) ) ? woo_ce_display_time_elapsed( $start_time, $end_time ) : '-' ); ?></td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<th><?php _e( 'Idle memory usage (start)', 'woo_ce' ); ?></th>
|
33 |
+
<td><?php echo ( ( $idle_memory_start != false ) ? woo_ce_display_memory( $idle_memory_start ) : '-' ); ?></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<th><?php _e( 'Memory usage prior to loading export type', 'woo_ce' ); ?></th>
|
37 |
+
<td><?php echo ( ( $data_memory_start != false ) ? woo_ce_display_memory( $data_memory_start ) : '-' ); ?></td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<th><?php _e( 'Memory usage after loading export type', 'woo_ce' ); ?></th>
|
41 |
+
<td><?php echo ( ( $data_memory_end != false ) ? woo_ce_display_memory( $data_memory_end ) : '-' ); ?></td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<th><?php _e( 'Memory usage at render time', 'woo_ce' ); ?></th>
|
45 |
+
<td>-</td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<th><?php _e( 'Idle memory usage (end)', 'woo_ce' ); ?></th>
|
49 |
+
<td><?php echo ( ( $idle_memory_end != false ) ? woo_ce_display_memory( $idle_memory_end ) : '-' ); ?></td>
|
50 |
+
</tr>
|
51 |
+
|
52 |
+
</tbody>
|
53 |
+
</table>
|
54 |
+
<br />
|