コード例 #1
0
 /// <summary>
 /// Registers a jQueryUI script tag in the page header, if it is desired and not already on the page
 /// </summary>
 public void RegisterJqueryUI()
 {
     if (jControl.IncludeJqueryUI)
     {
         var jquiUri = new Uri("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js");
         var jqueryUI = new jWebResource("jquery-ui-library", jquiUri, jWebResourceType.Javascript);
         jqueryUI.Register(jControl.Page);
     }
 }
コード例 #2
0
 /// <summary>
 /// Registers a jQueryUI theme, if it is not already on the page
 /// </summary>
 public void RegisterUITheme(UIThemes theme)
 {
     if (theme != UIThemes.None)
     {
         var themeUri = new Uri(String.Format(
                 "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/{0}/jquery-ui.css",
                 TranslateThemeName(theme)));
         var themeElem = new jWebResource("jquery-ui-theme", themeUri, jWebResourceType.Css);
         themeElem.Register(jControl.Page);
     }
 }
コード例 #3
0
 /// <summary>
 /// Registers a jQuery script tag in the page header, if it is desired and not already on the page
 /// </summary>
 public void RegisterJquery()
 {
     if (jControl.IncludeJquery)
     {
         var jqUri = new Uri(String.Format(
                                 "https://ajax.googleapis.com/ajax/libs/jquery/{0}/jquery.min.js",
                                 jControl.JqueryVersion));
         var jquery = new jWebResource("jquery-library", jqUri, jWebResourceType.Javascript);
         jquery.Register(jControl.Page);
     }
 }
コード例 #4
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jQuery
            Helper.RegisterJquery();

            //register dlb plugin
            var dlb = new jWebResource("dlb-library", new jWebResourceName("dualListBox_2_0_min.js"));
            dlb.Register(Page);

            //register the css
            var styles = new jWebResource("dlb-styles", new jWebResourceName("dualListBox_min.css"));
            styles.Register(Page);

            //this format string will build a onDomReady jquery handler to initialize galleria
            var initFormat = "jQuery(function(){{jQuery('#{0}').dualListBox({1});}});";

            //build out the options string
            var optionStr = JsonConvert.SerializeObject(BuildOptions());

            //compose the init body
            var initBody = string.Format(initFormat, this.ClientID, optionStr);

            //build the init control
            var initControl = new jWebResource("dlb-init-" + this.ClientID, initBody, jWebResourceType.Javascript);

            //register the control
            initControl.Register(Page);

            //finally, set selection mode to multiple
            SelectionMode = ListSelectionMode.Multiple;
        }
コード例 #5
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jquery
            Helper.RegisterJquery();

            //register jqueryUI and theme
            Helper.RegisterJqueryUI();
            Helper.RegisterUITheme(this.UITheme);

            //some style adjustments
            var adjustStr = ".ui-widget-content a{display:block;}";
            if (this.MaxHeight != 0)
            {
                adjustStr += '#' + this.ClientID + "-option-holder .ui-autocomplete{";
                adjustStr += "max-height:" + this.MaxHeight + ";overflow-y:auto;";
                adjustStr += "overflow-x:hidden;padding-right:20px;}";
            }
            var adjust = new jWebResource("autocomplete-css-adjust", adjustStr, jWebResourceType.Css);
            adjust.Register(Page);

            //this format string will build a onDomReady jquery handler to initialize galleria
            var initFormat = new StringBuilder("jQuery(function(){{");
            initFormat.Append("jQuery('#{0}').autocomplete({1});");
            initFormat.Append("jQuery('{0}-option-holder').css('width',jQuery('#{0}').width());");
            initFormat.Append("jQuery('{0}-option-holder').css('width',jQuery('#{0}').width());");
            initFormat.Append("}});");

            //build out the options string
            var optionStr = JsonConvert.SerializeObject(BuildOptions());

            //compose the init body
            var initBody = string.Format(initFormat.ToString(), this.ClientID, optionStr);

            //build the init control
            var initControl = new jWebResource("autocomplete-init-" + this.ClientID, initBody, jWebResourceType.Javascript);

            //register the control
            initControl.Register(Page);
        }
コード例 #6
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jQuery
            Helper.RegisterJquery();

            //register galleria
            var galleria = new jWebResource("galleria-library", new jWebResourceName("galleria_1_2_2_min.js"));
            galleria.Register(Page);

            //if we're running a standard theme, register required resources
            if (this.Theme != GalleryTheme.Custom)
            {
                var themeInfo = MapTheme(Theme);
                this._themeUrl = jControlHelper.AppUrl() + jWebResource.GetResourceUri(new jWebResourceName(themeInfo.Key));
                this._themeCss = jControlHelper.AppUrl() + jWebResource.GetResourceUri(new jWebResourceName(themeInfo.Value));
                
            }

            //register the theme css
            var themeStyle = new jWebResource("galleria-theme-" + this.ID, new Uri(this._themeCss), jWebResourceType.Css);
            themeStyle.Register(Page);

            //this format string will build a onDomReady jquery handler to initialize galleria
            var initFormat = "jQuery(function(){{window.jqNET={{galleria:{{themeCss:'{0}'}}}};Galleria.loadTheme('{1}');jQuery('#{2}').galleria({3});}});";
            
            //build out the options string
            var optionStr = JsonConvert.SerializeObject(BuildOptions());

            //compose the init body
            var initBody = string.Format(initFormat, this._themeCss, this._themeUrl, this.ClientID, optionStr);

            //build the init control
            var initControl = new jWebResource("galleria-init-" + this.ClientID, initBody, jWebResourceType.Javascript);

            //register the control
            initControl.Register(Page);
        }
コード例 #7
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jquery
            Helper.RegisterJquery();

            //register fancybox
            var fancybox = new jWebResource("fancybox-library", new jWebResourceName("fancybox_1_3_4_min.js"));
            fancybox.Register(Page);

            //register fancybox styles
            var fancyStyles = new jWebResource("fancybox-styles", new jWebResourceName("fancybox_1_3_4_min.css"));
            fancyStyles.Register(Page);

            //enable mousewheel, if desired
            if (EnableMousewheel)
            {
                var mousewheel = new jWebResource("mousewheel-library", new jWebResourceName("mousewheel_3_0_4_min.js"));
                mousewheel.Register(Page);
            }

            //build and register invoker
            BuildInvoker().Register(Page);
        }
コード例 #8
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jquery
            Helper.RegisterJquery();

            //register jqueryUI and theme
            Helper.RegisterJqueryUI();
            Helper.RegisterUITheme(this.UITheme);

            //this format string will build a onDomReady jquery handler to initialize the accordion
            var initFormat = new StringBuilder("jQuery(function(){{");
            initFormat.Append("jQuery('#{0}').accordion({1});");
            initFormat.Append("}});");

            //build out the options string
            var optionStr = JsonConvert.SerializeObject(BuildOptions());

            //compose the init body
            var initBody = string.Format(initFormat.ToString(), this.ClientID, optionStr);

            //build the init control
            var initControl = new jWebResource("accordion-init-" + this.ClientID, initBody, jWebResourceType.Javascript);

            //register the control
            initControl.Register(Page);
        }
コード例 #9
0
        protected override void OnPreRender(EventArgs e)
        {
            //register jquery
            Helper.RegisterJquery();

            //register cycle library
            var cycle = new jWebResource("cycle-library", new jWebResourceName("cycle_all_min.js"));
            cycle.Register(Page);

            //do some stuff for cycle controls
            var controlAdjust = "";
            if (!DisableControlStyles && DisplayControls != CycleControls.None)
            {
                //register default styles
                var cycleStyles = new jWebResource("cycle-styles", new jWebResourceName("cycle_min.css"));
                cycleStyles.Register(Page);

                //some script to set the cycle controls width
                var adjustTemplate = new StringBuilder("var w=jQuery('#{0}').outerWidth();");
                var templateArgs = new List<string>();
                templateArgs.Add(this.ClientID);
                if (DisplayControls.Has(CycleControls.All) && PagerPosition == PrevNextPosition)
                {
                    adjustTemplate.Append("var nav=jQuery('#{1}'),ctrlW=w;nav.width(w);");
                    templateArgs.Add(NavControlsID());
                    adjustTemplate.Append("ctrlW-=nav.find('.prev-control').outerWidth();");
                    adjustTemplate.Append("ctrlW-=nav.find('.next-control').css('float', 'left').outerWidth();");
                    adjustTemplate.Append("jQuery('#{2}').width(ctrlW).css({{'display':'inline-block','float':'left'}});");
                    templateArgs.Add(PagerID());
                }
                else
                {
                    adjustTemplate.Append("jQuery('#{1},#{2}').width(w);");
                    templateArgs.Add(NavControlsID());
                    templateArgs.Add(PagerID());
                }
                controlAdjust = string.Format(adjustTemplate.ToString(), templateArgs.ToArray());
            }

            //this format string will build a onDomReady jquery handler to initialize galleria
            var initFormat = "jQuery(function(){{jQuery('#{0}').cycle({1});{2}}});";

            //build out the options string
            var optionStr = JsonConvert.SerializeObject(BuildOptions());

            //compose the init body
            var initBody = string.Format(initFormat, this.ClientID, optionStr, controlAdjust);

            //build the init control
            var initControl = new jWebResource("cycle-init-" + this.ClientID, initBody, jWebResourceType.Javascript);

            //register the control
            initControl.Register(Page);

            //transfer rendering responsibility to the repeater
            InnerRepeater.ID = this.ID;

            if (DataSource == null)
            {
                DataSource =
                    (from string fPath in Helper.BuildFileList(FolderPath, FolderFilter, RecursiveSearch)
                     select fPath).ToList();
                DataBind();
            }

            if (ItemTemplate == null)
            {
                InnerRepeater.ItemCreated += new RepeaterItemEventHandler(InnerRepeater_ItemCreated);
                InnerRepeater.DataBind();
            }

            
        }