6👍
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.
3👍
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
- How to locally test Django's Sites Framework
- Is it possible to stop Django from creating .pyc files, whilst in development?
- Python Django Asynchronous Request handling
- Django ORM for desktop application
2👍
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.
- Translating formatted strings in Django not working
- Include a view in a template
- Django and models with multiple foreign keys
- Django python-rq — DatabaseError SSL error: decryption failed or bad record mac
- Django and reverse relations from foreign keys
1👍
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/
1👍
There’s a free, and fully supported, Django package that we built to have the same functionality as the Django Book site.
That codebase is used on several publicly-available websites, such at http://connectmv.com/tutorials
We do our best to maintain this package: installation can take some time – which is expected, given what the software is doing. Please give it a try and send us your feedback via the commenting feature on the http://ucomment.org site.
Kevin
- Create Read-Only MySQL Database Connection in Django
- Django datefield and timefield to python datetime
- How to get uploaded file name in django
0👍
I thought the DjangoBook site was built with Django, which would seem to imply it uses the Django comments framework.
UPDATE: There’s a note here which attributes a lot of the code for the comment system to Jack Slocum. The link on the DjangoBook page is dead, so I couldn’t find any additional info, but it may be that the code referred to is for the YUI/AJAX pieces that make the contextual commenting possible.
- Dict keys with spaces in Django templates
- SSH into Django Shell
- Django – Objects for business hours
- How to filter multiple fields with list of objects
0👍
You may want to try using WordPress with CommentPress plugin that is adding similar behaviour.
- Django authenticate using logged in windows domain user
- Centering and aligning width of figcaption tag on image in figure tag
- Live notification/chat in django
- Django REST Framework – multiple models / APIs?
- Django's HttpResponseRedirect is http instead of https
0👍
I dunno why I fall in this post again, but this is right now done by a lot of site I think. A nice implementation is: https://github.com/aroc/side-comments/
- Adding link to django admin page
- Can I delete the django migration files inside migrations directory
- Python Django Asynchronous Request handling