Page MenuHomePhabricator

Wikieditor: In a toolbar button, display the label instead of the icon create an error
Open, LowPublicFeature

Description

Author: nikus0pokus

Description:
I found that if I set a wrong or an empty value in the icon field of a toolbar button in the file « jquery.wikiEditor.toolbar.config.js » it displays the label instead of the icon.

'tt': {
    'label': 'tt',
    'type': 'button',
    'icon': 'noicon.jpg',
    'action': {
        'type': 'encapsulate',
        'options': {
            'pre': "<tt>",
            'post': "</tt>"
        }
    }
}

It is very useful because the text is well render comparing to text inside png icons. Svg icons have better rendering but it is easier to use the label than to create svg icons.
But if I use wrong or an empty value in the icon field, I have the following error:

[error] open() "/srv/http/mywiki/extensions/WikiEditor/modules/images/toolbar/noicon.jpg" failed (2: No such file or directory)

So, I would like to know how to display the label in a toolbar button without having the previous error.


Version: REL1_22-branch
Severity: enhancement

Details

Reference
bz65409

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:17 AM
bzimport added a project: WikiEditor.
bzimport set Reference to bz65409.
bzimport added a subscriber: Unknown Object (MLST).

The issue of undefined icons was fixed with T172500.

Aklapper triaged this task as Low priority.Feb 4 2022, 10:51 AM
Aklapper changed the subtype of this task from "Task" to "Feature Request".
Aklapper removed a subscriber: TrevorParscal.

There is no longer an error when passing a falsy (e.g. blank) icon field. It does currently pass the label as the link text, but that text isn't displayed. The icon (when present) is a background image, so it's not a straight replacement.