gpt4 book ai didi

tinymce 剪切/粘贴插件

转载 作者:行者123 更新时间:2023-12-04 06:40:31 31 4
gpt4 key购买 nike

我想在剪切/粘贴事件触发后调用函数。

例如,当用户通过键盘或鼠标(带有上下文菜单)在编辑器中剪切/粘贴时,我想计算用户输入的字符数。

用户执行剪切/粘贴后有什么方法可以调用我们自己的函数吗?

最佳答案

是的,这是可能的。

使用 paste plugin .

tinyMCE.init({
// General options
//mode:'exact',
mode: "textareas", // none, textareas, exact, ...
theme: "advanced", // also simple available

plugins : "paste",

paste_postprocess : function(pl, o) {

// o.content holds the pasted content o.content.length will give you the number of characters the user entered
alert(o.content.length);
},

关于tinymce 剪切/粘贴插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4301369/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com