Romuald
Romuald

Reputation: 21

Disable primefaces-extension ckeditor

I use Primefaces extension 3.0.0 with Primefaces 5.2 with no problem.

But i try now to upgrade to Primefaces extension 3.2.0 and i've a problem with ckeditor.

I don't want to use the embed Primefaces extension CkEditor, but a custom one that is in my webapp/resources directory. With 3.0.0 all is ok. But with the 3.2.0 version, all the GET for needed resources, like plugins, are intercepted by primefaces extension and my custom ckeditor doesn't start. I don't want to install the primefaces-extension ckeditor. Just use my own.

I've this errors :

GET http://localhost:8080/chainedit3/javax.faces.resource/ckeditor/config.js.xhtml?ln=primefaces-extensions&v=3.2.0 404 (Introuvable) Uncaught TypeError: Cannot set property 'dir' of undefined

The good GET should be : GET http://localhost:8080/chainedit3/resources/ckeditor/config.js

How can i disable this bad resources GET in primefaces-extension or in ckeditor?

<p:panel rendered="#{inputItem.type == 'typeeditor'}" width="75%">  
     <script type="text/javascript" >
            var CKEDITOR_BASEPATH  = '../../resources/ckeditor/';
     </script>
     <script src="../../resources/ckeditor/ckeditor.js" type="text/javascript"/>
     <script type="text/javascript" >
            CKEDITOR.plugins.basePath = '../../resources/ckeditor/plugins/';
     </script>

     <textarea cols="90" rows="20"  id="editor0" name="0editor">
        #{inputItem.inputItemEditor.value}
     </textarea>

     <script type="text/javascript" >
    CKEDITOR.replace( 'editor0',
    {
        uiColor: '#85B5D9',
        width: '100%',
        height: '300px',
        readOnly : #{!associateBean.editMode},
        chaineditCKEditorURL : "../../resources/ckeditor",
        mathJaxLib : 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML',
        <ui:repeat value="#{inputItem.inputItemEditor.parameters}" 
            var="eAttribute" varStatus="statusAttribute">
            #{eAttribute.value} : #{eAttribute.label},
        </ui:repeat>
        allowedContent : true
    });
    </script>
</p:panel>

Upvotes: 2

Views: 711

Answers (1)

Lu&#237;s Soares
Lu&#237;s Soares

Reputation: 6203

I did it the following way:

CKEDITOR_GETURL = function (r) {
   return r.startsWith('http:') ? r : "http//cdn.ckeditor.com/4.5.6/full-all/" + r;
};

Upvotes: 0

Related Questions