ckeditor

CKeditor populate dialog select with Ajax

时光怂恿深爱的人放手 提交于 2019-12-06 14:27:33
I am trying to populate my CKeditor dialog selectbox with ajax. The following is from my plugin.js file: ... { type : 'select', id : 'style', label : 'Style', setup : CKEDITOR.ajax.post( '.../ckeditor/plugins/simpleLink/ajax.php', JSON.stringify( { foo: 'bar' } ), 'application/json', function( data ) { console.log( data); }), items : [ ['--- Select something ---', 0] ], commit : function( data ) { data.style = this.getValue(); } } ... The ajax output looks like this: ["Basketball","basketball"],["Baseball","baseball"],["Hockey","hockey"] I am really wondering how to get the output INTO the

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

自作多情 提交于 2019-12-06 13:53:46
问题 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

CKEDITOR inline on dynamic created element ( droppable/sortable )

被刻印的时光 ゝ 提交于 2019-12-06 13:01:00
问题 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(

How can I apply a @media print style to a ckeditor instance?

╄→гoц情女王★ 提交于 2019-12-06 12:55:50
I have tried defining a @media style in the page as well as the external file that I am passing ckeditor in the config but neither seems to have any effect when I click the print button in the toolbar. This example (framed) should give you some ideas ( jsFiddle ): CKEDITOR.replace( 'editor', { plugins: 'toolbar,wysiwygarea,sourcearea,print,basicstyles', on: { // When CKEditor DOM is loaded, append stuff to <head>. contentDom: function() { var doc = this.document, head = doc.getHead(); // Via <link> tag. doc.createElement( 'link', { attributes: { rel: 'stylesheet', type: 'text/css', href:

Inserting blank P tags before and after fake element

与世无争的帅哥 提交于 2019-12-06 12:00:34
问题 I'm new to CKEditor , writing my first plugin and i just can't find the answer to this one anywhere. I have a plugin which creates a div element in the source containing just the text !!!!!NEWSTABLE!!!!! . The class attribute is set to newsDiv . On the WYSIWYG editor, I just want it to display a fake placeholder element. This works fine, the problem is that when I switch back to WYSIWYG mode after having been in source mode, it inserts blank paragraph tags above and below the inserted div.

Inline CKEditor with toolbar on generated code

流过昼夜 提交于 2019-12-06 11:55:25
I'm building a backend for a cms at the moment. I've been asked to create a module that generates different blocks to quickly make a page (picture with text below, picture with text to right etc.) That bit is working but for editing the text I'm trying to use ckeditor. Using the follwing code the text is editable but I'm not getting a toolbar : <div id="editable" contenteditable="true"> <h4>{{title}}</h4> {{text}} </div> To try and solve this I tried using the javascript from CKEditor's guide : CKEDITOR.disableAutoInline = true; CKEDITOR.inline( 'editable' ); This code is just creating an

PHPWord read word documents preserving the styles

泄露秘密 提交于 2019-12-06 11:52:51
问题 I have successfully extracted the text content in a word file using phpWord and the following code: <?php require_once 'vendor/autoload.php'; // Read contents $name = 'linux'; $source = "{$name}.docx"; echo date('H:i:s'), " Reading contents from {$source} <hr>"; $phpWord = \PhpOffice\PhpWord\IOFactory::load($source); $sections = $phpWord->getSections(); foreach ($sections as $key => $value) { $sectionElement = $value->getElements(); foreach ($sectionElement as $elementKey => $elementValue) {

Angular 4. Add Ckeditor to component.ts

人走茶凉 提交于 2019-12-06 11:38:44
Need help to add CKEditor to my ANGULAR 4 ("@angular/core": "^4.2.4") component. This will work if i will add <script src="https://cdn.ckeditor.com/4.7.0/standard-all/ckeditor.js"></script> to index.html , but library is very heavy, that is why i try to load source script through component. I tried safe markup trough pipe on all lifecycle hooks. If add safe markup to constructor, then script is loads the source code, but CKEditor library can't see source script in the DOM. Any help is very appreciated. Source code: cke-component.component.component.ts import { Component } from '@angular/core';

CKEditor how to create custom styles drop down?

末鹿安然 提交于 2019-12-06 11:07:34
Is there any way to create custom Styles drop down in Ckeditor? Screenshot: As can be seen in screenshot, I want to be able to create a new dropdown (like Styles dropdown) to contain these yellow and green markers and possibly others that I want. I have seen docs but they only show how to create custom buttons to add to toolbar but I dont know how to add a custom dropdown with styles to toolbar. Any help will be greatly appreciated. Thanks for your help I believe you will need to create a plugin to make this work. An example can be found here: http://ckeditor.com/forums/CKEditor-3.x/Custom

Multiple instances of CKEditor (in Safari) [duplicate]

我的未来我决定 提交于 2019-12-06 11:03:20
This question already has answers here : CKEditor instance already exists (32 answers) Closed 6 years ago . I'm having a problem creating multiple instances of a CKEditor in a JQuery UI dialog. The dialog loads a remote form via AJAX, so the goal is to be able to close and reopen the dialog and have a new instance of the editor. With the default options, when reopening the dialog it gives an error saying that an editor with that name already exists. So I have tried several methods of destroying the editor instance and they all result in the same problem. When the editor is reloaded, the text