博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
自定义UEditor右键菜单
阅读量:6478 次
发布时间:2019-06-23

本文共 10878 字,大约阅读时间需要 36 分钟。

//打开右键菜单功能        ,enableContextMenu: true//右键菜单的内容,label留空支持国际化,否则以此配置为准//,contextMenu:[//    {
// label:'', //显示的名称// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName// exec:function () {
// //this是当前编辑器的实例// //this.ui._dialogs['inserttableDialog'].open();// }// }//] ,contextMenu: [ {label: '全选',cmdName: 'selectall'}, { label: '清空文档', cmdName: 'cleardoc', exec: function() { if ( confirm('确定清空当前文档么?') ) { this.execCommand('cleardoc'); } } }, '-', { group: '段落样式', icon: 'justifyjustify', subMenu: [{ label: '', cmdName: 'justify', value: 'left' }, { label: '', cmdName: 'justify', value: 'right' }, { label: '', cmdName: 'justify', value: 'center' }, { label: '', cmdName: 'justify', value: 'justify' }] }, '-', { group: '表格', icon: 'table', subMenu: [{ label: '插入表格', cmdName: 'inserttable' }, { label: '删除表格', cmdName: 'deletetable' }, '-', { label: '删除行', cmdName: 'deleterow' }, { label: '删除列', cmdName: 'deletecol' }, { label: '左插入列', cmdName: 'insertcol' }, { label: '右插入列', cmdName: 'insertcolnext' }, { label: '前插入行', cmdName: 'insertrow' }, { label: '后插入行', cmdName: 'insertrownext' }, '-', { label: '插入表格名称', cmdName: 'insertcaption' }, { label: '删除表格名称', cmdName: 'deletecaption' }, { label: '插入标题行', cmdName: 'inserttitle' }, { label: '删除标题行', cmdName: 'deletetitle' }, { label: '插入标题列', cmdName: 'inserttitlecol' }, { label: '删除标题列', cmdName: 'deletetitlecol' }, '-', { label: '合并单元格', cmdName: 'mergecells' }, { label: '向右合并', cmdName: 'mergeright' }, { label: '向下合并', cmdName: 'mergedown' }, '-', { label: '拆分行', cmdName: 'splittorows' }, { label: '拆分列', cmdName: 'splittocols' }, { label: '拆分单元格', cmdName: 'splittocells' }, '-', { label: '平均分配行', cmdName: 'averagedistributerow' }, { label: '平均分配列', cmdName: 'averagedistributecol' }, '-', { label: '单元格属性', cmdName: 'edittd', exec: function() { if (UE.ui['edittd']) { new UE.ui['edittd'](this); } this.getDialog('edittd').open(); } }, { label: '表格属性', cmdName: 'edittable', exec: function() { if (UE.ui['edittable']) { new UE.ui['edittable'](this); } this.getDialog('edittable').open(); } }, { label: '设置边框可见', cmdName: 'setbordervisible' } ] }, '-', { group: '表格排序', icon: 'tablesort', subMenu: [ { label:"开启表格排序", cmdName: 'enablesort' }, { label:"关闭表格排序", cmdName: 'disablesort' }, { label:"排序逆转", cmdName: 'sorttable', value: 'reversecurrent' }, { label:"ASCII升序", cmdName: 'sorttable', value: 'orderbyasc' }, { label:"ASCII降序", cmdName: 'sorttable', value: 'reversebyasc' }, { label:"数值升序", cmdName: 'sorttable', value: 'orderbynum' }, { label:"数值降序", cmdName: 'sorttable', value: 'reversebynum' } ] }, '-', { group: '边框底纹', icon: 'borderBack', subMenu: [ { label:"隔行着色", cmdName: "interlacetable", exec: function() { this.execCommand("interlacetable"); } }, { label:"取消隔行着色", cmdName: "uninterlacetable", exec: function() { this.execCommand("uninterlacetable"); } }, { label:"选取背景隔行", cmdName: "settablebackground", exec: function() { this.execCommand("settablebackground", { repeat: true, colorList: ["#bbb", "#ccc"] }); } }, { label:"取消选取背景", cmdName: "cleartablebackground", exec: function() { this.execCommand("cleartablebackground"); } }, { label:"红蓝相间", cmdName: "settablebackground", exec: function() { this.execCommand("settablebackground", { repeat: true, colorList: ["red", "blue"] }); } }, { label:"三色渐变", cmdName: "settablebackground", exec: function() { this.execCommand("settablebackground", { repeat: true, colorList: ["#aaa", "#bbb", "#ccc"] }); } } ] }, '-', { group: '单元格对齐方式', icon: 'aligntd', subMenu: [ { cmdName: 'cellalignment', value: { align: 'left', vAlign: 'top' } }, { cmdName: 'cellalignment', value: { align: 'center', vAlign: 'top' } }, { cmdName: 'cellalignment', value: { align: 'right', vAlign: 'top' } }, { cmdName: 'cellalignment', value: { align: 'left', vAlign: 'middle' } }, { cmdName: 'cellalignment', value: { align: 'center', vAlign: 'middle' } }, { cmdName: 'cellalignment', value: { align: 'right', vAlign: 'middle' } }, { cmdName: 'cellalignment', value: { align: 'left', vAlign: 'bottom' } }, { cmdName: 'cellalignment', value: { align: 'center', vAlign: 'bottom' } }, { cmdName: 'cellalignment', value: { align: 'right', vAlign: 'bottom' } } ] }, '-', { group: '表格对齐方式', icon: 'aligntable', subMenu: [ { cmdName: 'tablealignment', className: 'left', label: '', value: "left" }, { cmdName: 'tablealignment', className: 'center', label: '', value: "center" }, { cmdName: 'tablealignment', className: 'right', label: '', value: "right" } ] }, '-', { label: '前插入段落', cmdName: 'insertparagraph', value: true }, { label: '后插入段落', cmdName: 'insertparagraph' }, '-', { label: '复制(Ctrl+C)', cmdName: 'copy' }, { label: '粘贴(Ctrl+V)', cmdName: 'paste' } ]

 

转载于:https://www.cnblogs.com/yiven/p/7210239.html

你可能感兴趣的文章
U-BOOT之一:BootLoader 的概念与功能
查看>>
我的路上
查看>>
Velocity处理多余空白和多余空白行问题
查看>>
DB2与oracle有什么区别
查看>>
创建一个多级文件目录
查看>>
Picasa生成图片幻灯片页面图文教程
查看>>
svn status 显示 ~xx
查看>>
常用HiveQL总结
查看>>
[转]使用Visual Studio Code开发Asp.Net Core WebApi学习笔记(三)-- Logger
查看>>
POJ 3311 Hie with the Pie(状压DP + Floyd)
查看>>
Security updates and resources
查看>>
DNS为什么通常都会设置为14.114.114.114
查看>>
Sqoop架构(四)
查看>>
golang copy函数
查看>>
《你有多少问题要请示》精华集粹
查看>>
打印图片
查看>>
SHOW CREATE DATABASE Syntax
查看>>
rsync常见问题及解决办法
查看>>
MySQL日期 专题
查看>>
C#中禁止程序多开
查看>>