[xwiki-users] how to declare in a js script that the editor can have more than one id

2009-11-11 Thread Bubulina

Hello,
I found this link :
http://code.xwiki.org/xwiki/bin/view/Modules/WysiwygEditorModule. It is an
useful one, but if i wanna edit more than one html element(in this case
textarea that has the id=demo) then it does now what to do.
i tried making an array of hookedIds but that does not help either.
my case scenario is something like this:
i have a table with multiple input type=text .. or textarea . they are
grouped in a table(which had an id..thinking that if all elements are
integrated in an table that has an id i am doing a step forward..quess not).
each field has an id because when i press Edit i wanna edit all those
elements from the table, except some labels lets say. So, folowing the
example from the link above i tried, made a table, created input types and
labels. just like a normal table. i gave ids to all the elements that i
wanna edit later on. then when i call the editor on load in javascript, i
have this variable there:hookId. this one can receive only one id?. my scope
is to add as many ids as i need to so that when i press the edit button to
be ablet to edit those   

this is a long shot, but it's my best idea yet. if you think there is
something wrong in the logic, please tell me. did anybody ran into such
stuff? 
thank you
-- 
View this message in context: 
http://n2.nabble.com/how-to-declare-in-a-js-script-that-the-editor-can-have-more-than-one-id-tp3985102p3985102.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] AUTO: MaryEllen Coleman/Poughkeepsie/IBM is out of the office. (returning 11/12/2009)

2009-11-11 Thread MaryEllen Coleman


I am out of the office until 11/12/2009.

I will not have access to email.  For wiki assistance, please contact Kim
Dillon.


Note: This is an automated response to your message  users Digest, Vol 28,
Issue 16 sent on 11/11/09 2:10:10.

This is the only notification you will receive while this person is away.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] how to declare in a js script that the editor can have more than one id

2009-11-11 Thread Marius Dumitru Florea
Hi,

Bubulina wrote:
 Hello,
 I found this link :
 http://code.xwiki.org/xwiki/bin/view/Modules/WysiwygEditorModule. It is an
 useful one, but if i wanna edit more than one html element(in this case
 textarea that has the id=demo) then it does now what to do.
 i tried making an array of hookedIds but that does not help either.
 my case scenario is something like this:
 i have a table with multiple input type=text .. or textarea . they are
 grouped in a table(which had an id..thinking that if all elements are
 integrated in an table that has an id i am doing a step forward..quess not).
 each field has an id because when i press Edit i wanna edit all those
 elements from the table, except some labels lets say. So, folowing the
 example from the link above i tried, made a table, created input types and
 labels. just like a normal table. i gave ids to all the elements that i
 wanna edit later on. then when i call the editor on load in javascript, i
 have this variable there:hookId. this one can receive only one id?. my scope
 is to add as many ids as i need to so that when i press the edit button to
 be ablet to edit those   

You need to instantiate as many editors as text-areas-to-be-replaced you 
have. In other words, each WYSIWYG editor instance replaces just one 
text area. That's why when you configure a WYSIWYG editor instance you 
specify just one hook id. So if you have:

textarea id=foo/textarea
textarea id=bar/textarea

in order to replace both you have to wrote something like:

Wysiwyg.onModuleLoad(function() {
   new WysiwygEditor({hookId:'foo'});
   new WysiwygEditor({hookId:'bar'});
});

Of course, it's more elegant if you mark all text areas to be replaced 
with a CSS class like:

textarea id=foo class=richtextarea/textarea
textarea id=bar class=richtextarea/textarea

and then have:

Wysiwyg.onModuleLoad(function() {
   $$('.richtextarea').each(function(textArea) {
 new WysiwygEditor({hookId:textArea.id});
   });
});

Note that in case you want to edit properties of XWiki objects then it's 
easier to use the wysiwyg_editProperties velocity macro.

Hope this helps,
Marius

 
 this is a long shot, but it's my best idea yet. if you think there is
 something wrong in the logic, please tell me. did anybody ran into such
 stuff? 
 thank you
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] how to declare in a js script that the editor can have more than one id

2009-11-11 Thread Jerome Velociter
On 11/11/09 1:10 PM, Marius Dumitru Florea wrote:
 Hi,

 Bubulina wrote:
 Hello,
 I found this link :
 http://code.xwiki.org/xwiki/bin/view/Modules/WysiwygEditorModule. It is an
 useful one, but if i wanna edit more than one html element(in this case
 textarea that has the id=demo) then it does now what to do.
 i tried making an array of hookedIds but that does not help either.
 my case scenario is something like this:
 i have a table with multipleinput type=text .. or textarea . they are
 grouped in a table(which had an id..thinking that if all elements are
 integrated in an table that has an id i am doing a step forward..quess not).
 each field has an id because when i press Edit i wanna edit all those
 elements from the table, except some labels lets say. So, folowing the
 example from the link above i tried, made a table, created input types and
 labels. just like a normal table. i gave ids to all the elements that i
 wanna edit later on. then when i call the editor on load in javascript, i
 have this variable there:hookId. this one can receive only one id?. my scope
 is to add as many ids as i need to so that when i press the edit button to
 be ablet to edit those   

 You need to instantiate as many editors as text-areas-to-be-replaced you
 have. In other words, each WYSIWYG editor instance replaces just one
 text area. That's why when you configure a WYSIWYG editor instance you
 specify just one hook id. So if you have:

 textarea id=foo/textarea
 textarea id=bar/textarea

 in order to replace both you have to wrote something like:

 Wysiwyg.onModuleLoad(function() {
 new WysiwygEditor({hookId:'foo'});
 new WysiwygEditor({hookId:'bar'});
 });

 Of course, it's more elegant if you mark all text areas to be replaced
 with a CSS class like:

 textarea id=foo class=richtextarea/textarea
 textarea id=bar class=richtextarea/textarea

 and then have:

 Wysiwyg.onModuleLoad(function() {
 $$('.richtextarea').each(function(textArea) {
   new WysiwygEditor({hookId:textArea.id});
 });
 });

Maybe we could offer that by default in xwiki.js, WDYT ?

Would be interesting in the case we would force the displayer of 
textarea object properties to add the CSS class when the XWiki class is 
configured to use the WYSIWYG.

(note I'd rather make the selector $$('textarea.rich') FWIW)

Jerome.

 Note that in case you want to edit properties of XWiki objects then it's
 easier to use the wysiwyg_editProperties velocity macro.

 Hope this helps,
 Marius


 this is a long shot, but it's my best idea yet. if you think there is
 something wrong in the logic, please tell me. did anybody ran into such
 stuff?
 thank you
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] editor with preloaded data

2009-11-11 Thread Marius Dumitru Florea
Hi,

Bubulina wrote:
 hello
 i am trying to understand how the edit a page works, how does it
 know(where is sending the request) to preload the data of the page in the
 editor(wysiwyg). If the developers take a look on this topic, please give me
 a trail to follow. the flow at least . thank you

Here's what happens when you choose Edit  WYSIWYG from the menu:

1) The browser requests the edit URL: 
xwiki/bin/edit/Space/Page?editor=wysiwyg

2) The editwysiwygnew.vm velocity template is evaluated.

3) wysiwyg_editProperty velocity macro (from macros.vm) is called to 
replace the content plain text area with the WYSIWYG editor.

4) wysiwyg_inputProperty velocity macro (from macros.vm) is called to 
prepare the WYSIWYG editor input value. A key for the input URL (see 
below) is generated and this key is used to store the editor input value 
of the session.

5) wysiwyg_storeConfig velocity macro (from macros.vm) is called to 
configure the WYSIWYG editor. The inputURL configuration parameter looks 
like xwiki/bin/edit/Space/Page?xpage=wysiwyginputkey=yXrgrender=true . 
Notice the key in the query string.

6) The browser receives the response and executes the JavaScript code

7) A new WYSIWYG editor instance is created using the configuration that 
was generated on the server by the wysiwyg_storeConfig velocity macro.

8) The editor replaces the plain text area identified by the hookId 
parameter with an iframe and sets its src attribute to the inputURL 
configuration parameter.

9) The browser makes a request to the inputURL in order to load the iframe

10) The wysiwyginput.vm velocity template is evaluated.

11) The key from the query string is used to retrieve the editor input 
value from the session.

12) The browser receives the response and triggers the load event on the 
  iframe.

13) The WYSIWYG editor, which listens to the load event, is notified and 
makes the iframe editable then loads the editor plugins and the rest of 
its UI.

Hope this helps,
Marius
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] how to declare in a js script that the editor can have more than one id

2009-11-11 Thread Sergiu Dumitriu
On 11/11/2009 01:27 PM, Jerome Velociter wrote:
 On 11/11/09 1:10 PM, Marius Dumitru Florea wrote:
 Of course, it's more elegant if you mark all text areas to be replaced
 with a CSS class like:

 textarea id=foo class=richtextarea/textarea
 textarea id=bar class=richtextarea/textarea

 and then have:

 Wysiwyg.onModuleLoad(function() {
  $$('.richtextarea').each(function(textArea) {
new WysiwygEditor({hookId:textArea.id});
  });
 });

 Maybe we could offer that by default in xwiki.js, WDYT ?

 Would be interesting in the case we would force the displayer of
 textarea object properties to add the CSS class when the XWiki class is
 configured to use the WYSIWYG.


+1

 (note I'd rather make the selector $$('textarea.rich') FWIW)

+1 for this too.
-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] how to declare in a js script that the editor can have more than one id

2009-11-11 Thread Marius Dumitru Florea
Hi Jerome,

Jerome Velociter wrote:
 On 11/11/09 1:10 PM, Marius Dumitru Florea wrote:
 Hi,

 Bubulina wrote:
 Hello,
 I found this link :
 http://code.xwiki.org/xwiki/bin/view/Modules/WysiwygEditorModule. It is an
 useful one, but if i wanna edit more than one html element(in this case
 textarea that has the id=demo) then it does now what to do.
 i tried making an array of hookedIds but that does not help either.
 my case scenario is something like this:
 i have a table with multipleinput type=text .. or textarea . they are
 grouped in a table(which had an id..thinking that if all elements are
 integrated in an table that has an id i am doing a step forward..quess not).
 each field has an id because when i press Edit i wanna edit all those
 elements from the table, except some labels lets say. So, folowing the
 example from the link above i tried, made a table, created input types and
 labels. just like a normal table. i gave ids to all the elements that i
 wanna edit later on. then when i call the editor on load in javascript, i
 have this variable there:hookId. this one can receive only one id?. my scope
 is to add as many ids as i need to so that when i press the edit button to
 be ablet to edit those   
 You need to instantiate as many editors as text-areas-to-be-replaced you
 have. In other words, each WYSIWYG editor instance replaces just one
 text area. That's why when you configure a WYSIWYG editor instance you
 specify just one hook id. So if you have:

 textarea id=foo/textarea
 textarea id=bar/textarea

 in order to replace both you have to wrote something like:

 Wysiwyg.onModuleLoad(function() {
 new WysiwygEditor({hookId:'foo'});
 new WysiwygEditor({hookId:'bar'});
 });

 Of course, it's more elegant if you mark all text areas to be replaced
 with a CSS class like:

 textarea id=foo class=richtextarea/textarea
 textarea id=bar class=richtextarea/textarea

 and then have:

 Wysiwyg.onModuleLoad(function() {
 $$('.richtextarea').each(function(textArea) {
   new WysiwygEditor({hookId:textArea.id});
 });
 });
 

 Maybe we could offer that by default in xwiki.js, WDYT ?
 
 Would be interesting in the case we would force the displayer of 
 textarea object properties to add the CSS class when the XWiki class is 
 configured to use the WYSIWYG.
 

The problem is that I need to prepare the editor input on the server and 
thus I need to know what properties are edited on the server. This 
constraint comes from the fact that the WYSIWYG editor syntax (HTML) is 
different from the storage syntax (xwiki/2.0). I can't just take the 
value of the plain HTML text area on the client because:

* the value needs to be in the storage syntax in case the JavaScript is 
disabled
* I have to load the full HTML content (not just the body or a fragment) 
in order to have the JavaScript and stylesheet extensions applied in 
edit mode (that's why I'm using the wysiwyginput.vm template).

 (note I'd rather make the selector $$('textarea.rich') FWIW)

Right.

Thanks,
Marius

 
 Jerome.
 Note that in case you want to edit properties of XWiki objects then it's
 easier to use the wysiwyg_editProperties velocity macro.

 Hope this helps,
 Marius

 this is a long shot, but it's my best idea yet. if you think there is
 something wrong in the logic, please tell me. did anybody ran into such
 stuff?
 thank you
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Number of attachments on an XWiki page

2009-11-11 Thread Niels Mayer
Some WEB-INF/xwiki.cfg settings that might improve performance  w/r/t
attachments (note the uncommented portions):

...
#-# Whether the document recycle bin feature is activated or not
# xwiki.recyclebin=1
#-# Whether the attachment recycle bin feature is activated or not
storage.attachment.recyclebin=0
#-# Whether the document versioning feature is activated or not
# xwiki.store.versioning=1
#-# Whether the attachment versioning feature is activated or not
xwiki.store.attachment.versioning=0
#-# Whether the attachments should also be rolled back when a document is
reverted.
xwiki.store.rollbackattachmentwithdocuments=0
...

Corollary questions for the list:
(1) When these are set, do the issues raised by Guillaume still apply?
(2) Other than the obvious change of not having attachments change when
rolling back documents, are there any other
 side-effects or caveats in using the above custom settings for a Xwiki
instance?
(3) What about the same performance question, but regarding comments
attached to documents. Is the main performance  impact coming from the
total size of comments, or from the number of comment objects attached to
documents? (Of course comments are limited to 64K so the size issue is
somewhat self-limiting).

Niels
http://nielsmayer.com

PS: Ms Coleman --  Could you please disable your away mail reminder
program from bouncing to the list? Thanks.
[xwiki-users] AUTO: MaryEllen Coleman/Poughkeepsie/IBM is out of the
office. (returning 11/04/2009)
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Adding buttons to WYSIWYG toolbar

2009-11-11 Thread Trevor Russ
Hello,

I've tried to add toolbar buttons for fonts and colours to the Syntax 2.0 
WYSIWYG toolbar in XWiki 1.9.3 by following the online guide at: 
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/WysiwygEditor .

First, in macros.vm (or anywhere else) I didn't find any lines that looked 
like these:
plugins: '$xwiki.getXWikiPreference(wysiwyg.plugins, submit line separator 
text list indent history format symbol link image table macro importer#if($full 
 $request.sync) sync#end)',
toolbar: '$xwiki.getXWikiPreference(wysiwyg.toolbar, bold italic underline 
strikethrough | subscript superscript | unorderedlist orderedlist | outdent 
indent | undo redo | hr symbol)',

they looked like this:
plugins: 'submit line separator text valign list indent history format symbol 
link image table macro importer#if($full  $request.sync) sync#end',
toolbar: 'bold italic underline strikethrough | subscript superscript | 
unorderedlist orderedlist | outdent indent | undo redo | format | hr symbol | 
link unlink | importer',

I changed the two lines to this:
plugins: 'submit line separator text font color valign list indent history 
format symbol link image table macro importer#if($full  $request.sync) 
sync#end',
toolbar: 'bold italic underline strikethrough | subscript superscript | 
unorderedlist orderedlist | outdent indent | undo redo | format fontname 
fontsize forecolor backcolor | hr symbol | link unlink | importer',

According to the documentation: You can reload your web container. and You 
don't have to restart the server..  By reloading the web container do you mean 
refreshing the browser page?  Or exiting and re-entering the WYSIWYG editor?  I 
have not tried restarting the server but the buttons are not showing up.  

Thanks,
Trevor
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] XEclipse syntax highlighting and code completion

2009-11-11 Thread Vincent Massol
On Nov 11, 2009, at 11:44 PM, Radek Rekas wrote:

 Whoops, that was it, i feel silly now.

Np

-Vincent

 Thank you very much for the help.


 Radek

 - Original Message -
 From: Vincent Massol vinc...@massol.net
 Sent: Wed, 11/11/2009 6:09pm
 To: XWiki Users users@xwiki.org
 Subject: Re: [xwiki-users] XEclipse syntax highlighting and code  
 completion


 On Nov 11, 2009, at 12:10 AM, Radek Rekas wrote:

 I've made sure that the xwiki syntax is set to Xwiki 1.0 for the
 page but when I type [] or $xwiki. as per the screenshots in the
 XWiki Page Editor section of the XEclipse user guide 
 (http://xeclipse.xwiki.org/xwiki/bin/view/Main/UserGuide
 ) no autocompletion popup boxes appear.

 Have you pressed ctrl+space too?

 Thanks
 -Vincent


 I'm using XEclipse 1.2.0 RC1


 Radek

 - Original Message -
 From: Vincent Massol vinc...@massol.net
 Sent: Tue, 10/11/2009 6:30pm
 To: XWiki Users users@xwiki.org
 Subject: Re: [xwiki-users] XEclipse syntax highlighting and code
 completion

 Hi Radek,

 On Nov 10, 2009, at 7:23 AM, Radek Rekas wrote:

 Hi,

 I can't seem to get the syntax highlighting and code completion
 working in XEclipse, is there anything that needs to be done to get
 this working or should it work out of the box?

 It'll work OOB but only for the XWiki 1.0 syntax for now. We need
 someone to make it work for the 2.0 syntax.

 Thanks
 -Vincent
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users