[xwiki-devs] Add the ability to apply predefined custom styles in the WYSIWYG editor
Hi devs, I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages. Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc.. Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it. Thanks, Marius
Hi Marius, On Nov 29, 2010, at 5:01 PM, Marius Dumitru Florea wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Where would the styles be saved? How would the user define them? Thanks -Vincent
Hi Vincent, On 11/29/2010 06:05 PM, Vincent Massol wrote:
Hi Marius,
On Nov 29, 2010, at 5:01 PM, Marius Dumitru Florea wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Where would the styles be saved?
The styles are saved in the skin (file system stylesheets, skin object, stylesheet extensions). For instance you could put: .todo { background: url(/path/to/todo.png) no-repeat scroll 6px 8px #EFEFEF; color: darkblue; padding: 8px 28px; } in a stylesheet extension then configure the WYSIWYG editor like this: styleNames: "[{...}, {name: 'todo', label: 'TODO', inline: false}, {...}]" For a start, the list of predefined style names (CSS class names) will be configurable only from macros.vm but later we can create a nice UI in the administration to allow wiki administrators to configure the list. When the user selects a piece of text and applies the TODO style from the WYSIWYG editor, he'll get: (% class="todo" %) Some TODO text..
How would the user define them?
I don't think it's good to let users define their own styles. The idea is to have consistency between wiki pages. One way to achieve this is to enforce users to use the same styles for the same type of information. Thanks, Marius
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Nov 29, 2010, at 5:37 PM, Marius Dumitru Florea wrote:
Hi Vincent,
On 11/29/2010 06:05 PM, Vincent Massol wrote:
Hi Marius,
On Nov 29, 2010, at 5:01 PM, Marius Dumitru Florea wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Where would the styles be saved?
The styles are saved in the skin (file system stylesheets, skin object, stylesheet extensions). For instance you could put:
.todo { background: url(/path/to/todo.png) no-repeat scroll 6px 8px #EFEFEF; color: darkblue; padding: 8px 28px; }
in a stylesheet extension then configure the WYSIWYG editor like this:
styleNames: "[{...}, {name: 'todo', label: 'TODO', inline: false}, {...}]"
For a start, the list of predefined style names (CSS class names) will be configurable only from macros.vm but later we can create a nice UI in the administration to allow wiki administrators to configure the list.
I don't like too much to use macros.vm for this since the goal is to remove it so we're slimming it down instead. Thanks -Vincent
When the user selects a piece of text and applies the TODO style from the WYSIWYG editor, he'll get:
(% class="todo" %) Some TODO text..
How would the user define them?
I don't think it's good to let users define their own styles. The idea is to have consistency between wiki pages. One way to achieve this is to enforce users to use the same styles for the same type of information.
Thanks, Marius
Thanks -Vincent
On 11/29/2010 06:59 PM, Vincent Massol wrote:
On Nov 29, 2010, at 5:37 PM, Marius Dumitru Florea wrote:
Hi Vincent,
On 11/29/2010 06:05 PM, Vincent Massol wrote:
Hi Marius,
On Nov 29, 2010, at 5:01 PM, Marius Dumitru Florea wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Where would the styles be saved?
The styles are saved in the skin (file system stylesheets, skin object, stylesheet extensions). For instance you could put:
.todo { background: url(/path/to/todo.png) no-repeat scroll 6px 8px #EFEFEF; color: darkblue; padding: 8px 28px; }
in a stylesheet extension then configure the WYSIWYG editor like this:
styleNames: "[{...}, {name: 'todo', label: 'TODO', inline: false}, {...}]"
For a start, the list of predefined style names (CSS class names) will be configurable only from macros.vm but later we can create a nice UI in the administration to allow wiki administrators to configure the list.
I don't like too much to use macros.vm for this since the goal is to remove it so we're slimming it down instead.
I don't like it that much either but macros.vm is the place were we keep the velocity macros used to include the WYSIWYG editor in a page (e.g. wysiwyg_editProperty). Among them there is wysiwyg_storeConfig which is used to provide the default values for the WYSIWYG editor configuration parameters. I can use $xwiki.getXWikiPreference('wysiwyg.styleNames', '[]') to get the list of style names. This way you can enable and configure this feature from the wiki, without touching macros.vm . Thanks, Marius
Thanks -Vincent
When the user selects a piece of text and applies the TODO style from the WYSIWYG editor, he'll get:
(% class="todo" %) Some TODO text..
How would the user define them?
I don't think it's good to let users define their own styles. The idea is to have consistency between wiki pages. One way to achieve this is to enforce users to use the same styles for the same type of information.
Thanks, Marius
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
That's cool. Will you provide a UI in the admin section for when it's enabled ? +1 to have it in XE 2.7 Jerome On Mon, Nov 29, 2010 at 5:01 PM, Marius Dumitru Florea <[email protected]> wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Thanks, Marius _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 11/29/2010 06:06 PM, Jerome Velociter wrote:
That's cool.
Will you provide a UI in the admin section for when it's enabled ?
Not for 2.7. But it would be nice to have one later. The WYSIWYG editor can take the style names configuration from one of XWiki.XWikiPreferences' properties. Since the format is JSON it should be pretty easy to create a UI to fill that property. Thanks, Marius
+1 to have it in XE 2.7
Jerome On Mon, Nov 29, 2010 at 5:01 PM, Marius Dumitru Florea <[email protected]> wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Thanks, Marius _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Marius, On Mon, Nov 29, 2010 at 17:01, Marius Dumitru Florea < [email protected]> wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Sounds great, I'm sure that plenty of cool projects need that feature!! I have one in mind right now ;-) Guillaume
Thanks, Marius _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
That's a great idea ! On Mon, Nov 29, 2010 at 17:01, Marius Dumitru Florea <[email protected]> wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
Thanks, Marius _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On 11/29/2010 05:01 PM, Marius Dumitru Florea wrote:
Hi devs,
I'd like to introduce a new feature in the WYSIWYG editor in XE 2.7: the ability to apply predefined custom styles to a text selection. Using this instead of the other text formatting features (e.g. font name, font size, text color etc.) can help improve the consistency between wiki pages.
Wiki administrators will be able to define a list of custom styles (CSS class names) which will be listed in a select box on the WYSIWYG tool bar. These styles should have meaningful names, e.g. "important", "comment", "todo" etc..
Considering that this feature is independent and will be disabled by default (i.e. we don't provide predefined styles in the standard XE distribution) I think it's save to introduce it in 2.7. Let me know if you are against it.
+1 for providing a WYSIWYG tool for applying predefined styles to selected characters or blocks of text. +1 for having style == CSS classname. I'd rather have the administration part done as well, but since it's not critical at the moment, I'm OK with postponing this part, so that we at least have the WYSIWYG UI done. Vincent, this isn't adding new macros to macros.vm, but merely changing the code of existing macros. -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (6)
-
Guillaume Lerouge -
Jerome Velociter -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol