ckeditor

How to load TypeKit fonts into a CKEditor instance using jQuery

妖精的绣舞 提交于 2019-12-04 20:49:12
I'm trying to load TypeKit fonts into an instance of the CKEditor via jQuery. Here's my code: $('.ck-blog textarea').ckeditor(function () { CKEDITOR.scriptLoader.load( "http://use.typekit.com/zku8fnp.js", function (success) { Typekit.load(); alert(success); }, null, true); }, { resize_enabled: false, skin: 'kama', height: '500px', toolbarCanCollapse: false, toolbar_Full: toolbar, forcePasteAsPlainText: true, autoGrow_onStartup: true, templates_replaceContent: false, extraPlugins: 'autogrow,wordcount', removePlugins: 'resize', contentsCss: '/areas/admin/content/css/ckeditor-blog.css', templates

CKEDITOR inline on dynamic created element ( droppable/sortable )

旧街凉风 提交于 2019-12-04 20:24:58
Let's take this jquery example: http://jqueryui.com/sortable/#connect-lists When i'm moving elements from right list to left list i want to have an inline CKEditor for the text of the dropped element that is cloned. Here is what i tried: $("#maincontent").droppable({ drop: function(event, ui) { var blockId = ui.draggable.attr('block-id'); ui.draggable.load(site_url+'/blocks/'+blockId+'.html'); ui.draggable.attr('contenteditable','true'); ui.draggable.css('width','100%'); ui.draggable.css('height','auto'); CKEDITOR.inline( ui.draggable.get( 0 ) ); }, over: function(event, ui) {} }); My problem

CKEditor: HowTo destroy instance on blur?

老子叫甜甜 提交于 2019-12-04 19:56:59
i have a single html page with mulitple div elements on it. Each time a user clicks on on a div , it is replaced with an CKEditor on the fly: $('.editable').click(function() { editor = CKEDITOR.replace(this); }); Now, if the CKEditor instance loses its focus (blur event), i need to post the content to a separate script via ajax (if something changed) and destroy this instance: $('.editable').click(function() { editor = CKEDITOR.replace(this); editor.on('blur', function(e) { if (e.editor.checkDirty()) // get data with e.editor.getData() and do some ajax magic e.editor.destroy(); }); }); But

Dummy(Duplicate) Node in Ckeditor [IE]

北城以北 提交于 2019-12-04 19:21:43
in CKEDITOR Document I have a node named User_Image <User_Image><sometags><sometags>sometext<sometags>sometext</sometags></sometags></sometags></User_Image> User_Image node i stored in Variable Uimage var Duimage=CKEDITOR.dom.element.createFromHtml(Uimage.getOuterHtml()); now just i created (dummy) duplicate node but this code supported me in all browsers other than IE. in IE Missing Customtags. the all tags are dynamic. then i try with following : var Duimage=ediInstance.document.createElement("User_Image"); Uimage.appendTo(Duimage); but in this code if i changed in Duimage it also affect in

How to prevent CKEditor replacing spaces with  ?

和自甴很熟 提交于 2019-12-04 19:07:28
问题 I'm facing an issue with CKEditor 4, I need to have an output without any html entity so I added config.entities = false; in my config, but some   appear when an inline tag is inserted: the space before is replaced with   text is pasted: every space is replaced with   even with config.forcePasteAsPlainText = true; You can check that on any demo by typing test test eg. Do you know how I can prevent this behaviour? Thanks! 回答1: These entities: // Base HTML entities. var htmlbase = 'nbsp,gt,lt

Ckeditor plugin : insert fake element add unwilling <p> tags before and after

南楼画角 提交于 2019-12-04 18:34:57
I'm new to CKEditor. I'm trying to build a plugin that inserts a new div element which contains some custom content. The user have to see in the editor only a fake element that represent the true generated html content, created through createFakeElement() function. Here is the onOk() function of the plugin : onOk: function () { var dialog = this, data = {}, container = editor.document.createElement('div'); this.commitContent(data); container.addClass('insert').setHtml(data.htmldata); var fakeElement = editor.createFakeElement(container, 'insert', 't_insert', false); editor.insertElement

uncaught exception: [CKEDITOR.editor] The instance already exists

限于喜欢 提交于 2019-12-04 17:48:36
问题 I've included the CKEditor on my site. Everything works even though I get this JS error: uncaught exception: [CKEDITOR.editor] The instance "simple_editor" already exists. The code below is contained inside a PHP file which I include where ever I want the editor. I only have one instance of the editor per page. <textarea class='ckeditor' id='simple_editor' name='simple_editor'>".$page_content."</textarea>"; <script type="text/javascript"> CKEDITOR.replace( 'simple_editor', { height: '110px',

How do I specify the interface language for CKEditor (jquery version)?

爱⌒轻易说出口 提交于 2019-12-04 17:47:53
问题 My code atm is this simple: $(document).ready(function(){ $('textarea').ckeditor(); }); It works flawlessly, I just need to add one more thing: I need to specify the interface language (localisation). I tried reading the CKEditor help site, but it isn't very helpful. Can anyone tell me where and how do I add any code to specify the language? 回答1: Try this: $('textarea').ckeditor({language: 'de'}); 回答2: Untested, but check this out: http://www.sayopenweb.com/ckeditor-faq/ Q. How do i set

How to dynamically switch text direction in CKEditor

别来无恙 提交于 2019-12-04 17:28:37
On my current project, users can type text in English and Hebrew languages. Would be great to define direction automatically, according to the current text. For example, if the text contains Hebrew symbols, the direction should be RTL. But if the text doesn't contain Hebrew, then the direction is LTR. Text can be changed at any moment, and I think that the best solution is to switch the direction dynamically like it works in the Google Translate service. I didn't find already done solution and I want to propose my own. It works pretty simply. Each time, when text has been changed, I'm checking

How to apply multiple styles to one element in ckeditor?

回眸只為那壹抹淺笑 提交于 2019-12-04 17:26:02
I want to integrate some bootstrap classes to my ckeditor profile: { name : 'Button Large' , element : 'a', attributes : { 'class' : 'btn-lg' } }, { name : 'Button Primary' , element : 'a', attributes : { 'class' : 'btn-primary' } }, but the problem is those styles cant be combined. If I want a button which is btn-primary AND btn-lg I would have to create a third style: { name : 'Button Large Primary' , element : 'a', attributes : { 'class' : 'btn-lg btn-primary' } }, which obviously is quite redundant for many buttons and not necessary. So how can you do this? Using CKeditor 4.4.3 Antares42