期货大赛项目|八,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 ...
随机推荐
- MT【315】勾股数
(高考压轴题)证明以下命题:(1)对任意正整数$a$都存在正整数$b,c(b<c)$,使得$a^2,b^2,c^2$成等差数列.(2)存在无穷多个互不相似的三角形$\Delta_n$,其边长$a ...
- Spring中的AOP 专题
Caused by: java.lang.IllegalArgumentException: ProceedingJoinPoint is only supported for around advi ...
- TOMCAT ---> servlet概念
1 TOMCAT ---> servlet概念 2 TOMCAT 目录结构 (各个文件夹都存放什么东西) 3 TOMCAT 程序的层级 web | |---- js,jsp,html,css ( ...
- 学习Git过程中常用命令的总结
复制远程库git clone git@github.com:Hconly/learngit.git在GitHub上,可以任意Fork开源仓库:自己拥有Fork后的仓库的读写权限:可以推送pull re ...
- Java Properties 类读配置文件保持顺序
前几天,公司项目中有一个需求是读取配置文件的,而且最好能够保证加载到内存中的顺序能够和配置文件中的顺序一致,但是,如果使用 jdk 中提供的 Properties 类的话,读取配置文件后,加载到内存中 ...
- vue开发常用插件
dependencies axios // 用于请求数据 better-scroll // 用于处理页面列表的滚动,下拉刷新等 fastclick // 用于处理移动设备点击会有300毫秒延迟的问题 ...
- ACM-ICPC 2018 徐州赛区网络预赛 A Hard to prepare(递推)
https://nanti.jisuanke.com/t/31453 题目 有n个格子拉成一个环,给你k,你能使用任意个数的0 ~ 2^k - 1,规定操作 i XNOR j 为~(i ^ j), ...
- numpy&pandas基础
numpy基础 import numpy as np 定义array In [156]: np.ones(3) Out[156]: array([1., 1., 1.]) In [157]: np.o ...
- tr1
tr echo 12345 | tr '0-9' '9876543210' echo 87654 | tr '9876543210' '0-9' ROT13 echo "tr came, t ...
- MySQL学习4 - 数据类型一
介绍 一.数值类型 二.浮点型 验证三种类型建表 验证三种类型的精度 三.日期类型 综合练习: 介绍 存储引擎决定了表的类型,而表内存放的数据也要有不同的类型,每种数据类型都有自己的宽度,但宽度是可选 ...