/**
* Configuration File.
* Establishes links and options parameters to be utilized by the S11FloatingLinks class.
*
* @class S11FloatingLinks
*/
( ( wp ) => {
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
// Define a configuration variable for Formidable's floating links.
const frmFloatingLinksConfig = {};
/**
* SVG definitions for the icons
*/
// Icon for Upgrade link
frmFloatingLinksConfig.upgradeIcon = `
`;
// Icon for Support link
frmFloatingLinksConfig.supportIcon = `
`;
// Icon for Documentation link
frmFloatingLinksConfig.documentationIcon = `
`;
// Icon for Notifications link
frmFloatingLinksConfig.notificationsIcon = `
`;
/**
* Define links for the "free" version of the plugin
*/
frmFloatingLinksConfig.freeVersionLinks = [
{
title: __( 'Upgrade', 'formidable' ),
icon: frmFloatingLinksConfig.upgradeIcon,
url: 'https://formidableforms.com/lite-upgrade/',
openInNewTab: true
},
{
title: __( 'Support', 'formidable' ),
icon: frmFloatingLinksConfig.supportIcon,
url: 'https://wordpress.org/support/plugin/formidable/',
openInNewTab: true
},
{
title: __( 'Documentation', 'formidable' ),
icon: frmFloatingLinksConfig.documentationIcon,
url: 'https://formidableforms.com/knowledgebase/',
openInNewTab: true
}
];
/**
* Define links for the "pro" version of the plugin
*/
frmFloatingLinksConfig.proVersionLinks = [
{
title: __( 'Support & Docs', 'formidable' ),
icon: frmFloatingLinksConfig.supportIcon,
url: 'https://formidableforms.com/knowledgebase/',
openInNewTab: true
}
];
/**
* Define options
*/
frmFloatingLinksConfig.options = {
hoverColor: '#4199FD',
bgHoverColor: '#F5FAFF',
logoIcon: `
`
};
// Determine the appropriate links and initialize the S11FloatingLinks class
frmFloatingLinksConfig.links = s11FloatingLinksData.proIsInstalled ? frmFloatingLinksConfig.proVersionLinks : frmFloatingLinksConfig.freeVersionLinks;
// Trigger the 'set_floating_links_config' action, passing the config
wp.hooks.doAction( 'set_floating_links_config', frmFloatingLinksConfig );
})( window.wp );