期货大赛项目|八,ueditor的应用
百度开发的富文本编辑器还是很不错的,可以已经不维护了
下载ueditor1_4_3_3-utf8-net放到项目中
找到net文件夹下config.json
修改以下两行
"imageUrlPrefix": "/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/net/", /* 图片访问路径前缀 */
"imagePathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
imageUrlPrefix一定要找到自己放到的目录的net文件夹下
imagePathFormat就随意了 引入JS和CSS
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.config.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.all.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/lang/zh-cn/zh-cn.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.parse.js"></script>
html
<script id="container" name="content" type="text/plain">
</script>
完整页面
@using System.Web.Optimization
@{
ViewBag.Title = "Index";
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section css{
@Styles.Render("~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/themes/ueditorCss") }
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>内容编辑</h3>
</div>
</div>
<div class="clearfix"></div> <div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>大赛规则<small>编辑的内容将显示在前端的大赛规则中</small></h2> <div class="clearfix"></div>
</div>
<div class="x_content">
@* <div id="editor"> *@
@* </div> *@
<script id="container" name="content" type="text/plain">
</script>
<div class="ln_solid"></div>
<div class="form-group">
<button id="save" type="button" class="btn btn-success">保存</button>
</div>
</div>
</div>
</div> </div>
</div>
<!-- /page content -->
@section scripts{
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.config.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.all.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/lang/zh-cn/zh-cn.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.parse.js"></script>
<script src="~/Scripts/Admin/GameIntro/index.js"></script>
}
ue初始化
var ue = UE.getEditor("container", {
initialFrameHeight: 300
});
获取ue值
var content;
ue.ready(function () {
content = ue.getContent();
});
设置ue值
ue.ready(function() {
ue.setContent(data.data);
});
期货大赛项目|八,ueditor的应用的更多相关文章
- 期货大赛项目|四,MVC的数据验证
上图先看下效果 样式先不说,先了解下数据验证是怎么实现的 一 必须是强类型的视图 二 这些显示提示的话语,都在强类型的实体中 三 必须使用Html.BeginForm或者Html.AjaxBeginF ...
- 期货大赛项目|十,MVC对js和css的压缩
在Global.asax中添加两行代码 //默认在调试期间,不会启用js和css的压缩 //下面的语句确保了在调试期间也压缩css和js BundleTable.EnableOptimizations ...
- 期货大赛项目|六,iCheck漂亮的复选框
废话不多说,直接上图 对,还是上篇文章的图,这次我们不研究datatables,而是看这个复选框,比平常的复选框漂亮太多 看看我是如何实现的吧 插件叫iCheck 用法也简单 引入js和css $(& ...
- 期货大赛项目|九,fileinput插件的应用
引入JS和CSS bundles.Add(new ScriptBundle("~/bundles/fileinputJs").Include( "~/Content/ve ...
- 期货大赛项目|五,表格插件datatatables在MVC中的应用
系统中都需要表格,我见过最好的表格就是Datatables了,但中文文档有限,英文能力有限,就写一些简单用法 上图看效果先 要了分页和排序 基本用法 引入js和css bundles.Add(new ...
- 期货大赛项目|三,autofac简单用法
autofac是依赖注入 我们以前要引入一个dal层,是这么写的 private IDal _dao = new Dal() 我们可以看得出,这样写,我们的bll层不光依赖了接口IDal,还依赖了Da ...
- 期货大赛项目|二,DAL详解
接口层就不重点讲述了,直接DAL层 DAL层 using System; using System.Collections.Generic; using System.Linq; using Syst ...
- Java Web项目 配置 ueditor心得
近期的JAVA项目,由于客户要求需要引入富文本编辑器. 参考了两款插件,一款是ckeditor,一款是ueditor. ckeditor在上传文件的时候必须配合ckfinder使用,而ckfinder ...
- ssm项目中ueditor富文本编辑器的使用
一.下载 https://ueditor.baidu.com/website/index.html 将ueditor放到项目中合适的位置 二 . 配置文件上传路径 在utf8-jsp/jsp/conf ...
随机推荐
- Python——Set集合
一.定义 Set集合用于表示相互之间无需的一种组合对象,包括:并集.交集.补集 二.集合的两种模式 sample = set() 初始化普通集合 sample = frozenset() 初始化不可 ...
- VMware Workstation 10序列号:
VMware Workstation 10序列号:1Y0LW-4WJ9N-LZ5G9-Z81QP-92PN7
- Spring MVC 使用介绍(八)—— 类型转换
一.概述 spring类型转换有两种方式: PropertyEditor:可实现String<--->Object 之间相互转换 Converter:可实现任意类型的相互转换 类型转换的过 ...
- 使用jar包格式化Docker 容器日志
前面使用JS格式化textarea中的日志内容,但局限于JS语言性能,在日志内容较多时效率无法接受,建议日志内容大于5000行时转投本java程序,文末提供jar包下载. LogsFormat.jav ...
- 【nginx】nginx的工作模式和信号量控制
nginx是一个多进程/多线程高性能web服务器,在linux系统中,nginx启动后会以后台守护进程(daemon)的方式去运行,后台进程包含一个master进程和多个worker进程(这个数量可以 ...
- java String转int int转化为String
String转int String str = "123"; int a = Integer.parseInt(str); System.out.println(a); Integ ...
- ubuntu16.04连接wifi
前提:实验室里没有网线,也没有无线网络,只能用个人手机开热点上网! Then~~ 首先参考了这两篇博文: https://blog.csdn.net/weixin_41762173/article/d ...
- Django 中使用kindeditor
KindEditor 是一套开源的在线HTML编辑器,主要用于让用户在网站上获得所见即所得编辑效果,开发人员可以用 KindEditor 把传统的多行文本输入框(textarea)替换为可视化的富文本 ...
- CMDB资产管理系统开发【day25】:windows客户端开发
1.目录结构 PS Y:\MadkingClient> tree /f 卷 netgame 的文件夹 PATH 列表 卷序列号为 ACE3-896E Y:. ├─bin │ NedStark.p ...
- 为Nexus配置阿里云代理仓库
Nexus默认远程仓库为https://repo1.maven.org/maven2/ 慢死,还常连不上. 可以添加阿里云代理仓库 URL:http://maven.aliyun.com/nexus/ ...