disable-string-scan-notices.js
1.81 KB
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
50
51
52
53
54
55
56
57
58
/*globals jQuery, ajaxurl, wpml_st_disable_notices_strings */
function wpml_st_hide_strings_scan_notices(element, callback) {
"use strict";
var buttonNo = wpml_st_disable_notices_strings.no;
var buttonYes = wpml_st_disable_notices_strings.yes;
var dialog = jQuery('<div title="' + wpml_st_disable_notices_strings.title + '"><p>' + wpml_st_disable_notices_strings.message + '</p></div>');
dialog.css('display', 'none');
dialog.dialog({
resizable: false,
height: "auto",
width: "auto",
modal: true,
buttons: {
buttonNo: {
text: buttonNo,
click: function () {
if (typeof callback === 'function') {
callback();
}
dialog.dialog("close");
}
},
buttonYes: {
text: buttonYes,
class: 'button-primary',
click: function () {
jQuery.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'hide_strings_scan_notices'
},
dataType: 'json',
complete: function () {
if (typeof callback === 'function') {
callback();
}
dialog.dialog("close");
}
});
}
}
},
open: function () {
jQuery('#jquery-ui-style-css').prop('disabled', true);
jQuery('.ui-widget-overlay.ui-front').css('z-index', '10001');
jQuery('.ui-dialog').css('z-index', '10002');
},
close: function () {
jQuery('#jquery-ui-style-css').prop('disabled', false);
}
});
}