Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PrimeFaces Extensions编辑器:无法访问自定义配置_Javascript_Html_Ckeditor_Xhtml_Primefaces Extensions - Fatal编程技术网

Javascript PrimeFaces Extensions编辑器:无法访问自定义配置

Javascript PrimeFaces Extensions编辑器:无法访问自定义配置,javascript,html,ckeditor,xhtml,primefaces-extensions,Javascript,Html,Ckeditor,Xhtml,Primefaces Extensions,我需要我的pe:ckEditor来加载自定义配置,但我在这件事上已经失败了一段时间,我欢迎任何关于如何使其工作的建议 (我需要它的功能,因为我有这个问题:,这可能会解决这个或类似的东西) 自定义配置文件与使用pe:ckEditor的XHTML文件位于同一文件夹中 自定义配置内容: CKEDITOR.editorConfig = function( config ) { config.uiColor = '#AADC6E'; config.toolbar = [ {

我需要我的
pe:ckEditor
来加载自定义配置,但我在这件事上已经失败了一段时间,我欢迎任何关于如何使其工作的建议

(我需要它的功能,因为我有这个问题:,这可能会解决这个或类似的东西)

自定义配置文件与使用
pe:ckEditor
的XHTML文件位于同一文件夹中

自定义配置内容:

CKEDITOR.editorConfig = function( config ) {
    config.uiColor = '#AADC6E';
    config.toolbar = [
        { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
        { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] },
        '/',
        { name: 'links', items: [ 'Link', 'Unlink' ] },
        { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
        '/',
        { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
        { name: 'insert', items: [ 'Table', 'HorizontalRule',  'SpecialChar'] },
        { name: 'tools', items: [ 'ShowBlocks' ] },
        { name: 'document', items: [ 'Source' ] },
    ];
};
我试过:

<h:outputScript name="ckEditor.js" library="js"></h:outputScript>
<pe:ckEditor id="editor" customConfig="ckEditor.js"></pe:ckEditor>
<script type="text/javascript">
    CKEDITOR.config.customConfig = 'ckEditor.js'; 
    CKEDITOR.replace('editor'); 
 </script>

CKEDITOR.config.customConfig='CKEDITOR.js';
CKEDITOR.replace('editor');
以及:


以及:


CKEDITOR.config.customConfig='CKEDITOR.js';
CKEDITOR.replace('editor');
以及:


以及:


和(文件的完整路径是project/WebContent/pages/inc/ckEditor.js和project/WebContent/pages/inc/emailEditor.xhtml):


以及:


和(因为):



当我将自定义配置文件中的详细信息输入到
下面的
中时,它起到了作用,但不幸的是,对于我的情况,这不是一个解决方案,因为我在许多页面上使用编辑器,并且需要将其设置仅存储在一个位置

另外,当我在谷歌上搜索时,我发现一些建议,建议我应该将自定义配置的方向放在默认配置文件中,但我在我的项目中没有找到任何默认配置文件,因此很遗憾,这不是我的选项

我在谷歌上搜索过,在PrimeFaces扩展页面和CKEditor页面上阅读过文档,在PrimeFaces论坛、CKEditor论坛和这里阅读过类似的问题,但还没有任何效果


PrimeFaces扩展-7.0.2版

PrimeFaces-Version7.0.7

pe:ckEditor
上的
customConfig
属性是一个URL。
所以只要把你的JS放在一个可以通过浏览器访问的地方。

如果其可访问性(例如)为
localhost:8080/myfolder/ckeditor.js
,则当您将
customConfig
设置为“#{request.contextPath}myfolder/ckeditor.js”

时,它应该可以正常工作,但当我将
customConfig
设置为
{request.contextPath}myPath/theCustomConfigFile.js
。我试图将
customConfig
设置为完整的URL,通过该URL,我可以通过浏览器
http://localhost:8093/myPath/theCustomConfigFile.js.xhtml?ln=js
成功了!非常感谢你的帮助,@tandraschko!
<h:outputScript name="ckEditor.js" library="js"></h:outputScript>
<pe:ckEditor id="editor" customConfig="ckEditor.js"></pe:ckEditor>
<pe:ckEditor id="editor"></pe:ckEditor>
    <script type="text/javascript">
        CKEDITOR.config.customConfig = 'ckEditor.js'; 
        CKEDITOR.replace('editor'); 
     </script>
<pe:ckEditor id="editor" customConfig="ckEditor.js"></pe:ckEditor>
<pe:ckEditor id="editor" customConfig="./ckEditor.js"></pe:ckEditor>
<pe:ckEditor id="editor" customConfig="project/WebContent/pages/inc/ckEditor.js"></pe:ckEditor>
<pe:ckEditor id="editor" customConfig="/project/WebContent/pages/inc/ckEditor.js"></pe:ckEditor>
<pe:ckEditor id="editor" customConfig="#{request.contextPath}/ckEditor.js"></pe:ckEditor>