diff --git a/api.php b/api.php deleted file mode 100755 index d8d27c1..0000000 --- a/api.php +++ /dev/null @@ -1,64 +0,0 @@ - - - - -EOF; - } - - // Builds Cognito module embed script - public static function get_embed_script($key, $module) { - $base = self::$servicesBase; - return <<< EOF -
- - -
-EOF; - } -} - -?> \ No newline at end of file diff --git a/cogicon.ico b/cogicon.ico deleted file mode 100755 index 62b50ba..0000000 Binary files a/cogicon.ico and /dev/null differ diff --git a/gear.ico b/gear.ico deleted file mode 100755 index 316b1b4..0000000 Binary files a/gear.ico and /dev/null differ diff --git a/plugin.php b/plugin.php index 1ba38ba..57a38e8 100644 --- a/plugin.php +++ b/plugin.php @@ -69,19 +69,6 @@ if ( !class_exists('CognitoFormsPlugin') ) { public function admin_init() { if(!current_user_can('edit_posts') && !current_user_can('edit_pages')) return; - register_setting('cognito_plugin', 'cognito_api_key'); - register_setting('cognito_plugin', 'cognito_admin_key'); - register_setting('cognito_plugin', 'cognito_public_key'); - register_setting('cognito_plugin', 'cognito_organization'); - - // If the flag to delete options was passed-in, delete them - if (isset($_GET['cog_clear']) && $_GET['cog_clear'] == '1') { - delete_option('cognito_api_key'); - delete_option('cognito_admin_key'); - delete_option('cognito_public_key'); - delete_option('cognito_organization'); - } - // Initialize TinyMCE Plugin $this->tinymce_init(); } @@ -138,7 +125,7 @@ if ( !class_exists('CognitoFormsPlugin') ) { } // Set up TinyMCE buttons - public function mce_buttons($buttons) { + public function mce_buttons( $buttons ) { array_push($buttons, '|', 'cognito'); return $buttons; } @@ -151,22 +138,16 @@ if ( !class_exists('CognitoFormsPlugin') ) { // Initialize administration menu (left-bar) public function admin_menu() { - add_menu_page('Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array($this, 'main_page'), "data:image/svg+xml;base64," . base64_encode( '' ) ); - 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')); - - add_options_page('Cognito Options', 'Cognito Forms', 'manage_options', 'CognitoOptions', array($this, 'options_page')); + add_menu_page( 'Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array( $this, 'main_page' ), "data:image/svg+xml;base64," . base64_encode( '' ) ); + 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' ) ); } // Entrypoint for Cognito Forms access public function main_page() { include 'templates/main.php'; } - - public function options_page() { - include 'templates/options.php'; - } } new CognitoFormsPlugin; diff --git a/src/assets/cogicon.svg b/src/assets/cogicon.svg new file mode 100644 index 0000000..7fa4932 --- /dev/null +++ b/src/assets/cogicon.svg @@ -0,0 +1 @@ + diff --git a/src/assets/cogicon.tsx b/src/assets/cogicon.tsx deleted file mode 100644 index 3296b59..0000000 --- a/src/assets/cogicon.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import * as React from 'react'; - -export default ; diff --git a/src/components/block-controls.tsx.ignore b/src/components/block-controls.tsx.ignore deleted file mode 100644 index 5144489..0000000 --- a/src/components/block-controls.tsx.ignore +++ /dev/null @@ -1,55 +0,0 @@ -/** - * WordPress dependencies - */ -import * as React from 'react'; -import { __ } from '@wordpress/i18n'; -import { - ToolbarButton, - PanelBody, - ToggleControl, - ToolbarGroup, -} from '@wordpress/components'; -import { BlockControls, InspectorControls } from '@wordpress/block-editor'; -import { edit } from '@wordpress/icons'; - -const EmbedControls = ( { - blockSupportsResponsive, - showEditButton, - themeSupportsResponsive, - allowResponsive, - getResponsiveHelp, - toggleResponsive, - switchBackToURLInput, -} ) => ( - <> - - - { showEditButton && ( - - ) } - - - { themeSupportsResponsive && blockSupportsResponsive && ( - - - - - - ) } - -); - -export default EmbedControls; diff --git a/src/edit.tsx b/src/edit.tsx index ade1e83..b965368 100644 --- a/src/edit.tsx +++ b/src/edit.tsx @@ -10,7 +10,7 @@ import { InspectorControls, } from '@wordpress/block-editor'; -import CogIcon from '@/assets/cogicon'; +import { ReactComponent as CogIcon } from '@/assets/cogicon.svg'; import SelectDialog from '@/components/select-dialog'; import PreviewForm from '@/components/preview-form'; import { BlockAttributes, EmbedMode } from '@/types'; diff --git a/src/index.tsx b/src/index.tsx index 46089e9..7e62005 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,7 +12,7 @@ import { BlockAttributes } from './types'; import Edit from './edit'; import Save from './save'; -import CogIcon from './assets/cogicon'; +import { ReactComponent as CogIcon } from './assets/cogicon.svg'; registerBlockType( 'cognito-forms/cognito-embed', { title: 'Cognito Forms', diff --git a/templates/options.php b/templates/options.php deleted file mode 100755 index d71e710..0000000 --- a/templates/options.php +++ /dev/null @@ -1,29 +0,0 @@ -

Cognito Forms

- -
- - - - - - - - - - - - - - - - - - - -
API Key
Admin API Key
Public API Key
Organization Code
- -

- -

- -
\ No newline at end of file diff --git a/testing/dialog.html b/testing/dialog.html deleted file mode 100644 index f6f1eaa..0000000 --- a/testing/dialog.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - Form Selection - - - - - - - - diff --git a/tinymce/gear.ico b/tinymce/gear.ico deleted file mode 100755 index 316b1b4..0000000 Binary files a/tinymce/gear.ico and /dev/null differ diff --git a/webpack.config.js b/webpack.config.js index d9cf9b1..3267e38 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -14,13 +14,9 @@ module.exports = { }, { test: /\.svg$/, - exclude: /node_modules/, - use: { - loader: 'svg-react-loader', - options: { - jsx: true, - }, - }, + issuer: /\.tsx?$/, + use: [ '@svgr/webpack', 'url-loader' ], + type: 'javascript/auto', }, { test: /\.scss$/,