Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find/build a commenting system similar as at Djangobook [closed]

I want to open-source my notes similarly as at DjangoBook. I have not found any similar open-source system as at the website. I am particularly interested in the vertical commenting system.

This suggests me that I need to build one by myself for open-source.

How would you build a similar commenting system as at the website?

like image 437
Léo Léopold Hertz 준영 Avatar asked Jun 26 '09 13:06

Léo Léopold Hertz 준영


4 Answers

Each paragraph (<p>) in the document has an ID (cn0, cn1, etc.) and a class (cn). This is the only part of the comment system rendered near the text. Also on the page is the div that acts as the popup, which also contains the comment form.

The rest is done with Javascript. When the page is loaded, they send an AJAX request back to get the number and location of all the comments in the document. It looks like:

[[0,4],[3,2],...]

With this, it adds a div in the margin with the speech bubble and number of comments on that line.

When you click on the bubbles, another AJAX request is initiated to get the comments for that bubble. In this case, they send down the actual HTML to be rendered instead of a JSON object like before.

On the backend (this is all conjecture now) they're tying each set of comments to a document and a location in that document (this allows them to show all comments for a document at once). I would probably use the built-in comments app to do this, and either package both items into one foreign key, by creating a model to link the document and location, or by subclassing the Comment model itself.

Hope this gets you in the right direction. You can probably learn more by looking at their Javascript, but it's been minified, so it's a little hard to read(UPDATE: found unminified js). They're building on YUI, but the code is pretty straight forward.

like image 65
tghw Avatar answered Nov 15 '22 22:11

tghw


You may be interested by Wooki. It's a collaborative writing platform, 100% open source and free. It was based on Django Book system.

Take a look : http://wookicentral.com

like image 42
Robin K Avatar answered Nov 15 '22 21:11

Robin K


A long time ago (2 years'ish) someone created a Django project to mimic the DjangoBook called Open Book Platform.

It has been dormant for a long time and might not even work properly on Django 0.96 let alone 1.0.x. However, when I just visited to get the URL I notice there's been some activity in the last month.

like image 25
Van Gale Avatar answered Nov 15 '22 22:11

Van Gale


Remark box is built on the same principles as the DjangoBook comment system, its a free service for small sites.

And unlike the projects or plug-ins others have mentioned on this thread, it can be used on any HTML page, integration is just a few JavaScript lines.

Their front page has a live demo http://www.remarkbox.com/

like image 27
drubio Avatar answered Nov 15 '22 23:11

drubio