Integrate CKEditor into extension

436 views
Skip to first unread message

jbasdf

unread,
Aug 8, 2010, 1:54:35 AM8/8/10
to Chromium-extensions
I noticed a previous post where Gildas mentioned he had implemented
the CKEditor in a Chrome Extension. I'm curious about how to get it
running.

If I do something like this I get 'CKEDITOR is undefined':
jQuery('head').append('<script type="text/javascript" src="' +
chrome.extension.getURL('plugins/ckeditor/ckeditor.js') + "></
script>');
In that instance I've checked to make sure that the src tag resolves
to the correct file.

I've tried this in background.html but then I get 'Uncaught TypeError:
Cannot read property 'options' of undefined'
function add_ck_editor_scripts() {
chrome.tabs.executeScript(null, {file: 'plugins/ckeditor/
ckeditor.js'});
}

I've tracked that one to a bit of code in ckeditor.js on line 45. The
code is packed so the best I get is that the problem is with
"l.lang.contextmenu.options". I'm guessing contextmenu is the
undefined object. I can comment that out but then it just gives the
same error later on only with 'title'. From my trace below I'm
guessing it's because it isn't able to successfully load en.js.

Any tips or pointers for implementing CKEditor? I've managed to get
totally stuck.

Thanks,
Justin


Here's a trace of the files loading and the errors they produce.

plugins/ckeditor/config.js
config.js:6Uncaught ReferenceError: CKEDITOR is not defined <--- For
some reason CKEDITOR is not defined
plugins/ckeditor/config.js
plugins/ckeditor/config.js
plugins/ckeditor/skins/kama/
plugins/ckeditor/chrome-extension://fgpniphjpcipijanbogfhpdhmfopcmik/
plugins/ckeditor/skins/kama/editor.css
plugins/ckeditor/lang/en.js
en.js:6Uncaught ReferenceError: CKEDITOR is not defined <--- or some
reason CKEDITOR is not defined
plugins/ckeditor/plugins/about/
plugins/ckeditor/plugins/a11yhelp/
plugins/ckeditor/plugins/basicstyles/
plugins/ckeditor/plugins/blockquote/
plugins/ckeditor/plugins/button/
plugins/ckeditor/plugins/clipboard/
plugins/ckeditor/plugins/colorbutton/
plugins/ckeditor/plugins/colordialog/
plugins/ckeditor/plugins/contextmenu/
plugins/ckeditor/plugins/div/
plugins/ckeditor/plugins/elementspath/
plugins/ckeditor/plugins/enterkey/
plugins/ckeditor/plugins/entities/
plugins/ckeditor/plugins/filebrowser/
plugins/ckeditor/plugins/find/
plugins/ckeditor/plugins/flash/
plugins/ckeditor/plugins/font/
plugins/ckeditor/plugins/format/
plugins/ckeditor/plugins/forms/
plugins/ckeditor/plugins/horizontalrule/
plugins/ckeditor/plugins/htmldataprocessor/
plugins/ckeditor/plugins/image/
plugins/ckeditor/plugins/indent/
plugins/ckeditor/plugins/justify/
plugins/ckeditor/plugins/keystrokes/
plugins/ckeditor/plugins/link/
plugins/ckeditor/plugins/list/
plugins/ckeditor/plugins/liststyle/
plugins/ckeditor/plugins/maximize/
plugins/ckeditor/plugins/newpage/
plugins/ckeditor/plugins/pagebreak/
plugins/ckeditor/plugins/pastefromword/
plugins/ckeditor/plugins/pastetext/
plugins/ckeditor/plugins/popup/
plugins/ckeditor/plugins/preview/
plugins/ckeditor/plugins/print/
plugins/ckeditor/plugins/removeformat/
plugins/ckeditor/plugins/resize/
plugins/ckeditor/plugins/save/
plugins/ckeditor/plugins/scayt/
plugins/ckeditor/plugins/smiley/
plugins/ckeditor/plugins/showblocks/
plugins/ckeditor/plugins/showborders/
plugins/ckeditor/plugins/sourcearea/
plugins/ckeditor/plugins/stylescombo/
plugins/ckeditor/plugins/table/
plugins/ckeditor/plugins/tabletools/
plugins/ckeditor/plugins/specialchar/
plugins/ckeditor/plugins/tab/
plugins/ckeditor/plugins/templates/
plugins/ckeditor/plugins/toolbar/
plugins/ckeditor/plugins/undo/
plugins/ckeditor/plugins/wysiwygarea/
plugins/ckeditor/plugins/wsc/
plugins/ckeditor/plugins/codemirrorarea/
plugins/ckeditor/plugins/dialog/
plugins/ckeditor/plugins/styles/
plugins/ckeditor/plugins/domiterator/
plugins/ckeditor/plugins/panelbutton/
plugins/ckeditor/plugins/floatpanel/
plugins/ckeditor/plugins/menu/
plugins/ckeditor/plugins/editingblock/
plugins/ckeditor/plugins/selection/
plugins/ckeditor/plugins/fakeobjects/
plugins/ckeditor/plugins/richcombo/
plugins/ckeditor/plugins/htmlwriter/
plugins/ckeditor/plugins/menubutton/
plugins/ckeditor/plugins/dialogui/
plugins/ckeditor/plugins/panel/
plugins/ckeditor/plugins/listblock/
Uncaught TypeError: Cannot read property 'options' of undefined
Reply all
Reply to author
Forward
0 new messages