Giter Club home page Giter Club logo

ueditor's Introduction

Get Started

鉴于目前 ISSUE 较多而维护时间较少,且在进行后续的版本更新,目前暂时关闭 ISSUE,若社区有人跟进,欢迎和我们联系。重复的问题,请参阅常见问题的 FAQ Wiki

重要安全通告:

UEditor 所提供的所有后端代码都仅为 DEMO 作用,切不可直接使用到生产环境中,目前已知 php 的代码会存在 ssrf 的安全漏洞。修复方式:使用最新的 Uploader.class code .

ueditor富文本编辑器介绍

UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。

1 入门部署和体验

1.1 下载编辑器

  1. git clone 仓库
  2. npm install 安装依赖(如果没有安装 grunt , 请先在全局安装 grunt)
  3. 在终端执行 grunt default

1.2 创建demo文件

解压下载的包,在解压后的目录创建demo.html文件,填入下面的html代码

<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>ueditor demo</title>
</head>
<body>
	<!-- 加载编辑器的容器 -->
	<script id="container" name="content" type="text/plain">这里写你的初始化内容</script>
	<!-- 配置文件 -->
	<script type="text/javascript" src="ueditor.config.js"></script>
	<!-- 编辑器源码文件 -->
	<script type="text/javascript" src="ueditor.all.js"></script>
	<!-- 实例化编辑器 -->
	<script type="text/javascript">
	    var ue = UE.getEditor('container');
	</script>
</body>
</html>

1.3 在浏览器打开demo.html

如果看到了下面这样的编辑器,恭喜你,初次部署成功!

部署成功

1.4 传入自定义的参数

编辑器有很多可自定义的参数项,在实例化的时候可以传入给编辑器:

var ue = UE.getEditor('container', {
    autoHeight: false
});

配置项也可以通过ueditor.config.js文件修改,具体的配置方法请看[前端配置项说明](http://fex.baidu.com/ueditor/#start-config1.4 前端配置项说明.md)

1.5 设置和读取编辑器的内容

通getContent和setContent方法可以设置和读取编辑器的内容

var ue = UE.getEditor();
//对编辑器的操作最好在编辑器ready之后再做
ue.ready(function(){
    //设置编辑器的内容
    ue.setContent('hello');
    //获取html内容,返回: <p>hello</p>
    var html = ue.getContent();
    //获取纯文本内容,返回: hello
    var txt = ue.getContentTxt();
});

ueditor的更多API请看API 文档

2 详细文档

ueditor 官网:http://ueditor.baidu.com

ueditor API 文档:http://ueditor.baidu.com/doc

ueditor github 地址:http://github.com/fex-team/ueditor

ueditor 第三方插件贡献 wiki : 第三方插件贡献规范

ueditor 贡献代码规范(javascript): javascript规范

3 第三方贡献

ueditor for nodejs 参考https://github.com/netpi/ueditor

4 联系我们

email:[email protected]

issue:github issue

ueditor's People

Contributors

51mono avatar akikonata avatar badsummer avatar birdol avatar campaign avatar carsonxu avatar csbde avatar dafrok avatar dail avatar eecjimmy avatar hancong03 avatar houyhea avatar kaisy00 avatar leechael avatar minikey avatar netpi avatar nwind avatar phinome avatar regrex avatar risent avatar sjshare avatar strugglebird avatar tangtanglove avatar taofish avatar taoqili avatar techird avatar worry127722 avatar yancend avatar zhuwenxuan avatar zxeoc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.