Hi devs,
I have been working on two small enhancements for officeimporter interface:
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.
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? :)
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.
Please let me know what you think, I didn't commit these features because I
am not sure if my approach is ok.
Thanks.
- Asiri