// Interface Tiddly with OmniComment to get a comment page for each Tiddler.

// ~~~ var cgi_path = “/cgi/omni.cgi”; var server = “http://” + window.location.hostname;

config.macros.omni = {};

config.macros.omni.handler = function (place,macroName,params,wikifier,paramString,tiddler){

var id = story.findContainingTiddler(place).id.substr(7); var hs_search = new RegExp(‘\s\sW’, ‘gi’); id = id.replace(hs_search, “_”);

xh = new XMLHttpRequest(); xh.open(“GET”, server + cgi_path + “?count=1&filename=wiki_” + id, false); xh.send(null);

commentsLabel = “Comments (“ + xh.responseText + “)”; var commentsPrompt = “Comments on this tiddler”; var commentsHandler = function(e) { window.location=server + cgi_path + “?filename=wiki_“+id; return false; }; var commentsButton = createTiddlyButton(place, commentsLabel, commentsPrompt, commentsHandler);

}

// ~~~