plugin-cmf
v0.1.4
Published
Plugin de avaliação de vagas da Cadê meu Feedback
Downloads
1,532
Readme
CMF Plugin Installation and Usage Guide
Overview
The CMF Plugin allows you to integrate a feedback form into your website, enabling users to provide feedback on job descriptions. This guide will walk you through the installation and configuration process.
Installation
Step 1: Include the Plugin Script
Add the following script to your HTML file to include the CMF plugin:
<script src="path/to/cade-plugin.js"></script>
Step 2: Add Meta Tags
Include the following meta tags in the <head>
section of your HTML to configure the plugin:
<meta name="cmf-client-secret" content="your-client-secret">
<meta name="cmf-base-url" content="your-base-url">
<meta name="cmf-foreign-id" content="your-foreign-id">
<meta name="cmf-role-title" content="your-role-title">
Step 3: Add Plugin Container
Add a container element where the plugin will be rendered:
<div id="plugin_feedback"></div>
Step 4: Initialize the Plugin
Initialize the plugin by calling the start
method. Parameters are optional as the plugin will also get values from the meta tags:
<script>
CadePlugin.start();
</script>
If you prefer, you can also pass the parameters directly:
<script>
CadePlugin.start('your-client-secret', 'your-base-url', 'your-foreign-id');
</script>
Usage
Meta Tags
- cmf-client-secret: The client secret for authentication.
- cmf-base-url: The base URL where the plugin is enabled.
- cmf-foreign-id: An identifier for the foreign entity (e.g., job posting).
- cmf-role-title: The title of the role/job posting.
Methods
The CMF Plugin class provides several methods to manage the feedback form and handle user interactions.
- start(clientSecret, baseUrl, foreignId): Initializes the plugin with the provided parameters. If parameters are not provided, it will use the values from the meta tags.
- toggle(): Toggles the visibility of the plugin form.
Example Usage
Here is a complete example of how to set up and use the CMF Plugin:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Feedback</title>
<meta name="cmf-client-secret" content="your-client-secret">
<meta name="cmf-base-url" content="your-base-url">
<meta name="cmf-foreign-id" content="your-foreign-id">
<meta name="cmf-role-title" content="your-role-title">
<link rel="stylesheet" href="path/to/cade-plugin.css">
<script src="path/to/cade-plugin.js"></script>
</head>
<body>
<div id="plugin_feedback"></div>
<script> CadePlugin.start(); </script>
</body>
</html>