PluginProbe
If-So Dynamic Content – Elementor & All Page Builders Personalization / trunk
If-So Dynamic Content – Elementor & All Page Builders Personalization vtrunk
1.10.1 1.10.0.1 1.10 1.9.9 1.9.2.2 1.9.3 1.9.3.1 1.9.3.2 1.9.4 1.9.4.1 1.9.5 1.9.5.1 1.9.6 1.9.7 1.9.8 trunk 0.1 1.0 1.0.1 1.0.2 1.0.3 1.0.5 1.0.6 1.0.7 1.0.8 All 100 releases
if-so / extensions / extension-base / lib / plugin-update-checker / js / debug-bar.js

debug-bar.js in If-So Dynamic Content – Elementor & All Page Builders Personalization trunk, at extensions/extension-base/lib/plugin-update-checker/js/debug-bar.js

54 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(function($) {
2
3 function runAjaxAction(button, action) {
4 button = $(button);
5 var panel = button.closest('.puc-debug-bar-panel-v5');
6 var responseBox = button.closest('td').find('.puc-ajax-response');
7
8 responseBox.text('Processing...').show();
9 $.post(
10 ajaxurl,
11 {
12 action : action,
13 uid : panel.data('uid'),
14 _wpnonce: panel.data('nonce')
15 },
16 function(data) {
17 //The response contains HTML that should already be escaped in server-side code.
18 //phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html
19 responseBox.html(data);
20 },
21 'html'
22 );
23 }
24
25 $('.puc-debug-bar-panel-v5 input[name="puc-check-now-button"]').on('click', function() {
26 runAjaxAction(this, 'puc_v5_debug_check_now');
27 return false;
28 });
29
30 $('.puc-debug-bar-panel-v5 input[name="puc-request-info-button"]').on('click', function() {
31 runAjaxAction(this, 'puc_v5_debug_request_info');
32 return false;
33 });
34
35
36 // Debug Bar uses the panel class name as part of its link and container IDs. This means we can
37 // end up with multiple identical IDs if more than one plugin uses the update checker library.
38 // Fix it by replacing the class name with the plugin slug.
39 var panels = $('#debug-menu-targets').find('.puc-debug-bar-panel-v5');
40 panels.each(function() {
41 var panel = $(this);
42 var uid = panel.data('uid');
43 var target = panel.closest('.debug-menu-target');
44
45 //Change the panel wrapper ID.
46 target.attr('id', 'debug-menu-target-puc-' + uid);
47
48 //Change the menu link ID as well and point it at the new target ID.
49 $('#debug-bar-menu').find('.puc-debug-menu-link-' + uid)
50 .closest('.debug-menu-link')
51 .attr('id', 'debug-menu-link-puc-' + uid)
52 .attr('href', '#' + target.attr('id'));
53 });
54 });