コード例 #1
0
        public static HtmlTag RenderGrid <T>(this IFubuPage page, string id) where T : IGridDefinition, new()
        {
            var grid = new T();

            var div = new HtmlTag("div").Id(id).AddClass("slick-grid");

            div.Data("columns", grid.ToColumnJson());

            page.Asset("slickgrid_styles");
            page.Asset("slickgrid/SlickGridActivator.js");


            var url = grid.SelectDataSourceUrl(page.Urls);

            if (url.IsNotEmpty())
            {
                div.Data("url", url);
            }

            return(div);
        }
コード例 #2
0
 public void register_assets()
 {
     thePage.Asset("a.css", "b.css", "c.css", "d.js");
     theRequirements.AssertWasCalled(x => x.Require("a.css", "b.css", "c.css", "d.js"));
 }
コード例 #3
0
 public static CollapsiblePartialExpression CollapsiblePartialFor <TInputModel>(this IFubuPage page) where TInputModel : class
 {
     page.Asset("twitter/activate-collapsible.js");
     return(new CollapsiblePartialExpression(() => page.Partial <TInputModel>()));
 }
コード例 #4
0
 public static CollapsiblePartialExpression CollapsiblePartialFor(this IFubuPage page, object input)
 {
     page.Asset("twitter/activate-collapsible.js");
     return(new CollapsiblePartialExpression(() => page.PartialFor(input)));
 }
コード例 #5
0
 /// <summary>
 /// Registers one or more style assets and their dependencies as required assets,
 /// but does NOT write out any html tags.
 /// Really just a call to page.Asset(), but left here for backwards compatibility
 /// </summary>
 /// <param name="page"></param>
 /// <param name="cssNames"></param>
 public static void Css(this IFubuPage page, params string[] cssNames)
 {
     page.Asset(cssNames);
 }
コード例 #6
0
 /// <summary>
 /// Registers one or more scripts and their dependencies as required assets,
 /// but does NOT write out any html tags.
 /// Really just a call to page.Asset(), but left here for backwards compatibility
 /// </summary>
 /// <param name="page"></param>
 /// <param name="scripts"></param>
 public static void Script(this IFubuPage page, params string[] scripts)
 {
     page.Asset(scripts);
 }
コード例 #7
0
 /// <summary>
 /// Registers all the specified assets as required *and* writes the html tags
 /// for all known required assets and their dependencies
 /// </summary>
 /// <param name="page"></param>
 /// <param name="assetNames"></param>
 /// <returns></returns>
 public static TagList WriteAssetTags(this IFubuPage page, params string[] assetNames)
 {
     page.Asset(assetNames);
     return(page.Get <IAssetTagWriter>().WriteAllTags());
 }
コード例 #8
0
 /// <summary>
 /// Registers all the specified script assets, then writes html tags for *only*
 /// the assets where the MimeType is Javascript
 /// </summary>
 /// <param name="page"></param>
 /// <param name="scriptNames"></param>
 /// <returns></returns>
 public static TagList WriteScriptTags(this IFubuPage page, params string[] scriptNames)
 {
     page.Asset(scriptNames);
     return(page.Get <IAssetTagWriter>().WriteTags(MimeType.Javascript));
 }
コード例 #9
0
 /// <summary>
 /// Registers all the specified style assets, then writes html tags for *only*
 /// the assets where the MimeType is CSS
 /// </summary>
 /// <param name="page"></param>
 /// <param name="styleNames"></param>
 /// <returns></returns>
 public static TagList WriteCssTags(this IFubuPage page, params string[] styleNames)
 {
     page.Asset(styleNames);
     return(page.Get <IAssetTagWriter>().WriteTags(MimeType.Css));
 }