ckeditor

How to do CKEditor 5 Image Uploading?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 02:30:20
ClassicEditor .create( editorElement, { ckfinder: { uploadUrl: 'my_server_url' } } ) .then( ... ) .catch( ... ); What should be my server response? I am using Java in the backend. Whatever my response is, it throws a dialog box 'cannot upload file'. Ganesh prajapati Success response : { "uploaded": true, "url": "http://127.0.0.1/uploaded-image.jpeg" } Failure response : { "uploaded": false, "error": { "message": "could not upload this image" } } this is my code for Ckeditor 5 and Phalcon framework.#products_desc point to textarea id. <script> var myEditor; ClassicEditor .create( document

我的网站搭建 (第21天) 评论功能设计

若如初见. 提交于 2019-11-29 21:50:22
一、前言 为什么一直拖着评论功能到现在才开始准备写,确实因为最近较忙,而且评论功能确实也不好写。之前,我上网查了很久,大概的方法总结起来有下面三个。 方法一:第三方社会化评论插件,如友言,多说,畅言,disqus。 方法二:Django评论库 方法三:自己写代码实现 先从第三方社会化评论插件开始,我没有做过多的涉及,而且插件众多,没有必要多花精力,使用专业的配置上就好,如果想使用评论插件,可以看这篇 https://www.cnblogs.com/KevinSong/p/4695899.html 。 至于Django的评论库,可以按照官方文档配置一番即可, https://django-contrib-comments.readthedocs.io/en/latest/ 。 下面开始说重点了,我采用的正好是第三种方法,这种逻辑性比较强,不过难度上确实不低。在这里必须要感谢杨仕航老师的精心讲解,教会了我使用子评论与父评论数据库自关联使用及Ajax加载评论。 二、建立评论模型 一个健全的评论模型,主要应该包括:评论内容、评论时间、评论人、评论对象,其中评论对象包括文章和评论,也就是说除了可以对文章进行评论,还可以对评论进行评论。涉及到对评论进行评论就要区分此时的评论是父评论还是它下面的子评论,这就是数据库自关联的使用。 我将评论模型建立如下,需要解释一下,root字段是某篇文章的源评论

CKEditor instance in a jQuery dialog

冷暖自知 提交于 2019-11-29 20:06:53
问题 I am using jQuery to open a dialog window with a textarea transformed into an instance of CKEditor. I'm using the jQuery adapter provided by the CKEditor team but when the dialog window opens up I cannot interact with the editor (it's created but "null" is written in the content space and I can't click on anything or modify the content). This bug report seems to say that by using a patch provided the issue is fixed but it doesn't seem to be working for me... Here's my code (maybe I did

How to add class or attribute automatically to img tags in CKEditor?

房东的猫 提交于 2019-11-29 19:27:08
问题 I'm using CKEditor version 3.6 I want to automatically add class="newsleft" to any image tag added through the WYSIWYG. I've seen a few posts that mention dataProcessor but have no idea which file this should be added or how to do it. Can someone tell me where I would place the following code? editor.dataProcessor.htmlFilter.addRules( { elements: { img: function( element ) { if ( !element.attributes.alt ) element.attributes.alt = 'An image'; } } } ); 回答1: Basically put it in instanceReady

CKEditor Custom Plugins Button

痴心易碎 提交于 2019-11-29 19:26:08
I've written a custom plugin for CKEditor--successful on all fronts, save one currently: I can't, for the life of me, figure out how to customize the image on the button in the toolbar of the editor. As I'm a new user, you'll have to click through to see attached image; the highlighted square in the top left should have a pretty picture (like most of the other toolbar items). geo I have written a complete tutorial covering every aspect of CKeditor plugin development, including buttons, context menus, dialogs and more. The answer is to set the icon property of the button settings like so:

mysql_result() expects parameter 1 to be resource, boolean given [duplicate]

拜拜、爱过 提交于 2019-11-29 18:30:14
This question already has an answer here: mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or result 32 answers mysql_result() expects parameter 1 to be resource, boolean given error [duplicate] 2 answers mysql_result() expects parameter 1 to be resource, boolean given [duplicate] 3 answers The code below gives me the error: mysql_result() expects parameter 1 to be resource, boolean given I have double checked my database and all table/field names are correct. Are there any other reasons why I would get this error? if(isset($_GET[

How to configure CKEditor in Rails 3.1 (gem + Asset Pipeline)

无人久伴 提交于 2019-11-29 18:24:14
问题 I've successfully configured the ckeditor gem from https://github.com/galetahub/ckeditor on my Rails 3.1 app. My problem now is that I can't figure out how to configure the CKEditor. The files that are used according to the Readme simply don't exists in a Rails 3.1 application with the asset pipeline enabled. 回答1: The answer was easy once i've figured out the thrown error message. /app/assets/javascript/ckeditor CKEDITOR.editorConfig = function( config ) { config.toolbar_MyToolbar = [ { name:

Preserving SCRIPT tags (and more) in CKEditor

你。 提交于 2019-11-29 18:07:22
问题 Is it possible to create a block of code within the CKEditor that will not be touched by the editor itself, and will be maintained in its intended-state until explicitly changed by the user? I've been attempting to input javascript variables (bound in script tags) and a flash movie following, but CKEditor continues to rewrite my pasted code/markup, and in doing so breaking my code. I'm working with the following setup: <script type="text/javascript"> var editor = CKEDITOR.replace("content", {

IE lose custom tag while sethtml

巧了我就是萌 提交于 2019-11-29 17:34:58
This following Code Running in FF & IE TempNode= CKEDITOR.dom.element.createFromHtml("<span></span>"); TempNode.setHtml("<p>test</p>"); But below mentioned code losing user defined Tags In IE (FF Works Fine) TempNode= CKEDITOR.dom.element.createFromHtml("<span></span>"); TempNode.setHtml("<myTag>test</myTag>"); Also same problem with * appendHtml() * My Exact Requirement is : Element.setHtml(AnotherElement.getHtml()); original value in AnotherElement.getHtml() is: <P><mytag id="test_39878" data-cke-expando="undefined">some. text</myTag></P> after Element.sethtml() it containing value is : <P

ckfinder php 2.6.2 settings view, display, sorting doesn't working

半城伤御伤魂 提交于 2019-11-29 16:49:56
the example Functions are not working. someone with the same problem? any suggestion? thanks There was an unfortunate bug in CKFinder, which was left unattended. We do our best to provide reliable software, but even such weird bugs in software sometimes happen. Once we found out that the bug exists in the setCookie function we released CKFinder 2.6.2.1 for anyone willing to take this occasion to update CKFinder 2.x to the latest stable version which is free of this bug. Also, considering that the issue was definitely our fault, we fixed all previous packages of CKFinder for ASP/ASP.NET