PluginProbe ʕ •ᴥ•ʔ
CloudSecure WP Security / 1.4.14
CloudSecure WP Security v1.4.14
1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 trunk 0.9.0 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.21 1.3.22 1.3.23 1.3.24 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8
cloudsecure-wp-security / assets / js / script.js
cloudsecure-wp-security / assets / js Last commit date
script.js 2 weeks ago
script.js
45 lines
1 /**
2 * REST API無効化ページのボタンの処理
3 *
4 * @package REST API無効化ページボタン
5 */
6 document.addEventListener(
7 'DOMContentLoaded',
8 function()
9 {
10 let disableRestApiExclude = document.querySelector( '#disable_rest_api_exclude' );
11 let activePlugins = document.querySelector( '#active-plugins' );
12 if ( activePlugins ) {
13 let btnExcludeList = activePlugins.querySelectorAll( '.btn-exclude' );
14 btnExcludeList.forEach(
15 function(btnExclude)
16 {
17 btnExclude.addEventListener(
18 'click',
19 function()
20 {
21 let li = this.closest( 'li' );
22 let group = li.getAttribute( 'data-group' );
23 if ( disableRestApiExclude.value === '' ) {
24 disableRestApiExclude.value += li.querySelector( 'span' ).textContent;
25 } else {
26 disableRestApiExclude.value += String.fromCharCode( 10 ) + li.querySelector( 'span' ).textContent;
27 }
28 li.parentNode.removeChild( li );
29
30 // 同じグループの�
31 目がなくなったらグループ見出し(-- テーマ -- / -- プラグイン --)も非表示にする
32 if ( group && activePlugins.querySelectorAll( 'li[data-group="' + group + '"]:not(.exclude-group-label)' ).length === 0 ) {
33 let groupLabel = activePlugins.querySelector( 'li.exclude-group-label[data-group="' + group + '"]' );
34 if ( groupLabel ) {
35 groupLabel.parentNode.removeChild( groupLabel );
36 }
37 }
38 }
39 );
40 }
41 );
42 }
43 }
44 );
45