About

The eLog library was initially developed as a research prototype and later published for lifelogging researchers in 2010 to help them easily analyze heterogenous data and complex visualization. It has been kept growing with the progress of mobile computing environments and recently its UI part is released with GPL v3 license for wider usage. The eLog UI library is optimized for mobile environment and can get easily integrated with existing Web services.

Who We Are

The original work was proposed by Pil Ho and later extended the work with collaboration with 28 researchers around the world who contributed their lifelogs, collaborated for lifelog analysis and share research results to build up an open lifelogging platform for the public. Pil Ho has been keeping the development updating the library following up the progress in mobile computing.

Updates

  • Nov. 2014: Change the web page skin using bootstrap.
  • Nov. 2014: Published elog UI library as GPL v3.
  • Oct. 2014: Version up eLog library and documentation.

 

eLifeLog API documentation user comment support using DISQUS

For eLifeLog API documentation, we have been using Jsduck (https://github.com/senchalabs/jsduck) for our client APIs (Built atop Sencha Touch Javascript Framework) and server APIs (PHP). You can find some details at http://www.elifelog.org/lab/elog_doc/#!/guide/documentation

The problem was that recently Jsduck decides to only focus on Javascript and thus PHP code parsing supports has been dropped off. So we had to stick to the old Jsduck version (3.11.0) and thus can't use their comment server supports (https://github.com/senchalabs/jsduck-comments). While we see no reason to upgrade to newer Jsduck, there are significant needs for user comment supports.

This small lab is focused on adjusting the output of Jsduck to include http://disqus.com commenting services. We will describe the progress here for the record and also as the open source.

Ideas

Main ideas come from DevInterface where he wrote on "How to insert more Disqus comments box in a single page". As DISQUS allows only one comment page per document, we need to create iframs as many as functions to get user comments. If we want to display multiple comments at the same time, this is the only method now (April, 2013).

Download

Do not copy and paste below codes. Some problems with syntax highlighting cause a part of code hidden. Use this link for the full version: http://www.elifelog.org/dist/jsduck_disqus_handler.zip

Implementation

Whole source codes are composed of 4 files. 

The first one is a user console interface that the class in load disqus_comment_handler.php and performs DISQUS comment service inserting jobs.

You can run above PHP in this way

php disqus_comment_insert.php -d jsduck_generated_document_directory -s your_disqus_shortname -c your_disqus_category_id_number

The content of disqus_comment_handler.php class is below

disqus_comments.php is the iframe content to display DISQUS contents within the JsDuck generated document.




References

DISQUS callback functions

DISQUS supports user-defined callback functions (unofficially). See http://blog.slashpoundbang.com/post/2592867566/disqus-the-missing-manual for details. Also look into the embed.js code from go.disqus.com, then you can find this code

{onReady: "loading.done",onNewComment: "posts.create",onPaginate: "posts.paginate",onIdentify: "session.identify"};

and also

callbacks: {preData: [],preInit: [],onInit: [],afterRender: [],onReady: [],onNewComment: [],preReset: [],onPaginate: [], onIdentify: []}};

From above callbacks, we will use afterRender and onReady to adjust the size of status of iframes.