CK editor can work


#1

I download CK editor in website and paste it in public folder. After that I include it in main.html
head>
‘script type=“text/javascript” src="…/ckeditor/ckeditor.js">
`script type=“text/javascript” src="…/ckeditor/adapters/jquery.js">
‘script src="//tinymce.cachefly.net/4.0/tinymce.min.js">
’/head>
I continue use it:
‘textarea name=“content” id=“content” type=“text” value="" placeholder=“Your contents” class=“form-control” rows=“5"
and in js files:”
$(’#content’).ckeditor();

But then I run server it can’t work and the error is jQuery should be loaded before CKEditor jQuery adapter. Please help me!!


#2

Why don’t you use one of the many ckeditor modules available?

 meteor search ckeditor
Matching packages:                            
charcolios:angular-ckeditor     CKEditor directive for AngularJS
lsun:ckeditor                   Latest version CKEditor loaded via CDN
nekoanz:ckeditor                CKEditor wrapper for meteorjs
nekoanz:ckeditor-advance        CKEditor(advance) wrapper for meteorjs
pikiwix:meteor-ckeditor-jquery  Last version of CKEditor with the jQuery Adapter

You can use 'meteor show' to get more information on a specific item.

#3

When I use lsun:ckeditor it can’t work.
In folder server/main.js: I write this code

BrowserPolicy.content.allowOriginForAll('cdn.ckeditor.com');

then I run it show that BrowserPolicy undefine. Before that I’m sure add lsun:ckeditor package.


#4

You dont need BrowserPolicy.content.allowOriginForAll('cdn.ckeditor.com');. Have you tried it without?


#5

yes, I have try it but it show the message that: $(’#content’).ckeditor(); is not a function. Content is a id of textarea


#6

Try this inside your renders:

        $.when(
		$.getScript("/ckeditor/ckeditor.js"),
		$.getScript("/ckeditor/adapters/jquery.js")
	).done(function(){
		$("#messageContent").ckeditor();
		CKEDITOR.config.pasteFromWordRemoveFontStyles = false;

	       // Auto start SCAYT spell checker
		CKEDITOR.config.scayt_autoStartup = true;
		// Min length before SCAYT spell checker starts
		CKEDITOR.config.scayt_minWordLength = 3;
		CKEDITOR.config.scayt_ignoreDomainNames = true;
		CKEDITOR.config.scayt_ignoreAllCapsWords = true;
		CKEDITOR.config.scayt_ignoreWordsWithNumbers = true;
		CKEDITOR.config.scayt_ignoreWordsWithMixedCases = true;
	});