Subscribe to my RSS feed RSS

Posted: May 26th, 2008

Demisauce Comment notifications and Help System

A lot of work on the Demisauce Help system, using facebox jquery plugin for the popup page, or at least a heavily modifed version of Facebox. I had to implement quite a few changes to allow for content to be gathered from the Demisauce server, which would be a different domain. Therefore, the traditional ajax get in the Facebox wouldn't work, and i had to modify it to do a Document.write instead.

I added this method to Facebox to route requests via an inserted script.

// in facebox.js 
function fillFaceboxFromDocumentWrite(href, klass) {
    if ($('#facebox .content').attr('src') == href){
        $.facebox.reveal(null, klass,href);
    }else {
        var ds_html_script = document.createElement('script');
        ds_html_script.type = 'text/javascript';
        ds_html_script.src = $.facebox.settings.base_url + href;
        document.getElementById('facebox').appendChild(ds_html_script)
        $.facebox.reveal(null, klass,href);
    }
}

The script that gets called is dynamically generated to produce javascript, which will get inserted into the Dom of the remote server.

//  python code to generate ds_help_output
document.getElementById('facebox_content_holder').innerHTML = ds_help_output;

The end result is this help system. You can edit content at the Demisauce Hosted Server or can host a version of demisauce, then include a line of javascript in your apps to get built in help system. Here is a screenshot. Help System

Also, modified Demisauce to allow for Comment notification's. demisaucecommentsnotification

Posted: May 18th, 2008

First Version of the Demisauce Comment System!

Wow! A whirlwind of hacking has produced the first version of the comment system that i am going to use on this Potlatch blog, a Google App engine powered blog. The comment system is built as a proof of concept for Demisauce, the open source project i have been working on. The core idea of Demisauce is an open source set of web services that allow you to add functionality to your app. This service is mostly a javascript service that you embed on your app, allowing comments on anything. The other Demisauce services so far are XML services and html. This service (comments) is not better than the other comment systems out there (Disqus.com is very nice, and obviously Wordpress.com has comments for all blogs at Wordpress), but it is able to be installed and run behind a corporate firewall. I am thinking of using it for some applications at work to comment on just about anything, not just blog posts. Think of comments on images (flickr), or commenting on a purchase order, or requistion, or request to hire someone that are in corporate systems.

The configuration Page with the javascript you would need to copy, and embed in your pages. Also shows comments by this user.
Comment configuration
Here is an actual view of the comments in a blog, showing comments, comment box, login etc.
Comment box for Authenticated user
Here is a view by a user not logged in (uses google Authentication or you can create an account).
Comment form for Anonymous User
This shows a user that has clicked on "Logon" but is already authenticated.
Logon Page for logged on user
These are the Logon Comments
login comments


The features

  • Google Authentication for Users (optional)
  • Gravatar Icons
  • Native authentication for users (if Not using Google)
  • Configuration tools to setup javascript for your app

The application is built on the Python, Pylons base of Demisauce, but the core of the presentation is Javascript/Jquery. You can get the code at Demisauce on google code or get this blog code at Potlatch Blog on Github.

Although Comment systems are not the services I wanted to build first for Demisauce, I decided it is a great example for a service that combines Javascript, Data/Persistence, Widget/Embedding. I am planning on enhancing this a bit more, possibly doing a Django Book style pop-up comment system. Also, been wanting to enhance the help system some more, which uses the content management system which although not fancy is usable. If anyone else has some ideas on what they would like to see first I would love to hear them.