Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript error fired in case of multiple instances of CKEditor in one page. #105

Closed
isummation opened this issue Aug 18, 2015 · 8 comments

Comments

@isummation
Copy link

Following javascript error occurred when we have multiple CKEditor instances available and spell checker do not work then. If I give delay between two instances generation (around 5 seconds) work fine. Seems like if I create another instance before webspellchecker api called will cause issue.
Uncaught TypeError: SCAYT.prototype.IO.callbackjhhh7b97f is not a function

Here is sample I am trying.

$(function(){
                for(var i=1;i<=2;i++){
                CKEDITOR.replace( 'text' + i  , {
                    height: 180,
                    removePlugins: 'elementspath,resize',
                    scayt_autoStartup: false,
                    on : {
                        configLoaded:function(){
                            this.config.scayt_autoStartup = true;
                        },
                        instanceReady: function() {
                            this.keystrokeHandler.keystrokes = [];
                        }
                    },
                    toolbar: [
                        { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo' ] },
                        { name: 'basicstyles', items: [ 'Bold', 'Italic', '-', 'RemoveFormat' ] },
                        { name: 'tools', items: [ 'Maximize' ] }
                    ],
                    forcePasteAsPlainText : true
                });
            }
        });

HTML Code

<form>
            <textarea name='text1' class="text"></textarea>
            <textarea name="text2" rows="8" cols="40"  class="text"></textarea>
        </form>
@paoloteo
Copy link

paoloteo commented Sep 1, 2015

I'm experiencing the same issue.
Have you been able to work around it?
For me putting a delay is not really an option unfortunately.

@isummation
Copy link
Author

@paoloteo , I create first instance of CKEditor and rest I have created with 3 seconds of delay. This is not perfect solution since if CKEditor do not load within 3 seconds of time then still error will occur. Basically, it occurs due to multiple request send to SCAYT website for license check and this cause issue. If first instance completed license check and then you load all others instances will work fine.

@WebSpellChecker
Copy link
Collaborator

Hello @isummation @paoloteo ,

We`ve checked provided details and would like to ask you to clarify your request in more detailed way. Could you please provide the following information:

  1. SCAYT version
  2. CKEditor version
  3. Browser
  4. Screenshot or video of the issue if it’s possible

Thanks!

@isummation
Copy link
Author

Sorry for delay in response.. You may want to check out
https://jsfiddle.net/y6dfznL0/

@WebSpellChecker
Copy link
Collaborator

The issue has been already fixed in the SCAYT plug-in for CKEditor. To apply the fix the CKEditor should be rebuilt with new SCAYT plug-in. It'll be available in the CKEditor package after further CKEditor's releases.

Please find the link to commit: ac88e3a

@CharlyPoppins
Copy link

Hi,
I've remplace scayt plugin.js from the one of commit ac88e3a.
I still got the problem for CKEditor version 4.5.3. Do I need to update anything ?

@RichardD2
Copy link

The problem still exists in 4.5.4, even after deploying the plugin directly from GitHub.

Never mind - I needed a custom build of CKEditor to exclude the built-in SCAYT plugin.

@WebSpellChecker
Copy link
Collaborator

We confirm the issue in the CKEditor 4.5.3+ default package. The issue is already fixed hasn't include into the package yet. To avoid the issue you could rebuild CKEditor with new SCAYT plugin from master on GitHub. Please find the manual below:

  1. Clone the CKEditor development repository hosted at GitHub:

    git clone https://github.com/ckeditor/ckeditor-dev.git

  2. Switch to the version that you need:

    git checkout tags/your_version

  3. Go to /plugins folder and clone SCAYT:

    git clone https://github.com/WebSpellChecker/ckeditor-plugin-scayt.git scayt

  4. Update config.js and dev/builder/build-config.js files with SCAYT plugin to include it into the CKEditor configuration:

    'scayt,' +
    and
    'scayt: 1'

  5. Build CKEditor:

    sh build.sh

  6. Built CKEditor with updated SCAYT plugin is located in the 'release' folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants