diff options
author | Leif Johansson <leifj@sunet.se> | 2011-05-30 11:17:02 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-05-30 11:17:02 +0200 |
commit | 1866e375b69aecb53b617da8993fc71c798af8f4 (patch) | |
tree | d93eaf3f65b6a72763874815be18215353695500 /src/site-media/js | |
parent | db3632c30e9262adbe7a35be404ace0436a20271 (diff) |
A simple jquery-based widget for disaplaying stuff from meetingtools.
Diffstat (limited to 'src/site-media/js')
-rw-r--r-- | src/site-media/js/jquery.meetingtools.js | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/site-media/js/jquery.meetingtools.js b/src/site-media/js/jquery.meetingtools.js index 5bed8f3..1453226 100644 --- a/src/site-media/js/jquery.meetingtools.js +++ b/src/site-media/js/jquery.meetingtools.js @@ -1,6 +1,5 @@ /* - * - * + * a jQuery plugin for listing tagged meetings from meetingtools * */ @@ -12,17 +11,27 @@ jQuery.fn.meetingtools = function(options) { if (!url) { url = 'http://localhost:8000'; } - var url = url+'/room/+'+tags+'.json' - var div = $(this) + var url = url+'/room/+'+tags+'.json'; + var div = $(this); $.getJSON(url,function(data) { - div.append("<ul style=\"list-style: none;\">") - $.each(data,function(room) { - div.append("<li style=\"display: list-item; list-style: none; padding: 2px; 5px;\" class=\"ui-helper-reset ui-widget ui-state-highlight ui-corner-all\">"); - div.append(room['url']); - div.append("</li>"); + html = "<ul class=\"meeting-list\">"; + $.each(data,function(i,room) { + html += "<li class=\"meeting\"><h4>"+room['name']+"</h4><div class=\"meeting-info\">"; + if (room['description']) { + html += "<div class=\"meeting-description\">"; + html += room['description']; + html += "</div>"; + } + html += "<div class=\"meeting-participants\">" + html += "There are currently " + room['user_count'] + " participant(s) and " + room['host_count'] + " host(s) in the room."; + html += "</div>"; + html += "<div class=\"meeting-url\"><a href=\"" + room['url'] + "\">" + room['url'] + "</a></div>"; + html += "</li>"; }); - div.append("</ul>") + html += "</ul>"; + div.append(html); }); + }); }
\ No newline at end of file |