Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ckeditor in browserify: home dir error

in package.json:

"browser": {
        "ckeditor": "./public/ckeditor/ckeditor.js",
        "bootstrap": "./public/bootstrap/js/bootstrap.js"
      }

in source browserify coffee-script file:

$  = jQuery = require 'jquery-browserify'
ckeditor = require 'ckeditor'
jqueryCkeditor = require '../ckeditor/adapters/jquery.js'
$('#Info').ckeditor()

Errors in chrome browser console:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/config.js?t=E7KD
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/skins/moono/editor.css?t=E7KD
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/lang/en.js?t=E7KD
Uncaught TypeError: Cannot set property 'dir' of undefined ckeditor.js:219
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/skins/moono/editor.css?t=E7KD

Seemingly ckeditor cannon find its home directory: /ckeditor. How to help it?

Update

working source code:

$ = jQuery = require 'jquery'
window.CKEDITOR_BASEPATH = '/ckeditor/'

ckeditor = require 'ckeditor'
jqueryCkeditor = require '../ckeditor/adapters/jquery.js'
$ ->
    CKEDITOR.replace("Info")
like image 302
Maxim Yefremov Avatar asked Mar 17 '26 10:03

Maxim Yefremov


1 Answers

Maybe you need to specify the path manually - http://docs.ckeditor.com/#!/guide/dev_basepath

window.CKEDITOR_BASEPATH = './public/ckeditor/';
like image 152
Reinmar Avatar answered Mar 19 '26 12:03

Reinmar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!