-
Notifications
You must be signed in to change notification settings - Fork 1
/
thincc.js
49 lines (38 loc) · 1.73 KB
/
thincc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
jQuery(document).ready(function ($) {
function thincc_prepare() {
var $form = $("#thincc-form");
$("#thincc-results").html('<strong>Loading...</strong>');
var data = {
action: 'thincc_ajax',
export_flagged_only: $form.find('input[name="export_flagged_only"]:checked').val(),
use_custom_vars: $form.find('input[name="use_custom_vars"]:checked').val(),
use_web_links: $form.find('input[name="use_web_links"]:checked').val(),
include_fm: $form.find('input[name="include_fm"]:checked').val(),
include_bm: $form.find('input[name="include_bm"]:checked').val(),
include_parts: $form.find('input[name="include_parts"]:checked').val(),
include_topics: $form.find('input[name="include_topics"]:checked').val(),
include_assignments: $form.find('input[name="include_assignments"]:checked').val(),
include_guids: $form.find('input[name="include_guids"]:checked').val(),
version: $form.find('select[name="version"] option:selected').val(),
cc_download: 0
};
return data;
}
$("a.button-secondary").click(function (event) {
event.preventDefault();
$("#thincc_modal").show();
var data = thincc_prepare();
$.post(ajaxurl, data, function (data) {
$("#thincc-results").html(data);
});
});
$("#thincc-results-close").click(function (event) {
event.preventDefault();
$("#thincc_modal").hide();
});
// close popup with esc key
$(document).keyup(function (ev) {
if (ev.keyCode == 27)
$("#thincc-results-close").click();
});
});