Compare commits
7 Commits
23a23f7f56
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e0cfdac2f | |||
| 39c65dcbce | |||
| 7b06e0226b | |||
| 1e0ddad379 | |||
| 3ea79e669c | |||
| 9662a50022 | |||
| 20a2fa92a9 |
@@ -43,8 +43,8 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
|
|||||||
// Initialization actions
|
// Initialization actions
|
||||||
private static $actions = array(
|
private static $actions = array(
|
||||||
'admin_init',
|
'admin_init',
|
||||||
'admin_menu',
|
'init',
|
||||||
'init'
|
'wp_ajax_cognito_tinymce_dialog'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Supported shortcodes
|
// Supported shortcodes
|
||||||
@@ -59,12 +59,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
|
|||||||
add_action( $action, array( $this, $action ) );
|
add_action( $action, array( $this, $action ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registers plug-in filters
|
|
||||||
private function add_filters( $filters ) {
|
|
||||||
foreach ( $filters as $filter )
|
|
||||||
add_filter( $filter, array( $this, $filter ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Registers shortcodes
|
// Registers shortcodes
|
||||||
private function add_shortcodes( $shortcodes ) {
|
private function add_shortcodes( $shortcodes ) {
|
||||||
foreach ( $shortcodes as $tag => $func )
|
foreach ( $shortcodes as $tag => $func )
|
||||||
@@ -171,10 +165,8 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
|
|||||||
// Initialize classic editor (TinyMCE)
|
// Initialize classic editor (TinyMCE)
|
||||||
public function tinymce_init() {
|
public function tinymce_init() {
|
||||||
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
||||||
$this->add_filters( array(
|
add_filter( 'mce_buttons', array( $this, 'tinymce_buttons' ) );
|
||||||
'tinymce_buttons',
|
add_filter( 'mce_external_plugins', array( $this, 'tinymce_external_plugins' ) );
|
||||||
'tinymce_external_plugins'
|
|
||||||
) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,12 +182,9 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
|
|||||||
return $plugin_array;
|
return $plugin_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize administration menu (left sidebar)
|
public function wp_ajax_cognito_tinymce_dialog() {
|
||||||
public function admin_menu() {
|
include 'tinymce/dialog.php';
|
||||||
add_menu_page( 'Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array( $this, 'main_page' ), "data:image/svg+xml;base64," . base64_encode( file_get_contents( plugin_dir_path( __FILE__ ) . 'cogicon.svg' ) ) );
|
wp_die();
|
||||||
add_submenu_page( 'Cognito', 'Cognito Forms', 'View Forms', 'manage_options', 'Cognito', array( $this, 'main_page' ) );
|
|
||||||
add_submenu_page( 'Cognito', 'Create Form', 'New Form', 'manage_options', 'CognitoCreateForm', array( $this, 'main_page' ) );
|
|
||||||
add_submenu_page( 'Cognito', 'Templates', 'Templates', 'manage_options', 'CognitoTemplates', array( $this, 'main_page' ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when a 'CognitoForms' shortcode is encountered, renders form embed script
|
// Called when a 'CognitoForms' shortcode is encountered, renders form embed script
|
||||||
@@ -207,11 +196,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
|
|||||||
return CognitoAPI::get_form_embed_script( $key, $atts['id'] );
|
return CognitoAPI::get_form_embed_script( $key, $atts['id'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Entrypoint for Cognito Forms access
|
|
||||||
public function main_page() {
|
|
||||||
include 'templates/main.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add support for oEmbed using the generic Gutenberg Embed block
|
// Add support for oEmbed using the generic Gutenberg Embed block
|
||||||
public function oembed_init() {
|
public function oembed_init() {
|
||||||
wp_oembed_add_provider( '#https?://(www\.)?cognitoforms\.com/.*#i', 'https://www.cognitoforms.com/f/oembed/', true );
|
wp_oembed_add_provider( '#https?://(www\.)?cognitoforms\.com/.*#i', 'https://www.cognitoforms.com/f/oembed/', true );
|
||||||
|
|||||||
34
docker-compose.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mysql:5.7
|
||||||
|
volumes:
|
||||||
|
- db_data:/var/lib/mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: somewordpress
|
||||||
|
MYSQL_DATABASE: wordpress
|
||||||
|
MYSQL_USER: wordpress
|
||||||
|
MYSQL_PASSWORD: wordpress
|
||||||
|
|
||||||
|
wordpress:
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
image: wordpress:5.9.0
|
||||||
|
volumes:
|
||||||
|
- wordpress_data:/var/www/html
|
||||||
|
- .:/var/www/html/wp-content/plugins/cognito-forms:ro
|
||||||
|
ports:
|
||||||
|
- "8085:80"
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
WORDPRESS_DB_HOST: db:3306
|
||||||
|
WORDPRESS_DB_USER: wordpress
|
||||||
|
WORDPRESS_DB_PASSWORD: wordpress
|
||||||
|
WORDPRESS_DB_NAME: wordpress
|
||||||
|
WORDPRESS_DEBUG: "true"
|
||||||
|
volumes:
|
||||||
|
db_data: {}
|
||||||
|
wordpress_data: {}
|
||||||
|
|
||||||
146
readme.txt
@@ -3,91 +3,113 @@ Contributors: cognitoapps
|
|||||||
Donate link: https://www.cognitoforms.com
|
Donate link: https://www.cognitoforms.com
|
||||||
Tags: form, forms, cognito, cognito forms, create form, create forms, form builder, form creator, form generator, html form, online form, online form builder, online forms, registration, survey, surveys, web form, web forms, embed, anti-spam, email form, email, responsive, payment
|
Tags: form, forms, cognito, cognito forms, create form, create forms, form builder, form creator, form generator, html form, online form, online form builder, online forms, registration, survey, surveys, web form, web forms, embed, anti-spam, email form, email, responsive, payment
|
||||||
Requires at least: 3.5
|
Requires at least: 3.5
|
||||||
Tested up to: 5.6
|
Tested up to: 5.9.3
|
||||||
Stable tag: 1.1.8
|
Stable tag: 2.0.0
|
||||||
License: GPLv2 or later
|
License: GPLv2 or later
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
|
||||||
Create responsive contact forms, order forms, registration forms and more. For free and without ever leaving WordPress.
|
Create responsive contact forms, order forms, registration forms and more. With PCI, CCPA, and HIPAA compliance.
|
||||||
|
|
||||||
== Description ==
|
== Description ==
|
||||||
Basic or advanced, we have all the features you need to quickly create powerful online forms.
|
Cognito Forms is an easy-to-use online form builder that enables you to create everything from simple surveys to complex registration forms - no code required. Whether you’re using a pre-made template or starting from scratch, you can create forms to help your organization in just a matter of minutes.
|
||||||
|
|
||||||
FREE Features:
|
New to Cognito Forms? Watch a quick tutorial to get acquainted with the form builder, and learn how to create your first form!
|
||||||
-----------
|
|
||||||
|
|
||||||
[Unlimited Forms & Fields](https://www.cognitoforms.com/features/unlimited-forms-fields)
|
[youtube https://www.youtube.com/watch?v=8lZ7cK29C9U]
|
||||||
Collect all the data you need, no matter what - make as many forms as you want, with as many fields as you want.
|
|
||||||
[Calculations](https://www.cognitoforms.com/features/calculations)
|
|
||||||
Let us do the math for you - build forms with powerful calculations that can total costs, compare dates and so much more.
|
|
||||||
[Conditional Logic](https://www.cognitoforms.com/features/conditional-logic)
|
|
||||||
Take each of your users on a unique path through your forms and control what they see with Conditional Logic.
|
|
||||||
[Countries, Languages & Currencies](https://www.cognitoforms.com/features/countries-languages-currencies)
|
|
||||||
18 languages. 121 countries. 137 currencies. Awesome forms.
|
|
||||||
[Email Notifications](https://www.cognitoforms.com/features/email-notifications)
|
|
||||||
Create custom autoresponder emails that include all the details of your customer's purchase or entry so they can review their order at any time.
|
|
||||||
[Entry Management](https://www.cognitoforms.com/features/entry-management)
|
|
||||||
Sort, filter, and organize your form submissions to help you smoothly run your business or organization.
|
|
||||||
[File Uploads](https://www.cognitoforms.com/features/file-uploads)
|
|
||||||
Capturing multiple files at once, setting file size and type limits - it all comes free with every single Cognito Forms account.
|
|
||||||
[Form Confirmations](https://www.cognitoforms.com/features/form-confirmations)
|
|
||||||
Create a personalized message to confirm a user's submission and allow them to review their order or entry data.
|
|
||||||
[Multi-Page Forms](https://www.cognitoforms.com/features/multi-page-forms)
|
|
||||||
Get more responses to your complex surveys and long forms with page breaks, progress bars and conditional pages.
|
|
||||||
[Payment](https://www.cognitoforms.com/features/payment)
|
|
||||||
Secure credit and debit card payment processing through Stripe. Or upgrade to use PayPal.
|
|
||||||
[Rating Scales](https://www.cognitoforms.com/features/rating-scales)
|
|
||||||
Give your customers an outlet for feedback right on your forms with customizable rating scales.
|
|
||||||
[Repeating Sections & Tables](https://www.cognitoforms.com/features/repeating-sections)
|
|
||||||
Collect as much or as little data as your customers can give, without any extra work or adding a lot of clutter.
|
|
||||||
[SPAM Prevention](https://www.cognitoforms.com/features/spam-prevention)
|
|
||||||
Keep your forms easy-to-use while eliminating rogue entries with our powerful, automatic spam prevention.
|
|
||||||
[Template Sharing](https://www.cognitoforms.com/features/template-sharing)
|
|
||||||
Made an awesome form? Share your form as a template so others can bask in your awesomeness.
|
|
||||||
|
|
||||||
**Premium Features**
|
== Online Payment ==
|
||||||
[Data Encryption](https://www.cognitoforms.com/features/data-encryption)
|
Accept online payments directly through your forms – using Square, Stripe or PayPal. Whether you’re collecting a simple online donation or processing complex multivariable transactions, you can do so easily on any of our plan levels.
|
||||||
Keep your form data safe and sound.
|
|
||||||
[Document Merging](https://www.cognitoforms.com/features/document-merging)
|
|
||||||
Create PDF and Word docs from your entry data, completely customized the way you want.
|
|
||||||
[Electronic Signatures](https://www.cognitoforms.com/features/electronic-signatures)
|
|
||||||
Collect signatures on every form and on any device.
|
|
||||||
[Entry Sharing](https://www.cognitoforms.com/features/entry-sharing)
|
|
||||||
Give your users the ability to update their entries even after they've already been submitted.
|
|
||||||
[HIPAA Compliance](https://www.cognitoforms.com/features/hipaa-compliance)
|
|
||||||
Easily create secure forms to engage with your patients and protect their data.
|
|
||||||
[Save & Resume](https://www.cognitoforms.com/features/save-resume)
|
|
||||||
Allow users to pick up right where they left off by saving their progress on partially completed form responses.
|
|
||||||
[Saved Entry Views](https://www.cognitoforms.com/features/entry-management#saved)
|
|
||||||
After you sort and filter your entry data, save those settings to create a unique entry view.
|
|
||||||
|
|
||||||
Learn more at [cognitoforms.com](https://www.cognitoforms.com).
|
Simply connect your payment account to begin doing business in minutes. These secure online transactions integrate directly into your forms to deliver a better experience both for you and your customers.
|
||||||
|
|
||||||
|
== Integrations ==
|
||||||
|
Increase the power, utility and functionality of your forms using native and third-party integrations. It’s surprisingly simple.
|
||||||
|
|
||||||
|
Use Zapier, Microsoft Power Automate or Integromat to exchange data with thousands of applications. Create workflows and automatically trigger tasks directly from your form entries. And quickly set it all up using either no-code visual interfaces or JSON.
|
||||||
|
|
||||||
|
== Security & Compliance ==
|
||||||
|
Protect your customers, your organization and all the information you collect. Because, in today’s online world, security comes first.
|
||||||
|
|
||||||
|
Quickly create additional protections for fields and forms. Set organizational controls by the individual form or folder. Manage access and account permissions. And stay compliant with HIPAA, GDPR, CCPA and other security regulations.
|
||||||
|
|
||||||
|
== Features ==
|
||||||
|
|
||||||
|
**Data Collection**
|
||||||
|
|
||||||
|
[Electronic Signatures](https://www.cognitoforms.com/product/electronic-signatures)
|
||||||
|
[File Uploads](https://www.cognitoforms.com/product/file-uploads)
|
||||||
|
[Multi-Page Forms & Page Breaks](https://www.cognitoforms.com/product/multi-page-forms)
|
||||||
|
[Rating Scales](https://www.cognitoforms.com/product/rating-scales)
|
||||||
|
[Repeating Sections & Tables](https://www.cognitoforms.com/product/repeating-sections-tables)
|
||||||
|
[Save & Resume](https://www.cognitoforms.com/product/save-resume)
|
||||||
|
[Style Customization](https://www.cognitoforms.com/product/style-customization)
|
||||||
|
|
||||||
|
**Data Management**
|
||||||
|
|
||||||
|
[Importing](https://www.cognitoforms.com/product/importing)
|
||||||
|
[Exporting](https://www.cognitoforms.com/product/exporting)
|
||||||
|
[Entry Sharing](https://www.cognitoforms.com/product/entry-sharing)
|
||||||
|
[Saved Entry Views](https://www.cognitoforms.com/product/saved-entry-views)
|
||||||
|
|
||||||
|
**Integrations**
|
||||||
|
|
||||||
|
[Google Analytics](https://www.cognitoforms.com/product/google-analytics)
|
||||||
|
[Microsoft Power Automate](https://www.cognitoforms.com/product/microsoft-power-automate)
|
||||||
|
[Zapier](https://www.cognitoforms.com/product/zapier)
|
||||||
|
[Make (formerly Integromat)](https://www.cognitoforms.com/product/integromat)
|
||||||
|
[JSON Webhooks](https://www.cognitoforms.com/product/json-webhooks)
|
||||||
|
|
||||||
|
**Logic & Automation**
|
||||||
|
|
||||||
|
[Calculations](https://www.cognitoforms.com/product/calculations)
|
||||||
|
[Conditional Logic](https://www.cognitoforms.com/product/conditional-logic)
|
||||||
|
[Quantity Limits](https://www.cognitoforms.com/product/quantity-limits)
|
||||||
|
[Lookup Field](https://www.cognitoforms.com/product/lookup-field)
|
||||||
|
[Notifications](https://www.cognitoforms.com/product/notifications)
|
||||||
|
[Document Generation](https://www.cognitoforms.com/product/document-generation)
|
||||||
|
|
||||||
|
**Online Payment**
|
||||||
|
|
||||||
|
[Stripe Payments](https://www.cognitoforms.com/product/stripe-payments)
|
||||||
|
[Card on File](https://www.cognitoforms.com/product/card-on-file)
|
||||||
|
[PayPal Payments](https://www.cognitoforms.com/product/paypal-payments)
|
||||||
|
[Square Payments](https://www.cognitoforms.com/product/square-payments)
|
||||||
|
|
||||||
|
**Security & Compliance**
|
||||||
|
|
||||||
|
[Two-Factor Authentication](https://www.cognitoforms.com/product/two-factor-authentication)
|
||||||
|
[Data Encryption](https://www.cognitoforms.com/product/data-encryption)
|
||||||
|
[Data Protection & Privacy](https://www.cognitoforms.com/product/data-protection-privacy)
|
||||||
|
[Folder Permissions](https://www.cognitoforms.com/product/folder-permissions)
|
||||||
|
[HIPAA Compliance](https://www.cognitoforms.com/product/hipaa-compliance)
|
||||||
|
[ADA Compliance](https://www.cognitoforms.com/product/ada-compliance)
|
||||||
|
|
||||||
== Installation ==
|
== Installation ==
|
||||||
|
|
||||||
1. Install and activate the plugin through the "Plugins" menu in WordPress.
|
1. Upload `cognitoforms.zip` from the Upload section of the 'Plugins' menu in WordPress.
|
||||||
2. If you have not already done so, install and activate the "Classic Editor" plugin from the WordPress store.
|
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
||||||
|
|
||||||
== Frequently Asked Questions ==
|
== Frequently Asked Questions ==
|
||||||
|
|
||||||
= Is Cognito Forms cloud-hosted? =
|
= Is Cognito Forms cloud-hosted? =
|
||||||
|
|
||||||
Yes, your forms and your submissions are securely stored in the cloud.
|
Cognito Forms is a subscription-based service and we host all of the forms and data collected securely on the Microsoft Azure cloud platform, which is PCI (DSS) Level 1 and HIPAA compliant.
|
||||||
|
|
||||||
= How do I create a form? =
|
= How do I create a form? =
|
||||||
|
|
||||||
In order to create a form, you need to create a Cognito Forms account through the plugin. Once you design your form, you can embed it onto a post or a page by using the Cognito Forms icon, the orange cog, that shows up on the editor toolbar. We'll automatically add the short code for you.
|
In order to create a form, you need to create a Cognito Forms account through the plugin. Once you design your form, you can embed it onto a post or a page by using the Cognito Forms icon, the orange cog, that shows up on the editor toolbar. We'll automatically add the short code for you.
|
||||||
|
|
||||||
|
= Now that I've built a form, can I receive a notification every time my form is submitted? =
|
||||||
|
|
||||||
|
Yes – in fact, our forms default to sending an email notification to the email address belonging to the owner of the account.
|
||||||
|
|
||||||
|
You can further customize that email notification to be sent on behalf of your website domain, contain custom content, show details from the entry, or go to multiple email addresses.
|
||||||
|
|
||||||
== Screenshots ==
|
== Screenshots ==
|
||||||
|
|
||||||
1. After activation, the Cognito Forms plugin will appear in your menu. Click on the plugin to be taken to Cognito Forms.
|
1. After activation, the Cognito Forms plugin will appear in your menu. Click on the plugin to be taken to Cognito Forms.
|
||||||
2. Click on the menu icon in the upper right to log in or sign up.
|
2. Once logged in, build a new form from a template or from scratch.
|
||||||
3. Once logged in, build a new form from a template or from scratch.
|
3. Open the page or post where you'd like to insert your form, then add the Cognito Forms block.
|
||||||
4. Build your form and click "Save".
|
4. Select your form from the drop down and click "Embed".
|
||||||
5. In your WordPress menu, add a new Page or Post.
|
5. The plugin automatically embeds the form on your site.
|
||||||
6. In the editor, click on the orange Cog icon for Cognito Forms.
|
6. Preview or publish to see your new form in action!
|
||||||
7. Select the form name from the drop down and click "Insert Form".
|
|
||||||
8. The plugin inserts the Cognito Forms short code for you.
|
|
||||||
9. Preview or post your new form!
|
|
||||||
|
|
||||||
|
|||||||
BIN
screenshot-1.png
Executable file → Normal file
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 382 KiB |
BIN
screenshot-2.png
Executable file → Normal file
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 444 KiB |
BIN
screenshot-3.png
Executable file → Normal file
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 277 KiB |
BIN
screenshot-4.png
Executable file → Normal file
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 263 KiB |
BIN
screenshot-5.png
Executable file → Normal file
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 792 KiB |
BIN
screenshot-6.png
Executable file → Normal file
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 766 KiB |
BIN
screenshot-7.png
|
Before Width: | Height: | Size: 68 KiB |
BIN
screenshot-8.png
|
Before Width: | Height: | Size: 70 KiB |
BIN
screenshot-9.png
|
Before Width: | Height: | Size: 31 KiB |
@@ -37,7 +37,7 @@ class SelectDialog extends React.Component<IDialogProps> {
|
|||||||
shouldCloseOnClickOutside={ false }
|
shouldCloseOnClickOutside={ false }
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
style={ { width: '500px', height: '500px', display: 'block' } }
|
style={ { width: '500px', height: '100%', display: 'block' } }
|
||||||
src={ `${ baseUrl }/integrations/cms` }
|
src={ `${ baseUrl }/integrations/cms` }
|
||||||
title="Choose a Form"
|
title="Choose a Form"
|
||||||
></iframe>
|
></iframe>
|
||||||
|
|||||||
@@ -52,9 +52,10 @@
|
|||||||
|
|
||||||
// Remove modal padding
|
// Remove modal padding
|
||||||
.cognito-modal {
|
.cognito-modal {
|
||||||
|
height: 600px;
|
||||||
|
|
||||||
.components-modal__content {
|
.components-modal__content {
|
||||||
padding: initial;
|
padding: initial;
|
||||||
height: fit-content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.components-modal__content::before {
|
.components-modal__content::before {
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Cognito Forms WordPress Plugin.
|
|
||||||
*
|
|
||||||
* The Cognito Forms WordPress Plugin is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License, version 2, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* The Cognito Forms WordPress Plugin is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
$url = CognitoAPI::$formsBase;
|
|
||||||
|
|
||||||
if ($_GET['page'] == 'CognitoCreateForm') {
|
|
||||||
$url = $url . '/forms/new';
|
|
||||||
} elseif ($_GET['page'] == "CognitoTemplates") {
|
|
||||||
$url = $url . '/templates';
|
|
||||||
} else {
|
|
||||||
$url = $url . '/forms';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<iframe id="cognito-frame" src="<?= $url ?>"></iframe>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
#wpcontent {
|
|
||||||
padding-left: 0!important;
|
|
||||||
}
|
|
||||||
#wpfooter {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#wpwrap, #wpcontent, #wpbody, #wpbody-content {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
#wpbody-content *:not(#cognito-frame) {
|
|
||||||
display: none!important;
|
|
||||||
}
|
|
||||||
#cognito-frame {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -17,6 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php require_once dirname( __FILE__ ) . '/../api.php'; ?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@@ -29,6 +31,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
line-height: 0;
|
||||||
}
|
}
|
||||||
#cognito-frame {
|
#cognito-frame {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -38,7 +41,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe id="cognito-frame" src="https://forms.cognito.test/integrations/cms"></iframe>
|
<iframe id="cognito-frame" src="<?= CognitoAPI::$formsBase ?>/integrations/cms"></iframe>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('message', handleMessage);
|
window.addEventListener('message', handleMessage);
|
||||||
@@ -48,7 +51,6 @@
|
|||||||
var baseUrl = new URL(frame.getAttribute('src')).origin;
|
var baseUrl = new URL(frame.getAttribute('src')).origin;
|
||||||
|
|
||||||
if (event.origin === baseUrl) {
|
if (event.origin === baseUrl) {
|
||||||
console.log('Message received!');
|
|
||||||
sendData(event.data);
|
sendData(event.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
editor.addCommand( 'cognito_embed_window', function() {
|
editor.addCommand( 'cognito_embed_window', function() {
|
||||||
editor.windowManager.open( {
|
editor.windowManager.open( {
|
||||||
title: 'Cognito Forms',
|
title: 'Cognito Forms',
|
||||||
url: url + '/dialog.php',
|
url: ajaxurl + '?action=cognito_tinymce_dialog',
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 500,
|
height: 500,
|
||||||
} );
|
} );
|
||||||
|
|||||||