Git Product home page Git Product logo

ckeditor-cowriter's Introduction

Deployment

Build Environment

You need to have a Node.js environment with gulp and yarn.

You can use the offical Node.js Docker container image:

docker run -ti --rm -v `pwd`:/work node bash
npm install --global gulp-cli
cd /work

Build

yarn
yarn install
gulp

Deploy

Deployment is done by pushing the updated index.html to github.com:netresearch/netresearch.github.io.git

ckeditor-cowriter's People

Contributors

cybottm avatar dependabot[bot] avatar gitsko avatar olagwin avatar snyk-bot avatar vergissberlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckeditor-cowriter's Issues

Superfluous default value for translation values

Describe the bug
In the plugin.js when a translation label is called, we use something like

label: editor.lang.cowriter.writeAbout || 'About what should I write?',

according to the bug in #1 the second part seems to not work as default when there is no translation of this label, so we can remove it in every place. We register only en and de for the plugin and have language files for them now, so there should not be a problem with other languages.

Complaint Regarding Cowriter Plugin Issue

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

Demo not working

Describe the bug
Demo is throwing errors and not working

To Reproduce
Steps to reproduce the behavior:

  1. Try the demo

Screenshots
image

Desktop (please complete the following information):

  • Win 10
  • Edge

Additional context

plugin.js?t=MAUD:11 
        
       Uncaught TypeError: Cannot read properties of undefined (reading 'tabGeneral')
    at plugin.js?t=MAUD:11:37
    at new CKEDITOR.dialog (ckeditor.js:640:331)
    at a.openDialog (ckeditor.js:689:134)
    at CKEDITOR.command.exec (ckeditor.js:684:445)
    at CKEDITOR.command.exec (ckeditor.js:215:215)
    at a.execCommand (ckeditor.js:289:3)
    at CKEDITOR.tools.extend.click (ckeditor.js:708:247)
    at Object.execute (ckeditor.js:709:359)
    at ckeditor.js:710:234
    at ckeditor.js:33:205

Not working check with regex

Describe the bug
For the field range there seems to be a validation check which should check (according to the error-label) if the number is between 1 and 1000. But the default is 4000 and I can change this value as I want. Something is wrong here.

The task is to find out what the purpose of this number was, what wrong is and to fix it.

validate: function () {return CKEDITOR.dialog.validate.regex(/^[1-9][0-9]{0,2}$/, editor.lang.cowriter.errorNotBetween)},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.