PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / trunk
Forumax – AI Powered Advanced Community Forum Plugin vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / assets / admin / js / review.js

review.js in Forumax – AI Powered Advanced Community Forum Plugin trunk, at assets/admin/js/review.js

38 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function () {
2
3 // Show review popup
4 jQuery("#bbpc_notify_review a").on("click", function () {
5 const thisElement = this;
6 const fieldValue = jQuery(thisElement).attr("data");
7 const freeLink = "https://wordpress.org/support/plugin/forumax/reviews/#new-post";
8 let hidePopup = false;
9 if (fieldValue == "rateNow") {
10 window.open(freeLink, "_blank");
11 } else {
12 hidePopup = true;
13 }
14
15 jQuery
16 .ajax({
17 dataType: 'json',
18 url: forumax_local_object.ajaxurl,
19 type: "post",
20 data: {
21 action: "forumax_notify_save_review",
22 field: fieldValue,
23 nonce: forumax_local_object.nonce,
24 },
25 })
26 .done(function (result) {
27 if (hidePopup == true) {
28 jQuery( "#bbpc_notify_review .notice-dismiss" ).trigger( "click" );
29 }
30 })
31 .fail(function (res) {
32 if (hidePopup == true) {
33 console.log(res.responseText);
34 jQuery( "#bbpc_notify_review .notice-dismiss" ).trigger( "click" );
35 }
36 });
37 })
38 })