Ejemplo n.º 1
0
        /// <summary>
        /// Adds all addons for the DropDownList component to the current page.
        /// </summary>
        public static async Task IncludeExplicitAsync()   // this component is reusable so we need to explicitly include all js/css
        {
            bool useKendo = true;

            if (useKendo)
            {
                await KendoUICore.AddFileAsync("kendo.data.min.js");

                // await KendoUICore.AddFileAsync("kendo.popup.min.js"); // is now a prereq of kendo.window (2017.2.621)
                await KendoUICore.AddFileAsync("kendo.list.min.js");

                await KendoUICore.AddFileAsync("kendo.fx.min.js");

                await KendoUICore.AddFileAsync("kendo.userevents.min.js");

                await KendoUICore.AddFileAsync("kendo.draganddrop.min.js");

                await KendoUICore.AddFileAsync("kendo.mobile.scroller.min.js");

                await KendoUICore.AddFileAsync("kendo.virtuallist.min.js");

                await KendoUICore.AddFileAsync("kendo.dropdownlist.min.js");
            }
            await Manager.AddOnManager.AddTemplateAsync(Controllers.AreaRegistration.CurrentPackage.AreaName, "DropDownList");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds all addons for the Text component to the current page.
        /// </summary>
        public static async Task IncludeExplicitAsync()   // this component is reusable so we need to explicitly include all js/css
        //await KendoUICore.AddFileAsync("kendo.maskedtextbox.min.js");
        {
            await KendoUICore.UseAsync();// needed for css

            await Manager.AddOnManager.AddTemplateAsync(Controllers.AreaRegistration.CurrentPackage.AreaName, "Text");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            await KendoUICore.AddFileAsync("kendo.userevents.min.js");

            await KendoUICore.AddFileAsync("kendo.numerictextbox.min.js");

            await base.IncludeAsync();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            //await KendoUICore.AddFileAsync("kendo.popup.min.js"); // is now a prereq of kendo.window (2017.2.621)
            await KendoUICore.AddFileAsync("kendo.button.min.js");

            await KendoUICore.AddFileAsync("kendo.menu.min.js");

            await base.IncludeAsync();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            await KendoUICore.UseAsync();// needed for css

            //await KendoUICore.AddFileAsync("kendo.maskedtextbox.min.js");
            await Manager.AddOnManager.AddTemplateAsync(Controllers.AreaRegistration.CurrentPackage.AreaName, "Text");

            await base.IncludeAsync();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            await KendoUICore.AddFileAsync("kendo.calendar.min.js");

            //await KendoUICore.AddFileAsync("kendo.popup.min.js"); // is now a prereq of kendo.window (2017.2.621)
            await KendoUICore.AddFileAsync("kendo.timepicker.min.js");

            await KendoUICore.AddFileAsync("kendo.datetimepicker.min.js");

            await base.IncludeAsync();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            if (Manager.CurrentSite.TabStyle == YetaWF.Core.Site.TabStyleEnum.JQuery)
            {
                await JqueryUICore.UseAsync();
            }
            else if (Manager.CurrentSite.TabStyle == YetaWF.Core.Site.TabStyleEnum.Kendo)
            {
                await KendoUICore.AddFileAsync("kendo.data.min.js");

                await KendoUICore.AddFileAsync("kendo.tabstrip.min.js");
            }
            else
            {
                throw new InternalError("Unknown tab control style");
            }
            await base.IncludeAsync();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            await KendoUICore.AddFileAsync("kendo.maskedtextbox.min.js");

            await base.IncludeAsync();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Called by the framework when the component is used so the component can add component specific addons.
        /// </summary>
        public override async Task IncludeAsync()
        {
            await KendoUICore.UseAsync();// needed for css

            await base.IncludeAsync();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(MenuComponentBase.MenuData model)
        {
            HtmlBuilder hb = new HtmlBuilder();

            MenuStyleEnum style = PropData.GetAdditionalAttributeValue("Style", MenuStyleEnum.Automatic);

            if (style == MenuStyleEnum.Automatic)
            {
                style = Manager.SkinInfo.UsingBootstrap ? MenuStyleEnum.Bootstrap : MenuStyleEnum.Kendo;
            }

            if (style == MenuStyleEnum.Bootstrap)
            {
                string menu = (await CoreRendering.RenderMenuAsync(model.MenuList, DivId, null, RenderEngine: YetaWF.Core.Modules.ModuleAction.RenderEngineEnum.BootstrapSmartMenu, HtmlHelper: HtmlHelper));
                if (!string.IsNullOrWhiteSpace(menu))
                {
                    await Manager.AddOnManager.AddAddOnNamedAsync(Package.AreaName, "github.com.vadikom.smartmenus"); // multilevel navbar

                    hb.Append(menu);
                }
            }
            else
            {
                string menu = (await CoreRendering.RenderMenuAsync(model.MenuList, DivId, model.CssClass, RenderEngine: YetaWF.Core.Modules.ModuleAction.RenderEngineEnum.KendoMenu, HtmlHelper: HtmlHelper));
                if (!string.IsNullOrWhiteSpace(menu))
                {
                    //await KendoUICore.AddFileAsync("kendo.popup.min.js"); // is now a prereq of kendo.window (2017.2.621)
                    await KendoUICore.AddFileAsync("kendo.menu.min.js");

                    hb.Append($@"
<div class='yt_yetawf_menus_menu t_display' role='navigation'>
    {menu}
</div>");

                    ScriptBuilder sb = new ScriptBuilder();
                    sb.Append($@"
$('#{DivId}').kendoMenu({{
    direction: '{model.GetDirection()}',
    orientation: '{model.GetOrientation()}',
    popupCollision: 'fit flip',");

                    //if (Module.UseAnimation) {
                    //    @:  animation: {
                    //    @:      open: { effects: '@Module.GetOpenEffects()', duration: @Module.OpenDuration },
                    //    @:      close: { effects: '@Module.GetCloseEffects()', duration: @Module.CloseDuration }
                    //    @:  },
                    //},

                    sb.Append($@"
    hoverDelay: {model.HoverDelay}
}});");

                    if (model.ShowPath)
                    {
                        sb.Append($@"
{BeginDocumentReady(DivId)}
    new YetaWF_ComponentsHTML.MenuDisplayComponent('#{DivId}');
{EndDocumentReady()}");
                    }

                    Manager.ScriptManager.AddLast(sb.ToString());
                }
            }

            return(hb.ToString());
        }