On 07/27/2011 06:09 PM, Campbell, John wrote:
>> In order to add a new style to the "Styles" list box from the WYSIWYG
>> editor tool bar you have to:
>>
>> (1) Define the style in your skin:
>>
>> .important {
>>    color: red;
>>    font-size: larger;
>> }
>>
>> I think the best option is to create a wiki page with a
>> StyleSheetExtension object that is applied to the entire wiki, I'm not a
>> skin expert though :) .
>>
>> (2) Register the style in the WYSIWYG editor administration section:
>>
>> Style name: important
>> Style label: Important
>> Inline style: whether the style should be applied only to the selected
>> text (true) or to the entire block of text (e.g. paragraph) that
>> contains the selected text (false)
>>
>> Hope this helps,
>> Marius
>
> -----------
>
> Hi, Marius.
>
> I created a StyleSheetExtension object called "MPStyle" and added a few style 
> definitions in there, then applied it to the entire wiki. I've listed the 
> style definitions below:
>
> .title {
>     font-family:"Arial","sans-serif";
>     font-size:20.0pt;
>     text-align:center;
>     color:rgb(20,54,135);
> }
>
> .h1 {
>     font-family:"Arial","sans-serif";
>     font-size:17.0pt;
>     color:rgb(20,54,135);
> }
>
> .h2 {
>     font-family:"Arial","sans-serif";
>     font-size:14.0pt;
> }
>
> .body {
>     font-family:"Arial","sans-serif";
>     font-size:10.0pt
> }
>
> .cmd (
>     font-family:"Courier New","serif";
>     font-size:10.0pt;
>     color:rgb(202,20,6);
> }
>
> .important {
>     color: red;
>     font-size: larger;
> }
>
> I was then able to register the styles in the format you indicated. An 
> example follows:
>
> Style name: cmd
> Style label: CommandLine
> Inline style: true
>

> Now all the styles show up in the WYSIWYG editor, which is wonderful. But 
> they don't seem to do anything. The title, h1, and h2 styles change the 
> color/size of the text, but the alignment change does not seem to apply. And 
> the other styles don't seem to do anything at all. Does the Style name field 
> in the WYSIWYG editor configuration page need to include the name of the 
> StyleSheetExtension object as well?

If some of the styles are applied (e.g. color, font name, font size) 
then the feature works fine. The issue is that some styles are used in 
the wrong context. For instance text-align has effect only on block 
level elements so you have to uncheck "Inline style" so that the style 
is applied to the entire block (e.g. paragraph) and not just to the 
selected text.

Hope this helps,
Marius

>
> Thanks,
> John
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to