GreenItSolutions / dokuwiki-plugin-switchpanel

Visual representation of the network switch schemes
13 stars 7 forks source link

If text="" specified, display broken unless case type also specified #22

Closed FosseWay closed 6 years ago

FosseWay commented 7 years ago

Adding a text, link, or textlink value to a port causes unexpected display issues, unless case type is specified for that port. This makes case type defaulting not very useful.

This code:

<switchpanel>
==line:number=6
1,1,
2,2
3,3
4,4
5,5
6,6
</switchpanel>

displays: image which is what I expect.

However, I want to add a hover label to the port. I try this code:

<switchpanel>
==line:number=6
1,1,text="example"
2,2
3,3
4,4
5,5
6,6
</switchpanel>

but this appears to pass the whole text="example" tag through, which is surely not desirable: image

I can work around that by specifying the case type:

<switchpanel logo="http://www.opensecurityarchitecture.org/cms/images/OSA_images/icon_library/osa_hub.png">
==line:number=6
1,1:case=rj45,text="example"
2,2
3,3
4,4
5,5
6,6
</switchpanel>

which then gives me what I expect: image

Am I doing something wrong, or is the case type defaulting broken when text is specified?

GreenItSolutions commented 7 years ago

Hello,

The syntax is no correct : 1,1,text="example"

Use this : 1,1,example

What should be remembered is that at the beginning of the line the separator "," uses the third argument as the text of the element. The separator ":" defines the options of the line.

==line:number=(number of cases),color=(backgroud color),case=(type of case),labelLeft=(label left),labelRight=(label right),colorLabelLeft=(color of label left),colorLabelRight=(color of label right) 1,label,title:color=(backgroud color),text=(text of popup message),link=(url of link),case=(type of case),target=(type of link target)

By