public static jQuery CreateRadioInput(string id, string label, string[] options) { jQuery divRadio = new jQuery("<div>"); divRadio.AddClass("col-sm-10"); for (int i = 0; i < options.Length; i++) { divRadio .Append(new jQuery("<label>") .AddClass("radio-inline") .Append(new InputElement { Type = InputType.Radio, Id = id + "-" + i, Name = id, Value = options[i] }) .Append(options[i]) ); } return new jQuery("<div>") .AddClass("form-group") .Append(new LabelElement { ClassName = "control-label col-sm-2", HtmlFor = id, InnerHTML = label + ":" }) .Append(divRadio); }
public static void CreateForm(jQuery container, Form template) { foreach (FormField field in template.Fields) { container.Append(App.CreateFormField(field)); } container.Append(new jQuery("<div>") .AddClass("form-group") .Append(new jQuery("<div>") .AddClass("col-sm-offset-2 col-sm-10") .Append(new jQuery(new InputElement { Type = InputType.Submit, Value = "Submit", ClassName = "btn btn-primary", FormAction = SUBMIT_URL, FormMethod = "POST" })) ) ); }
private static void MakeList() { jQuery row = new jQuery("<div>").AddClass("row"); jQuery col1 = new jQuery("<div>").AddClass("col-sm-3").AppendTo(row); jQuery col2 = new jQuery("<div>").AddClass("col-sm-9").AppendTo(row); row.Get(0).Style.Padding = "20px"; AccordionPanel p = AccordionPanel.Make("Sharp THREEjs", "(jus a try out :)", "myID", PanelType.panel_default); foreach (KeyValuePair<string, List<BaseDemo>> kvp in Demos) { ListMaker m = new ListMaker(); foreach (BaseDemo d in kvp.Value) { m.AddListItem(d.DemoName, clickDemo, d); } p.AddPanel(kvp.Key, m.List); } col1.Append(p.MainContainer); row.AppendTo(Document.Body); DemoContainer = col2.Get(0); }
public static AccordionPanel Make(string headerText, string subtext, string id, PanelType type) { AccordionPanel accor = new AccordionPanel(); accor.id = id; accor.PType = type; jQuery c = new jQuery("<div>"); if (!string.IsNullOrEmpty(headerText)) c.Append(new jQuery("<h2>").Html(headerText)); if (!string.IsNullOrEmpty(subtext)) c.Append(new jQuery("<h4>").Html(subtext)); accor.PanelGroup = new jQuery("<div>").AddClass("panel-group").Attr("id", id); c.Append(accor.PanelGroup); accor.MainContainer = c; return accor; }
private jQuery MakePanelTitle(string title, string href, string dataParent, Action<jQueryEvent> clickHandler, object panelTag) { jQuery panelHeading = new jQuery("<div>").AddClass("panel-heading"); jQuery panelTitle = new jQuery("<h4>").AddClass("panel-title"); jQuery panelAcoordion = new jQuery("<a>").Attr("data-toggle", "collapse").Attr("data-parent",dataParent ).Attr("href", href).Html(title); if (clickHandler != null) panelAcoordion.Click(panelTag, clickHandler); panelTitle.Append(panelAcoordion); panelHeading.Append(panelTitle); return panelHeading; }
private jQuery MakeContentPanel(jQuery content, string id) { jQuery panelCollapse = new jQuery("<div>").AddClass("panel-collapse collapse").Attr("id",id); if (content != null) { jQuery panelBody = new jQuery("<div>").AddClass("panel-body"); panelBody.Append(content); panelCollapse.Append(panelBody); } return panelCollapse; }
public jQuery AddPanel(string title, jQuery content, Action<jQueryEvent> clickHandler=null, object panelTag=null) { panelCount++; string className = GetPanelTypeName(PType); jQuery panel = new jQuery("<div>").AddClass(className); panel.Append(MakePanelTitle(title, "#panel_" + id + panelCount.ToString(), "#" + id, clickHandler, panelTag)); panel.Append(MakeContentPanel(content, "panel_" + id + panelCount.ToString())); PanelGroup.Append(panel); return panel; }