public HtmlDocument get_page_with_assets() { _document.Head.Append(_document.Css("styles1.css", "nonexistent.css")); _document.Add(x => x.Image("image1.bmp")); _document.Add(x => x.Image("image2.bmp")); _document.Push("footer"); _document.Add(x => x.Script("script1.js", "nonexistent.js")); return(_document); }
public HtmlDocument get_instrumentation(HomeInputModel inputModel) { _document.Title = "Instrumentation Samples"; _document.Add("h1").Text("Hello!"); _document.Add("a").Attr("href", "/_fubu#instrumentation").Text("Go to instrumentation"); _document.Push("ul"); _document.Add("li/a") .Text("Make a really long request") .Attr("href", _urls.UrlFor <InstrumentationEndpoint>(x => x.get_really_long_request())); _document.Add("li/a") .Text("Throw an exception") .Attr("href", _urls.UrlFor <ErrorEndpoint>(x => x.get_exception())); _document.Add("li/a") .Text("Make a request with a custom behavior") .Attr("href", _urls.UrlFor(new OtherInputModel { HelloText = "Nothing" })); _document.Add("li/a") .Text("Make a request that occasionally throws an error") .Attr("href", _urls.UrlFor(new OccasionalInput { HelloText = "Hello" })); return(_document); }
public FubuHtmlDocument Index() { _document.Title = "FubuMVC Demonstrator"; _document.Head.Append(_document.Css("myStyles.css")); _document.Add("h1").Text("FubuMVC Demonstrator"); _document.Add("p").Text("Generated at " + DateTime.Now); _document.Add("hr"); _document.Add("h2").Text("Images"); _document.Add("p").Text("There should be a picture of the Serenity right below me..."); _document.Add(x => x.Image("Firefly.jpg")); _document.Add("p").Text("The url of the image above is '{0}'".ToFormat(_document.ImageUrl("Firefly.jpg"))); _document.Add("hr"); _document.Add("h1").Text("Stylesheets"); _document.Add("div") .Text("This text should be green because of the .green class in myStyles.css") .AddClass("green"); _document.Add("hr"); _document.Add("p").Text("If the script tags are working, you should see text right below me"); _document.Add("div").Id("script-div"); _document.Push("footer"); _document.Add(x => x.Script("jquery-2.1.0.min.js", "Go.js")); return(_document); }
public void SetUp() { var services = new InMemoryServiceLocator(); theDocument = new FubuHtmlDocument(services); theDocument.Push("div"); theBuilder = new DetailTableBuilder(theDocument); }
public HtmlDocument AllCases() { _document.Asset("ui.jqgrid.css"); _document.Asset("redmond/jquery.ui.theme.css"); _document.Title = "All Cases"; _document.Push("div").Hide(); _document.Add("button").Text("Remove").Id("removeFilter"); _document.Pop(); _document.Add("h1").Text("All Cases"); _document.Add("hr"); _document.Push("ul"); _repository.GetAll <Case>().Each(x => { _document.Push("li"); _document.Add("a").Text(x.Identifier).Attr("href", _urls.UrlFor(x)); _document.Pop(); }); _document.Pop(); _document.Add("hr"); _document.Add(x => x.FiltersFor <CaseGrid>()); _document.Add("button").Text("Add").Id("add"); _document.Add("button").Text("Clear").Id("clear"); _document.Add("button").Text("Search").Id("search-criteria-search"); _document.Add("hr"); _document.Add(x => x.SmartGridFor <CaseGrid>(null)); _document.WriteScriptsToBody(); return(_document); }
public HtmlDocument GettingStarted() { var document = new FubuHtmlDocument(_services); document.Title = "Getting Started with FubuMVC"; document.Add(x => x.Image("logo.png")); document.Push("div"); document.Add("hr"); document.Add(x => x.LinkTo<BehaviorGraphWriter>(o => o.Index()).Text("Diagnostics for your application")); document.Add("div").Encoded(false).Text(getContent()); return document; }
public HtmlDocument get_samplejob_controller() { _document.Title = "Sample Job Controller"; _document.Add("h1").Text("Sample Job Controller"); _document.Add("p").Text("Has executed {0} times".ToFormat(SampleJob.ExecutionCount)); _document.Add("p") .Text(SampleJob.WillSucceed ? "The job will succeed on execution" : "The job fails on execution"); _document.Push("form").Attr("action", _document.Urls.UrlFor<ToggleSampleJob>()).Attr("method", "POST"); _document.Add("input").Attr("type", "submit").Text("Toggle the Sample Job Success State"); _document.Pop(); _document.Add("hr"); _document.Push("form").Attr("action", _document.Urls.UrlFor<SetSampleJobTime>()).Attr("method", "POST"); _document.Add("input").Attr("type", "text").Value(SampleJob.Delay.ToString()).Name("Seconds"); _document.Add("input").Attr("type", "submit").Text("Set the execution time in seconds"); return _document; }
public HtmlDocument GettingStarted() { var document = new FubuHtmlDocument(_services); document.Title = "Getting Started with FubuMVC"; document.Add(x => x.Image("logo.png")); document.Push("div"); document.Add("hr"); document.Add(x => x.LinkTo <BehaviorGraphWriter>(o => o.Index()).Text("Diagnostics for your application")); document.Add("div").Encoded(false).Text(getContent()); return(document); }
public HtmlDocument get_person_Name(TextModel model) { var document = new FubuHtmlDocument <TextModel>(_services, new InMemoryFubuRequest()) { Model = model }; document.Title = "Persion:" + model.Name; document.Push("p"); document.Add("span").Text(document.Model.Name); document.Add("input").Attr("type", "text").Id("Name").Name("Name").Value(model.Name); return(document); }
public HtmlDocument get_person_Name(TextModel model) { var document = new FubuHtmlDocument <TextModel>(_services, new InMemoryFubuRequest()) { Model = model }; document.Title = "Persion:" + model.Name; document.Push("p"); document.Add(x => x.LabelFor(o => o.Name)); document.Add(x => x.InputFor(o => o.Name)); return(document); }
public HtmlDocument GettingStarted() { var document = new FubuHtmlDocument(_services); document.Title = "Getting Started with FubuMVC"; document.Add(x => x.Image("logo.png")); document.Push("div"); document.Add("hr"); // we're gonna cheat here since the diagnostics markers changed // TODO -- Share input models for the dashboard document.Add(new LinkTag("Diagnostics for your application", _request.ToFullUrl("_fubu"))); document.Add("div").Encoded(false).Text(getContent()); return document; }
public HtmlDocument GettingStarted() { var document = new FubuHtmlDocument(_services); document.Title = "Getting Started with FubuMVC"; document.Add(x => x.Image("logo.png")); document.Push("div"); document.Add("hr"); // we're gonna cheat here since the diagnostics markers changed // TODO -- Share input models for the dashboard document.Add(new LinkTag("Diagnostics for your application", _request.ToFullUrl("_fubu"))); document.Add("div").Encoded(false).Text(getContent()); return(document); }
private HtmlTag buildDocument(Guid chainId, Action <DetailsTableTag, BehaviorChain, RouteReport> action) { writeAssets(); var chain = _graph.Behaviors.FirstOrDefault(x => x.UniqueId == chainId); if (chain == null) { return(new HtmlTag("div").Text("This route cannot be found")); } var top = _document.Push("div"); var report = RouteReport.ForChain(chain, _urls); var details = buildDetails(report); action(details, chain, report); return(top); }
public HtmlDocument Index() { _document.Title = "Scheduled Job Testing Harness"; _document.Add("p").Text("The running nodes are:"); _document.Push("ul"); _group.Nodes().Each(node => { var url = _urls.UrlFor(new ShutdownRequest { Node = node.Id }); _document.Add("li/a").Text("Shutdown " + node.Id).Attr("href", url); }); _document.Add("p/a").Text("Scheduled Job Diagnostics") .Attr("href", _urls.UrlFor <ScheduledJobsFubuDiagnostics>(x => x.get_scheduled_jobs())); _document.Add("p/a").Text("Quit the harness").Attr("href", _urls.UrlFor <HomeEndpoint>(x => x.get_quit())); return(_document); }
public HtmlDocument Index() { _document.Title = "FubuTransportation Diagnostics Harness"; _document.Add("a").Attr("href", "/_fubu").Text("Diagnostics"); _document.Add("p") .Text("Type in a list of comma delimited integers. Any number over 100 will cause an exception in the message handling"); var formTag = _document.FormFor <NumberPost>(); _document.Push(formTag); _document.Add("textarea").Name("Numbers"); _document.Add("br"); _document.Add("input").Attr("type", "submit").Attr("value", "Submit"); _document.Pop(); _document.Add(new LiteralTag("</form>")); // ugh. return(_document); }
private HtmlDocument buildDocument(FileUploadOutput model) { _document.Model = model; _document.Title = "File Upload View"; _document.Add("h1").Text(model.Text); _document.Add("form") .Attr("method", "post") .Attr("enctype", "multipart/form-data") .Attr("action", _document.Urls.UrlFor <FileUploadInput>(null)); _document.Add("br"); _document.Push("p"); _document.Add("span").Text("File 1: "); _document.Add("input").Attr("type", "file").Attr("name", "File1"); _document.Add("br"); _document.Add("input").Attr("type", "submit"); return(_document); }