Ejemplo n.º 1
0
        public static void Test()
        {
            InputElement input = new InputElement();

            input.OnChange += (ev) =>
            {
                // Tests if ev.CurrentTarget.Value compiles
                Console.Log("ev.CurrentTarget.Value: " + ev.CurrentTarget.Value);

                // Tests if ev.IsMouseEvent() compiles
                Console.Log("IsMouseEvent: " + ev.IsMouseEvent());
            };

            AnchorElement anchor = new AnchorElement();

            anchor.OnClick += (ev) =>
            {
                // Tests if ev.CurrentTarget.Href compiles
                Console.Log("ev.CurrentTarget.Href: " + ev.CurrentTarget.Href);
            };

            // Test if Document.GetElementById<>() compiles
            DivElement div = Document.GetElementById<DivElement>("div1");

            // Tests if Element is still a superclass of all the element classes and the following code compiles
            Element element;

            element = new InputElement();
            element = new TextAreaElement();
        }
Ejemplo n.º 2
0
 public static void TestUseCase()
 {
     var textArea = new TextAreaElement();
     textArea.Id = "textArea1";
     textArea.Value = "Test";
     
     var root = Document.GetElementById("qunit-fixture");
     root.AppendChild(textArea);
     
     var ta = Document.GetElementById("textArea1");
     Assert.AreEqual(ta["value"], "Test", "Bridge816 textArea1.value");
 }
Ejemplo n.º 3
0
        public static jQuery CreateFormField(string name, string glyph)
        {
            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"
                };
            }

            return new jQuery("<div>")
                .AddClass("input-group")
                .Css("margin-bottom", "10px")
                .Append(new SpanElement
                {
                    ClassName = "glyphicon glyphicon-" + glyph + " input-group-addon"
                })
                .Append(input);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        public static jQuery CreateFormField(string name, string glyph)
        {
            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"
                };
            }

            return new jQuery("<div>")
                .AddClass("input-group")
                .Css("margin-bottom", "10px")
                .Append(new SpanElement
                {
                    ClassName = "glyphicon glyphicon-" + glyph + " input-group-addon"
                })
                .Append(new jQuery(input)
                    .Attr("rel", "tooltip")
                    .Tooltip(new TooltipOptions
                    {
                        Title = "Required Field",
                        Container = "body",
                        Placement = PopupPlacement.Right
                    })
                );
        }