Sharepoint 2010 功能区粘贴命令

发布于 2024-10-08 18:12:08 字数 457 浏览 1 评论 0原文

目前,SharePoint 2010 提供了 2 种方法将剪贴板内容插入到文本字段中。包含格式设置和“仅粘贴文本”选项的普通粘贴。

我想要实现的是,“仅粘贴文本”选项是默认选项,而其他选项是隐藏的。用户不应该有机会粘贴带有格式的文本。

到目前为止,我发现 RTE_OnPaste_Restricted Javascript 函数可以解决这个问题,但我找不到将其设置为功能区默认值的方法。因此,我试图隐藏默认的粘贴按钮并将其替换为我自己的按钮,但我不知道应该为该按钮分配哪个命令。围绕粘贴命令发生了更多操作,但我无法使用 Javascript 调试器跟踪它。

仔细观察 JavaScript 代码,您可以看到 SharePoint 中的 RichHtmlField 控件附带了一种受限模式,该模式仅允许插入文本,但要启用此模式,您必须禁用 HTML 编辑。

有什么想法如何解决这个问题吗?

提前谢谢

史蒂夫

currently SharePoint 2010 offers 2 ways to insert the clipboard content for example into a textfield. The normal paste which contains formatting and the "paste only text" option.

What I'd like to achieve is, that the "paste text only" option is the default and the other option is hidden. The user should have no chance to paste text with formattings in it.

What I've found so far is the RTE_OnPaste_Restricted Javascript function that does the trick but I can't find a way to set this as default for the ribbon. So I'm trying to hide the default paste button and replace it with my own but I don't know which command I should assign to this button. There is a lot more action around the paste command that happens, but I can't trace it with a Javascript debugger.

Looking closely on the javascript code you can see that the RichHtmlField Control from SharePoint comes with a restricted mode that would allow only text insert but to enable this mode you have to disable HTML Editing.

Any ideas how to solve this?

Thx in Advance

Steve

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美人骨 2024-10-15 18:12:08

经过更多调查,我找到了我正在寻找的函数:RTE.RichTextEditor.paste(true);

With a little more investigation i found the function I was looking for: RTE.RichTextEditor.paste(true);

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文