Page 1 of 1

[SOLVED] cssPref not working?

Posted: 12 April 2020, 20:19
by Woodruff
Hi everybody!

I am trying to set an user preference using the gameoptions.inc.php, using cssPref in order to customize the display using css.

Code: Select all

$game_preferences = array(
    100 => array(
        'name' => totranslate('Display field and pawn numbers?'),
        'needReload' => false,
        'values' => array(
            1 => array('name' => totranslate('No'), 'cssPref' => 'hide_numbers'),
            2 => array('name' => totranslate('Yes'), 'cssPref' => 'show_numbers')
        )
    )
);
The documentation says that the value of cssPref is applied to the body (as a class I surmise), but I see nothing using a web console; this does not seem to work and the body has no particular tag.

What do you think I miss?

Thanks for your help!

Woodruff

Re: cssPref not working?

Posted: 12 April 2020, 20:59
by Woodruff
I found the source and the problem, so I reply to the subject myself in case somebody wonders.

It turns out that the class is applied on the <html> tag, not on the <body>, despite what the documentation said.
A reload is needed in order for that change to take place so it would be wise to set needReload to true.

I have edited the documentation accordingly.

Take care!

Woodruff