public static void DefineNiceController()
        {
            AngularJSDemo.hwbApp.Controller<ControllerDataObjectStructure>
                ("hwcSctl", CtlFunction);

            var ctlDiv = new DivElement();
            ctlDiv.SetNGController("hwcSctl");
            Document.Body.AppendChild(ctlDiv);

            var fltFld = new InputElement();
            fltFld.SetNGModel("hwcFlt");
            ctlDiv.AppendChild(fltFld);

            var ordFld = new SelectElement();
            ordFld.SetNGModel("hwcOrderBy");
            ordFld.Add(new OptionElement() {
                Value = "Checkpoint",
                InnerHTML = "Alphabetically"
            });
            ordFld.Add(new OptionElement() {
                Value = "id",
                InnerHTML = "Series ID"
            });
            ctlDiv.AppendChild(ordFld);

            var rptSpan = new SpanElement();
            rptSpan.SetNGRepeat("checkpoint", "checkpoints", fltFld.GetNGModel(),
                ordFld.GetNGModel());
            rptSpan.InnerHTML = "{{checkpoint.callsign}}[{{checkpoint.id}}] ";
            ctlDiv.AppendChild(rptSpan);
        }
示例#2
0
        public static Element[] CreateDateTimeField()
        {
            var label = new LabelElement
            {
                HtmlFor = "dateTimeInput",
                InnerHTML = "Server Date and Time:"
            };

            var div = new DivElement
            {
                ClassName = "input-group"
            };

            var spanPrefix = new SpanElement
            {
                ClassName = "input-group-addon glyphicon glyphicon-time"
            };

            var spanSuffix = new SpanElement
            {
                ClassName = "input-group-btn"
            };

            var button = new ButtonElement
            {
                Type = ButtonType.Button,
                ClassName = "btn btn-primary",
                InnerHTML = "<span class=\"glyphicon glyphicon-refresh\"></span>",
                OnClick = Html5App.UpdateButton_Click
            };

            var input = new InputElement
            {
                Id = "dateTimeInput",
                Type = InputType.Text,
                ClassName = "form-control",
                Placeholder = "Click update...",
                ReadOnly = true,
                Name = "datetime"
            };

            spanSuffix.AppendChild(button);

            div.AppendChild(spanPrefix);
            div.AppendChild(input);
            div.AppendChild(spanSuffix);

            return new Element[] { label, div };
        }
示例#3
0
        public static DivElement CreateFormField(string name, string glyph)
        {
            var div = new DivElement
            {
                ClassName = "input-group",
                Style =
                {
                    MarginBottom = "10px"
                }
            };

            var span = new SpanElement
            {
                ClassName = "glyphicon glyphicon-" + glyph + " input-group-addon"
            };

            Element input;
            var placeholder = name + "...";

            if (name == "Message")
            {
                input = new TextAreaElement
                {
                    Name = name.ToLowerCase(),
                    Placeholder = placeholder,
                    Required = true,
                    ClassName = "form-control"
                };
            }
            else
            {
                input = new InputElement
                {
                    Type = InputType.Text,
                    Name = name.ToLowerCase(),
                    Placeholder = placeholder,
                    Required = true,
                    ClassName = "form-control"
                };
            }

            div.AppendChild(span);
            div.AppendChild(input);

            return div;
        }
示例#4
0
文件: Demo.cs 项目: phaethom/Demos
        public static void Main()
        {
            Console.Log("Demo. Logged on console.");

            var spanEl = new SpanElement()
            {
                InnerHTML = "If you can read this line, then bridge is working!"
            };

            Document.Body.AppendChild(spanEl);

            var button = new ButtonElement
            {
                InnerHTML = "Show Bridge.NET message",
                OnClick = (ev) =>
                {
                    Global.Alert("Welcome to Bridge.NET");
                }
            };

            Document.Body.AppendChild(button);
        }
 /// <summary>
 /// This function determines the format of the contents of the entry
 /// point where the dynamic code will be injected.
 /// </summary>
 /// <returns></returns>
 public static object dynMehTemplate()
 {
     var span = new SpanElement();
     span.SetNGController("hwbctl");
     span.InnerHTML = "AJS says by directive: [{{message}}]";
     return new { template = span.OuterHTML };
 }
        public static void UpdateControls()
        {
            Console.Log("Checkpoint Zebra: [rdy] nothing at this point will " +
                "like AngularJS.");

            var lbl = new SpanElement() { InnerHTML = "We have Bridge script " +
                    "running." };
            Document.Body.AppendChild(lbl);
        }
 public static object ThreeWayFunction()
 {
     var span = new SpanElement();
     span.SetNGController("hwbSctl");
     span.InnerHTML = "AJS for three scopined: " +
         "[msg:{{message}}][foo:{{foo}}][bar:{{bar}}]";
     return new { template = span.OuterHTML };
 }
        public static Element GetRepeatRegion()
        {
            var itemsSpan = new SpanElement();
            itemsSpan.InnerHTML = "Checkpoint";
            var itemsPara = new ParagraphElement();
            itemsPara.InnerHTML = "{{checkpoint.callsign}}[{{checkpoint.id}}]";

            var itemsLI = new LIElement();
            itemsLI.SetNGRepeat("checkpoint", "checkpoints");
            itemsLI.AppendChild(itemsSpan);
            itemsLI.AppendChild(itemsPara);

            var itemsUL = new UListElement();
            itemsUL.AppendChild(itemsLI);

            var itemsSubSpan = new SpanElement()
            {
                InnerHTML = "[{{checkpoint.callsign}}.{{checkpoint.id}}] "
            };

            var itemsSearchBox = new InputElement();
            itemsSearchBox.SetNGModel("cpFilter");

            var itemsOrderSelector = GetOrderBySelector("cpOrderBy");

            itemsSubSpan.SetNGRepeat("checkpoint", "checkpoints",
                itemsSearchBox.GetNGModel(), itemsOrderSelector.GetNGModel());

            var itemsDiv = new DivElement();
            itemsDiv.SetNGController("hwbSctl");
            itemsDiv.AppendChild(itemsUL);
            itemsDiv.AppendChild(itemsSearchBox);
            itemsDiv.AppendChild(itemsOrderSelector);
            itemsDiv.AppendChild(itemsSubSpan);

            return itemsDiv;
        }