Hi Asiri,
On Mon, May 25, 2009 at 5:16 PM, Asiri Rathnayake <
asiri.rathnayake(a)gmail.com> wrote:
Hi devs,
I have been working on two small enhancements for officeimporter interface:
Cool :-)
1. Use a drop-down list for target space input field. This list contains all
existing spaces + an option to create a new space.
2. Suggest the target page name based on the input file name.
Great. Both seem fine to me. A potential issue will arise when / if a wiki
has a lot of spaces. You could maybe add a check and if the wiki has more
than 50 spaces replace the select box with a text input with autosuggest, or
make autosuggest the default.
To implement these two features I used bit of
javascript which I embedded
in
the XWiki.OfficeImporter page (inside <script> tags). I didn't bother using
JSX because this javascript fragment is really small. Is this ok?
In the first feature, the user can select one of existing spaces. If he
selects the [New Space] option, a javascript un-hides a text field into
which the user can type in the new space name. Question; should I worry
about browsers with javascript disabled? Any hints about how to handle such
a scenario? :)
You can add a layer:
1. Default state: text input is shown, space selector is hidden
2. When loading the page, a JS command switches both inputs (text input
is now hidden and space selector is shown)
3. When selecting "New space", a JS command switches the text input to
show it
This way if JS is disabled only the text input is shown and if JS is
available your current behavior keeps working.
The second feature calculates the target page name based on the input file
name and updates the "Target page" text
field. If the user does not like
the
auto-generated page name, he can adjust the value in "Target page" text
field manually. For an example, if the input file name is "My Word
Document.doc" the target page name will be "My Word Document". This
calculation + update is also done in javascript.
This sounds ok to me. If JS is disabled it will keep working as it currently
does which is fine too.
Please let me know what you think, I didn't commit these features because I
am not sure if my approach is ok.
Can you make them available on
incubator.myxwiki.org for review?
Thanks,
Guillaume
Thanks.
- Asiri
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://guillaumelerouge.com/