From: Florian Zeitz Date: Sun, 22 Aug 2010 22:35:10 +0000 (+0200) Subject: Add ability to render forms (no submitting yet) X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=commitdiff_plain;h=83dffb602a2d29d0f0030ba171c722ae254a37ca;ds=sidebyside Add ability to render forms (no submitting yet) --- diff --git a/index.html b/index.html index 28ce002..a4ab660 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -XMPP Chat +adHocWeb diff --git a/js/main.js b/js/main.js index 61ddaa4..c20969d 100644 --- a/js/main.js +++ b/js/main.js @@ -42,16 +42,103 @@ function onConnect(status) { } } +function addNote(elem, text, type) { + if (!type) { + type = "info"; + } + $(elem).append("

" + text + "

"); +} + +function addForm(elem, x) { + var form = $("
"); + form.submit(function(){return false;}); + var fieldset = $("
"); + form.append(fieldset); + $("").text($(x).find("title").text()).appendTo(fieldset); + $("

").text($(x).find("instructions").text()).appendTo(fieldset); + $(x).find("field").each(function(){ + var item = null; + var type = $(this).attr("type"); + if($(this).attr("label")) { + $("