Example #1
0
        public static void AddFooter(WidgetObject menu, int recordCount)
        {
            jQueryObject footer = menu.Next();

            if (footer.Length == 0 || !footer.HasClass("sparkle-menu-footer"))
            {
                footer = jQuery.FromHtml("<div class='sparkle-menu-footer ui-front'></div>");
                menu.Parent().Append(footer);
            }

            if (footer != null)
            {
                footer.Html("");
                jQueryObject footerContent = jQuery.FromHtml("<span class='sparkle-menu-footer-content'></span>");
                jQueryObject footerLeft    = jQuery.FromHtml("<span class='sparkle-menu-footer-left'></span>");
                jQueryObject footerRight   = jQuery.FromHtml("<span class='sparkle-menu-footer-right'></span>");
                footerContent.Append(footerLeft);
                footerContent.Append(footerRight);
                footerLeft.Append(String.Format(SparkleResourceStrings.LookupFooter, recordCount));
                footer.Append(footerContent);
            }

            jQueryPosition pos    = menu.Position();
            int            height = menu.GetHeight();
            int            width  = menu.GetWidth();

            if (footer != null && footer.Length > 0)
            {
                footer.Show();
                footer.CSS("top", (pos.Top + height + 4).ToString() + "px");
                footer.CSS("left", (pos.Left).ToString() + "px");
                footer.Width(width);
            }
        }
Example #2
0
 public void AddFilterSeparator()
 {
     if (quickFiltersDiv != null)
     {
         quickFiltersDiv.Append(J("<hr/>"));
     }
 }
        public MyCssView(jQueryObject container, ControlDisplayMode controlDisplayMode) : base(container)
        {
            container.Append(string.Format("Control [sizeMode:{0}]", controlDisplayMode.ToString()));
            container.CSS(Css.Background, "#f0ebc5");
            container.CSS(Css.Width, "300px");
            container.CSS(Css.Height, "200px");

            container.CSS("-webkit-border-radius", "10px");
            container.CSS("-moz-border-radius", "10px");
            container.CSS("border-radius", "10px");
        }
        public static string GetFetchXmlParentFilter(FetchQuerySettings query, string parentAttribute)
        {
            jQueryObject fetchElement = query.FetchXml.Find("fetch");

            fetchElement.Attribute("count", "{0}");
            fetchElement.Attribute("paging-cookie", "{1}");
            fetchElement.Attribute("page", "{2}");
            fetchElement.Attribute("returntotalrecordcount", "true");
            fetchElement.Attribute("distinct", "true");
            fetchElement.Attribute("no-lock", "true");
            jQueryObject orderByElement = fetchElement.Find("order");

            // Get the default order by field - currently only supports a single sort by column
            query.OrderByAttribute = orderByElement.GetAttribute("attribute");
            query.OrderByDesending = orderByElement.GetAttribute("descending") == "true";

            orderByElement.Remove();

            // Get the root filter (if there is one)
            jQueryObject filter = fetchElement.Find("entity>filter");

            if (filter != null)
            {
                // Check that it is an 'and' filter
                string filterType = filter.GetAttribute("type");
                if (filterType == "or")
                {
                    // wrap up in an and filter
                    jQueryObject andFilter = jQuery.FromHtml("<filter type='and'>" + filter.GetHtml() + "</filter>");

                    // remove existing filter
                    filter.Remove();

                    filter = andFilter;
                    // Add in the existing filter
                    fetchElement.Find("entity").Append(andFilter);
                }
            }

            // Add in the parent query filter
            jQueryObject parentFilter = jQuery.FromHtml("<condition attribute='" + parentAttribute + "' operator='eq' value='" + ParentRecordPlaceholder + "'/>");

            filter.Append(parentFilter);

            // Add the order by placeholder for the EntityDataViewModel
            return(query.FetchXml.GetHtml().Replace("</entity>", "{3}</entity>"));
        }
        public void ClassInitialize()
        {
            divContainer = TestHarness.AddElement();
            Css.SetSize(divContainer, 200, 300);

            string url = "/Samples/AccordianTest";
            Log.Info("Downloading HTML. " + Html.ToHyperlink(url));
            jQuery.Get(url, delegate(object data)
                                                     {
                                                         Log.Success("HTML downloaded.");
                                                         divContainer.Append(data.ToString());
                                                         isInitialized = true;
                                                         TestHarness.UpdateLayout();
                                                     });

            divContainer.Empty();
        }
Example #6
0
        // image deletion function
        static void DeleteImage(jQueryObject item)
        {
            string recycle_icon = "<a href='link/to/recycle/script/when/we/have/js/off' title='Recycle this image' class='ui-icon ui-icon-refresh'>Recycle image</a>";

            item.FadeOut(EffectDuration.Slow, delegate()
            {
                jQueryObject list = jQuery.Select("ul", jQuery.Select("#trash")).Length > 0 ?
                                    jQuery.Select("ul", jQuery.Select("#trash")) :
                                    jQuery.Select("<ul class='gallery ui-helper-reset'/>").AppendTo("#trash");

                item.Find("a.ui-icon-trash").Remove();
                item.Append(recycle_icon).AppendTo(list).FadeIn(EffectDuration.Slow, delegate()
                {
                    item.Animate(new Dictionary("width", "48px"))
                    .Find("img")
                    .Animate(new Dictionary("height", "36px"));
                });
            });
        }
        static Serialize()
        {
            jQuery.OnDocumentReady(delegate()
            {
                jQuery.Select("#selectable2")
                .Plugin <SelectableObject>()
                .Selectable(new SelectableOptions(SelectableEvent.Stop,
                                                  new SelectableStopEventHandler(delegate(jQueryEvent e, SelectableStopEvent uiEvent)
                {
                    jQueryObject result = jQuery.Select("#select-result").Empty();

                    jQuery.Select(".ui-selected", jQuery.Select("#selectable2")).Each(delegate(int idx, Element element)
                    {
                        int index = jQuery.Select("#selectable2 li").Index(element);
                        result.Append(" #" + (index + 1));
                    });
                })));
            });
        }
        private void linkFn(AcgSpacesScope scope, jQueryObject element, object attrs)
        {
            var updater = new Action(() =>
                                     {
                                         element.Children()
                                             .Each((ind, e) => { angular.Element(e).Scope<BaseScope>().Destroy(); });


                                         element.Empty();

                                         var content = @"<div>
    <div acg-draw-space ng-style='spaceStyle'>
        <div ng-repeat='card in space.pile.cards' acg-draw-card ng-style='cardStyle'>
        </div>
    </div> 
</div>";

                                         angular.ForEach(scope.Spaces,
                                             (space) =>
                                             {
                                                 var e = angular.Element(content);
                                                 var _scope = scope.New<AcgSpacesScope>();
                                                 _scope.Space = space;
                                                 var elk = myCompile(e.Contents())(_scope);

                                                 element.Append(elk);
                                             });
                                     });

            //scope["$watch"]("spaces",updater);

            myGameContentManagerService.Redraw += () =>
                                                  {
                                                      Console.WriteLine("updating board");
                                                      updater();
                                                      scope.Apply();
                                                  };

            updater();
        }
        public void Render(jQueryObject into)
        {
            // Generate HTML content for the layer.
            jQueryObject div = Html.CreateDiv();
            foreach (ButtonStateTemplate item in GetCurrentTemplates())
            {
                item.Template.AppendTo(div, Model.TemplateData);
            }

            // Apply CSS classes to each layer.
            string css = GetClassText();
            if (!string.IsNullOrEmpty(css))
            {
                div.Children().Each(delegate(int index, Element element)
                                        {
                                            jQuery.FromElement(element).AddClass(css);
                                        });
            }

            // Insert into the DOM.
            into.Append(div.GetHtml());
        }
Example #10
0
        public void constructPagerUI()
        {
            _container.Empty();

            jQueryObject pager = jQuery.FromHtml("<table cellspacing='0' cellpadding='0' class='sparkle-grid-status'><tbody><tr>" +
                                                 "<td class='sparkle-grid-status-label'>1 - 1 of 1&nbsp;(0 selected)</td>" +
                                                 "<td class='sparkle-grid-status-paging'>" +
                                                 "<img src='../../sparkle_/css/images/transparent_spacer.gif' class='sparkle-grid-paging-first'>" +
                                                 "<img src='../../sparkle_/css/images/transparent_spacer.gif' class='sparkle-grid-paging-back'>" +
                                                 "<span class='sparkle-grid-status-paging-page'>Page 1</span>" +
                                                 "<img src='../../sparkle_/css/images/transparent_spacer.gif' class='sparkle-grid-paging-next'>" +
                                                 "&nbsp;</td></tr></tbody></table>");

            jQueryObject firstButton = pager.Find(".sparkle-grid-paging-first");
            jQueryObject backButton  = pager.Find(".sparkle-grid-paging-back");
            jQueryObject nextButton  = pager.Find(".sparkle-grid-paging-next");
            jQueryObject label       = pager.Find(".sparkle-grid-status-label");
            jQueryObject pageInfo    = pager.Find(".sparkle-grid-status-paging-page");

            _container.Append(pager);
            firstButton.Click(gotoFirst);
            backButton.Click(gotoPrev);
            nextButton.Click(gotoNext);
        }
Example #11
0
 public static TWidget CreateInside <TWidget>(jQueryObject container, object options = null,
                                              Action <TWidget> init = null)
     where TWidget : Widget
 {
     return(Create <TWidget>(e => container.Append(e), options, init));
 }
        // image deletion function
        static void DeleteImage(jQueryObject item)
        {
            string recycle_icon = "<a href='link/to/recycle/script/when/we/have/js/off' title='Recycle this image' class='ui-icon ui-icon-refresh'>Recycle image</a>";

            item.FadeOut(EffectDuration.Slow, delegate()
            {
                jQueryObject list = jQuery.Select("ul", jQuery.Select("#trash")).Length > 0 ?
                                    jQuery.Select("ul", jQuery.Select("#trash")) :
                                    jQuery.Select("<ul class='gallery ui-helper-reset'/>").AppendTo("#trash");

                item.Find("a.ui-icon-trash").Remove();
                item.Append(recycle_icon).AppendTo(list).FadeIn(EffectDuration.Slow, delegate()
                {
                    item.Animate(new Dictionary("width", "48px"))
                        .Find("img")
                        .Animate(new Dictionary("height", "36px"));
                });
            });
        }