ueditor编辑器和at.js集成

王朝学院·作者佚名  2016-08-27
窄屏简体版  字體: 小  |  中  |  大  |  超大  

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

//禁止jsp解析${}

%>

<%@ page isELIgnored="true"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme() + "://"

+ request.getServerName() + ":" + request.getServerPort()

+ path + "/";

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<base href="<%=basePath%>">

<title>at+ueditor整合</title>

<meta http-equiv="x-ua-compatible" content="IE=Edge" />

<meta http-equiv="PRagma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">

<meta http-equiv="keyWords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<link href="<%=path %>/CSS/jquery.atwho.min.css" rel="stylesheet">

<script src="<%=path%>/js/jquery.min.js" type="text/Javascript"></script>

<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.config.js"></script>

<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/_examples/editor_api.js"></script>

<script src="<%=path %>/js/jquery.caret.min.js" type="text/javascript"></script>

<script src="<%=path %>/js/jquery.atwho.min.js" type="text/javascript"></script>

<style type="text/css">

.dkhs-edui {

border: 1px solid #d4d4d4;

}

</style>

<script type="text/javascript">

$(function(){

var at_config = {

at: "@",

data:['Peter', 'Tom', 'Anne', 'zhangsan', 'lisi', 'wangwu', 'laoliu', 'libai', 'dupu', 'xiaozhou'],

limit: 20

}

var ue = UE.getEditor('mytextarea',{

contextMenu:[],

//focus时自动清空初始化时的内容

autoClearinitialContent:true,

//关闭字数统计

wordCount:false,

//关闭elementPath

elementPathEnabled:false,

});

ue.addListener('ready', function(editor){

$("#edui1").removeClass("edui-editor edui-default").addClass("dkhs-edui");

$(this.document.body).atwho(at_config);

});

});

</script>

</head>

<body>

<textarea id="mytextarea" contenteditable="true">dd</textarea>

</body>

</html>

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航