User:Inchikutty/OPW Internship Report

UploadWizard OSM Map Embedding Project
This project is about enhancing the image upload process for Wikimedia Commons. Commons is an image hosting site which is used by Wikipedia and a bunch of other sites, as a central location to store free images, which can be reused anywhere without needing to worry about copyright. Commons has millions of images and Wikipedia editors need to be able to find quickly the right ones for their articles, so it is important to store various metadata with the image which will help navigation - topic of the image, when it was made and so on. This metadata is usually stored in a complex template language that is specific to MediaWiki, and the sight of which usually makes people to flee in terror. Since we cannot expect image authors to learn to write something like that, Commons has a tool called UploadWizard which creates all the code for you, after you fill out a bunch of forms. The main goal of the OSM map embedding project would be to provide map interface & the integration with external databases to the UploadWizard. (OSM stands for OpenStreetMap) The secondary goal is to integrate with some databases of locations and use that in various ways. One way would be checking if there are locations with requested images nearby (that is, someone put out a note that Commons needs good images about a certain place and doesn't currently have any), and warn the uploader about them. Another involves image competitions where people can participate with pictures taken at some predefined locations; UploadWizard could get a list of these locations and use it to help the participant in selecting where he took the photo. Information Courtesy:Gergő Tisza,Project Mentor

Status
Work In Progress

Plan

 * With the help of my mentor,I will navigate through the existing code and structure of UploadWizard, in order to understand the system in detail.

Progress
Dec 10 : Navigating through source code of UploadWizard .. Dec 11 : Working on an exercise task Dec 12 : First step

Dec 13 : Investigation Time.. Spend most of the day by going through various manuals, reading about Git best practices

Dec 14 : Uploaded another patchset, Investigation time.. this time about Upload Wizard/Geolocation

Dec 15 : The curious case of declaring and using 'state' variable within 'loop'.. possibilities and impossibilities..

Dec 16 : Rushing through various manuals and closely looking at leaflet.js

Dec 17 : Actually working on .each, .map and eliminating global state variables while using these methods

Plan

 * Design and Code

Progress
Dec 18 : IRC meeting at #opw channel and planning on next week activities.. added another patchset

Dec 19 : More time with JQuery

Dec 20 : Playing around with display (CSS time)

Dec 21 : Alternative to line break.. CSS best practices

Dec 22 : Experimenting with CSS pseudo elements

break : Merry Christmas

Plan

 * Report, Design and Code

Progress
Dec 26 :I was working with a very lengthy method.. using CSS content property I added a text string say "xxxxxx" and made it transparent. So eventually I will have a invisible text string before the link and hence a fake line break is achieved.. I am not happy about it.. Will look into more methods..

Dec 27 :Found a very useful discussion at stackoverflow

Dec 28 : Uploaded another patch set

Dec 29 : Thanks to my mentor [|Tisza Gergő] I know that my next step is to make design documents, and for that purpose I should dive into the actual design of UploadWizard..Its investigation time again

Dec 30 : Came to know about Wikimedia labs and MediaWiki-Vagrant for the first time.. More investigation

Dec 31 : Patch set is merged. Decided to build a mockup.

Jan 01 : Setting up and getting used to MediaWiki-Vagrant

Plan

 * To build a mockup

Progress
Jan 02: Its penciltime.

Jan 03: Learning the art of mockups

Jan 04: Leaflet.js experiments for mockup

Jan 05: Created the first mock up with Pencil.. But Its not good

Jan 06: Pencil Tutorials and some coding time

Jan 07:Going through interesting UI plans

Jan 08: Finally realized that with GUI prototyping template for exporting document can make a lot of difference to Mock-up

Plan

 * To complete mockup
 * Continue coding

Progress
Jan 09: Tackled pencil... mock-up started to look decent

Jan 10: Coding map widget and trying out leaflet.js in this fiddle

Jan 11: Had a detailed discussion with mentor regarding next steps.. and started working towards the next step

Jan 12: Working on adding a new class file to Extension:UploadWizard

Jan 13: Working on Static map, geolocation , plotting inputs to map widget and vice verse, and OSM geocoding service look up.Also deciding on how to split code written so far into smaller patch sets.

Jan 14: Going through ResourceLoader module registration

Jan 15: Testing the new file added to the local copy UploadWizard.. and also improving static map ..

Plan

 * Start adding following features one by one to UploadWizard, commit changes on gerrit!
 * 1.Static Map
 * 2.Leaflet dynamic map

Progress
Jan 16:Committed change set to embed static map to UploadWizard

Jan 17:Working on CSS file

Jan 18: Coding rest of the rough working prototype.

Jan 19: Learning about advanced gerrit usage

Jan 20: Adding leaflet files to UploadWizard and working on dynamic map

Jan 21: 'No value provided for {s} variable' error resolving

Jan 22: Completed coding functions to perform dynamic map- static map initializing, deinitializing, plotting input coordinates on both kind of maps (output screencast )

Plan

 * Patchset division
 * complete mapViewToInputs function
 * Add controls so that user can switch between static map and dynamic map

Progress
Jan 23:Submitted patchset which adds leaflet script to UploadWizard

Jan 24: Submitted patch set which introduces static map and leaflet map on UploadWizard Functions added:

Jan 25:Going through JSDuck format for documentation
 * Static map initialization
 * Static map de-initialization
 * leaflet map initialization
 * leaflet map de-initialization
 * plotting input coordinates to leaflet map
 * updating input coordinates from leaflet map

Jan 26:Making changes as per reviews and some learning related to split a submitted change

Jan 27:Mentor taught me to change dependency chain of currently opened changes also taught about variable scopes in javascript, Installing JSDuck, working on leaflet map functions (case of simultaneous multiple uploads )

Jan 28: Reviewing lessons learnt from mentor ( variable scopes in Java Script)

Jan 29: uploaded another patch set, installed JSduck and learning documenting java script files using JSDuck

Plan

 * To do Proper Documentation using JSDuck and upload newer patch sets
 * Open two more patches adding geo search and geo location

Progress
Jan 30: uploaded a new patch set under change : 107892 including documentation as per jsduck format (first attempt with jsduck documentation)

Jan 31: Rebasing changesets, reporting and documenting code(more jsduck)

Feb 01: Improving changesets, resolving jsduck error in parsing

Feb 02: Uploaded another patchset under change 107892

Feb 03: Uploaded another patchset under change 109263

Feb 04: Uploaded another patchset under change109263

Feb 05: Resolving problem with the "Copy information to all uploads below ..." within change 107892

Plan

 * fix the problem with the "Copy information to all uploads below ..." link
 * add rate-limiting to the events so that the browser does not download three static map images when you type "132"
 * for the static map, give the user some simple feedback that the image is loading

Progress
Feb 06: Had a google hangout with mentor, discussed next steps

Feb 07: .trigger and custom events in jQuery [investigation]

Feb 08: spinner animation and debouncing

Feb 09: Better control over choosing right type of map [WIP] change : 112342

Feb 10: adding custom event 'uw-copy' to UploadWizard and resolving error:jquery-on-gets-uncaught-range-error-maximum-call-stack-size-exceeded

Feb 11: Had a google hangout with mentor, discussed next steps and progress

Added a new patch set under change:107892 which does the following
 * added spinner animation
 * custom event to resolve conflict during "copy all informations to all uploads below" step

Feb 12: geocoding and reverse geocoding

Week 10 ( Feb 13 - Feb 19 )
TARGET: Wrap up geocoding.

Plan

 * add rate-limiting to the events so that the browser does not download three static map images when you type "132"
 * add a text input where the user can enter an address, which then moves the map to that position (if the address lookup was successful)[geocoding and reverse geocoding]

Progress
Feb 13:
 * geocoding using Control.OSMGeocoder.js successfully added to mw.GeoMap.js, but working on implementing geocoding without the plugin
 * Updated dependency chain of currently open changes
 * First step towards geocoding and reverse geocoding -change:112342

Feb 14: Finally "close to done"  patch set of Change: 107892- embedding static map to UploadWizard with spinner animation & debouncing

Feb 15:

Feb 16:

Feb 17:

Feb 18:

Feb 19: