Sharepoint 2010 功能区粘贴命令
目前,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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过更多调查,我找到了我正在寻找的函数:RTE.RichTextEditor.paste(true);
With a little more investigation i found the function I was looking for: RTE.RichTextEditor.paste(true);