Exemplo n.º 1
0
        public static void Show(string titleText, string bodyText)
        {
            ParagraphElement bodyContent = new ParagraphElement();
            bodyContent.InnerHTML = bodyText;

            ShowDlgWithContent(titleText, bodyContent);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        public static ModalDlg Make(string titleText, string bodyText, string id)
        {
            DivElement myModal = new DivElement();
            myModal.ClassName = "modal fade";
            myModal.Id = id;
            myModal.SetAttribute("role", "dialog");
            jQuery jq = new jQuery(myModal).On("hidden.bs.modal", OnHidden);

            DivElement modalDlg = new DivElement();
            modalDlg.ClassName = "modal-dialog-sm";
            myModal.AppendChild(modalDlg);

            DivElement modalContent = new DivElement();
            modalContent.ClassName = "modal-content";
            modalDlg.AppendChild(modalContent);

            DivElement modalHeader = new DivElement();
            modalHeader.ClassName = "modal-header";
            modalContent.AppendChild(modalHeader);

            ButtonElement button = new ButtonElement();
            button.SetAttribute("type", "button");
            button.ClassName = "close";
            button.SetAttribute("data-dismiss", "modal");
            button.InnerHTML = "×";
            modalHeader.AppendChild(button);

            HeadingElement title = new HeadingElement(HeadingType.H4);
            title.ClassName = "modal-title";
            title.InnerHTML = titleText;
            modalHeader.AppendChild(title);

            DivElement modalBody = new DivElement();
            modalBody.ClassName = "modal-body";
            modalContent.AppendChild(modalBody);

            ParagraphElement bodyContent = new ParagraphElement();
            bodyContent.InnerHTML = bodyText;
            modalBody.AppendChild(bodyContent);

            DivElement footer = new DivElement();
            footer.ClassName = "modal-footer";

            ButtonElement footerButton = new ButtonElement();
            footerButton.SetAttribute("type", "button");
            footerButton.ClassName = "btn btn-default";
            footerButton.SetAttribute("data-dismiss", "modal");
            footerButton.InnerHTML = "Close";

            footer.AppendChild(footerButton);
            modalContent.AppendChild(footer);

            Document.Body.AppendChild(myModal);

            ModalDlg dlg = new ModalDlg();
            dlg.TopElement = myModal;
            dlg.Body = modalBody;
            dlg.Title = title;
            dlg.BodyContent = bodyContent;
            dlg.Footer = footer;
            dlg.id = id;
            return dlg;
        }