[xwiki-users] Button Plugin in WYSIWYG editor
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0. The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message. While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing. Is there any method to make the commands parsed by just inputting them to the editor? There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them? -- View this message in context: http://n2.nabble.com/Button-Plugin-in-WYSIWYG-editor-tp3229334p3229334.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, ArielWang wrote:
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0.
The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message.
While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing.
Is there any method to make the commands parsed by just inputting them to the editor?
There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them?
These macros have been added in XE 2.0M1 (see http://jira.xwiki.org/jira/browse/XWIKI-2968 ; I don't know why they weren't included in 1.9.1). So you can: * upgrade to 2.0M1 (milestone release, beware) and you'll have the info, warning and error macros accessible from the WYSIWYG editor * or upgrade to 1.9.1 (stable release) and try to install the message macro ( http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macr... ) . They should be compatible, but I haven't succeeded installing it.. * or use your current installation and insert a velocity macro from the WYSIWYG editor, setting its content to {{html wiki=true}}#error("some messages"){{/html}} (it's a pain, I know..) * or, if you have coding skills, you can create your own WYSIWYG plugin; you'll have to take a look at the exiting macro plugin; just checkout the code of the editor from http://svn.xwiki.org/svnroot/xwiki/platform/web/branches/xwiki-web-1.8/wysiw... (for XE 1.8) Hope this helps, Marius
Hi again, See below, Marius Dumitru Florea wrote:
Hi,
ArielWang wrote:
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0.
The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message.
While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing.
Is there any method to make the commands parsed by just inputting them to the editor?
There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them?
These macros have been added in XE 2.0M1 (see http://jira.xwiki.org/jira/browse/XWIKI-2968 ; I don't know why they weren't included in 1.9.1). So you can:
* upgrade to 2.0M1 (milestone release, beware) and you'll have the info, warning and error macros accessible from the WYSIWYG editor
* or upgrade to 1.9.1 (stable release) and try to install the message macro ( http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macr... ) . They should be compatible, but I haven't succeeded installing it..
I think this is the best option for you. Here's what you have to do: 1) upgrade to XE 1.9.1 2) download the Message macro jar from http://tinyurl.com/lztm6y and copy it to WEB-INF/lib directory of your XE installation 3) create a "plexus" directory in WEB-INF/classes/META-INF/ and place the file attached to this mail (components.xml) inside. So you should have: WEB-INF/classes/META-INF/plexus/components.xml 4) restart the server At this point you should see the info, warning and error macros listed in the "Insert Macro" WYSIWYG dialog. Hope this helps, Marius
* or use your current installation and insert a velocity macro from the WYSIWYG editor, setting its content to {{html wiki=true}}#error("some messages"){{/html}} (it's a pain, I know..)
* or, if you have coding skills, you can create your own WYSIWYG plugin; you'll have to take a look at the exiting macro plugin; just checkout the code of the editor from http://svn.xwiki.org/svnroot/xwiki/platform/web/branches/xwiki-web-1.8/wysiw... (for XE 1.8)
Hope this helps, Marius
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Marius Dumitru Florea wrote:
Hi again,
See below,
Marius Dumitru Florea wrote:
Hi,
ArielWang wrote:
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0.
The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message.
While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing.
Is there any method to make the commands parsed by just inputting them to the editor?
There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them?
These macros have been added in XE 2.0M1 (see http://jira.xwiki.org/jira/browse/XWIKI-2968 ; I don't know why they weren't included in 1.9.1). So you can:
* upgrade to 2.0M1 (milestone release, beware) and you'll have the info, warning and error macros accessible from the WYSIWYG editor
* or upgrade to 1.9.1 (stable release) and try to install the message macro ( http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macr... ) . They should be compatible, but I haven't succeeded installing it..
I think this is the best option for you. Here's what you have to do:
1) upgrade to XE 1.9.1 2) download the Message macro jar from http://tinyurl.com/lztm6y and copy it to WEB-INF/lib directory of your XE installation 3) create a "plexus" directory in WEB-INF/classes/META-INF/ and place the file attached to this mail (components.xml) inside. So you should have: WEB-INF/classes/META-INF/plexus/components.xml
I'm dumping here the file just in case: ----------8<---------- <?xml version="1.0" encoding="UTF-8"?> <component-set> <components> <component> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>info</role-hint> <implementation>org.xwiki.rendering.internal.macro.message.MessageMacro</implementation> <requirements> <requirement> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>box</role-hint> </requirement> </requirements> <instantiation-strategy>singleton</instantiation-strategy> </component> <component> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>warning</role-hint> <implementation>org.xwiki.rendering.internal.macro.message.MessageMacro</implementation> <requirements> <requirement> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>box</role-hint> </requirement> </requirements> <instantiation-strategy>singleton</instantiation-strategy> </component> <component> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>error</role-hint> <implementation>org.xwiki.rendering.internal.macro.message.MessageMacro</implementation> <requirements> <requirement> <role>org.xwiki.rendering.macro.Macro</role> <role-hint>box</role-hint> </requirement> </requirements> <instantiation-strategy>singleton</instantiation-strategy> </component> </components> </component-set> ---------->8----------
4) restart the server
At this point you should see the info, warning and error macros listed in the "Insert Macro" WYSIWYG dialog.
Hope this helps, Marius
* or use your current installation and insert a velocity macro from the WYSIWYG editor, setting its content to {{html wiki=true}}#error("some messages"){{/html}} (it's a pain, I know..)
* or, if you have coding skills, you can create your own WYSIWYG plugin; you'll have to take a look at the exiting macro plugin; just checkout the code of the editor from http://svn.xwiki.org/svnroot/xwiki/platform/web/branches/xwiki-web-1.8/wysiw... (for XE 1.8)
Hope this helps, Marius
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
------------------------------------------------------------------------
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks so much and I will try!:handshake: -- View this message in context: http://n2.nabble.com/Button-Plugin-in-WYSIWYG-editor-tp3229334p3234906.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Marius Dumitru Florea wrote:
Hi,
ArielWang wrote:
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0.
The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message.
While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing.
Is there any method to make the commands parsed by just inputting them to the editor?
There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them?
These macros have been added in XE 2.0M1 (see http://jira.xwiki.org/jira/browse/XWIKI-2968 ; I don't know why they weren't included in 1.9.1). So you can:
* upgrade to 2.0M1 (milestone release, beware) and you'll have the info, warning and error macros accessible from the WYSIWYG editor
* or upgrade to 1.9.1 (stable release) and try to install the message macro ( http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macr... ) . They should be compatible, but I haven't succeeded installing it..
* or use your current installation and insert a velocity macro from the WYSIWYG editor, setting its content to {{html wiki=true}}#error("some messages"){{/html}} (it's a pain, I know..)
* or, if you have coding skills, you can create your own WYSIWYG plugin; you'll have to take a look at the exiting macro plugin; just checkout the code of the editor from http://svn.xwiki.org/svnroot/xwiki/platform/web/branches/xwiki-web-1.8/wysiw... (for XE 1.8)
Hope this helps, Marius
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks very much for your advice. The problem is I am using 1.8 and I want to add the three button in XWIKI 1.8. I still not understand how to plugin using macro because I find it cannot be parsed when I add code to the editor. Would you please give me more information or an example of this? I am really hurry. Thank you so much for your assistant! -- View this message in context: http://n2.nabble.com/Button-Plugin-in-WYSIWYG-editor-tp3229334p3249159.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, see below, ArielWang wrote:
Marius Dumitru Florea wrote:
Hi,
ArielWang wrote:
I want to add three buttons to the toolbar in WYSIWYG V2. Now I have XWIKI 1.8 and WYSIWYG V2 with Syntax 2.0.
The problem is: When I use WYSIWYG V1, the message #error(“some messages”)can be parsed as error message.
While with Syntax 2.0, the new syntax has been changed to:{{velocity}}{{html wiki=true}}#error("some messages"){{/html}}{{/velocity}}, which is not allowed to input WYSIWYG messages for parsing.
Is there any method to make the commands parsed by just inputting them to the editor?
There is Macro box in the new editor, but I didn’t find the macros of error, info and warning, how can I add them? These macros have been added in XE 2.0M1 (see http://jira.xwiki.org/jira/browse/XWIKI-2968 ; I don't know why they weren't included in 1.9.1). So you can:
* upgrade to 2.0M1 (milestone release, beware) and you'll have the info, warning and error macros accessible from the WYSIWYG editor
* or upgrade to 1.9.1 (stable release) and try to install the message macro ( http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-rendering-macr... ) . They should be compatible, but I haven't succeeded installing it..
* or use your current installation and insert a velocity macro from the WYSIWYG editor, setting its content to {{html wiki=true}}#error("some messages"){{/html}} (it's a pain, I know..)
* or, if you have coding skills, you can create your own WYSIWYG plugin; you'll have to take a look at the exiting macro plugin; just checkout the code of the editor from http://svn.xwiki.org/svnroot/xwiki/platform/web/branches/xwiki-web-1.8/wysiw... (for XE 1.8)
Hope this helps, Marius
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks very much for your advice. The problem is I am using 1.8 and I want to add the three button in XWIKI 1.8. I still not understand how to plugin using macro because I find it cannot be parsed when I add code to the editor. Would you please give me more information or an example of this?
Have you tried to install the Message macro on XE 1.8 by following the steps I gave you for XE 1.9? I just did this and when I click the Macro
Insert Macro... menu a dialog is opened and I can see the Error, Info and Warning macros in the list of available macros. I select one of them, type in the content and that's it. If I switch to Wiki editor I can see:
{{error}}This is an error!{{/error}} {{info}}This is an info!{{/info}} {{warning}}This is a warning!{{/warning}} If you don't like how they look after you save the page then it's a matter of adjusting the style sheet. Here's what I did, by just comparing the latest toucan.css with the version from XE 1.8: 1) I added this at the end of skins/toucan/toucan.css: ----------8<---------- .errormessage, .warningmessage, .infomessage { margin: 4px 0; border: 1px solid #DDD; padding: 8px 28px; background: #F5F5F5 6px 8px no-repeat; text-align: justify; color: #555; } .infomessage { background-image: url( $xwiki.getSkinFile('icons/silk/information.gif') ); color: #369; } .warningmessage { background-image: url( $xwiki.getSkinFile('icons/silk/error.gif') ); color: #D5A13D; } .errormessage { background-image: url( $xwiki.getSkinFile('icons/silk/exclamation.gif') ); color: #e14726; } ---------->8---------- 2) I searched in skins/toucan/toucan.css for: #xwikimaincontainerinner .box { and replaced it with only: .box { Ans that's it. The error, info and warning messages look great. Hope this helps, Marius
I am really hurry.
Thank you so much for your assistant!
Now it works. Thank you for all the help! -- View this message in context: http://n2.nabble.com/Button-Plugin-in-WYSIWYG-editor-tp3229334p3261521.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
ArielWang -
Marius Dumitru Florea