Extension:Page Forms/Select2 for autocompletion/Progress Report

Switching Semantic Forms Autocompletion to Select2
 Public URL:  https://www.mediawiki.org/wiki/User:Jatin.me/GSoC14  Bugzilla report: Bug 61974 Announcement:  http://lists.wikimedia.org/pipermail/wikitech-l/2014-March/075276.html Status:  https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Select2_for_autocompletion/Progress_Report

Goals for the first half of the internship

 * Introducing the Select2 JS library to the current autocompletion system of Semantic Forms. Having discussed it with my mentors, we have decided to do this in conjunction with the jQuery UI Autocomplete which is used currently in SF for autocompletion.
 * Making 'combobox' input type in SF use this new Select2 library for autocompletion and see if everything works fine with this.
 * Make remote autocompletion work for combobox input type.
 * Switching the #forminput parser function which also supports autocompletion, on possible page names to use Select2 as well - and probably switch it to a combo box interface, for consistency.
 * Switching 'Semantic property' field in Special:CreateTemplate page also to Select2 combobox.

Communication plan

 * Email - I will keep mentor updated about the progress.
 * Skype and gtalk - Skype and gtalk have been my primary means of communication with mentors.
 * IRC Channel - I also go on the #semantic-mediawiki channel during the working hours.
 * Mailing list - semediawiki-user mailing list will be used to communicate progress.

Lessons learned since 21st April

 * Report to your mentors regularly about the progress of the project because mentors will help in rectifying flaws, which you may not notice, before its too late.
 * Do not make things complex, keep them easy and simple.
 * Prioritize tasks to be done and focus on important deliverables.
 * Discussions and feedback make thing better.

Week 1: 19 May to 25 May

 * I dove into the Semantic Forms code for autocompletion, got myself familiar with it and understood how this all works. Here are some of the related files:
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Included the stuff related to Select2 JS library into the SF extension.
 * Tested if the Select2 library is successfully included and working fine with SF.
 * Started working on making 'combobox' input type use Select2 for autocompletion.

Week 2: 26 May to 1 June
Combo box using Select2 for autocompletion|none]]
 * Tested 'combobox' using Select2 for autocompletion.[[File:ComboSelect2.png|link=https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Select2_for_autocompletion/File:ComboSelect2.png|thumb|160x160px|


 * Added a new attribute 'placeholder' to 'combobox'.
 * Started working on remote autocompletion for combobox.
 * Learnt Modular Javascript and started writing JS modules for making combobox use Select2 for autocompletion. I also wrote a small blog about Modular JS (see here).

Week 3: 2 June to 8 June

 * Completed module for autocompletion of combobox from local values.
 * Understood how Select2 does remote autocompletion and tried to integrate it to the module of combobox for autocompletion.
 * Integration successful, now combobox can do remote autocompletion if 'remote autocompletion' parameter is specified in the field tag.
 * Worked on the 'values from url' parameter for the combobox, now values for autocompletion can also be fetched from outside the wiki (other wikis or some other external url).

Week 4: 9 June to 15 June

 * Started working on switching #forminput to Select2 for autocompletion.
 * Found some bugs in the existing code of #forminput in SFParserFunctions::renderFormInput function. It produces some weird outputs when some parameters are not given in specific order. This problem is occurring due to the support for unnamed parameters by #forminput.
 * Having discussed with my mentor, we have decided to get rid of these unnamed parameters and remove its support by the #forminput.
 * We also discussed about removing 'remote autocompletion' parameter and letting code SF decide itself whether to do local or remote autocompletion based on the number of values for autocompletion, if there are more than a certain number of values, which is settable via LocalSettings.php, then switch to remote autocompletion.
 * Working on the above two points discussed with the mentors.