/*
* a jQuery plugin for listing tagged meetings from meetingtools
*
*/
jQuery.fn.meetingtools = function(options) {
var defaults = {
onAdd: function() {},
onUpdate: function() {},
url: 'http://localhost:8000'
};
var options = $.extend({}, defaults, options);
this.each(function() {
var tags = options.tags;
var url = options.url;
var url = options.url+'/room/+'+tags+'.json?callback=?';
var div = $(this);
$.getJSON(url,function(data) {
div.html("
");
ul = div.find('ul.meeting-list');
$.each(data,function(i,room) {
var html = ""+room['name']+"
";
if (room['description']) {
html += "
";
html += room['description'];
html += "
";
}
html += "
"
html += "There are currently " + room['user_count'] + " participant(s) and " + room['host_count'] + " host(s) in the room.";
html += "
";
html += "
";
html += "
" + room['url'] + "
";
html += "
";
html += " ";
ul.append(html);
options.onAdd();
});
options.onUpdate();
});
});
}