PluginProbe ʕ •ᴥ•ʔ
Akismet Anti-spam: Spam Protection / 5.7
Akismet Anti-spam: Spam Protection v5.7
5.7 3.0.4 3.0.5 3.1 3.1.1 3.1.10 3.1.11 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 5.0 5.0.1 5.0.2 5.1 5.2 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.4 5.5 5.6 trunk 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.4.0 2.4.1 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 3.0.0 3.0.0-RC1 3.0.1 3.0.2 3.0.3
akismet / _inc / akismet-admin.js
akismet / _inc Last commit date
fonts 1 month ago img 1 month ago rtl 1 month ago akismet-admin.css 1 month ago akismet-admin.js 2 months ago akismet-frontend.js 2 months ago akismet.css 6 months ago akismet.js 1 month ago
akismet-admin.js
70 lines
1 document.addEventListener( 'DOMContentLoaded', function() {
2 // Prevent aggressive iframe caching in Firefox
3 var statsIframe = document.getElementById( 'stats-iframe' );
4 if ( statsIframe ) {
5 statsIframe.contentWindow.location.href = statsIframe.src;
6 }
7
8 initCompatiblePluginsShowMoreToggle();
9 initApiKeyCopyButton();
10 } );
11
12 function initApiKeyCopyButton() {
13 const button = document.querySelector( '.akismet-api-key-copy' );
14 if ( ! button ) {
15 return;
16 }
17
18 button.addEventListener( 'click', function() {
19 const input = document.getElementById( 'key' );
20 if ( ! input || ! input.value ) {
21 return;
22 }
23
24 if ( navigator.clipboard && navigator.clipboard.writeText ) {
25 navigator.clipboard.writeText( input.value ).then( function() {
26 const svg = button.querySelector( 'svg' );
27 const original = svg.innerHTML;
28 svg.innerHTML = '<polyline points="20 6 9 17 4 12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>';
29 setTimeout( function() {
30 svg.innerHTML = original;
31 }, 2000 );
32 } ).catch( function() {
33 input.select();
34 document.execCommand( 'copy' );
35 } );
36 } else {
37 input.select();
38 document.execCommand( 'copy' );
39 }
40 } );
41 }
42
43 function initCompatiblePluginsShowMoreToggle() {
44 const section = document.querySelector( '.akismet-compatible-plugins' );
45 const list = document.querySelector( '.akismet-compatible-plugins__list' );
46 const button = document.querySelector( '.akismet-compatible-plugins__show-more' );
47
48 if ( ! section || ! list || ! button ) {
49 return;
50 }
51
52 function isElementInViewport( element ) {
53 const rect = element.getBoundingClientRect();
54 return rect.top >= 0 && rect.bottom <= window.innerHeight;
55 }
56
57 function toggleCards() {
58 list.classList.toggle( 'is-expanded' );
59 const isExpanded = list.classList.contains( 'is-expanded' );
60 button.textContent = isExpanded ? button.dataset.labelOpen : button.dataset.labelClosed;
61 button.setAttribute( 'aria-expanded', isExpanded.toString() );
62
63 if ( ! isExpanded && ! isElementInViewport( section ) ) {
64 section.scrollIntoView( { block: 'start' } );
65 }
66 }
67
68 button.addEventListener( 'click', toggleCards );
69 }
70