| Server IP : 130.225.57.55 / Your IP : 216.73.216.60 Web Server : Apache System : Linux wp-vhost07 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /srv/www/reco2st.eu/https/wp-content/plugins/w3-total-cache/ |
Upload File : |
/**
* File: Extension_NewRelic_Popup_View.js
*
* New Relic configuration lightbox interactions.
*
* @package W3TC
* @since 2.9.0
*/
jQuery(function ($) {
function w3tcnr_update_apply_state() {
var $apply = $(".w3tcnr_apply_configuration");
if (!$apply.length) {
return;
}
var hasApm = $(".w3tcnr_apm option").length > 0;
var hasBrowser = $(".w3tcnr_browser option").length > 0;
// No apps at all, keep disabled.
if (!hasApm && !hasBrowser) {
$apply.prop("disabled", true);
return;
}
var monitoring = $('input[name="monitoring_type"]:checked').val();
var selected = "";
if (monitoring === "apm") {
selected = $(".w3tcnr_apm").val();
} else if (monitoring === "browser") {
selected = $(".w3tcnr_browser").val();
}
$apply.prop("disabled", !(monitoring && selected));
}
// Initialize button state on load.
w3tcnr_update_apply_state();
$("body")
.on("click", ".w3tcnr_configure", function () {
W3tc_Lightbox.open({
id: "w3tc-overlay",
close: "",
width: 800,
height: 400,
url:
ajaxurl +
"?action=w3tc_ajax&_wpnonce=" +
w3tcGetAjaxNonce("newrelic_popup") +
"&w3tc_action=newrelic_popup",
callback: function (lightbox) {
lightbox.resize();
},
});
})
.on("click", ".w3tcnr_list_applications", function () {
var url =
ajaxurl +
"?action=w3tc_ajax&_wpnonce=" +
w3tcGetAjaxNonce("newrelic_list_applications") +
"&w3tc_action=newrelic_list_applications&api_key=" +
encodeURIComponent($(".w3tcnr_api_key").val());
W3tc_Lightbox.load(url);
})
.on(
"change",
'input[name="monitoring_type"], .w3tcnr_apm, .w3tcnr_browser',
function () {
w3tcnr_update_apply_state();
},
)
.on("click", ".w3tcnr_apply_configuration", function () {
// Prevent submit if disabled.
if ($(this).prop("disabled")) {
return;
}
var url =
ajaxurl +
"?action=w3tc_ajax&_wpnonce=" +
w3tcGetAjaxNonce("newrelic_apply_configuration") +
"&w3tc_action=newrelic_apply_configuration";
$(".w3tcnr_form")
.find("input")
.each(function (i) {
var name = $(this).attr("name");
var type = $(this).attr("type");
if (type == "radio") {
if (!$(this).prop("checked")) return;
}
if (name)
url +=
"&" +
encodeURIComponent(name) +
"=" +
encodeURIComponent($(this).val());
});
$(".w3tcnr_form")
.find("select")
.each(function (i) {
var name = $(this).attr("name");
url +=
"&" +
encodeURIComponent(name) +
"=" +
encodeURIComponent($(this).val());
});
W3tc_Lightbox.load(url);
});
});