User:Ganeshaditya1/$PROGRAM

GSoC: Prototyping inline comments

 * Public URL: https://www.mediawiki.org/w/index.php?title=User:Ganeshaditya1/$PROGRAM
 * Bugzilla report link: (Bug 46440) https://bugzilla.wikimedia.org/show_bug.cgi?id=46440

Name and contact information
https://www.mediawiki.org/wiki/User:Ganeshaditya1

Name: AV Aditya Sastry

Email:ganeshaditya1@gmail.com

IRC or IM networks/handle(s): AdityaSastry

Location:Vishakhapatanam, Andhra Pradesh

Typical working hours: 2:00 PM to 12:30AM

Synopsis
Every MediaWiki article has a talk page. But the discussions here are very generic in nature and are concerned with the whole article rather than a part of it.

With Inline commenting, user could select a line of an article and write a comment for it, which could be viewed by other users and they can respond to the comment as well. This greatly helps engage the readers as well the editors in discussions about the articles and thus help make them better and accurate.

One of the main reasons why I choose the visual editor sub category was because prior to getting acquainted with MediaWiki, Wikipedia was entirely an enigma to me. I was largely a consumer of information but was never able to contribute back. This was because the interface back then was pretty complicated for me, with wiki text and stuff. With things like talk pages and stuff, it is generally very tough to engage readers especially the non-tech savvy readers. An inline commenting extension would greatly appeal to there intuition of how community would collaborate to make articles better IMO.

Project summary
My idea is to have a single special page which would be displayed as a tab right next to edit button if possible. This page would receive the article name and will use it to extract the article from the database and then render it and display it like an ordinary wiki article. Now when someone wants to leave a comment for a line, he would select the line and press a specific key. Then we would record his selection.

As pointed out by James Forester to me in the Bugzilla page of this project, Rangy is the ideal choice for capturing the text selection as it supports firefox, ie , chrome and all browsers equally. With rangy I would get the DOM containers starting and ending DOM nodes  where the selection happened as well as the offsets in these DOM containers. These four parameters along with the article name will be saved in a database.

These four parameters will be used to reconstruct the location where the selection happened.

An important task here is to serialize the DOM node to be able to save in a database. I chose to represent the DOM tree node as XPath string. This conversion from DOM node to xpath and back to DOM node is implemented in JavaScript. I derived the idea for this from the OFKN project's annotator tool.

Deliverables
1) Special page to view comments as well as make them

2) Database classes.

3) Sanitizer classes needed to sanitize the comments posted.

4) AJAX, JQuery and any necessary JS functions to implement this functionality.

About you
I am a programming addict. I have programming since I was 12 year's old. This is the reason why I decided to pursue a degree in computer science. I am a workaholic and I work for the joy of engineering.

I have been using Wikipedia since my 10th class. I owe my life to Wikipedia cause anything I have accomplished academically its owing to Wikipedia. I have only contributed to my university's Wikipage once. But mostly I have been a consumer.

How ever I feel ashamed in confessing that until I started working on MediaWiki I didn't know about the talk page and even when I came to know about it, I noticed that the talk pages of few articles that I frequently read are congested with discussions about the whole article rather than a sub part of it that I am concerned with. Hence I had to read the whole discussion to comprehend the context to be able to contribute to these discussions. I am sure other Wikipedia readers might have felt the same about it to.

Participation
My friends tell me that I am a chatterbox. I available all the time except for the time I am sleeping in all ways of communication. I respond fairly quickly to emails. I mostly lurk in freenode. I hangout mostly in facebook like most of my friends.

I have already created a github repository with the UI part of the code. I would be commiting to it periodically like once a week. I will be also posting about the various challenges I have faced during this project in my blog as well as the status reports. I will be tweeting and posting these things on facebook wall as well.

Past open source experience
I have fixed four bugs in MediaWiki. Here's my github [%20https://github.com/ganeshaditya1 account] and I plan on fixing two more over the weekend. Also in a couple of weeks from now, I will be starting an opensource java library which converts DOM nodes to XPaths and XPaths to DOM nodes. Most of the libraries available these days make heavy use of document.Evaluate. My project will be be available across all browsers. I have used the code that I have developed for this in the prototype given below.

Any other info
I have developed a fully functional prototype for this project. Server sided scripting is pretty straight forward so I have written some dummy scripts for the JavaScript to interact with. I plan on fixing the bugs in the UI part and using it as a part of the project if selected. Here's the source code.