ckeditor

JSP-一个ckeditor实现

匿名 (未验证) 提交于 2019-12-02 23:42:01
版权声明:【北京Java青年】:456588754 https://blog.csdn.net/Amen_Wu/article/details/53457502 第一步:向WebContent下添加ckeditor插件文件夹 第二步: //js的src属性填写ckeditor文件夹下的ckeditor.js地址 <head> <script type="text/javascript" src="../ckeditor/ckeditor.js"></script> </head> //将textarea的class改为ckeditor <body> <textarea class="ckeditor" id="ncontent" name="ncontent" cols="70" rows="10"></textarea> </body> 第三步: 想要控制编辑器尺寸的话,可以在textarea外边添加input标签,设置input的style内的尺寸属性即可。 文章来源: https://blog.csdn.net/Amen_Wu/article/details/53457502

python 后台 安装 富文本编辑

匿名 (未验证) 提交于 2019-12-02 22:56:40
前言 safe 可以把后台的标签转换 , 安装编辑器 你的项目:我的是mysite >>pip install django-ckeditor 他会自动帮你安装一个django-js-asset 这个js解释器 ,哈 然后在 注册应用‘ckeditor‘ mysite\setting.py 修改 INSTALLED_APPS = [ ‘ django.contrib.admin ‘ , ‘ django.contrib.auth ‘ , ‘ django.contrib.contenttypes ‘ , ‘ django.contrib.sessions ‘ , ‘ django.contrib.messages ‘ , ‘ django.contrib.staticfiles ‘ , # 引入本地相对路径 ‘ blog ‘ , ‘ ckeditor ‘ , # 添加这个 ] 配置model 在blog \models.py下的修改 把字段改成 RichTextField from django.db import models from django.contrib.auth.models import User from ckeditor.fields import RichTextField # 引入库 # Create your models here. class

if(str(saved_path).split(&#039;.&#039;)[1].lower() != &#039;gif&#039;): IndexError: list index out of range ERROR basehttp 124 \&quot;POST /ckeditor/upload/ HTTP/1.1\&quot; 500 96995

匿名 (未验证) 提交于 2019-12-02 22:56:40
用python写Django项目的时候 用了CKEditor富文本编辑器,编辑文本,上传图片的时候,当我点击上传到服务器,一开始网页 页面弹出 '不正确的服务器响应',我上网查,看到说版本的原因,我又去降pip install django-ckeditor==4.5.3 然后又出来其他问题 TypeError: build attrs() got an unexpected keyword argument 'name' TypeError:build attrs()得到了一个意想不到的关键字参数“名称”,还是版本不行 ,我又升到最新,重新开始检查 '不正确的服务器响应'的问题,最后发现原来我们将通过Django上传的图片保存到了FastDFS中,而保存在FastDFS中的文件名没有后缀名,ckeditor在处理上传后的文件名按照有后缀名来处理,所以会出现bug错误, 修正方法 找到虚拟环境目录中的ckeditor_uploader/views.py文件,如 ~/.virtualenvs/meiduo/lib/python3.5/site-packages/ckeditor_uploader/views.py 将第95行代码修改如下: 文章来源: if(str(saved_path).split('.')[1].lower() != 'gif'): IndexError:

Django项目中添加富文本编辑器django-ckeditor

匿名 (未验证) 提交于 2019-12-02 22:51:30
django-ckeditor库的使用步骤:   1.在命令行下安装django-ckeditor这个库;   2.安装成功后,配置Django项目中的settings.py文件:     2.1:将ckeditor和ckeditor_uploader注册到INSTALLED_APPS中:     2.2:配置富文本编辑的存储路径,以及ckeditor的配置如下图:    3.在模型(models.py文件)中引入富文本编辑器,并且在相应的字段内使用   3.1:引入django-ckeditor富文本编辑器:     from django.contrib.auth.models import AbstractUser   3.2:在模型的相应字段中使用:      4.本项目中manage.py文件下重新执行迁移,生成迁移文件     python manage.py makemigrations      python manage.py migrate 5.启动Django项目并且进入刚在所改模型的字段页面中,可以看到有富文本编辑器生成: 说明:本文只是本人学习笔记,仅供参考;之前网上找过很多富文本编辑器的配置方法, 最后发现用Django框架中的ckeditor也能更快很好的实现富文本编辑器的功能,最后就 选择了django-ckeditor库 文章来源: https:/

How to integrate CKEditor into Asp.net MVC

匆匆过客 提交于 2019-12-02 22:16:06
Saw this post at CodeProject for FCKEditor. Can someone explain what about the new version? It's pretty easy to do actually. First download the latest code from the website and extract it to a directory in your project (I choose /Scripts/ckeditor). Then in your view, use the same code as in the "complete sample" in this link and it should work. Basically, the important steps are: Make sure you include the ckeditor.js file in the head from your view or in your master page, however you want to do it. This needs to be the exact location within your project (I would use the find file dialog that

ckeditor + ckfinder + oss存储

匿名 (未验证) 提交于 2019-12-02 22:11:45
我这里整合后直接使用js代码 CKEDITOR.replace('content', { filebrowserBrowseUrl: '__SYSTEM__/ckfinder/ckfinder.html', filebrowserImageBrowseUrl: '__SYSTEM__/ckfinder/ckfinder.html?type=Images', filebrowserFlashBrowseUrl: '__SYSTEM__/ckfinder/ckfinder.html?type=Flash', filebrowserUploadUrl: "{:U('Public/uploadCkfinder')}",//默认插件自带的上传地址__SYSTEM__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', filebrowserImageUploadUrl: "{:U('Public/uploadCkfinder')}",//默认插件自带的上传地址'__SYSTEM__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images', filebrowserFlashUploadUrl: "{:U(

Ckeditor 4 复制粘贴截图并转化base64格式保存至数据库

匿名 (未验证) 提交于 2019-12-02 22:06:11
虽然Ckeditor 中自带的有上传图片和文件的功能,但是有时候我们并不需要把图片保存至服务器的文件夹中. 反而是截图复制粘贴,把图片转化为base64格式保存在数据库中即可满足要求. 1.首先下载安装包(选择最右边的,完整的安装包) https://ckeditor.com/ckeditor-4/download/#ckeditor4 2.把下载的安装包引入项目中,并在页面中引用js 3.自定义配置文件,在文件夹中找到config.js.并配置自己所需要的 4.页面使用一个textarea标签.并给该标签赋值id属性. 然后初始化控件,重写控件剪切版的复制粘贴方法.此时已配置完成.(此处注意,一定要指定重写的控件的ckname.否则此处的重写事件this指的将是整个页面的所有的Ckeditor. 这样重写事件将会出错.我就在此处犯了这个错误折腾了一个多小时....) 代码 CKEDITOR.replace('description'); SetCKEditor("description", _self.model.Description); function SetCKEditor(ckname, data) {   CKEDITOR.instances[ckname].on('instanceReady', function (event) {   var _data =

在html页面写一个富文本框

匿名 (未验证) 提交于 2019-12-02 20:34:42
第一步 :获取到富文本框的这个文件,链接地址: https://ckeditor.com/cke4/builder (1)里面有几个选择,看你需求自己进行选择,然后鼠标一直拖到最下面,开始下载包 注意: 博主在第一次的时候发现富文本框没有颜色,忘了选择下面这个,也就是第一个 第二步: 把ckeditor这个包放到WebRoot下面(位置是按博主第一次做的写的) 第三步 这个name是一定要的,目的就是第四步 对了把包放到WebRooT下,我们一定要引入啊,在你的html页面还得加一句话: <script src="${contextPath}/ckeditor/ckeditor.js"></script>具体的路径看你自身情况 第四步 :<script type="text/javascript"> 这句话相当的重要,没有这句话,只会显示文本域,没有富文本框的效果 第五步 :做这些不就得获取到文本域里面的内容;加上这句: 注意 :这个scpg是博主的id,也就是你文本域的id 到此就全部做完了,主要就是得到包,加上三两句话,记得引入你包的路径,然后就全部结束。 文章来源: 在html页面写一个富文本框

How to fill ckeditor from capybara with webkit or selenium driver

一曲冷凌霜 提交于 2019-12-02 20:33:39
How can I fill a CKEditor area within Capybara, assuming I'm using a javascript capable driver like capybara-webkit or selenium? Inspired from what I found here , I came up with the solution of using javascript to both set the data on the hidden textarea and on the CKEditor object. Neither seemed sufficient, depending on the circumstances. def fill_in_ckeditor(locator, opts) content = opts.fetch(:with).to_json # convert to a safe javascript string page.execute_script <<-SCRIPT CKEDITOR.instances['#{locator}'].setData(#{content}); $('textarea##{locator}').text(#{content}); SCRIPT end # Example:

How to remove buttons from CKeditor 4

这一生的挚爱 提交于 2019-12-02 20:05:09
The question is in the title : How to remove buttons from CKeditor 4 . Documentation does not answer it clearly Based on reinmar answer and tested here is the better answer. Add this in your ckeditor config.js : config.removeButtons = 'Underline,JustifyCenter'; For reference you can find the complete list of CKeditor 4 buttons there : http://ckeditor.com/comment/123266#comment-123266 I finaly found how, but I don't like this way as instead of removing what you don't want, you define which buttons you want (and simply don't put what you don't want). When you call CKeditor.replace you can define