tinymce添加自定义快捷键,ctrl+s保存

添加 tinymce 定义 快捷 ctrl+s 保存 回调 editor function 编程技术
发布日期 2022-12-10 更新日期 2022-12-10 阅读次数 204 文章字数 928

tinymce在初始化完成时,可添加回调函数,在回调里添加多个自定义快捷键函数

        tinymce.init({
            selector: '#articleContent',
            language: 'zh_CN',
            plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave bdmap indent2em autoresize formatpainter axupimgs importword kityformula-editor',
            toolbar: 'removeformat forecolor backcolor bold underline | alignleft aligncenter alignright charmap kityformula-editor | 
		  bullist numlist | subscript superscript image | 
		 table  media   hr pagebreak insertdatetime indent2em lineheight  | code-sample formatselect code preview',
            min_height: 600,
            autosave_ask_before_unload: false,
            automatic_uploads: false,
            images_upload_base_path: '/demo',
            images_upload_handler: function (blobInfo, succFun, failFun) {
                succFun('/demo/images/img.jpg');
            },
            mobile: {
                menubar: true
            },
            init_instance_callback: function (editor) {
              editor.shortcuts.add("ctrl+s", "save", function() { //可多个初始化回调
                vm.submit();
              })  
            }
        });

文章作者: 朱丰华

文章链接: https://smart.52dixiaowo.com/blog/post-234.html

版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。

添加 tinymce 定义 快捷 ctrl+s 保存 回调 editor function

发表评论

相关推荐
朱丰华   |   2个月前   |   对象 · 属性 · 反射 · js

js 对象反射 Reflect

100    评论    点赞
朱丰华   |   1年前   |   linux · upx

Linux下安装UPX

609    评论    点赞
朱丰华   |   1年前   |   js · 重复

js如何避免重复监听addEventListener事件?

220    评论    点赞
朱丰华   |   1年前   |   mysql · 变量 · sql

MySQL实现行号-自定义变量

161    评论    点赞
朱丰华   |   1年前   |   sed · 文件

Shell 指定行处理head、tail、sed

200    评论    点赞
朱丰华   |   1年前   |   js · export · import

js es6 export,import,export default的用法和区别

169    评论    点赞
朱丰华   |   1年前   |   js · vue · 监听

js vue监听,深度监听

157    评论    点赞
朱丰华   |   1年前   |   centos

centos安装golang

143    评论    点赞
朱丰华   |   1年前   |   js · vue · npm · 安装

npm快速上手

161    评论    点赞
朱丰华   |   1年前   |   nvm · git · 安装

entos7安装、使用nvm

121    评论    点赞
朱丰华   |   1年前   |   python

python怎么引入自定义的子目录、父目录文件?

105    评论    点赞
朱丰华   |   1年前   |   python · linux · www

linux给www用户【非root】安装python3

288    评论    点赞
朱丰华   |   1年前   |   linux · 变量 · 环境

linux查看环境变量、设置环境变量

131    评论    点赞
朱丰华   |   1年前   |   docker · 安装 · linux

centos安装docker

149    评论    点赞
朱丰华   |   1年前   |   zend · php · 字符串 · _string

php扩展zend_string类型与char类型转换

141    评论    点赞
朱丰华   |   1年前   |   php · 常量 · 扩展

php扩展中,取字符串常量的值

200    评论    点赞
朱丰华   |   2年前   |   tinymce · 高度

tinymce编辑器的高度限制,高度随内容变化

412    评论    点赞
朱丰华   |   2年前   |   wkhtmltoimage

wkhtmltoimage生成的图片有白边

214    评论    点赞
朱丰华   |   2年前   |   网页 · 提示 · 离开 · 保存 · 事件 · 显示 · < · beforeunload · 浏览器

网页离开提示未保存

91    评论    点赞
朱丰华   |   2年前   |   ImageMagick · pdf · png · windows

ImageMagick 把 pdf转png【windows】

77    评论    点赞
{{item.author_name}}   |   {{new Date(item.date*1000).log()}}   |   {{it}} ·

{{item.title}}

{{item.uv}}    评论    点赞