Improve classic editor support

This commit is contained in:
2022-03-30 11:03:12 -04:00
parent 3ea79e669c
commit 1e0ddad379
3 changed files with 12 additions and 4 deletions

View File

@@ -17,6 +17,8 @@
*/
?>
<?php require_once dirname( __FILE__ ) . '/../api.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
@@ -29,6 +31,7 @@
margin: 0;
padding: 0;
height: 100%;
line-height: 0;
}
#cognito-frame {
width: 100%;
@@ -38,7 +41,7 @@
</style>
</head>
<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">
window.addEventListener('message', handleMessage);
@@ -48,7 +51,6 @@
var baseUrl = new URL(frame.getAttribute('src')).origin;
if (event.origin === baseUrl) {
console.log('Message received!');
sendData(event.data);
}
}

View File

@@ -13,7 +13,7 @@
editor.addCommand( 'cognito_embed_window', function() {
editor.windowManager.open( {
title: 'Cognito Forms',
url: url + '/dialog.php',
url: ajaxurl + '?action=cognito_tinymce_dialog',
width: 500,
height: 500,
} );