我的ckeditor没有与我的ckfinder集成

时间:2014-03-11 08:05:23

标签: javascript php ckeditor ckfinder

我遇到了CKEditor和CKFinder的问题,我已经好几次阅读了文档,我不知道我的CKFinder出了什么问题。问题是,如果我单击图像图标上传器,则“浏览服务器”按钮不会显示。

代码有问题吗?

<script type="text/javascript" src="./js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="./ckfinder/ckfinder.js"></script>

<script type="text/javascript">

// This is a check for the CKEditor class. If not defined, the paths must be checked.
if ( typeof CKEDITOR == 'undefined' )
{
    document.write(
        '<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
        'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
        'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
        'this file, changing the wrong paths in the &lt;head&gt; (line 5) and the "BasePath"' +
        'value (line 32).' ) ;
}
else
{
    var editor = CKEDITOR.replace( 'strength',{
    filebrowserBrowseUrl : '/ckfinder/ckfinder.html',
    filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?type=Images',
    filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?type=Flash',
    filebrowserUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
    filebrowserImageUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
    filebrowserFlashUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});


    // Just call CKFinder.setupCKEditor and pass the CKEditor instance as the first argument.
    // The second parameter (optional), is the path for the CKFinder installation (default = "/ckfinder/").
    CKFinder.setupCKEditor( null, './ckfinder/' );

    // It is also possible to pass an object with selected CKFinder properties as a second argument.
    // CKFinder.setupCKEditor( editor, { basePath : '../', skin : 'v1' } ) ;
}

</script>

2 个答案:

答案 0 :(得分:0)

var editor = CKEDITOR.replace( 'editor1' ); CKFinder.setupCKEditor( editor, '../' ) ;

此代码来自Officail演示。

//只需调用CKFinder.setupCKEditor并将CKEditor实例作为第一个参数传递。

//第二个参数(可选)是CKFinder安装的路径(默认=&#34; / ckfinder /&#34;)。

我认为你的代码有错误:CKFinder.setupCKEditor(null,&#39; ./ ckfinder /&#39;);

答案 1 :(得分:0)

可能是您忘记编辑CKfinder config.php页面。

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <body ng-app="myapp" ng-controller="myctrl"> <input type="text" ng-model="name" /> <h2 ng-bind="name"></h2> display object 1 <table> <tr ng-repeat="(key, value) in elementObj1"> <td> {{key}} </td> <td> {{ value }} </td> </tr> </table> display object 2 <table> <tr ng-repeat="(key, value) in elementObj2"> <td> {{key}} </td> <td> {{ value }} </td> </tr> </table> </body>

您需要根据项目位置更改function CheckAuthentication() { return true; }$baseUrl