| Server IP : 63.32.33.223 / Your IP : 172.31.23.231 Web Server : Apache/2.4.68 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux ip-172-31-10-208.eu-west-1.compute.internal 6.8.0-1044-aws #46~22.04.1-Ubuntu SMP Tue Dec 2 12:52:18 UTC 2025 x86_64 User : kazang ( 1006) PHP Version : 8.2.31 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kazang/web/kazang.com/public_html/wp-content/plugins/formidable/js/ |
Upload File : |
/**
* Handles replacing the bottom row
* of the card with customized content.
*/
let FormidablePSH = {};
function frmPS() {
FormidablePSH = {
$pluginFilter: document.getElementById( 'plugin-filter' ),
/**
* Get parent search hint element.
*
* @return {Element|null} The parent search hint element.
*/
getCard() {
return document.querySelector( '.plugin-card-frm-plugin-search' );
},
/**
* Replace bottom row of the card to insert logo, text and link to dismiss the card.
*/
replaceCardBottom() {
const hint = FormidablePSH.getCard();
if ( 'object' === typeof hint && null !== hint ) {
hint.querySelector( '.plugin-card-bottom' ).outerHTML =
`<div class="plugin-card-bottom frm-plugin-search__bottom"><p class="frm-plugin-search__text">${ frmPlugSearch.legend }</p></div>`;
// Remove link and parent li from action links and move it to bottom row
const dismissLink = document.querySelector( '.frm-plugin-search__dismiss' );
dismissLink.parentNode.remove();
document.querySelector( '.frm-plugin-search__bottom' ).append( dismissLink );
}
},
/**
* Check if plugin card list nodes changed. If there's a Formidable PSH card, replace the title and the bottom row.
*
* @param {Array} mutationsList
*/
replaceOnNewResults( mutationsList ) {
mutationsList.forEach( function( mutation ) {
if (
'childList' === mutation.type &&
1 === document.querySelectorAll( '.plugin-card-frm-plugin-search' ).length
) {
FormidablePSH.replaceCardBottom();
}
} );
},
/**
* Start suggesting.
*/
init() {
if ( FormidablePSH.$pluginFilter === null ) {
return;
}
// Replace PSH bottom row on page load
FormidablePSH.replaceCardBottom();
// Listen for changes in plugin search results
const resultsObserver = new MutationObserver( FormidablePSH.replaceOnNewResults );
resultsObserver.observe( FormidablePSH.$pluginFilter, { childList: true } );
},
};
FormidablePSH.init();
}
FormidablePS = frmPS(); //eslint-disable-line sonarjs/no-use-of-empty-return-value