Hi James, On 08/01/2011 09:37 AM, 许凌志(Jamesxu) wrote:
Hi, Last week I have done following things: 1. Implemented the sub-triggers 'attach:', '@', '.' for link autosuggestion. I record a video(see:http://youtu.be/7lXeORkI6Ns) of how to use this triggers under link suggestion context. But still have some problems: a. I didn't implement the trigger for attribute "||", because the suggestion trigger type and behaviour are a bit different from the others, for example, when you type "||" the attributes of the link will be shown, and when user select one, then type '="' the value should be suggested to user, and if user want to add second attributes to the link, he can type "space" key and then the suggestion for available attributes should also be shown. The process are a bit complex, and the cost of implementation is high compare to the utility of the functions. So I decide to abandon this sub-triggers and focus on the trigger "attach:", "@" and "." only which are more useful when user add or edit links.
b. Not full tested, I test most cases I can think of, and ask my classmates to use this function and gave me some feedback, I did found some bugs, and fixed them, but I am not very sure some unexcepted bugs will come up
It works pretty well. I have some remarks though: * I don't like the scroll bars on the list of suggestions, especially when you have to go through all the wiki pages to get to the list of attachments. I think you should display only a small number of suggestions (5-10 maximum) without any scroll bars. Of course, the size of the suggestion box (both width and height) shouldn't be fixed. You can specify a max-width and max-height but the suggestion box should expand to fit its contents. Check http://www.youtube.com/watch?v=35M2zGWZ2Fc to see how link auto-complete looks in Confluence. * You should generate relative references. For instance, if you are editing Sandbox.Text and you select Sandbox.WebHome from the list of link suggestions then the result should be: [[Label Text>>WebHome]] because the target page is in the same space. * You shouldn't change the CSS of the text area used in wiki edit mode! Right now you add the .suggestion_editor CSS class which changes the font-size and font-family, among other things. This is bad. * It seem that attach: works outside of the link context ([[), which is fine because we support stand-alone links (without the [[ ]] wrapping) like: before attach:[email protected] after but the generated syntax is messed up. * I think it's useful to display the location for attachments too in the list of suggestions, like you do for wiki pages. * Default suggestions when there is no query would be very useful. Hope this helps, Marius
c. I didn't implement the default suggestions for "attach:", "." and "@" sub-triggers, I need to discuss with mentor this week.
2. Thanks Marius and Sergiu, with their help, I find all the server side search service for getting the suggestions of the link sub-triggers. 3. Thanks Marius, with his help, I can refine the default Panels.Recent Modified page to get the recent modified pages and attachmens as the default suggestions for link trigger "[[".
In this week, I am going to do the following things: 1. Implement the default suggestions for sub-triggers "attach:", "." and "@". 2. Implement the ctrl+space to re-open the suggestion box according to the different contexts of link suggestion.
-- Best wishes,
许凌志(Jame Xu)
MOE KLINNS Lab and SKLMS Lab, Xi'an Jiaotong University
Department of Computer Science and Technology, Xi’an Jiaotong University