PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.22
Code Manager v1.0.22
1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / assets / js / code_manager_message.js
code-manager / assets / js Last commit date
code_manager.js 3 years ago code_manager_dashboard.js 3 years ago code_manager_listmode.js 3 years ago code_manager_message.js 3 years ago code_manager_tabmode.js 3 years ago notify.min.js 3 years ago
code_manager_message.js
68 lines
1 function cm_warning() {
2 const cm_home = window.location.href.split('&')[0];
3
4 warningHtml = `
5 <p>
6 Adding custom code may introduce incompatibilities that break your site. Here are some guidelines to keep in mind when writing custom code:
7 </p>
8 <ul>
9 <li>Do NOT copy code into the Code Manager you don’t understand</li>
10 <li>Do NOT copy code from the internet into the Code Manager if you’re not sure what the code does</li>
11 <li>Know what you do, do what you know</li>
12 </ul>
13 <p>
14 Bookmark these links in case your code results in failures:
15 </p>
16 <ul>
17 <li>
18 <a href="${cm_home}">
19 Your Code Manager admin page
20 </a>
21 </li>
22 <li>
23 <a href="https://code-manager.com/blog/docs/index/getting-started/read-this-first/" target="_blank">
24 Four alternatives to disable faulty code
25 </a>
26 </li>
27 </ul>
28 <div>
29 <label>
30 <input type="checkbox" id="code_manager_message_off" /> Don't show this message again
31 </label>
32 </div>
33 `;
34
35 var dialog = jQuery("<div/>").html(warningHtml).dialog({
36 title: "Heads up!",
37 width: "max-content",
38 dialogClass: "code-manager-dialog",
39 modal: true,
40 autoOpen: true,
41 closeOnEscape: false,
42 draggable:false,
43 resizable: false,
44 buttons: {
45 "Go back": function() {
46 cm_message_off();
47 window.location.href = cm_home;
48 },
49 "I understand": function() {
50 cm_message_off();
51 dialog.dialog("destroy");
52 }
53 }
54 });
55 }
56
57 function cm_message_off() {
58 if (jQuery("#code_manager_message_off").is(":checked")) {
59 // turn off alert
60 jQuery.ajax({
61 type: 'POST',
62 url: pathname + '?action=code_manager_alert_off',
63 data: {
64 wpnonce: wpnonce
65 }
66 });
67 }
68 }