Dear Netsearch Team,
I hope this message finds you well. My name is Gourav Kumar, and I am writing to raise a complaint regarding a technical issue I am facing with the Cowriter plugin. I am using OPenAI free plan currently. I have been a loyal user of your services, and I believe that bringing this matter to your attention will help improve the overall user experience for others as well.
Issue Description:
I am encountering an error with the Cowriter plugin that is disrupting the functionality of my website. The specific error message I am receiving is as follows:
Uncaught Error: [CKEDITOR.resourceManager.add] The resource name "cowriter" is already registered.
at CKEDITOR.resourceManager.add (ckeditor.js:264:83)
at HTMLDocument. (1403:123:19)
I have thoroughly reviewed my code, and after exhaustive troubleshooting, I am confident that the issue lies within the Cowriter plugin itself rather than any misconfiguration on my part.
Sharing Code:
I have shared my relevant code related to the Cowriter plugin issue. I have also attached a detailed document highlighting the areas where I suspect the problem might be originating. I hope this will assist your technical team in identifying the root cause of the issue.
I appreciate your attention to this matter and thank you in advance for your efforts in resolving this issue. Should you require any further information or assistance, please feel free to contact me via email at [email protected] .
Looking forward to a positive and timely resolution.
Code :
<script src="https://cdn.ckeditor.com/4.20.1/basic/ckeditor.js"></script>
<script src="https://netresearch.github.io/ckeditor-cowriter/plugin.js"></script>
<script>
// Define a variable to track if the plugin is already registered
var cowriterPluginRegistered = false;
document.addEventListener('DOMContentLoaded', function () {
// Replace 'REPLACE_OPENAI_KEY' and 'REPLACE_OPENAI_ORG' with your actual OpenAI credentials
const openaiKey = '';
const openaiOrg = '';
if (!cowriterPluginRegistered) {
CKEDITOR.dialog.add("cowriterDialog", function(editor) {
});
CKEDITOR.plugins.add("cowriter", {
icons: "cowriter",
lang: ["en", "de"],
init: function(editor) {
editor.addCommand("cowriter", new CKEDITOR.dialogCommand("cowriterDialog"));
editor.ui.addButton("Cowriter", {
label: "Co-Writer",
command: "cowriter",
toolbar: "insert",
icon: this.path + "icons/cowriter-logo.png"
});
}
});
// Set the variable to indicate that the plugin is now registered
cowriterPluginRegistered = true;
}
// Initialize CKEditor with the Cowriter Plugin
CKEDITOR.replace('mytextarea', {
extra plugins: 'cowriter',
uiColor: '#bbbbbb',
height: 350,
cowriterSettings: {
apiKey: openaiKey,
orgId: openaiOrg,
},
});
});
</script>
<textarea name="quote" id="mytextarea" rows="3" class="form-control"></textarea>
Sincerely,
Gourav Kumar