CKEditor 3.x 添加文本到对话框

发布于 2024-12-02 05:16:15 字数 305 浏览 1 评论 0原文

我禁用了高级和链接对话框中的目标选项卡,只留下 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 技术交流群。

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

发布评论

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

评论(1

遗心遗梦遗幸福 2024-12-09 05:16:15

是的,您可以使用“ add(elementDefinition, nextSiblingId) ”将元素添加到对话框中。

从链接页面上的代码中,我在“infoTab.remove”条目之前添加了“infoTab.add”:

infoTab.add(
  {
    type : 'html',
    html : '<div id="myDiv">Supplemental <b>hint</b>.</div><br />'
  },
  'linkType'
);

// Remove unnecessary widgets from the 'Link Info' tab.         
infoTab.remove( 'linkType');
infoTab.remove( 'protocol');

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:

infoTab.add(
  {
    type : 'html',
    html : '<div id="myDiv">Supplemental <b>hint</b>.</div><br />'
  },
  'linkType'
);

// Remove unnecessary widgets from the 'Link Info' tab.         
infoTab.remove( 'linkType');
infoTab.remove( 'protocol');

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

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