@@ -0,0 +1 @@
|
||||
<?php defined('IN_TS') or die('Access Denied.');return array( 'name' => 'wangeditor编辑器', 'version' => '3.0', 'desc' => '针对ThinkSAAS社区开发的wangeditor编辑器', 'url' => 'http://www.thinksaas.cn', 'email' => 'thinksaas@qq.com', 'author' => 'wangeditor', 'author_url' => 'https://www.wangeditor.com', 'isedit' => '0',);
|
||||
Binary file not shown.
@@ -0,0 +1,47 @@
|
||||
var E = window.wangEditor
|
||||
var editor = new E('#tseditor')
|
||||
// 或者 var editor = new E( document.getElementById('editor') )
|
||||
|
||||
// 自定义菜单配置
|
||||
editor.customConfig.menus = [
|
||||
'head', // 标题
|
||||
'bold', // 粗体
|
||||
'fontSize',
|
||||
'fontName',
|
||||
'italic', // 斜体
|
||||
'underline', // 下划线
|
||||
'strikeThrough', // 删除线
|
||||
'foreColor', // 文字颜色
|
||||
'backColor', // 背景颜色
|
||||
'emoticon',
|
||||
'link', // 插入链接
|
||||
'video',//外链
|
||||
'list', // 列表
|
||||
'justify', // 对齐方式
|
||||
'quote', // 引用
|
||||
'image', // 插入图片
|
||||
'table', // 表格
|
||||
'code', // 插入代码
|
||||
'undo', // 撤销
|
||||
'redo' // 重复
|
||||
]
|
||||
|
||||
editor.customConfig.zIndex = 100
|
||||
|
||||
// 配置服务器端地址
|
||||
editor.customConfig.uploadImgServer = siteUrl+'index.php?app=pubs&ac=editor&ts=photo&js=1'
|
||||
// 将图片大小限制为 10M
|
||||
editor.customConfig.uploadImgMaxSize = 20000 * 1024 * 1024
|
||||
// 限制一次最多上传 5 张图片
|
||||
editor.customConfig.uploadImgMaxLength = 20
|
||||
editor.customConfig.uploadFileName = 'photo'
|
||||
|
||||
var content = $('textarea[name="content"]')
|
||||
editor.customConfig.onchange = function (html) {
|
||||
// 监控变化,同步更新到 textarea
|
||||
content.val(filterXSS(html))
|
||||
}
|
||||
|
||||
editor.create()
|
||||
// 初始化 textarea 的值
|
||||
content.val(editor.txt.html())
|
||||
@@ -0,0 +1,44 @@
|
||||
var E = window.wangEditor
|
||||
var editor = new E('#tseditor')
|
||||
// 或者 var editor = new E( document.getElementById('editor') )
|
||||
|
||||
// 自定义菜单配置
|
||||
editor.customConfig.menus = [
|
||||
'bold', // 粗体
|
||||
'foreColor', // 文字颜色
|
||||
'link', // 插入链接
|
||||
'list', // 列表
|
||||
'justify', // 对齐方式
|
||||
'quote', // 引用
|
||||
'image', // 插入图片
|
||||
]
|
||||
|
||||
editor.customConfig.zIndex = 100
|
||||
|
||||
// 配置服务器端地址
|
||||
editor.customConfig.uploadImgServer = siteUrl+'index.php?app=pubs&ac=editor&ts=photo&js=1'
|
||||
|
||||
// 将图片大小限制为 10M
|
||||
editor.customConfig.uploadImgMaxSize = 10 * 1024 * 1024
|
||||
|
||||
// 限制一次最多上传 5 张图片
|
||||
editor.customConfig.uploadImgMaxLength = 5
|
||||
|
||||
editor.customConfig.uploadFileName = 'photo'
|
||||
|
||||
var content = $('textarea[name="content"]')
|
||||
editor.customConfig.onchange = function (html) {
|
||||
// 监控变化,同步更新到 textarea
|
||||
content.val(filterXSS(html))
|
||||
}
|
||||
|
||||
//解决iphone中出现的问题
|
||||
editor.customConfig.onblur = function (html) {
|
||||
// html 即编辑器中的内容
|
||||
console.log('onblur', html)
|
||||
content.val(filterXSS(html))
|
||||
}
|
||||
|
||||
editor.create()
|
||||
// 初始化 textarea 的值
|
||||
content.val(editor.txt.html())
|
||||
@@ -0,0 +1,39 @@
|
||||
var E = window.wangEditor
|
||||
var editor = new E('#tseditor')
|
||||
// 或者 var editor = new E( document.getElementById('editor') )
|
||||
|
||||
// 自定义菜单配置 评论框
|
||||
editor.customConfig.menus = [
|
||||
'bold', // 粗体
|
||||
'foreColor', // 文字颜色
|
||||
'link', // 插入链接
|
||||
'emoticon', // 表情
|
||||
'image', // 插入图片
|
||||
]
|
||||
|
||||
editor.customConfig.zIndex = 100
|
||||
|
||||
editor.customConfig.zHeight = '100px'//编辑器编辑区高度
|
||||
|
||||
// 配置服务器端地址
|
||||
editor.customConfig.uploadImgServer = siteUrl+'index.php?app=pubs&ac=editor&ts=photo&js=1'
|
||||
// 将图片大小限制为 2M
|
||||
editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024
|
||||
// 限制一次最多上传 5 张图片
|
||||
editor.customConfig.uploadImgMaxLength = 5
|
||||
editor.customConfig.uploadFileName = 'photo'
|
||||
|
||||
var content = $('textarea[name="content"]')
|
||||
editor.customConfig.onchange = function (html) {
|
||||
// 监控变化,同步更新到 textarea
|
||||
content.val(filterXSS(html))
|
||||
}
|
||||
|
||||
//解决iphone中出现的问题
|
||||
editor.customConfig.onblur = function (html) {
|
||||
// html 即编辑器中的内容
|
||||
console.log('onblur', html)
|
||||
content.val(filterXSS(html))
|
||||
}
|
||||
|
||||
editor.create()
|
||||
@@ -0,0 +1,7 @@
|
||||
var E = window.wangEditor
|
||||
var editor = new E('#tseditor')
|
||||
// 或者 var editor = new E( document.getElementById('editor') )
|
||||
|
||||
editor.customConfig.zIndex = 100
|
||||
|
||||
editor.create()
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function wangeditor($loadjs='load'){
|
||||
if($loadjs!='load'){
|
||||
$loadjs='load_'.$loadjs;
|
||||
}
|
||||
|
||||
#判断手机访问
|
||||
if($loadjs=='load' && isMobile()==true){
|
||||
$loadjs = 'load_m';
|
||||
}
|
||||
|
||||
if($GLOBALS['TS_USER']){
|
||||
echo '<script type="text/javascript" charset="utf-8" src="'.SITE_URL.'public/js/xss.js"></script>';
|
||||
echo '<script type="text/javascript" charset="utf-8" src="'.SITE_URL.'plugins/pubs/wangeditor/wangEditor.js"></script>';
|
||||
echo '<script type="text/javascript" charset="utf-8" src="'.SITE_URL.'plugins/pubs/wangeditor/'.$loadjs.'.js?v=20181008"></script>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
addAction('tseditor','wangeditor');
|
||||
Reference in New Issue
Block a user