From 2f635c01d74b4e5a14be3ebc60c9dcd8e97641bf Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 11 Oct 2011 21:07:08 +0200 Subject: more skinning-support --- src/site-media/js/jquery.meetingtools.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/site-media/js') diff --git a/src/site-media/js/jquery.meetingtools.js b/src/site-media/js/jquery.meetingtools.js index b48ff2f..0141c38 100644 --- a/src/site-media/js/jquery.meetingtools.js +++ b/src/site-media/js/jquery.meetingtools.js @@ -5,18 +5,23 @@ jQuery.fn.meetingtools = function(options) { + var defaults = { + onAdd: function() {}, + onChange: function() {}, + url: 'http://localhost:8000'; + }; + var options = $.extend({}, defaults, options); + this.each(function() { var tags = options.tags; var url = options.url; - if (!url) { - url = 'http://localhost:8000'; - } - var url = url+'/room/+'+tags+'.json'; + var url = options.url+'/room/+'+tags+'.json'; var div = $(this); + div.html(''); // stop any spinners; $.getJSON(url,function(data) { - html = ""); + options.onUpdate(); }); -- cgit v1.1