gpt4 book ai didi

CKEditor v4 Remove / Change Button Title Attribute(CKEditor v4删除/更改按钮标题属性)

转载 作者:bug小助手 更新时间:2023-10-24 22:33:14 25 4
gpt4 key购买 nike



On CKEditor V4 all the editor buttons include a title attribute which triggers 50 errors on my client accessibility software.

在CKEditorV4上,所有的编辑器按钮都包含一个标题属性,该属性会在我的客户端辅助功能软件上触发50个错误。


Although we advised that this is not really an issue since the issue is caused because the title attribute exists with a different text that is on the button, the client insists this issue needs to be fixed.

虽然我们建议这不是一个真正的问题,因为问题是由于标题属性与按钮上的不同文本存在,但客户端坚持认为这个问题需要解决。


Upgrading to V5 is not a possibility.

升级到V5是不可能的。


Is it possible to remove the title attribute from CKEditor buttons (ex: Bold, Italic, Font...)?

是否可以从CKEditor按钮中删除标题属性(例如:粗体、斜体、字体...)?


Is there another way to fix this issue?

有没有其他方法来解决这个问题?


Thanks in advance.

先谢谢你。


更多回答

Why is the accessibility software flagging it? There is nothing in WCAG that says the tooltip should be the same text as the button. This is not an error and sounds like a bug in the accessibility software.

为什么易访问性软件会标记它?WCAG中没有任何内容规定工具提示应该与按钮的文本相同。这不是一个错误,听起来像是辅助功能软件中的错误。

@slugolicious they have their own software, based on axe-core, that does validations for all websites under the parent company and it's their base of truth. I believe they added some of their own "business rules" to complement correct copyright when applying accessibility. Therefore in an item has text, either there is no title or the title attribute must match the text.

@sluGolous他们有自己的软件,基于斧头核心,可以对母公司下的所有网站进行验证,这是他们的真理基础。我相信他们在应用可访问性时添加了一些自己的“业务规则”来补充正确的版权。因此,在具有文本的项中,要么没有标题,要么标题属性必须与文本匹配。

优秀答案推荐

First of all: You should not remove the title attribute, it is deteriorating usability and therefore accessibility.

首先:您不应该删除标题属性,它会降低可用性,从而降低可访问性。



A user’s understanding of an icon is based on previous experience. Due to the absence of a standard usage for most icons, text labels are necessary to communicate the meaning and reduce ambiguity.



Icon Usability by NN/g

-图标可用性按NN/g




It might still be interesting how one would go about reliably changing toolbar buttons’ properties.

如何可靠地更改工具栏按钮的属性可能仍然很有趣。


A lot of articles work directly on the DOM, which is a hack and sensitive to side-effects. You never know when a component is re-rendering its DOM.

很多文章都直接使用DOM,这是一种黑客行为,而且对副作用很敏感。您永远不知道组件何时重新呈现其DOM。


The editor titles come from the toolbar configuration, specifically from config.toolbar[*].items[*].title.

编辑器标题来自工具栏配置,具体地说就是来自Config.TOOLBLE[*].Items[*].title。


You will need to apply an “Item by Item” Configuration by creating a function to remove titles from the configuration.

您需要通过创建一个从配置中删除标题的函数来应用“Item by Item”配置。


I couldn’t figure out how to intervene each time when a new config part is loaded, for example by plug-ins, so in the example editorConfig is only called once with an object that does not define toolbar.

我不知道如何在每次加载新的配置部件(例如通过插件)时进行干预,因此在本例中,没有定义工具栏的对象只调用一次editorConfig。




   // This should go in the config.js file

const removeToolbarTitles = c => ({
...c,
toolbar: [
c.toolbar?.map(t => ({
...t,
items: Array.isArray(t.items) ? t.items.map(i => removeItemTitle(i)) : t.items
}))
]
});

const removeItemTitle = i => Object.fromEntries(Object.entries(i).filter(e => e[0] !== 'title'));

/* Change any loaded config file to remove titles */
CKEDITOR.editorConfig = removeToolbarTitles;

<script src="https://cdn.ckeditor.com/4.22.1/standard/ckeditor.js" integrity="sha384-IBDNY5TVKWr+u1841ldzW99oyOoUBpoGeouNuoXVwF0PBFR3v10dzwm09xNIEeiG" crossorigin="anonymous"></script>




更多回答

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