CKEditor 3.x 添加文本到对话框
我禁用了高级和链接对话框中的目标选项卡,只留下 URL 输入框。
实际上我所做的在这里得到了准确的解释: http:// peterpetrik.com/blog/remove-tabs-and-elements-from-ckeditor-dialog-window
我的问题是,是否可以向对话框添加文本字符串(正如我对用户的补充提示。) ?
I disabled the advanced & target tabs from the link dialog, and only left the URL input box.
Actually what I did is exactly explained here: http://peterpetrik.com/blog/remove-tabs-and-elements-from-ckeditor-dialog-window
My question is, is it possible to add a text string to the dialog (as my supplement hints for users.) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以使用“ add(elementDefinition, nextSiblingId) ”将元素添加到对话框中。
从链接页面上的代码中,我在“infoTab.remove”条目之前添加了“infoTab.add”:
nextSiblingId 用于将新元素放置在现有元素之上。
我将“linkType”指定为 nextSiblingId,以将新元素放置在 url 输入框上方。
要将新元素放置在 url 输入框和浏览按钮之间,请将“linkType”替换为“browse”(“browse”是在链接对话框的定义中分配给浏览按钮的 ID)。
要将新元素放置在按钮下方,只需删除 ( , 'linkType' )。
通过这些信息和您链接到的页面上找到的信息,您应该能够实现您的目标。
如果您想更好地了解您的选项,可以查看以下文件:
链接对话框的源文件:
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_plugin .js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_link .js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_anchor .js.html
源文件也位于您的 CKEditor 目录中:
ckecitor/_source/plugins/link/
CKEditor 文档位于此处:
http://docs.cksource.com/
来自 CKEditor API 的一些相关信息:
CKEDITOR.dialog
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html
CKEDITOR.dialog.definition.html
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR .dialog.definition.html.html
CKEDITOR.dialog.definitionObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog .definitionObject.html
CKEDITOR.dialog.definition.contentObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR .dialog.definition.contentObject.html
一切顺利,
乔
Yes, you can use " add(elementDefinition, nextSiblingId) ", to add elements to the dialog.
From the code on the page in your link, I added "infoTab.add" before the "infoTab.remove" entries:
The nextSiblingId is used to place the new element above an existing element.
I assigned "linkType" as nextSiblingId to place the new element above the url input box.
To place the new element between the url input box and the browse button, replace 'linkType' with 'browse' ( 'browse' is the id assigned to the browse button in the definition for the link dialog ).
To place the new element below the button, just remove ( , 'linkType' ).
Between this information and that found on the page you linked to, you should be able to accomplish your goal.
If you want to get a better understanding of your options, you can look at the following files:
The source files for the link dialog:
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_plugin.js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_link.js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_anchor.js.html
The source files are also in your CKEditor directory:
ckecitor/_source/plugins/link/
The CKEditor documentation is located here:
http://docs.cksource.com/
Some relevant info from the CKEditor API:
CKEDITOR.dialog
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html
CKEDITOR.dialog.definition.html
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.html.html
CKEDITOR.dialog.definitionObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definitionObject.html
CKEDITOR.dialog.definition.contentObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.contentObject.html
Be Well,
Joe